/* ============================================================
   COS — design system
   Linear/Notion/Stripe inspired: calm, dense, fast.
   Theming via CSS variables; dark mode toggled on <html data-theme>.
   ============================================================ */

:root {
  --bg:        #ffffff;
  --bg-soft:   #f7f8fa;
  --bg-sunken: #f1f2f5;
  --surface:   #ffffff;
  --border:    #e8e9ee;
  --border-strong: #d8dae2;
  --text:      #1c1f26;
  --text-soft: #5b606b;
  --text-mute: #8a8f9a;
  --accent:    #5b5bd6;
  --accent-soft: #eeeefb;
  --accent-text: #4a4ac4;
  --shadow-sm: 0 1px 2px rgba(20,22,30,.04), 0 1px 3px rgba(20,22,30,.06);
  --shadow-md: 0 4px 12px rgba(20,22,30,.08);
  --radius:    9px;
  --radius-sm: 6px;
  --sidebar-w: 232px;

  /* status / semantic */
  --c-slate:#64748b; --c-slate-bg:#f1f5f9;
  --c-blue:#2563eb;  --c-blue-bg:#eff4ff;
  --c-amber:#d97706; --c-amber-bg:#fff7ed;
  --c-violet:#7c3aed;--c-violet-bg:#f5f0ff;
  --c-green:#16a34a; --c-green-bg:#effbf2;
  --c-red:#dc2626;   --c-red-bg:#fef2f2;
  --c-orange:#ea580c;--c-orange-bg:#fff5ed;
  --c-muted:#9ca3af; --c-muted-bg:#f3f4f6;
}

html[data-theme="dark"] {
  --bg:        #0e0f13;
  --bg-soft:   #15171c;
  --bg-sunken: #1a1d23;
  --surface:   #16181d;
  --border:    #24272f;
  --border-strong:#30343d;
  --text:      #e8eaed;
  --text-soft: #a4a9b3;
  --text-mute: #6f7480;
  --accent:    #7b7bf0;
  --accent-soft: #1d1d35;
  --accent-text: #a9a9f5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 6px 18px rgba(0,0,0,.4);

  --c-slate-bg:#1b2330; --c-blue-bg:#15233f; --c-amber-bg:#2c2114;
  --c-violet-bg:#211a38;--c-green-bg:#10271a; --c-red-bg:#2c1618;
  --c-orange-bg:#2c1c12;--c-muted-bg:#1c1f26;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02','cv03','cv04','ss01';
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: none; opacity:.85; }
::selection { background: var(--accent-soft); }

/* layout shell ------------------------------------------------ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg);
  border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 14px 10px;
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 28px 60px; max-width: 1320px; width:100%; margin:0 auto; }

/* brand + nav ------------------------------------------------- */
.brand { display:flex; align-items:center; gap:9px; padding: 6px 8px 14px; }
.brand .logo { width:26px; height:26px; border-radius:7px; background: linear-gradient(135deg,var(--accent),#8b5cf6);
  display:grid; place-items:center; color:#fff; font-weight:700; font-size:14px; }
.brand b { font-size:15px; letter-spacing:-.01em; }
.nav { display:flex; flex-direction:column; gap:1px; margin-top: 4px; }
.nav a {
  display:flex; align-items:center; gap:10px; padding:7px 9px; border-radius:7px;
  color: var(--text-soft); font-weight:500; font-size:13.5px; transition:.12s;
}
.nav a .ic { width:17px; text-align:center; opacity:.85; font-size:14px; }
.nav a:hover { background: var(--bg-sunken); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav .label { padding:14px 9px 5px; font-size:11px; font-weight:600; letter-spacing:.06em;
  text-transform:uppercase; color: var(--text-mute); }
.sidebar .spacer { flex:1; }

/* topbar ------------------------------------------------------ */
.topbar {
  height:54px; flex-shrink:0; border-bottom:1px solid var(--border); background: var(--bg);
  display:flex; align-items:center; gap:14px; padding: 0 20px; position: sticky; top:0; z-index: 20;
}
.search-trigger {
  display:flex; align-items:center; gap:8px; height:34px; padding:0 12px; flex:1; max-width:420px;
  background: var(--bg-sunken); border:1px solid var(--border); border-radius:8px;
  color: var(--text-mute); cursor:pointer; font-size:13px;
}
.search-trigger kbd { margin-left:auto; font-size:11px; background:var(--bg); border:1px solid var(--border);
  border-radius:5px; padding:1px 6px; color:var(--text-soft); }
.topbar .grow { flex:1; }
.icon-btn { width:34px; height:34px; border-radius:8px; border:1px solid transparent; background:transparent;
  display:grid; place-items:center; cursor:pointer; color: var(--text-soft); font-size:16px; position:relative; }
.icon-btn:hover { background: var(--bg-sunken); }
.dot-badge { position:absolute; top:6px; right:6px; min-width:15px; height:15px; padding:0 3px; border-radius:8px;
  background: var(--c-red); color:#fff; font-size:9px; font-weight:700; display:grid; place-items:center; }

/* avatars ----------------------------------------------------- */
.avatar { width:26px; height:26px; border-radius:50%; background:var(--accent-soft); color:var(--accent-text);
  display:inline-grid; place-items:center; font-size:10.5px; font-weight:700; flex-shrink:0; border:1px solid var(--border); }
.avatar.sm { width:20px; height:20px; font-size:9px; }
.avatar.lg { width:34px; height:34px; font-size:12px; }
.avatar-stack { display:inline-flex; }
.avatar-stack .avatar { margin-left:-7px; box-shadow:0 0 0 2px var(--bg); }
.avatar-stack .avatar:first-child { margin-left:0; }
.presence-ring { position:relative; }
.presence-ring::after { content:''; position:absolute; right:-1px; bottom:-1px; width:9px; height:9px; border-radius:50%;
  border:2px solid var(--bg); }
.presence-ring.working::after { background: var(--c-green); }
.presence-ring.idle::after    { background: var(--c-amber); }
.presence-ring.offline::after { background: var(--c-muted); }

/* cards ------------------------------------------------------- */
.card { background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card .card-h { padding:13px 16px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:10px; }
.card .card-h h3 { margin:0; font-size:13px; font-weight:600; letter-spacing:-.01em; }
.card .card-h .count { margin-left:auto; font-size:12px; color:var(--text-mute); }
.card .card-b { padding:8px 8px; }
.card .card-b.pad { padding:14px 16px; }

/* stat row ---------------------------------------------------- */
.stat-row { display:grid; grid-template-columns: repeat(6,1fr); gap:12px; margin-bottom:20px; }
.stat { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; box-shadow:var(--shadow-sm); }
.stat .v { font-size:24px; font-weight:680; letter-spacing:-.02em; line-height:1.1; }
.stat .k { font-size:12px; color:var(--text-soft); margin-top:3px; display:flex; align-items:center; gap:6px; }
.stat .k .pip { width:7px; height:7px; border-radius:50%; }

/* grid -------------------------------------------------------- */
.grid-2 { display:grid; grid-template-columns: 1fr 1fr; gap:16px; }
.grid-3 { display:grid; grid-template-columns: 1.4fr 1fr; gap:16px; }
.mb { margin-bottom:16px; }

/* pills / badges ---------------------------------------------- */
.pill { display:inline-flex; align-items:center; gap:5px; height:22px; padding:0 9px; border-radius:6px;
  font-size:11.5px; font-weight:600; line-height:1; white-space:nowrap; }
.pill .pip { width:6px; height:6px; border-radius:50%; }
.badge-wt { display:inline-grid; place-items:center; min-width:24px; height:20px; padding:0 6px; border-radius:5px;
  font-size:11px; font-weight:700; background:var(--bg-sunken); color:var(--text-soft); border:1px solid var(--border); }
.priority-flag { font-size:11px; font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.priority-flag::before { content:'▰'; font-size:9px; }

/* progress bars ----------------------------------------------- */
.prog { height:6px; border-radius:6px; background:var(--bg-sunken); overflow:hidden; }
.prog > span { display:block; height:100%; border-radius:6px; background: linear-gradient(90deg,var(--accent),#8b5cf6); transition: width .5s; }
.prog.green > span { background: linear-gradient(90deg,#16a34a,#22c55e); }
.prog.amber > span { background: linear-gradient(90deg,#d97706,#f59e0b); }
.prog.red > span   { background: linear-gradient(90deg,#dc2626,#ef4444); }
.prog-num { font-variant-numeric: tabular-nums; font-weight:650; font-size:12.5px; }

/* lists / rows ------------------------------------------------ */
.row-item { display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:8px; }
.row-item:hover { background: var(--bg-soft); }
.row-item .t { font-weight:500; font-size:13.5px; }
.row-item .sub { color: var(--text-mute); font-size:12px; }
.divider { height:1px; background:var(--border); margin:2px 0; }

/* project glance list ----------------------------------------- */
.glance { display:flex; align-items:center; gap:12px; padding:8px 10px; border-radius:8px; }
.glance:hover { background: var(--bg-soft); }
.glance .name { font-weight:550; font-size:13.5px; flex-shrink:0; width:130px; }
.glance .bar { flex:1; }
.glance .pct { width:42px; text-align:right; }

/* tables ------------------------------------------------------ */
table.cos { width:100%; border-collapse:collapse; font-size:13px; }
table.cos th { text-align:left; font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--text-mute); padding:8px 10px; border-bottom:1px solid var(--border); }
table.cos td { padding:9px 10px; border-bottom:1px solid var(--border); vertical-align:middle; }
table.cos tr:last-child td { border-bottom:none; }
table.cos tr:hover td { background: var(--bg-soft); }

/* category / checklist ---------------------------------------- */
.cat { border:1px solid var(--border); border-radius:var(--radius); margin-bottom:12px; background:var(--surface); overflow:hidden; }
.cat-h { display:flex; align-items:center; gap:10px; padding:12px 14px; cursor:pointer; user-select:none; }
.cat-h:hover { background: var(--bg-soft); }
.cat-h .ic { font-size:16px; }
.cat-h .nm { font-weight:600; font-size:14px; }
.cat-h .meta { color:var(--text-mute); font-size:12px; }
.cat-h .bar { width:120px; margin-left:auto; }
.cat-b { border-top:1px solid var(--border); }
.task-row { display:flex; align-items:center; gap:11px; padding:9px 14px; border-bottom:1px solid var(--border); }
.task-row:last-child { border-bottom:none; }
.task-row:hover { background: var(--bg-soft); }
.task-row .check { width:18px; height:18px; border-radius:5px; border:1.5px solid var(--border-strong); flex-shrink:0;
  display:grid; place-items:center; cursor:pointer; font-size:11px; color:#fff; }
.task-row .check.done { background: var(--c-green); border-color: var(--c-green); }
.task-row .ttl { flex:1; font-size:13.5px; min-width:0; }
.task-row.done .ttl { color:var(--text-mute); text-decoration: line-through; }
.task-row .right { display:flex; align-items:center; gap:9px; }

/* buttons / forms --------------------------------------------- */
.btn { display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 14px; border-radius:8px;
  font-size:13px; font-weight:550; border:1px solid var(--border-strong); background:var(--surface); color:var(--text);
  cursor:pointer; transition:.12s; }
.btn:hover { background: var(--bg-sunken); }
.btn.primary { background: var(--accent); border-color: var(--accent); color:#fff; }
.btn.primary:hover { opacity:.92; }
.btn.sm { height:28px; padding:0 10px; font-size:12px; }
.btn.ghost { border-color:transparent; background:transparent; }
.input, select.input, textarea.input {
  width:100%; height:36px; padding:0 11px; border:1px solid var(--border-strong); border-radius:8px;
  background:var(--bg); color:var(--text); font-size:13.5px; font-family:inherit; }
textarea.input { height:auto; padding:9px 11px; }
.input:focus, select.input:focus, textarea.input:focus { outline:2px solid var(--accent-soft); border-color:var(--accent); }
label.fl { display:block; font-size:12px; font-weight:600; color:var(--text-soft); margin:0 0 5px; }
.field { margin-bottom:13px; }

/* page header ------------------------------------------------- */
.page-h { display:flex; align-items:center; gap:14px; margin-bottom:20px; }
.page-h h1 { margin:0; font-size:21px; font-weight:680; letter-spacing:-.02em; }
.page-h .sub { color:var(--text-soft); font-size:13.5px; }
.greeting { font-size:20px; font-weight:680; letter-spacing:-.02em; }
.greeting + .gsub { color:var(--text-soft); font-size:13.5px; margin-top:2px; }

/* empty states ------------------------------------------------ */
.empty { padding:26px 16px; text-align:center; color:var(--text-mute); font-size:13px; }
.empty .em-ic { font-size:22px; opacity:.5; margin-bottom:6px; }

/* tabs -------------------------------------------------------- */
.tabs { display:flex; gap:2px; border-bottom:1px solid var(--border); margin-bottom:18px; }
.tabs a { padding:9px 13px; font-size:13px; font-weight:550; color:var(--text-soft); border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabs a.active { color:var(--text); border-bottom-color: var(--accent); }

/* command palette --------------------------------------------- */
.cmdk-overlay { position:fixed; inset:0; background:rgba(10,12,18,.45); backdrop-filter: blur(2px); z-index:100; display:none; }
.cmdk-overlay.open { display:block; }
.cmdk { position:fixed; left:50%; top:18%; transform:translateX(-50%); width:min(560px,92vw); background:var(--surface);
  border:1px solid var(--border-strong); border-radius:14px; box-shadow:var(--shadow-md); z-index:101; display:none; overflow:hidden; }
.cmdk.open { display:block; }
.cmdk input { width:100%; height:50px; border:none; border-bottom:1px solid var(--border); background:transparent;
  padding:0 18px; font-size:15px; color:var(--text); outline:none; font-family:inherit; }
.cmdk .results { max-height:340px; overflow:auto; padding:6px; }
.cmdk .res { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:8px; cursor:pointer; font-size:13.5px; }
.cmdk .res:hover, .cmdk .res.sel { background: var(--bg-sunken); }
.cmdk .res .k { margin-left:auto; font-size:11px; color:var(--text-mute); }

/* flash ------------------------------------------------------- */
.flash { position:fixed; right:20px; bottom:20px; background:var(--text); color:var(--bg); padding:11px 16px;
  border-radius:9px; font-size:13.5px; box-shadow:var(--shadow-md); z-index:120; animation:slideup .3s; }
@keyframes slideup { from { transform:translateY(10px); opacity:0; } }

/* utility ----------------------------------------------------- */
.muted { color: var(--text-mute); }
.soft  { color: var(--text-soft); }
.flex  { display:flex; align-items:center; gap:8px; }
.between { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.wrap-actions { display:flex; gap:8px; flex-wrap:wrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* responsive -------------------------------------------------- */
@media (max-width: 980px) {
  .stat-row { grid-template-columns: repeat(3,1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .sidebar { position:fixed; left:-260px; z-index:60; transition:.2s; box-shadow:var(--shadow-md); }
  .sidebar.show { left:0; }
  .content { padding:18px 16px 50px; }
}
@media (max-width: 560px) {
  .stat-row { grid-template-columns: repeat(2,1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition:none !important; animation:none !important; } }

/* ============================================================
   Phase 3 — comments, mentions, attachments
   ============================================================ */

/* mentions */
.mention { color: var(--accent-text); background: var(--accent-soft); padding: 0 4px; border-radius: 5px; font-weight: 600; }

/* discussion / comments */
.discussion { display: flex; flex-direction: column; }
.comment { display: flex; gap: 10px; padding: 11px 0; align-items: flex-start; }
.comment + .comment { border-top: 1px solid var(--border); }
.comment.resolved { opacity: .62; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.comment-head strong { font-size: 13.5px; }
.comment-body { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 14px; margin-top: 7px; }
.comment .reply { padding: 9px 0 2px; border-top: none; margin-top: 6px; padding-left: 0; }
.comment .reply + .reply { border-top: none; }
.reply-form textarea { min-height: 34px; }

.link-btn { background: none; border: none; padding: 0; cursor: pointer; color: var(--text-mute);
  font-size: 12.5px; font-weight: 550; font-family: inherit; }
.link-btn:hover { color: var(--text); }
.link-btn.danger:hover { color: var(--c-red); }

/* mention popup */
.mention-pop { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 40;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-md); overflow: hidden; padding: 4px; }
.mention-opt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.mention-opt:hover { background: var(--bg-sunken); }
.mention-opt strong { color: var(--accent-text); }

/* attachments */
.files { display: flex; flex-direction: column; }
.attach-item { display: flex; align-items: center; gap: 11px; padding: 9px 2px; }
.attach-item + .attach-item { border-top: 1px solid var(--border); }
.attach-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.attach-name { font-weight: 550; font-size: 13.5px; word-break: break-all; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 12.5px;
  font-weight: 550; cursor: pointer; color: var(--text-soft); font-family: inherit; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.comment-form textarea, .reply-form textarea { resize: vertical; }

/* ============================================================
   Phase 5 — Calendar
   Plain monthly grid. Owner = light (.cal--light, the default tokens),
   member/manager = black-to-blue (.cal--midnight). A few chips per day,
   nothing heavier, so it never feels crowded.
   ============================================================ */
.cal {
  --cal-surface: var(--surface);
  --cal-border:  var(--border);
  --cal-muted:   var(--text-mute);
  --cal-soft:    var(--text-soft);
  --cal-text:    var(--text);
  --cal-head:    var(--bg-soft);
  --cal-day:     var(--surface);
  --cal-out:     var(--bg-soft);
  --cal-accent:  var(--accent-text);
}

/* header + month nav */
.cal-head { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:18px; }
.cal-hello { font-size:21px; font-weight:680; letter-spacing:-.02em; color:var(--cal-text); display:flex; align-items:center; gap:10px; }
.cal-tag { font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--cal-accent);
  border:1px solid var(--cal-border); border-radius:6px; padding:2px 8px; }
.cal-sub { font-size:13px; color:var(--cal-soft); margin-top:4px; }
.cal-back { color:var(--cal-accent); font-weight:550; }
.cal-nav { display:flex; align-items:center; gap:8px; }
.cal-month { min-width:132px; text-align:center; font-weight:650; font-size:14.5px; color:var(--cal-text);
  font-variant-numeric:tabular-nums; }
.cal-btn, .cal-today { display:inline-grid; place-items:center; height:34px; border-radius:8px; cursor:pointer;
  border:1px solid var(--cal-border); background:var(--cal-surface); color:var(--cal-text); font-size:15px; transition:.12s; }
.cal-btn { width:34px; }
.cal-today { padding:0 14px; font-size:13px; font-weight:550; }
.cal-btn:hover, .cal-today:hover { border-color:var(--cal-accent); color:var(--cal-accent); }

/* grid */
.cal-grid { border:1px solid var(--cal-border); border-radius:var(--radius); overflow:hidden;
  background:var(--cal-surface); box-shadow:var(--shadow-sm); }
.cal-dow { display:grid; grid-template-columns:repeat(7,1fr); background:var(--cal-head); border-bottom:1px solid var(--cal-border); }
.cal-dow > div { padding:9px 12px; font-size:11px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; color:var(--cal-muted); }
.cal-week { display:grid; grid-template-columns:repeat(7,1fr); }
.cal-week + .cal-week { border-top:1px solid var(--cal-border); }
.cal-day { min-height:116px; padding:7px 8px; border-right:1px solid var(--cal-border); background:var(--cal-day);
  display:flex; flex-direction:column; gap:5px; min-width:0; }
.cal-day:last-child { border-right:none; }
.cal-day.out { background:var(--cal-out); }
.cal-day.out .cal-date { opacity:.45; }
.cal-date { font-size:12.5px; font-weight:600; color:var(--cal-soft); font-variant-numeric:tabular-nums; align-self:flex-start; }
.cal-day.today .cal-date { display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 5px;
  border-radius:11px; background:var(--cal-accent); color:#fff; }

/* day chips */
.cal-events { display:flex; flex-direction:column; gap:3px; min-width:0; }
.cal-chip { display:flex; align-items:center; gap:6px; padding:3px 7px; border-radius:6px; min-width:0; transition:.12s;
  background:color-mix(in srgb, var(--chip) 12%, transparent);
  border:1px solid color-mix(in srgb, var(--chip) 26%, transparent); }
.cal-chip:hover { background:color-mix(in srgb, var(--chip) 22%, transparent); }
.cal-chip .dot { width:6px; height:6px; border-radius:50%; background:var(--chip); flex-shrink:0; }
.cal-chip .lbl { font-size:11.5px; font-weight:550; line-height:1.35; color:var(--cal-text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-chip.over .lbl { color:var(--c-red); }
.cal-more { font-size:11px; color:var(--cal-muted); padding:1px 7px; }

/* legend */
.cal-legend { display:flex; flex-wrap:wrap; gap:16px; margin-top:14px; font-size:12px; color:var(--cal-soft); }
.cal-legend span { display:inline-flex; align-items:center; gap:6px; }
.cal-legend i { width:9px; height:9px; border-radius:50%; display:inline-block; }

/* ---- black-to-blue "midnight" theme (member / manager) ------------- */
.cal--midnight {
  --cal-surface:#0b1020;
  --cal-border:#1e2a47;
  --cal-muted:#6c7b9e;
  --cal-soft:#9fb1d4;
  --cal-text:#e8eefc;
  --cal-head:linear-gradient(90deg,#0a0e1a,#102047);
  --cal-day:#0b1020;
  --cal-out:#080b15;
  --cal-accent:#3b82f6;
  padding:24px; border-radius:18px;
  background:linear-gradient(160deg,#05070d 0%,#0a1126 46%,#0e2150 100%);
  box-shadow:0 14px 46px rgba(4,10,34,.5);
}
.cal--midnight .cal-grid { background:transparent; box-shadow:none; }
.cal--midnight .cal-btn, .cal--midnight .cal-today, .cal--midnight .cal-tag { background:rgba(255,255,255,.04); }
.cal--midnight .cal-day.today .cal-date { background:linear-gradient(135deg,#2563eb,#3b82f6); color:#fff; }
.cal--midnight .cal-hello { background:linear-gradient(90deg,#ffffff,#7fb0ff);
  -webkit-background-clip:text; background-clip:text; color:transparent; }
.cal--midnight .cal-chip:hover { background:color-mix(in srgb, var(--chip) 30%, transparent); }

/* responsive — keep it usable, stay plain */
@media (max-width: 760px) {
  .cal-day { min-height:80px; padding:5px 6px; }
  .cal-dow > div { padding:7px 6px; font-size:10px; }
  .cal-chip .lbl { font-size:11px; }
  .cal--midnight { padding:14px; }
}

/* ============================================================
   Phase 5 — Assignments (direct ad-hoc to-dos)
   ============================================================ */
/* highlighted "Assigned to you" card on the dashboards */
.assign-card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft), var(--shadow-sm); }
.assign-card > .card-h { background: var(--accent-soft); }
.assign-card > .card-h h3 { color: var(--accent-text); }

/* the complete toggle is a <button> reusing .check — neutralise button chrome */
button.check { background: transparent; font-family: inherit; padding: 0; line-height: 1; }
button.check:hover { border-color: var(--c-green); }
button.check.done { background: var(--c-green); border-color: var(--c-green); }

/* ============================================================
   Phase 5 — Board (Trello-style cards grouped by due date)
   ============================================================ */
.board-group { margin-bottom: 22px; }
.board-group-h { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.board-group-h h3 { margin:0; font-size:14px; font-weight:680; letter-spacing:-.01em; }
.board-group-h .count { margin-left:auto; font-size:12px; color:var(--text-mute);
  background:var(--bg-sunken); border:1px solid var(--border); border-radius:20px; padding:1px 9px; }
.board-dot { width:9px; height:9px; border-radius:50%; background:var(--text-mute); flex-shrink:0; }
.board-dot.a-red { background:var(--c-red); } .board-dot.a-blue { background:var(--c-blue); } .board-dot.a-violet { background:var(--c-violet); }
.board-group.is-overdue .board-group-h h3 { color:var(--c-red); }

.board-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(228px,1fr)); gap:12px; align-items:start; }
.tcard { display:block; background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--stripe);
  border-radius:10px; padding:12px 13px; box-shadow:var(--shadow-sm); color:inherit; transition:.12s; }
.tcard:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); opacity:1; }
.board-group.is-overdue .tcard { border-color:var(--c-red); border-left-color:var(--c-red);
  background:color-mix(in srgb, var(--c-red) 6%, var(--surface)); }
.tcard-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.tcard-title { font-weight:600; font-size:13.5px; line-height:1.35; letter-spacing:-.01em; margin-bottom:9px; }
.tcard-meta { display:flex; align-items:center; gap:6px; font-size:12px; margin-bottom:11px; }
.tcard-meta .ic { font-size:13px; }
.tcard-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; }
