:root {
  --bg: #0f1220;
  --bg2: #161a2e;
  --panel: #1b2138;
  --panel2: #232a47;
  --line: #2c3358;
  --text: #e7e9f3;
  --muted: #8b93b8;
  --primary: #6c8cff;
  --primary-d: #5577f0;
  --todo: #8b93b8;
  --doing: #f0b54b;
  --done: #46c98b;
  --high: #ff6b6b;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1c2547 0%, var(--bg) 55%);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.spacer { flex: 1; }

/* buttons */
.btn {
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: .15s;
  line-height: 1;
}
.btn:hover { border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.danger { color: #ffb3b3; }
.btn.danger:hover { border-color: var(--high); }
.btn.danger-solid { background: var(--high); border-color: var(--high); color: #fff; font-weight: 600; }
.btn.danger-solid:hover { background: #e85a5a; border-color: #e85a5a; }

input, textarea, select {
  background: var(--bg2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
.select { padding: 8px 12px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.brand { font-weight: 700; font-size: 16px; letter-spacing: .3px; display: flex; align-items: center; gap: 8px; }
.logo { color: var(--primary); }
.err { color: var(--high); font-size: 13px; min-height: 16px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: 320px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.login-card .muted { margin: -4px 0 6px; }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 58px;
  background: rgba(20,24,44,.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; border: none; color: var(--muted);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel2); color: var(--text); }
.me { display: flex; align-items: center; gap: 8px; }
.me-name { color: var(--muted); font-size: 13px; }

.view { padding: 22px; max-width: 1200px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }

/* board */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.col { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 120px; }
.col.drag-over { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(108,140,255,.25) inset; }
.col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--line);
}
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.todo { background: var(--todo); }
.dot.doing { background: var(--doing); }
.dot.done { background: var(--done); }
.count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 12px; }

.task {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; cursor: grab; transition: .12s;
}
.task:hover { border-color: var(--primary); transform: translateY(-1px); }
.task.dragging { opacity: .5; }
.task .t-title { font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 11px; }
.badge.high { color: var(--high); border-color: var(--high); }
.badge.assignee { color: var(--primary); border-color: var(--primary); }
.badge.due { color: var(--doing); border-color: var(--doing); }

/* files */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); margin-bottom: 16px;
  transition: .15s;
}
.dropzone.drag-over { border-color: var(--primary); color: var(--text); background: rgba(108,140,255,.06); }
table.files { width: 100%; border-collapse: collapse; }
table.files th, table.files td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.files th { color: var(--muted); font-weight: 500; font-size: 12px; }
table.files td .fname { font-weight: 600; }
table.files tr:hover td { background: rgba(255,255,255,.02); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(6,8,18,.62); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fadeIn .12s ease; }
.confirm-wrap { z-index: 60; }
.modal { width: 480px; max-width: 100%; padding: 22px; display: flex; flex-direction: column; gap: 12px; max-height: 86vh; overflow: auto; animation: modalIn .16s cubic-bezier(.2,.7,.3,1); }
.confirm-card { width: 380px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 4px; }
.modal label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 5px; }
.modal .field { display: flex; flex-direction: column; }
.modal .row { display: flex; gap: 10px; }
.modal .row > * { flex: 1; }
.modal textarea { min-height: 90px; resize: vertical; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }

pre.cli { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: auto; font-size: 12.5px; line-height: 1.6; }
code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }

/* toast */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; font-size: 13px;
}

@media (max-width: 820px) {
  .board { grid-template-columns: 1fr; }
  .tabs { display: none; }
}
