:root {
  --bg: #0f1117;
  --bg2: #161a23;
  --panel: #1b2030;
  --panel2: #212740;
  --line: #2a3142;
  --text: #e7ecf3;
  --muted: #8a93a6;
  --accent: #7c5cff;
  --accent2: #9a82ff;
  --green: #35c98a;
  --amber: #ffb020;
  --blue: #4aa3ff;
  --violet: #b27cff;
  --red: #ff5d6c;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background:
    radial-gradient(1200px 700px at 80% -10%, #1c2236 0%, transparent 60%),
    radial-gradient(900px 600px at -10% 110%, #1a2030 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ---- brand / logo ---- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 30px; margin: 0; letter-spacing: -.5px; }
.brand .title { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.logo { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.logo i { display: block; width: 7px; border-radius: 3px; }
.logo i:nth-child(1) { height: 26px; background: var(--accent); }
.logo i:nth-child(2) { height: 18px; background: var(--green); }
.logo i:nth-child(3) { height: 11px; background: var(--amber); }
.brand.small .logo { height: 20px; } .brand.small .logo i { width: 5px; }
.brand.small .logo i:nth-child(1){height:20px} .brand.small .logo i:nth-child(2){height:14px} .brand.small .logo i:nth-child(3){height:9px}

/* ---- buttons ---- */
.btn {
  border: 1px solid var(--line); background: var(--panel2); color: var(--text);
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: .12s ease;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, var(--accent2), var(--accent)); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.ghost.subtle { color: var(--muted); }
.btn.danger { background: transparent; border-color: #5a2b34; color: var(--red); }
.btn.danger:hover { background: #2a1820; }

/* ---- login ---- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 360px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 28px; box-shadow: var(--shadow); display: flex;
  flex-direction: column; gap: 14px; text-align: center;
}
.login-card .brand { justify-content: center; }
.tagline { color: var(--muted); margin: -6px 0 6px; }
.login-card input {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 15px; outline: none;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.login-card button { padding: 12px; }
.login-err { color: var(--red); font-size: 13px; min-height: 16px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hint code { background: var(--bg2); padding: 1px 6px; border-radius: 6px; color: var(--accent2); }

/* ---- app shell ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: rgba(20,24,34,.6); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-actions { display: flex; gap: 10px; }

/* ---- board ---- */
.board {
  flex: 1; display: flex; gap: 18px; align-items: flex-start;
  padding: 22px; overflow-x: auto;
}
.column {
  flex: 0 0 300px; width: 300px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; flex-direction: column; height: calc(100vh - 110px);
  box-shadow: var(--shadow);
}
.column.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px;
}
.col-title {
  flex: 1; font-weight: 700; font-size: 15px; background: transparent; border: 1px solid transparent;
  color: var(--text); border-radius: 8px; padding: 4px 6px; outline: none;
}
.col-title:hover { background: var(--panel2); }
.col-title:focus { background: var(--bg2); border-color: var(--accent); }
.col-count { color: var(--muted); font-size: 12px; background: var(--bg2); padding: 2px 8px; border-radius: 20px; }
.col-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 6px; }
.col-del:hover { color: var(--red); background: var(--panel2); }
.cards { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.cards::-webkit-scrollbar { width: 8px; } .cards::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.col-foot { padding: 10px 12px 12px; }
.add-card { width: 100%; text-align: left; color: var(--muted); border-style: dashed; background: transparent; }
.add-card:hover { color: var(--text); }

/* ---- card ---- */
.card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 12px; cursor: grab; position: relative; border-left: 4px solid var(--line);
  transition: .1s ease; box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.card:hover { border-color: #3a4258; transform: translateY(-1px); filter: brightness(1.06); }
.card.dragging { opacity: .4; }
.card .c-title { font-weight: 600; word-break: break-word; }
.card .c-body { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.card.amber  { border-left-color: var(--amber); }
.card.green  { border-left-color: var(--green); }
.card.blue   { border-left-color: var(--blue); }
.card.violet { border-left-color: var(--violet); }
.card.red    { border-left-color: var(--red); }

/* drop placeholder */
.placeholder { border: 2px dashed var(--accent); border-radius: 11px; height: 44px; background: rgba(124,92,255,.07); }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; background: rgba(6,8,12,.6); display: grid; place-items: center; z-index: 20; backdrop-filter: blur(3px); }
.modal { width: 460px; max-width: 92vw; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.m-title { font-size: 18px; font-weight: 700; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 13px; outline: none; }
.m-body { min-height: 120px; resize: vertical; background: var(--bg2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 13px; outline: none; font: inherit; }
.m-title:focus, .m-body:focus { border-color: var(--accent); }
.m-colors { display: flex; gap: 10px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.swatch.sel { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel); }
.m-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.spacer { flex: 1; }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .2s ease; font-size: 14px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
