/* ─── TOKENS ────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-card-2:   #1c2128;
  --bg-hover:    #21262d;

  --green:       #39d353;
  --green-faint: rgba(57,211,83,.07);
  --green-glow:  rgba(57,211,83,.18);

  --blue:        #58a6ff;
  --orange:      #f0883e;
  --red:         #f85149;
  --yellow:      #e3b341;
  --purple:      #a371f7;

  --border:      rgba(48,54,61,.9);
  --border-h:    rgba(57,211,83,.35);

  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-faint:  #484f58;

  --radius:      8px;
  --radius-sm:   6px;
  --radius-xs:   4px;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Inter', sans-serif;

  --nav-h:       52px;
  --sidebar-w:   220px;

  /* priority */
  --p-critical:  #f85149;
  --p-high:      #f0883e;
  --p-medium:    #e3b341;
  --p-low:       #39d353;

  /* type */
  --t-bug:         #f85149;
  --t-feature:     #58a6ff;
  --t-improvement: #39d353;
  --t-task:        #8b949e;
}

[data-theme="light"] {
  --bg:          #f6f8fa;
  --bg-card:     #ffffff;
  --bg-card-2:   #f0f2f4;
  --bg-hover:    #eaeef2;

  --green:       #1a7f37;
  --green-faint: rgba(26,127,55,.07);
  --green-glow:  rgba(26,127,55,.15);

  --blue:        #0969da;
  --orange:      #bc4c00;
  --red:         #cf222e;
  --yellow:      #9a6700;

  --border:      rgba(208,215,222,.9);
  --border-h:    rgba(26,127,55,.4);

  --text:        #1f2328;
  --text-muted:  #656d76;
  --text-faint:  #adbac7;

  --p-critical:  #cf222e;
  --p-high:      #bc4c00;
  --p-medium:    #9a6700;
  --p-low:       #1a7f37;

  --t-bug:         #cf222e;
  --t-feature:     #0969da;
  --t-improvement: #1a7f37;
  --t-task:        #656d76;
}

/* ─── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
  overflow: hidden;
}
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ─── AUTH SCREEN ────────────────────────────────── */
#auth-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 20% 20%, #131a23 0%, var(--bg) 55%);
  overflow: hidden;
  z-index: 100;
}
[data-theme="light"] #auth-screen {
  background: radial-gradient(circle at 20% 20%, #e8eef6 0%, var(--bg) 58%);
}
#auth-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .45; pointer-events: none; z-index: 0;
}
[data-theme="light"] #auth-canvas { opacity: .18; mix-blend-mode: multiply; }
#auth-screen .hero-bg {
  position: absolute; inset: -15%; z-index: 0;
  background:
    radial-gradient(600px 400px at 10% 30%, rgba(57,211,83,.07), transparent 65%),
    radial-gradient(400px 300px at 85% 15%, rgba(57,211,83,.04), transparent 65%);
}
[data-theme="light"] #auth-screen .hero-bg {
  background:
    radial-gradient(640px 440px at 10% 30%, rgba(26,127,55,.18), transparent 66%),
    radial-gradient(500px 360px at 85% 15%, rgba(9,105,218,.11), transparent 69%);
}
.auth-window {
  width: min(520px, calc(100% - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  position: relative; z-index: 1;
  overflow: hidden;
}
.auth-body { padding: 28px; }
.auth-hint {
  color: var(--text-muted); font-size: 13px;
  margin-bottom: 20px; max-width: 42ch;
}
.auth-error {
  font-family: var(--mono); font-size: 12px;
  color: var(--red); margin-top: 8px; margin-bottom: 4px;
}
.auth-back {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-muted); margin-top: 12px;
  transition: color .15s;
}
.auth-back:hover { color: var(--green); }

/* ─── SHARED: TERM TITLEBAR ──────────────────────── */
.term-titlebar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-2);
}
.term-dots { display: flex; gap: 6px; }
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }
.term-title { font-family: var(--mono); color: var(--text-muted); font-size: 12px; }

/* ─── SHARED: SECTION LABEL / PROMPT ────────────── */
.section-label {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; color: var(--green);
  margin-bottom: 10px;
}
.prompt-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.prompt-sign { color: var(--green); font-family: var(--mono); font-weight: 700; }
.section-title { font-family: var(--mono); font-size: clamp(1rem,2.5vw,1.2rem); font-weight: 600; }
.cmd-hl { color: var(--green); }

/* ─── SHARED: INPUTS ─────────────────────────────── */
.input-group { margin-bottom: 16px; }
.input-label { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: .05em; }
.term-input {
  width: 100%; padding: 10px 12px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.term-input:focus {
  border-color: var(--border-h);
  box-shadow: 0 0 0 3px var(--green-faint);
}
.otp-input { letter-spacing: .6em; text-align: center; font-size: 20px; font-weight: 600; }
.term-textarea { resize: vertical; min-height: 80px; max-height: 180px; }
.term-select {
  width: 100%; padding: 10px 12px;
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 13px;
  transition: border-color .15s; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.term-select:focus { border-color: var(--border-h); box-shadow: 0 0 0 3px var(--green-faint); }

/* ─── SHARED: BUTTONS ────────────────────────────── */
.auth-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--green); border: 1px solid var(--border-h);
  background: var(--green-faint); border-radius: var(--radius-sm);
  padding: 10px 18px; transition: background .2s, transform .2s, box-shadow .2s;
  margin-top: 4px;
}
.auth-btn:hover {
  background: rgba(57,211,83,.14);
  box-shadow: 0 0 12px var(--green-glow);
  transform: translateY(-1px);
}
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-spinner {
  width: 12px; height: 12px;
  border: 2px solid rgba(57,211,83,.3); border-top-color: var(--green);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost {
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--border-h); color: var(--text); }

/* ─── TOP NAV ─────────────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}
.topnav-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.logo-mark { color: var(--green); font-size: 18px; font-weight: 700; line-height: 1; }
.logo-text { font-family: var(--mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.logo-sep { color: var(--text-muted); margin: 0 3px; }
.topnav-center { display: flex; align-items: center; justify-content: center; flex: 1; }
.topnav-right { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: flex-end; }
.view-toggle { display: flex; gap: 2px; background: var(--bg-card-2); border-radius: var(--radius-sm); padding: 3px; border: 1px solid var(--border); }
.view-btn { padding: 6px 8px; border-radius: 4px; color: var(--text-muted); transition: background .15s, color .15s; }
.view-btn.active { background: var(--green-faint); color: var(--green); }
.view-btn:hover:not(.active) { background: var(--bg-hover); color: var(--text); }
.icon-btn { padding: 8px; border-radius: var(--radius-sm); color: var(--text-muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

/* ─── LAYOUT ──────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
  min-height: 0;
}

/* ─── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 12px;
  display: flex; flex-direction: column; gap: 24px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.sidebar-section {}
.sidebar-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--text-faint); margin-bottom: 8px; padding: 0 4px;
}
.project-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.project-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  font-size: 13px; transition: background .15s; cursor: pointer;
  border: 1px solid transparent;
}
.project-item:hover { background: var(--bg-hover); }
.project-item.active { background: var(--green-faint); border-color: rgba(57,211,83,.2); }
.project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.project-name { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-count { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.sidebar-add-btn {
  width: 100%; padding: 6px 8px; text-align: left;
  font-family: var(--mono); font-size: 12px; color: var(--text-muted);
  border-radius: var(--radius-sm); transition: color .15s, background .15s;
}
.sidebar-add-btn:hover { color: var(--green); background: var(--green-faint); }
.danger-btn { color: var(--red) !important; border-color: rgba(248,81,73,.3) !important; }
.danger-btn:hover { color: var(--red) !important; background: rgba(248,81,73,.12) !important; }

/* filters */
.filter-group { margin-bottom: 12px; }
.filter-label { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; padding: 0 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-family: var(--mono); font-size: 10px;
  padding: 3px 7px; border-radius: 99px;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: all .15s; cursor: pointer; background: transparent;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip.active { background: var(--green-faint); border-color: var(--border-h); color: var(--green); }
.chip.bug.active         { background: rgba(248,81,73,.1);  border-color: rgba(248,81,73,.4);  color: var(--t-bug); }
.chip.feature.active     { background: rgba(88,166,255,.1); border-color: rgba(88,166,255,.4); color: var(--t-feature); }
.chip.improvement.active { background: var(--green-faint);  border-color: var(--border-h);     color: var(--t-improvement); }
.chip.task.active        { background: rgba(139,148,158,.1);border-color: rgba(139,148,158,.4);color: var(--t-task); }
.chip.p-critical.active  { background: rgba(248,81,73,.1);  border-color: rgba(248,81,73,.4);  color: var(--p-critical); }
.chip.p-high.active      { background: rgba(240,136,62,.1); border-color: rgba(240,136,62,.4); color: var(--p-high); }
.chip.p-medium.active    { background: rgba(227,179,65,.1); border-color: rgba(227,179,65,.4); color: var(--p-medium); }
.chip.p-low.active       { background: var(--green-faint);  border-color: var(--border-h);     color: var(--p-low); }

/* stats */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stat-card {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center;
}
.stat-num { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--green); line-height: 1; }
.stat-lbl { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-family: var(--mono); }

/* ─── MAIN CONTENT ────────────────────────────────── */
.main-content {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}

/* board */
.board-view {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  padding: 20px;
  min-height: 0;
}
.board-columns {
  display: flex; gap: 14px;
  height: 100%; min-height: 0;
  width: max-content; min-width: 100%;
  align-items: stretch;
}
.board-col {
  width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; height: 100%;
  min-height: 0;
}
.col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-card-2); flex-shrink: 0;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-name { font-family: var(--mono); font-size: 12px; font-weight: 600; flex: 1; }
.col-count { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.col-add { padding: 2px 6px; border-radius: var(--radius-xs); font-family: var(--mono); font-size: 14px; color: var(--text-muted); transition: color .15s, background .15s; }
.col-add:hover { color: var(--green); background: var(--green-faint); }
.col-cards {
  flex: 1 1 0; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
  position: relative;
}
.col-cards::-webkit-scrollbar { width: 4px; }
.col-cards::-webkit-scrollbar-track { background: transparent; }
.col-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.col-cards.is-empty {
  min-height: 120px;
  justify-content: center;
  align-items: center;
}
.col-cards.is-empty::before {
  content: attr(data-empty-label);
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  text-align: center;
  pointer-events: none;
}

/* ticket cards */
.ticket-card {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  cursor: grab; transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative; overflow: hidden;
  border-left: 3px solid transparent;
  flex: 0 0 auto;
  min-height: 84px;
}
.ticket-card:hover { border-color: var(--border-h); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.ticket-card.dragging { opacity: .5; }
.ticket-card.ghost { opacity: .15; }
.ticket-card[data-priority="critical"] { border-left-color: var(--p-critical); }
.ticket-card[data-priority="high"]     { border-left-color: var(--p-high); }
.ticket-card[data-priority="medium"]   { border-left-color: var(--p-medium); }
.ticket-card[data-priority="low"]      { border-left-color: var(--p-low); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card-title { font-size: 13px; font-weight: 500; line-height: 1.4; flex: 1; }
.card-menu { padding: 2px; color: var(--text-faint); border-radius: 4px; transition: color .15s, background .15s; opacity: 0; }
.ticket-card:hover .card-menu { opacity: 1; }
.card-menu:hover { color: var(--text); background: var(--bg-hover); }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
  border-radius: 99px; border: 1px solid transparent; white-space: nowrap;
}
.badge-type-bug         { color: var(--t-bug);         background: rgba(248,81,73,.1);   border-color: rgba(248,81,73,.3); }
.badge-type-feature     { color: var(--t-feature);     background: rgba(88,166,255,.1);  border-color: rgba(88,166,255,.3); }
.badge-type-improvement { color: var(--t-improvement); background: var(--green-faint);   border-color: rgba(57,211,83,.3); }
.badge-type-task        { color: var(--t-task);         background: rgba(139,148,158,.1); border-color: rgba(139,148,158,.3); }
.badge-project {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
  border-radius: 99px; border: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}
.card-id { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-left: auto; }

/* list view */
.list-view { flex: 1; overflow: auto; padding: 20px; }
.list-view { min-height: 0; }
.list-sections { display: flex; flex-direction: column; gap: 20px; }
.list-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 0;
}
.list-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--bg-card-2);
  border-bottom: 1px solid var(--border);
}
.list-section-title {
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--text); text-transform: uppercase;
}
.list-section-subtitle {
  margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--text-muted);
}
.list-table-wrap { overflow-x: auto; }
.list-table-wrap { min-height: 0; }
.ticket-table { width: 100%; border-collapse: collapse; }
.ticket-table th {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--text-muted); text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card); position: sticky; top: 0; z-index: 1;
  white-space: nowrap;
}
.sort-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit;
  white-space: nowrap;
}
.sort-btn:hover { color: var(--green); }
.sort-btn.active { color: var(--green); }
.sort-indicator { font-size: 10px; opacity: .8; }
.ticket-table td { padding: 10px 12px; border-bottom: 1px solid rgba(48,54,61,.5); vertical-align: middle; }
.ticket-table tr:hover td { background: var(--bg-hover); }
.ticket-table tr:last-child td { border-bottom: none; }
.td-id { font-family: var(--mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.td-title { font-size: 13px; max-width: 300px; }
.td-actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-btn { padding: 4px 8px; border-radius: var(--radius-xs); font-family: var(--mono); font-size: 11px; color: var(--text-muted); border: 1px solid transparent; transition: all .15s; }
.row-btn:hover { border-color: var(--border-h); color: var(--green); background: var(--green-faint); }
.row-btn.danger:hover { border-color: rgba(248,81,73,.4); color: var(--red); background: rgba(248,81,73,.1); }
.status-pill {
  font-family: var(--mono); font-size: 10px; padding: 3px 8px;
  border-radius: 99px; border: 1px solid var(--border); white-space: nowrap;
}
.status-backlog    { color: var(--text-muted); }
.status-todo       { color: var(--blue);       border-color: rgba(88,166,255,.3);  background: rgba(88,166,255,.07); }
.status-in_progress{ color: var(--yellow);     border-color: rgba(227,179,65,.3);  background: rgba(227,179,65,.07); }
.status-review     { color: var(--purple);     border-color: rgba(163,113,247,.3); background: rgba(163,113,247,.07); }
.status-done       { color: var(--green);      border-color: var(--border-h);      background: var(--green-faint); }

/* priority dot */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-dot.critical { background: var(--p-critical); }
.priority-dot.high     { background: var(--p-high); }
.priority-dot.medium   { background: var(--p-medium); }
.priority-dot.low      { background: var(--p-low); }

/* ─── FAB ─────────────────────────────────────────── */
.fab-wrap {
  position: fixed; bottom: 28px; right: 28px; z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.fab-wrap .fab {
  position: relative; bottom: auto; right: auto;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--green); color: #0d1117;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px var(--green-glow);
  transition: transform .2s, box-shadow .2s;
  z-index: 40; font-size: 24px;
}
.fab-menu {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  transform: translateY(8px); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.fab-wrap:hover .fab-menu,
.fab-wrap:focus-within .fab-menu,
.fab-wrap.is-open .fab-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.fab-menu-btn {
  padding: 8px 12px; border-radius: 999px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
}
.fab-menu-btn:hover { border-color: var(--border-h); color: var(--green); background: var(--green-faint); }
.fab:hover { transform: scale(1.08) rotate(90deg); box-shadow: 0 6px 24px var(--green-glow); }

/* ─── MODALS ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(1,4,9,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal {
  width: min(580px, 100%); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
  overflow: hidden; max-height: 90vh; display: flex; flex-direction: column;
}
.modal-lg { width: min(680px, 100%); }
.modal-sm { width: min(420px, 100%); }
.modal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-card-2); flex-shrink: 0;
}
.modal-title { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: var(--border); }
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; letter-spacing: .05em; }
.req { color: var(--red); }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.color-picker-row { display: flex; align-items: center; gap: 10px; }
.color-input { width: 44px; height: 36px; padding: 2px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.color-val { font-family: var(--mono); font-size: 13px; color: var(--text-muted); }

/* detail modal */
.detail-title { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.detail-meta-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin-bottom: 20px; }
.detail-meta-key { font-family: var(--mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.detail-meta-val { font-size: 13px; }
.detail-desc-label { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.detail-desc { font-size: 13px; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; overflow-y: auto; max-height: 200px; padding: 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.detail-actions { display: flex; gap: 8px; margin-top: 20px; justify-content: flex-end; }

/* ─── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 300; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 18px; font-family: var(--mono); font-size: 13px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  animation: slide-up .2s ease;
}
.toast.success { border-color: var(--border-h); color: var(--green); }
.toast.error   { border-color: rgba(248,81,73,.4); color: var(--red); }
@keyframes slide-up { from { opacity:0; transform: translate(-50%,10px); } to { opacity:1; transform: translate(-50%,0); } }

/* ─── SCROLLBAR GLOBAL ────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 180px; }
  :root { --sidebar-w: 180px; }
  .form-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { flex-direction: column; height: calc(100vh - var(--nav-h)); min-height: 0; overflow: hidden; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .main-content { min-height: calc(100vh - var(--nav-h)); }
  .board-view, .list-view { padding: 16px 12px; }
  .board-col { width: 240px; }
}
@media (max-width: 600px) {
  .topnav { height: var(--nav-h); padding: 0 12px; flex-wrap: nowrap; }
  .topnav-left, .topnav-center, .topnav-right { flex: 1 1 100%; justify-content: space-between; }
  .sidebar { padding: 12px; }
  .board-col { width: 240px; }
  .ticket-table { min-width: 820px; }
  .fab-wrap { bottom: 20px; right: 20px; }
}

/* ─── PARALLAX SCENE ──────────────────────────────── */
.parallax-scene { perspective: 800px; }
.parallax-layer { will-change: transform; transition: transform 120ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .parallax-layer { transition: none !important; transform: none !important; }
  #auth-canvas { opacity: .1; }
  .fab:hover { transform: scale(1.05); }
}

/* ─── LIGHT MODE ADJUSTMENTS ──────────────────────── */
[data-theme="light"] .topnav    { background: #fff; }
[data-theme="light"] .sidebar   { background: #fff; }
[data-theme="light"] .board-col { background: #f6f8fa; }
[data-theme="light"] .col-header{ background: #eaeef2; }
[data-theme="light"] .ticket-card { background: #fff; }
[data-theme="light"] .modal-body::-webkit-scrollbar-thumb { background: #d0d7de; }
