*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Clickable rows are navigated via a delegated listener in app.js, not a
   per-element binding, so this covers the cursor for ALL of them — including
   ones a page renders after load — instead of relying on each row's own class. */
tr[data-href], div[data-href] { cursor: pointer; }

:root {
  --bg:           #f4f4f8;
  --surface:      #ffffff;
  --surface-2:    #f8f8fb;
  --border:       #e6e6ed;
  --border-soft:  #ececf2;
  --text:         #15151a;
  --text-2:       #4c4c58;
  --text-3:       #9898a8;
  --primary:      #5046e4;
  --primary-h:    #4338ca;
  --primary-bg:   #eef1ff;
  --primary-ring: rgba(80,70,228,.15);
  --primary-grad: linear-gradient(135deg, #6a60f0 0%, #4d3fdb 100%);
  --sidebar-bg:   #111110;
  --sidebar-w:    244px;
  --topbar-h:     54px;
  /* Bumped up from 6/10/14 for a softer, more modern card language —
     these cascade everywhere automatically since every component already
     references the variable rather than a hardcoded px value. */
  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    18px;
  --radius-xl:    24px;
  /* Cool-toned (navy-tinted, not pure black) shadows read as more premium
     and match the purple brand color better than neutral grey shadows. */
  --shadow-xs:    0 1px 2px rgba(20,20,40,.05), 0 0 0 1px rgba(20,20,40,.025);
  --shadow-sm:    0 2px 8px rgba(20,20,40,.07), 0 1px 2px rgba(20,20,40,.04);
  --shadow-md:    0 8px 24px rgba(20,20,40,.10), 0 2px 8px rgba(20,20,40,.05);
  --shadow-lg:    0 24px 60px rgba(20,20,40,.16), 0 8px 20px rgba(20,20,40,.06);
  --ease:         cubic-bezier(.16,1,.3,1);
  --t:            .14s;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: row;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  color: #fff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -.4px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.logo-mark-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #818cf8 0%, #4f46e5 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.5), inset 0 1px 0 rgba(255,255,255,.15);
}

/* Quick action */
.sidebar-qa { padding: 6px 10px 2px; }
.nav-new-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 9px 11px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  color: rgba(255,255,255,.7);
  text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background var(--t), color var(--t), border-color var(--t);
  letter-spacing: -.1px;
}
.nav-new-btn:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.16);
  color: #fff;
}
.nav-new-btn svg { opacity: .7; flex-shrink: 0; }
.nav-new-btn:hover svg { opacity: 1; }

/* Nav */
.sidebar-nav { flex: 1; padding: 6px 10px 10px; overflow-y: auto; scrollbar-width: none; min-height: 0; }
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-group-label {
  font-size: 12px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: rgba(255,255,255,.22);
  padding: 15px 10px 6px;
  user-select: none;
}

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: 16px; font-weight: 500;
  transition: color var(--t), background var(--t), box-shadow var(--t);
  margin-bottom: 1px; letter-spacing: -.1px;
  position: relative;
}
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(129,140,248,.22), rgba(129,140,248,.08));
  box-shadow: inset 3px 0 0 #818cf8;
}
.nav-item svg { flex-shrink: 0; opacity: .55; transition: opacity var(--t); }
.nav-item:hover svg, .nav-item.active svg { opacity: 1; }
.nav-label { flex: 1; }
.nav-count {
  margin-left: auto; flex-shrink: 0;
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.1);
  padding: 1px 7px; border-radius: 99px;
  line-height: 1.7;
}
.nav-item.active .nav-count { background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); }

/* Footer */
.sidebar-footer { padding: 10px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.user-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 8px;
  cursor: pointer; transition: background var(--t);
}
.user-row:hover { background: rgba(255,255,255,.07); }
.av-sidebar {
  width: 32px; height: 32px; font-size: 12px;
  border-radius: 8px;
  box-shadow: none;
}
.user-info { flex: 1; min-width: 0; }
.user-name-text { font-size: 15px; font-weight: 500; color: rgba(255,255,255,.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-text { font-size: 12.5px; color: rgba(255,255,255,.28); text-transform: capitalize; }
.dd-menu-up { bottom: calc(100% + 6px); top: auto; left: 0; right: 0; min-width: 0; }

/* ── Double sidebar — rail + panel ───────────────────── */
.sidebar-rail {
  width: 68px;
  min-width: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
  flex-shrink: 0;
}
.rail-logo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0 13px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.rail-cats {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  min-height: 0;
}
.rail-cats::-webkit-scrollbar { display: none; }
.rail-cat {
  position: relative;
  width: 54px;
  padding: 9px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255,255,255,.32);
  cursor: pointer;
  transition: background var(--t), color var(--t);
  text-decoration: none;
}
.rail-cat span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.rail-cat svg { flex-shrink: 0; }
.rail-cat:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.72); }
.rail-cat.active { background: linear-gradient(135deg, rgba(129,140,248,.24), rgba(129,140,248,.12)); color: #818cf8; }
.rail-badge {
  position: absolute;
  top: 5px; right: 5px;
  min-width: 15px; height: 15px;
  background: #ef4444;
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
  border: 1.5px solid #1e1e2e;
  pointer-events: none;
}

.sidebar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.panel-section {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.panel-section.active { display: flex; }

/* ── Avatar ───────────────────────────────────────────── */
.av {
  border-radius: 50%;
  background: linear-gradient(145deg, #818cf8, #4f46e5);
  color: #fff;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 10px; width: 28px; height: 28px;
  letter-spacing: .02em;
  box-shadow: 0 1px 3px rgba(79,70,229,.3);
  position: relative; overflow: hidden;
}
.av-sm { width: 22px; height: 22px; font-size: 9px; box-shadow: none; }
.av-md { width: 34px; height: 34px; font-size: 12px; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── App shell ────────────────────────────────────────── */
.app-shell { flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; margin-left: var(--sidebar-w); }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: rgba(250,250,252,.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 22px; gap: 10px;
  position: sticky; top: 0; z-index: 50; flex-shrink: 0;
}
.topbar-title { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; letter-spacing: -.25px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Global search trigger + overlay ───────────────────── */
.gs-trigger {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px 10px; color: var(--text-3); font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: background var(--t), border-color var(--t);
}
.gs-trigger:hover { background: var(--bg); border-color: #d5d4cf; color: var(--text-2); }
.gs-trigger-label { white-space: nowrap; }
.gs-trigger-kbd {
  font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; line-height: 1.4;
}
@media (max-width: 860px) { .gs-trigger-label { display: none; } }

.gs-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15,15,25,.45); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.gs-box {
  width: min(560px, 92vw); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: slideUp .15s var(--ease);
}
.gs-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.gs-input-row input { flex: 1; border: none; outline: none; font-size: 15px; font-family: inherit; color: var(--text); background: none; }
.gs-esc { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }
.gs-results { overflow-y: auto; padding: 8px; }
.gs-hint { padding: 18px 10px; text-align: center; color: var(--text-3); font-size: 13px; }
.gs-hint code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; }
.gs-section-label { font-size: 10.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; padding: 10px 10px 4px; }
.gs-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-size: 13.5px;
}
.gs-row svg { flex-shrink: 0; color: var(--text-3); }
.gs-row.active, .gs-row:hover { background: var(--primary-bg); color: var(--primary); }
.gs-row.active svg, .gs-row:hover svg { color: var(--primary); }
.gs-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.gs-row-sub { flex-shrink: 0; font-size: 11.5px; color: var(--text-3); font-family: ui-monospace, monospace; }
.gs-row-exact { background: var(--primary-bg); color: var(--primary); font-weight: 600; margin-bottom: 4px; }
.gs-row-exact svg { color: var(--primary); }
.topbar-actions { display: flex; gap: 5px; align-items: center; min-width: 0; flex-shrink: 0; }
.topbar-page-actions {
  display: flex; gap: 5px; align-items: center; min-width: 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.topbar-page-actions::-webkit-scrollbar { display: none; }
.topbar-page-actions > * { flex-shrink: 0; }
.timer-topbar-btn, .notif-bell { flex-shrink: 0; }

/* ── Page ─────────────────────────────────────────────── */
.page { flex: 1; padding: 24px 26px; }
.page.ct-loading { opacity: .5; transition: opacity .1s; pointer-events: none; }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t);
  text-decoration: none; white-space: nowrap;
  font-family: inherit; line-height: 1.4; letter-spacing: -.1px;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 2px 6px rgba(80,70,228,.32), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(80,70,228,.4), inset 0 1px 0 rgba(255,255,255,.14); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn-ghost {
  background: var(--surface); color: var(--text-2);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: #ccc; }
.btn-sm  { padding: 6px 12px; font-size: 13.5px; }
.btn-xs  { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-active { background: var(--primary-bg); color: var(--primary); border-color: #c7d2fe; }

/* ── Stats ────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 10px; margin-bottom: 24px;
}
.stats-row.stats-row-5 { grid-template-columns: repeat(5,1fr); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.stat:hover { box-shadow: var(--shadow-md); border-color: #d5d4cf; transform: translateY(-2px); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(20,20,40,.04);
  margin-bottom: 16px; flex-shrink: 0;
}
.stat-n {
  font-size: 34px; font-weight: 700; letter-spacing: -1px;
  color: var(--text); line-height: 1; margin-bottom: 6px;
}
.stat-l { font-size: 12.5px; color: var(--text-3); font-weight: 500; letter-spacing: .02em; text-transform: uppercase; }

/* Compact stat variant for dense finance rows */
.stat.stat-sm { padding: 14px 16px; }
.stat.stat-sm .stat-n { font-size: 21px; letter-spacing: -.4px; margin-bottom: 4px; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── Finance kit: one tab/pill control, one table, one attention strip ── */
.fin-tabs { display: inline-flex; gap: 3px; background: var(--surface); border: 1px solid var(--border);
            border-radius: var(--radius); padding: 3px; margin-bottom: 16px; }
.fin-tab { padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; border: none;
           background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
           display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.fin-tab:hover { background: var(--surface-2); color: var(--text); }
.fin-tab.active { background: var(--primary); color: #fff; }
.fin-tab .fin-tab-count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
                          background: rgba(0,0,0,.12); }
.fin-tab.active .fin-tab-count { background: rgba(255,255,255,.25); }

.fin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border);
             border-radius: var(--radius-lg); overflow: hidden; font-size: 13px; }
.fin-table th { text-align: right; padding: 9px 14px; font-size: 11px; font-weight: 600; color: var(--text-3);
                text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border);
                white-space: nowrap; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table td { text-align: right; padding: 9px 14px; border-bottom: 1px solid var(--border-soft, var(--border));
                font-variant-numeric: tabular-nums; }
.fin-table tr:last-child td { border-bottom: none; }
.fin-table tr:hover td { background: var(--surface-2); }
.fin-pos { color: #16a34a; }
.fin-neg { color: #dc2626; }

.fin-attn { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.fin-attn-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
                 background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
                 font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none;
                 transition: border-color var(--t), box-shadow var(--t); }
.fin-attn-chip:hover { border-color: var(--primary); box-shadow: var(--shadow-xs); }
.fin-attn-chip .fin-attn-n { font-weight: 700; font-size: 14px; }
.fin-attn-chip.attn-warn { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.fin-attn-chip.attn-danger { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.fin-attn-chip.attn-ok { color: var(--text-3); }

/* ── Section header ───────────────────────────────────── */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -.15px; }

/* ── Table ────────────────────────────────────────────── */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 11px 18px;
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .09em;
  background: transparent;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--t);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr[data-href]:hover td.primary { color: var(--primary); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 14px 18px; font-size: 14px; color: var(--text-2); vertical-align: middle; }
td.primary { color: var(--text); font-weight: 500; font-size: 14px; transition: color var(--t); }
td.mono    { font-size: 12px; color: var(--text-3); font-family: monospace; }

/* ── Status pills ─────────────────────────────────────── */
.s-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 4px 9px; border-radius: 99px;
  letter-spacing: .01em;
}
.s-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0; opacity: .8;
}
.s-open            { color: #1d4ed8; background: #dbeafe; }
.s-needs_info      { color: #92400e; background: #fef3c7; }
.s-waiting_client  { color: #5b21b6; background: #ede9fe; }
.s-in_progress     { color: #155e75; background: #cffafe; }
.s-in_review       { color: #9a3412; background: #ffedd5; }
.s-resolved        { color: #14532d; background: #dcfce7; }
.s-closed          { color: #52525b; background: #f4f4f5; }

/* ── Priority chips ───────────────────────────────────── */
.p-low    { color: #15803d; font-size: 13.5px; font-weight: 600; }
.p-medium { color: #1d4ed8; font-size: 13.5px; font-weight: 600; }
.p-high   { color: #c2410c; font-size: 13.5px; font-weight: 600; }
.p-urgent { color: #dc2626; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; }

/* ── Badge ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  letter-spacing: .01em;
}

/* ── Tag chips + picker (clients / tickets / tasks) ──────── */
.tag-chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.tag-chip-x {
  border: none; background: none; cursor: pointer; padding: 0;
  font-size: 13px; line-height: 1; color: inherit; opacity: .6;
}
.tag-chip-x:hover { opacity: 1; }
.tag-add-btn {
  border: 1px dashed var(--border); background: none; border-radius: 99px;
  padding: 2px 9px; font-size: 11.5px; font-weight: 500; color: var(--text-3);
  cursor: pointer;
}
.tag-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

.tag-pop {
  display: none; position: fixed; z-index: 400; width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 8px;
}
.tag-pop-search {
  width: 100%; border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 9px; font-size: 12.5px; background: var(--bg); margin-bottom: 6px;
  outline: none; box-sizing: border-box;
}
.tag-pop-search:focus { border-color: var(--primary); }
.tag-pop-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.tag-pop-item {
  display: flex; align-items: center; gap: 7px; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 6px; border: none; background: none;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.tag-pop-item:hover { background: var(--surface-2); }
.tag-pop-item-check { width: 12px; font-size: 11px; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.tag-pop-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tag-pop-create { color: var(--primary); font-weight: 600; }
.tag-pop-empty { padding: 10px 8px; font-size: 12.5px; color: var(--text-3); }

/* ── Filter tabs ──────────────────────────────────────── */
.tabs {
  display: flex; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; gap: 0; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 9px 15px; font-size: 14px; font-weight: 500;
  color: var(--text-3); cursor: pointer;
  border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
  font-family: inherit; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: -.05px;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }
.tab .n {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 0 6px; border-radius: 99px; line-height: 1.65;
}
.tab.active .n { color: var(--text-2); }

/* ── Filter bar ───────────────────────────────────────── */
.filter-bar { display: flex; gap: 7px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search-box {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px 11px;
  flex: 1; max-width: 260px;
  transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-xs);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.search-box svg { color: var(--text-3); flex-shrink: 0; }
.search-box input {
  border: none; outline: none; font-size: 14.5px;
  color: var(--text); background: transparent; width: 100%; font-family: inherit;
}
.search-box input::placeholder { color: var(--text-3); }
.filter-sel {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 7px 11px; font-size: 14px; color: var(--text-2);
  background: var(--surface); outline: none; cursor: pointer;
  font-family: inherit; transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-xs);
}
.filter-sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* ── Inline status picker ─────────────────────────────── */
.status-cell { position: relative; }
.status-btn {
  cursor: pointer; background: none; border: none;
  padding: 2px 4px; border-radius: var(--radius-sm);
  transition: background var(--t); font-family: inherit;
}
.status-btn:hover { background: var(--border-soft); }
.status-picker {
  position: absolute; top: calc(100% + 5px); left: -4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 200; min-width: 195px; overflow: hidden;
  display: none; animation: popIn .1s var(--ease);
}
.status-picker.open { display: block; }
.sp-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; font-size: 14px; cursor: pointer;
  transition: background var(--t); font-weight: 500;
}
.sp-item:hover { background: var(--bg); }
.sp-item.current { background: var(--primary-bg); }
.sp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Combobox ─────────────────────────────────────────── */
.combobox { position: relative; }
.cb-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 11px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 14.5px; font-family: inherit;
  color: var(--text-2); cursor: pointer; text-align: left;
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.5; box-shadow: var(--shadow-xs);
}
.cb-btn:hover { border-color: #ccc; }
.cb-btn.open, .cb-btn:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.cb-btn svg { flex-shrink: 0; color: var(--text-3); transition: transform var(--t); }
.cb-btn.open svg { transform: rotate(180deg); }
.cb-val { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-val.selected { color: var(--text); font-weight: 500; }
.cb-drop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 300; display: none; overflow: hidden;
  animation: popIn .1s var(--ease);
}
.cb-drop.open { display: block; }
.cb-search-wrap { padding: 8px 8px 6px; border-bottom: 1px solid var(--border-soft); }
.cb-search {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--bg); outline: none; transition: border-color var(--t);
}
.cb-search:focus { border-color: var(--primary); }
.cb-list { max-height: 220px; overflow-y: auto; padding: 4px 0; }
.cb-opt {
  padding: 9px 13px; font-size: 14.5px; cursor: pointer; color: var(--text-2);
  transition: background var(--t);
}
.cb-opt:hover { background: var(--bg); color: var(--text); }
.cb-opt.selected { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.cb-opt.hidden { display: none; }
.cb-empty { padding: 12px; text-align: center; font-size: 13px; color: var(--text-3); }
.nsel-native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0;
  opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0,0,0,0);
}
.combobox.cb-block { display: block; }
.combobox.cb-inline { display: inline-block; }
.cb-btn.cb-compact {
  width: auto; padding: 7px 11px; font-size: 14px; color: var(--text-2);
  border-radius: var(--radius); white-space: nowrap;
}
.cb-drop { min-width: 200px; }

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; letter-spacing: -.05px; }
.form-hint  { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.form-control {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font-size: 14.5px; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-xs);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
textarea.form-control { min-height: 110px; resize: vertical; line-height: 1.65; }
select.form-control { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border-soft);
}
.card-title { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -.1px; }
.card-body  { padding: 16px; }

/* ── Ticket detail ────────────────────────────────────── */
.ticket-grid { display: grid; grid-template-columns: 1fr 256px; gap: 20px; align-items: start; }
.ticket-col  { display: flex; flex-direction: column; gap: 14px; }
.t-id    { font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; letter-spacing: .01em; }
.t-title { font-size: 23px; font-weight: 700; line-height: 1.3; letter-spacing: -.5px; color: var(--text); margin-bottom: 10px; }
.t-meta  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.t-desc  { font-size: 15px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; }

/* ── Comments ─────────────────────────────────────────── */
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment-body {
  flex: 1; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 11px 14px;
  background: var(--surface); box-shadow: var(--shadow-xs);
}
.comment.internal .comment-body { background: #fffdf0; border-color: #fde68a; }
.c-head   { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; flex-wrap: wrap; }
.c-author { font-size: 14px; font-weight: 600; color: var(--text); }
.c-time   { font-size: 12.5px; color: var(--text-3); }
.c-int    { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #92400e; background: #fef3c7; padding: 2px 7px; border-radius: 4px; }
.c-text   { font-size: 14.5px; color: var(--text-2); line-height: 1.75; white-space: pre-wrap; }
.cf-wrap  {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface); overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t);
  box-shadow: var(--shadow-xs);
}
.cf-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.cf-wrap textarea {
  width: 100%; min-height: 90px; border: none; outline: none;
  padding: 13px 15px; font-family: inherit; font-size: 15px;
  color: var(--text); resize: vertical; background: transparent; line-height: 1.6;
}
.cf-foot  {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-top: 1px solid var(--border-soft); background: var(--surface-2);
}

/* ── Meta sidebar ─────────────────────────────────────── */
.meta-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-xs);
}
.meta-row  {
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft);
  display: flex; flex-direction: column; gap: 5px;
}
.meta-row:last-child { border-bottom: none; }
.meta-l { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em; }
.meta-v { font-size: 14.5px; color: var(--text); font-weight: 500; }
.meta-sel {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 9px; font-size: 14px; color: var(--text);
  background: var(--surface-2); outline: none; cursor: pointer; width: 100%;
  font-family: inherit; font-weight: 500;
  transition: border-color var(--t), box-shadow var(--t);
}
.meta-sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

/* ── Kanban board ─────────────────────────────────────── */
.board-outer {
  overflow-x: auto; overflow-y: hidden;
  margin: -24px -26px 0; padding: 20px 26px 0;
  height: calc(100vh - var(--topbar-h) - 1px);
  display: flex; flex-direction: column;
}
.board-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; flex-shrink: 0;
}
.board {
  display: flex; gap: 10px;
  min-width: max-content; flex: 1;
  align-items: flex-start;
  padding-bottom: 24px;
}
.board-col { width: 240px; display: flex; flex-direction: column; max-height: 100%; flex-shrink: 0; }
.board-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  letter-spacing: .01em;
}
.board-col-cnt {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--text-3); background: var(--bg);
  padding: 1px 6px; border-radius: 99px;
}
.board-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.board-cards {
  flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface-2); padding: 6px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 100px; max-height: calc(100vh - var(--topbar-h) - 128px);
  transition: background var(--t), border-color var(--t);
}
.board-cards.drag-over { background: var(--primary-bg); border-color: #a5b4fc; }
.board-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius); padding: 10px 12px;
  cursor: grab; user-select: none;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), opacity var(--t), border-color var(--t), transform var(--t);
}
.board-card:hover { box-shadow: var(--shadow-sm); border-color: #d0cfcb; transform: translateY(-1px); }
.board-card.dragging { opacity: .4; cursor: grabbing; transform: none; }
.board-card.drag-placeholder { background: var(--primary-bg); border: 2px dashed #a5b4fc; border-left: 2px dashed #a5b4fc; }
.bc-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.45; margin-bottom: 7px; }
.bc-footer { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bc-client { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prio-low    { border-left-color: #16a34a; }
.prio-medium { border-left-color: #2563eb; }
.prio-high   { border-left-color: #d97706; }
.prio-urgent { border-left-color: #dc2626; }

@media (max-width: 680px) {
  /* draggable="true" cards can make mobile browsers try to run their own
     native drag-and-drop off touch input, fighting board-dnd.js's long-press
     gesture — disabled here the same way board-view.php's .bv-card already
     was, extended to every other board's card class too. */
  .board-card, .iss-board-card { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }
}

/* ── Kanban: rich board (Boards tool) ────────────────────
   Moved out of pages/board-view.php's inline <style> so every board can
   share it. Note: .bv-columns below plays the role of the *row of columns*
   (like .board above) — it used to be named .board-outer, which collided
   with the unrelated .board-outer wrapper (toolbar + board row) defined
   above; renamed to remove the collision, id="board-outer" (JS hook) kept
   as-is in the page markup. */
.bv-header { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.bv-title {
  font-size:20px; font-weight:700; letter-spacing:-.3px; cursor:pointer; padding:2px 4px;
  border-radius:4px; border:1px solid transparent;
}
.bv-title:hover { border-color:var(--border); background:var(--surface); }
.bv-desc {
  font-size:13px; color:var(--text-3); cursor:pointer; padding:2px 4px;
  border-radius:4px; border:1px solid transparent; flex:1;
}
.bv-desc:hover { border-color:var(--border); background:var(--surface); }
.bv-edit-input {
  font-size:20px; font-weight:700; letter-spacing:-.3px; padding:2px 6px;
  border:1px solid var(--border); border-radius:4px; background:var(--surface);
  outline:none; width:100%;
}
.bv-edit-desc {
  font-size:13px; color:var(--text); padding:2px 6px;
  border:1px solid var(--border); border-radius:4px; background:var(--surface);
  outline:none; width:100%;
}

.bv-columns {
  display:flex; flex-direction:row; gap:12px; overflow-x:auto; padding-bottom:16px;
  align-items:flex-start;
}
.bv-col {
  flex:0 0 270px; min-width:0;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  display:flex; flex-direction:column;
}
.bv-col-head {
  display:flex; align-items:center; gap:6px;
  padding:10px 12px 10px;
  border-bottom:1px solid var(--border);
}
.bv-col-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; cursor:pointer; }
.bv-col-name {
  flex:1; font-size:13px; font-weight:600; letter-spacing:.1px;
  border:none; background:transparent; padding:0; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.bv-col-name:focus { outline:none; background:var(--bg); border-radius:3px; padding:0 4px; cursor:text; }
.bv-col-count { font-size:12px; color:var(--text-3); }
.bv-col-del {
  opacity:0; transition:opacity var(--t); background:none; border:none; cursor:pointer;
  color:var(--text-3); padding:2px 3px; border-radius:3px;
}
.bv-col-del:hover { color:#dc2626; background:#fee2e2; }
.bv-col-head:hover .bv-col-del { opacity:1; }

.bv-cards { padding:8px; display:flex; flex-direction:column; gap:6px; min-height:40px; }
.bv-cards.drag-over { background:var(--primary-bg); border-radius:8px; }

.bv-card {
  background:var(--surface); border:1px solid var(--border);
  border-left-width:3px; border-left-color:transparent; /* .prio-low/-medium/-high/-urgent (shared with the ticket board) set this */
  border-radius:var(--radius); padding:11px 12px;
  cursor:grab; transition:box-shadow var(--t), border-color var(--t), transform var(--t), opacity var(--t);
  position:relative; user-select:none;
}
.bv-card:hover { border-color:#d5d4cf; box-shadow:var(--shadow-md); transform: translateY(-2px); }
.bv-card.dragging { opacity:.4; cursor:grabbing; }
/* Touch-drag feedback classes — toggled by assets/js/board-dnd.js on
   whichever card element the board uses (.bv-card, .board-card, .iss-board-card),
   so these are intentionally not scoped to a single card class. */
.touch-dragging { opacity:.9; box-shadow:var(--shadow-md); z-index:5; transition:box-shadow var(--t); }
.bv-card-edge-hint { box-shadow:0 0 0 2px var(--primary), var(--shadow-md); }
.card-color-bar { height:4px; border-radius:99px; width:30px; margin-bottom:9px; }
.bv-card-top { display:flex; align-items:flex-start; gap:9px; }
.bv-check {
  width:16px; height:16px; margin-top:2px; flex-shrink:0;
  accent-color:var(--primary); cursor:pointer;
}
.card-title-wrap { flex:1; min-width:0; }
/* Scoped (not a bare .card-title rule) so it doesn't collide with the
   shared kit's .card-title (app.css:715) used inside .card-head elsewhere. */
.bv-card .card-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--text); }
.card-desc-preview { font-size:12px; color:var(--text-3); margin-top:4px; line-height:1.5; }
.bv-card.done { opacity:.68; }
.bv-card.done .card-title { text-decoration:line-through; color:var(--text-3); }
.bv-card.done .card-desc-preview { text-decoration:line-through; }
.card-badges { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:8px; }
.card-meta {
  display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:10px; padding-top:9px;
  border-top:1px solid var(--border-soft);
}
.card-av {
  width:22px; height:22px; border-radius:50%; flex-shrink:0;
  background:var(--primary-grad); color:#fff; font-size:10px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 1px 3px rgba(79,70,229,.3);
}
.card-assign-btn {
  display:flex; align-items:center; gap:6px; min-width:0;
  background:none; border:none; padding:3px 5px; border-radius:6px; cursor:pointer;
}
.card-assign-btn:hover { background:var(--surface-2); }
.card-assign-name {
  font-size:12px; color:var(--text-3); white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; max-width:110px;
}
.card-assign-empty { font-size:12px; color:var(--text-3); font-weight:500; }
.card-move-arrows { display:none; gap:4px; flex-shrink:0; }
/* Reorder-within-column buttons — hidden by default on desktop (drag is the
   primary path there), revealed on card hover so they don't clutter every
   card at rest; always visible on mobile (no hover) alongside the existing
   move-to-adjacent-column arrows, matching that mobile media rule below. */
.card-reorder-btns { display:none; gap:4px; flex-shrink:0; }
.bv-card:hover .card-reorder-btns { display:flex; }
.card-move-btn {
  width:26px; height:26px; border-radius:6px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-2); padding:0; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.card-move-btn:hover { background:var(--surface-2); color:var(--text); }
.card-move-btn:active { transform:scale(.9); }

.assign-pop-item {
  display:block; width:100%; text-align:left; padding:7px 10px; border-radius:6px;
  border:none; background:none; font-size:13px; color:var(--text); cursor:pointer;
}
.assign-pop-item:hover { background:var(--surface-2); }
.assign-pop-item.active { background:var(--primary-bg); color:var(--primary); font-weight:600; }

/* Mobile column tabs (TickTick-style list switcher) — reusable by any board */
.bv-col-tabs {
  display:none; gap:6px; overflow-x:auto; -webkit-overflow-scrolling:touch;
  margin-bottom:10px; padding-bottom:2px; scrollbar-width:none;
}
.bv-col-tabs::-webkit-scrollbar { display:none; }
.bv-col-tab {
  flex:0 0 auto; display:flex; align-items:center; gap:6px;
  padding:8px 14px; border-radius:99px; font-size:12.5px; font-weight:600;
  border:1px solid var(--border); background:var(--surface); color:var(--text-2);
  white-space:nowrap; cursor:pointer;
}
.bv-col-tab.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.bv-col-tab-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.bv-col-tab-count { font-size:11px; font-weight:700; opacity:.75; }

@media (max-width: 680px) {
  .bv-col-tabs { display:flex; }
  .bv-columns {
    scroll-snap-type:x mandatory; gap:10px;
    -webkit-overflow-scrolling:touch; overscroll-behavior-x:contain;
  }
  .bv-col { flex:0 0 100%; scroll-snap-align:start; height:100%; min-height:0; }
  .bv-add-col { flex:0 0 100%; scroll-snap-align:start; }
  .bv-cards { flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; }
  .card-move-arrows { display:flex; }
  .card-reorder-btns { display:flex; }
  .bv-card { padding:13px 14px; }
  .bv-check { width:22px; height:22px; }
  .card-move-btn { width:30px; height:30px; }
  .bv-col-dot { width:14px; height:14px; }
  .bv-card { -webkit-user-drag:none; user-drag:none; -webkit-touch-callout:none; }
  .bv-col-del { opacity:1; padding:5px 6px; }
}

.add-card-btn {
  display:flex; align-items:center; gap:6px; width:100%;
  padding:7px 12px; background:none; border:none; cursor:pointer;
  color:var(--text-3); font-size:13px; font-weight:500;
  border-top:1px solid var(--border); transition:color var(--t), background var(--t);
  border-radius:0 0 var(--radius-lg) var(--radius-lg);
}
.add-card-btn:hover { color:var(--primary); background:var(--primary-bg); }
.add-card-form { padding:8px; border-top:1px solid var(--border); display:none; flex-direction:column; gap:6px; }
.add-card-form.visible { display:flex; }
.add-card-input { border:1px solid var(--border); border-radius:8px; padding:7px 10px; font-size:13.5px; resize:none; background:var(--bg); }
.add-card-input:focus { outline:none; border-color:var(--primary); }
.add-card-actions { display:flex; gap:6px; }

.bv-add-col {
  flex:0 0 220px; height:48px;
  display:flex; align-items:center; justify-content:center; gap:7px;
  background:transparent; border:2px dashed var(--border); border-radius:var(--radius-lg);
  cursor:pointer; color:var(--text-3); font-size:13px; font-weight:500;
  transition:border-color var(--t), color var(--t), background var(--t);
}
.bv-add-col:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-bg); }

.modal-two-col { display:flex; gap:24px; }
.modal-main { flex:1; min-width:0; }
.modal-side { width:180px; flex-shrink:0; display:flex; flex-direction:column; gap:14px; }
.modal-side-label { font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; color:var(--text-3); margin-bottom:4px; }
.color-swatches { display:flex; flex-wrap:wrap; gap:5px; }
.swatch { width:22px; height:22px; border-radius:50%; cursor:pointer; border:2px solid transparent; transition:transform .1s; }
.swatch:hover, .swatch.active { border-color:var(--text); transform:scale(1.15); }
.swatch.clear { background:var(--bg); border:1.5px dashed var(--border); }
.modal-assignee-sel { width:100%; }
.card-detail-title {
  font-size:16px; font-weight:700; width:100%; border:none; background:transparent;
  padding:0; outline:none; resize:none; line-height:1.4; color:var(--text);
  font-family:inherit;
}
.card-detail-title:focus { outline:none; }
.card-detail-desc {
  width:100%; border:1px solid transparent; border-radius:8px; padding:8px;
  font-size:13.5px; resize:none; background:transparent; color:var(--text);
  font-family:inherit; line-height:1.6; min-height:90px; transition:border-color var(--t);
}
.card-detail-desc:focus { outline:none; border-color:var(--border); background:var(--bg); }
.card-detail-desc::placeholder { color:var(--text-3); }

.bv-active-users { display:flex; align-items:center; }
.bv-avatar {
  width:26px; height:26px; border-radius:50%; background:var(--primary); color:#fff;
  font-size:11px; font-weight:600; display:flex; align-items:center; justify-content:center;
  border:2px solid var(--surface); margin-left:-8px; flex-shrink:0;
}
.bv-active-users .bv-avatar:first-child { margin-left:0; }
.bv-vis-badge { font-size:11px; font-weight:600; padding:2px 8px; border-radius:99px; }
.bv-vis-team { color:#16a34a; background:#f0fdf4; }
.bv-vis-restricted { color:#7c3aed; background:#ede9fe; }
.bv-activity-panel {
  position:fixed; top:0; right:0; bottom:0; width:320px; background:var(--surface);
  border-left:1px solid var(--border); box-shadow:-8px 0 24px rgba(0,0,0,.08);
  z-index:300; display:flex; flex-direction:column; transition:transform .2s var(--ease);
}
.bv-activity-panel.hidden { transform:translateX(100%); display:flex; }
.bv-activity-head { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--border); font-weight:700; font-size:14px; }
.bv-activity-list { flex:1; overflow-y:auto; padding:8px 16px; }
.bv-activity-row { padding:9px 0; border-bottom:1px solid var(--border-soft); font-size:13px; line-height:1.5; }
.bv-activity-time { color:var(--text-3); font-size:11.5px; display:block; margin-bottom:2px; }
.share-user-row { display:flex; align-items:center; gap:8px; padding:6px 0; font-size:13.5px; }

@media (max-width: 680px) {
  .bv-header { flex-wrap:wrap; row-gap:8px; }
  .bv-desc { flex-basis:100%; order:3; }
  .bv-activity-panel { width:100%; }
}

/* ── Kanban: index grid (Boards tool list page) ─────────── */
.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.board-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.board-card-item:hover { border-color: #ccc; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.bci-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.bci-desc { font-size: 13px; color: var(--text-3); line-height: 1.5; }
.bci-meta { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.bci-strip { display: flex; gap: 3px; margin-bottom: 4px; }
.bci-col-dot { height: 4px; flex: 1; border-radius: 99px; }
.bci-del {
  position: absolute; top: 12px; right: 12px;
  opacity: 0; transition: opacity var(--t);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: 4px;
}
.bci-del:hover { background: #fee2e2; color: #dc2626; }
.board-card-item:hover .bci-del { opacity: 1; }
.new-board-card {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  display: flex; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-3); font-size: 13.5px; font-weight: 500;
  min-height: 120px;
}
.new-board-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.bci-vis { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.bci-vis-team { color: #16a34a; background: #f0fdf4; }
.bci-vis-restricted { color: #7c3aed; background: #ede9fe; }
.bci-share {
  position: absolute; top: 12px; right: 38px;
  opacity: 0; transition: opacity var(--t);
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 4px; border-radius: 4px;
}
.bci-share:hover { background: var(--bg); color: var(--text-2); }
.board-card-item:hover .bci-share { opacity: 1; }

/* ── Login ────────────────────────────────────────────── */
body.login-body {
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 18% 14%, #eef1ff 0%, var(--bg) 45%),
              radial-gradient(circle at 86% 88%, #f3ecff 0%, var(--bg) 50%),
              var(--bg);
  position: relative; overflow: hidden;
}
.login-wrap { width: 100%; max-width: 380px; padding: 20px; position: relative; z-index: 1; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-lg);
  animation: loginIn .45s var(--ease);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; text-align: center; }
.login-logo .logo-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.login-logo h1 { font-size: 19px; font-weight: 700; letter-spacing: -.4px; }
.login-logo-img { width: auto; max-width: 300px; height: auto; max-height: 200px; object-fit: contain; }
.login-sub { font-size: 13.5px; color: var(--text-3); margin-top: -8px; }
.login-field { position: relative; }
.login-field svg.login-field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.login-field .form-control { padding-left: 38px; }
.login-field .pw-toggle {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-3); cursor: pointer;
  transition: background var(--t), color var(--t);
}
.login-field .pw-toggle:hover { background: var(--bg); color: var(--text-2); }
.login-field .form-control.has-toggle { padding-right: 36px; }
.login-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px; font-size: 14.5px;
}
.login-submit .spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .6s linear infinite; display: none;
}
.login-submit.loading .spinner { display: inline-block; }
.login-submit.loading .login-submit-label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-demo {
  margin-top: 18px; padding: 12px 14px; background: var(--bg);
  border-radius: var(--radius); font-size: 12.5px; color: var(--text-3);
  line-height: 1.9; font-family: monospace;
  border: 1px solid var(--border);
}

/* ── Alerts ───────────────────────────────────────────── */
.alert { padding: 10px 13px; border-radius: var(--radius); font-size: 13.5px; margin-bottom: 14px; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-success { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }

/* ── Dropdown ─────────────────────────────────────────── */
.dd { position: relative; display: inline-block; }
.dd-menu {
  position: absolute; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 150px; z-index: 500; display: none; overflow: hidden;
  animation: popIn .1s var(--ease);
}
.dd-menu.open { display: block; }
.dd-item {
  display: flex; align-items: center; gap: 7px; padding: 9px 14px;
  font-size: 14px; color: var(--text-2); cursor: pointer;
  transition: background var(--t); text-decoration: none;
  font-family: inherit; border: none; background: none; width: 100%; text-align: left;
}
.dd-item:hover { background: var(--bg); color: var(--text); }
.dd-item.danger { color: #dc2626; }
.dd-item.danger:hover { background: #fef2f2; }

/* ── Callout ──────────────────────────────────────────── */
.callout {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-lg);
  font-size: 14.5px; margin-bottom: 18px;
}
.callout-warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.callout a { font-weight: 600; color: inherit; }

/* ── Empty state ──────────────────────────────────────── */
.empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; text-align: center;
}
.empty svg { color: var(--text-3); margin-bottom: 12px; opacity: .6; }
.empty h3  { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: -.2px; }
.empty p   { font-size: 14.5px; color: var(--text-3); }

/* ── Misc utilities ───────────────────────────────────── */
.muted   { color: var(--text-3); }
.text-sm { font-size: 13px; }
.flex { display: flex; }
.items-c { align-items: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }
.mt-2 { margin-top: 8px; }
.mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border-soft); margin: 14px 0; }
.no-nav { }

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 20px; right: 20px;
  background: var(--text); color: #fff;
  padding: 10px 17px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px);
  transition: all .18s var(--ease);
  z-index: 9999; pointer-events: none;
  letter-spacing: -.05px;
}
.toast.show { opacity: 1; transform: none; }
.toast.err  { background: #dc2626; }

/* ── Animations ───────────────────────────────────────── */
@keyframes popIn {
  from { opacity: 0; transform: translateY(-5px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-height: 90vh; overflow-y: auto;
  animation: slideUp .17s var(--ease);
}
.modal-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title-text { font-size: 16px; font-weight: 700; flex:1; color: var(--text); letter-spacing: -.25px; }
.modal-x {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: var(--radius-sm);
  flex-shrink: 0; transition: background var(--t), color var(--t);
}
.modal-x:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.hidden { display: none !important; }

/* ── Global circular quick-access menu (every page) ─────
   Floating FAB, bottom-right, expands into an arc of shortcuts on click —
   per design feedback referencing a circular/arc menu pattern. */
.fab-wrap { position: fixed; bottom: 28px; right: 28px; width: 52px; height: 52px; z-index: 480; transition: bottom .2s var(--ease); }
.fab-wrap.above-wf-bar { bottom: 64px; }
.fab-toggle {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: var(--primary-grad); border: none; border-radius: 50%;
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  box-shadow: 0 6px 20px rgba(80,70,228,.4), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.fab-wrap.open .fab-toggle { transform: rotate(45deg); }
.fab-item {
  position: absolute; width: 44px; height: 44px; top: 4px; left: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); text-decoration: none;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transform: translate(0,0) scale(.4);
  transition: transform .32s cubic-bezier(.34,1.56,.64,1), opacity .22s var(--ease), color .15s, border-color .15s;
}
.fab-wrap.open .fab-item { opacity: 1; pointer-events: auto; }
.fab-wrap.open .fab-item-1 { transform: translate(-8px, -68px) scale(1); }
.fab-wrap.open .fab-item-2 { transform: translate(-62px, -40px) scale(1); }
.fab-wrap.open .fab-item-3 { transform: translate(-78px, 14px) scale(1); }
.fab-item:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-ring); }
.fab-item-label {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: var(--text); color: #fff; font-size: 11.5px; font-weight: 500;
  padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.fab-item:hover .fab-item-label { opacity: 1; }
.fab-backdrop { display: none; position: fixed; inset: 0; z-index: 470; }
.fab-wrap.open ~ .fab-backdrop, .fab-backdrop.open { display: block; }

/* ── @mentions ───────────────────────────────────────── */
.mention { color: var(--primary); background: var(--primary-bg); padding: 1px 5px; border-radius: 5px; font-weight: 600; }
.mention-dropdown {
  z-index: 500; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.15)); padding: 4px; max-height: 220px; overflow-y: auto;
}
.mention-opt { padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mention-opt.active, .mention-opt:hover { background: var(--primary-bg); color: var(--primary); }
.mention-opt-name { flex-shrink: 0; }
.mention-opt-tag { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; }

/* ── Notification bell ────────────────────────────────── */
.notif-bell {
  position: relative; background: none; border: none; cursor: pointer;
  color: var(--text-2); padding: 7px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.notif-bell:hover { background: var(--bg); color: var(--text); }
.notif-bell.active { background: var(--primary-bg); color: var(--primary); }
/* Sidebar placement (next to the user's name) needs light-on-dark colors
   instead of the topbar's light-surface palette. */
.sidebar-footer .notif-bell { flex-shrink: 0; color: rgba(255,255,255,.45); }
.sidebar-footer .notif-bell:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.sidebar-footer .notif-bell.active { background: rgba(129,140,248,.18); color: #818cf8; }
.sidebar-footer .notif-badge { border-color: var(--sidebar-bg); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: #dc2626; color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 99px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  line-height: 1;
  animation: badgePop .2s var(--ease);
}
@keyframes badgePop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notification panel ───────────────────────────────── */
.notif-panel {
  /* Anchored bottom-left, just above the sidebar footer where the bell now
     lives, per design feedback ("notifications next to the user's name"). */
  position: fixed; bottom: 70px; left: 16px;
  width: 360px; max-height: calc(100vh - 100px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 450; display: flex; flex-direction: column;
  transform: translateY(8px) scale(.98); opacity: 0;
  pointer-events: none;
  transition: transform .18s var(--ease), opacity .18s var(--ease);
  overflow: hidden;
}
.notif-panel.open {
  transform: none; opacity: 1; pointer-events: auto;
}
.notif-backdrop {
  display: none; position: fixed; inset: 0; z-index: 440;
}
.notif-backdrop.open { display: block; }

.notif-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title { font-size: 14.5px; font-weight: 700; color: var(--text); flex: 1; letter-spacing: -.2px; }
.notif-clear-all {
  font-size: 12.5px; font-weight: 500; color: var(--text-3);
  background: none; border: none; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: color var(--t), background var(--t);
}
.notif-clear-all:hover { color: var(--text); background: var(--bg); }
.notif-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: 4px;
  transition: background var(--t), color var(--t);
}
.notif-close:hover { background: var(--bg); color: var(--text); }

.notif-body { overflow-y: auto; flex: 1; }

.notif-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 24px 16px; font-size: 13.5px; color: var(--text-3);
}

.notif-empty {
  padding: 40px 20px; text-align: center;
}
.notif-empty-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; color: var(--text-3);
}
.notif-empty p { font-size: 14px; color: var(--text-3); font-weight: 500; }
.notif-empty span { font-size: 13px; color: var(--text-3); opacity: .7; }

.notif-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-3);
  padding: 12px 16px 4px;
}

.notif-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 16px; border-bottom: 1px solid var(--border-soft);
  transition: background var(--t); cursor: pointer;
  text-decoration: none; color: inherit;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }

.notif-type-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.notif-item-sub {
  font-size: 12.5px; color: var(--text-3); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time { font-size: 11.5px; color: var(--text-3); flex-shrink: 0; padding-top: 2px; }
.notif-dismiss {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: 4px;
  opacity: 0; transition: opacity var(--t), background var(--t), color var(--t);
  flex-shrink: 0;
}
.notif-item:hover .notif-dismiss { opacity: 1; }
.notif-dismiss:hover { background: var(--bg); color: var(--text); }

/* ── Attention block (dashboard) ──────────────────────── */
.attn-block {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  overflow: hidden;
}
.attn-block-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; font-size: 14.5px; font-weight: 700;
  color: #78350f; border-bottom: 1px solid rgba(252,211,77,.5);
}
.attn-block-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: #dc2626; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.attn-items { padding: 6px 0 8px; }
.attn-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; font-size: 14px; color: #78350f;
  text-decoration: none; cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
  font-family: inherit;
  transition: background var(--t);
}
.attn-item:hover { background: rgba(0,0,0,.04); }
.attn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.attn-label { flex: 1; font-weight: 500; }
.attn-arrow { flex-shrink: 0; opacity: .5; }

/* ── Reminder items (ticket sidebar) ─────────────────── */
.rem-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.rem-item:last-child { border-bottom: none; }
.rem-item-info { flex: 1; min-width: 0; }
.rem-item-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rem-item-time  { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.rem-dismiss-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: 4px;
  flex-shrink: 0; opacity: 0; transition: opacity var(--t), background var(--t);
}
.rem-item:hover .rem-dismiss-btn { opacity: 1; }
.rem-dismiss-btn:hover { background: #fee2e2; color: #dc2626; }

/* ── Mobile sidebar overlay ───────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5);
}
.mob-menu-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-2); padding: 5px; margin-right: 4px;
  border-radius: var(--radius-sm); flex-shrink: 0;
  transition: background var(--t);
}
.mob-menu-btn:hover { background: var(--bg); color: var(--text); }

/* ── Tablet ≤900px ────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-row   { grid-template-columns: 1fr 1fr; }
  .stats-row.stats-row-5 { grid-template-columns: 1fr 1fr; }
  .ticket-grid { grid-template-columns: 1fr; }
  .form-row    { grid-template-columns: 1fr; }
  .page        { padding: 20px 18px; }
  .tbl-wrap    { overflow-x: auto; }
}

/* ── Mobile ≤680px ────────────────────────────────────── */
@media (max-width: 680px) {
  .mob-menu-btn { display: flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 400;
    transform: translateX(-100%);
    transition: transform .22s var(--ease);
    height: 100dvh;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  body { display: block; }
  .app-shell { min-height: 100dvh; display: flex; flex-direction: column; margin-left: 0; }
  .topbar { padding: 0 14px; gap: 6px; }
  .topbar-title { font-size: 15px; }
  .topbar-page-actions { max-width: 38vw; }
  .page { padding: 16px 14px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .stats-row.stats-row-5 { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 16px; }
  .stat-n { font-size: 28px; }
  .stat-icon { width: 30px; height: 30px; margin-bottom: 12px; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hide-mobile { display: none; }
  thead th, tbody td { padding: 10px 11px; }
  .filter-bar { gap: 6px; }
  .search-box { max-width: none; width: 100%; }
  .ticket-grid { grid-template-columns: 1fr; gap: 14px; }
  .t-title { font-size: 19px; }
  .form-row { grid-template-columns: 1fr; }
  .board-outer { margin: -16px -14px 0; padding: 16px 14px 0; height: calc(100dvh - var(--topbar-h) - 1px); }
  .bv-header { flex-wrap: wrap; gap: 8px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
  .modal-two-col { flex-direction: column; gap: 16px; }
  .modal-side { width: 100%; }
  .cf-foot { flex-wrap: wrap; gap: 6px; }
  .section-head { flex-wrap: wrap; gap: 6px; }
}

  .notif-panel { width: calc(100vw - 24px); right: 12px; }

/* ── Very small ≤380px ────────────────────────────────── */
@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr; }
  .stats-row.stats-row-5 { grid-template-columns: 1fr; }
}

/* ── Timer widget ────────────────────────────────────── */
/* Business switcher — lives in the dark left sidebar, above the user footer */
.biz-switcher {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.45); flex-shrink: 0;
}
.biz-selector {
  flex: 1; min-width: 0; height: 30px; padding: 0 8px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.85);
  font-family: inherit; cursor: pointer; outline: none;
  transition: border-color var(--t), background var(--t);
}
.biz-selector:hover, .biz-selector:focus { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); }
.biz-selector option { background: #1f2028; color: #eee; }
.timer-topbar-btn {
  display: flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500; color: var(--text-2);
  cursor: pointer; transition: all var(--t);
  white-space: nowrap;
}
.timer-topbar-btn:hover { border-color: var(--primary); color: var(--primary); }
.timer-btn-running {
  background: #dcfce7; border-color: #86efac; color: #15803d;
}
.timer-btn-running:hover { border-color: #15803d; color: #15803d; }
.timer-btn-break {
  background: #fef3c7; border-color: #fcd34d; color: #b45309;
}
.timer-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a;
  animation: timerPulse 1.5s ease infinite;
  flex-shrink: 0;
}
@keyframes timerPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.7); }
}

/* Timer panel */
.timer-panel {
  position: fixed; top: var(--topbar-h); right: -340px;
  width: 320px; z-index: 450;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: right .22s var(--ease);
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - 20px);
  overflow-y: auto;
}
.timer-panel.open { right: 16px; }
.timer-panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.timer-panel-title { font-weight: 700; font-size: 14px; flex: 1; }
.timer-clock-wrap {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 14px;
}
.timer-clock {
  font-size: 36px; font-weight: 800; letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text); transition: color .3s;
}
.timer-clock-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.timer-ctx-display {
  padding: 0 16px 12px;
  text-align: center;
}
.timer-ctx-primary  { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.timer-ctx-secondary { font-size: 12.5px; color: var(--text-2); }
.timer-section-label {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3);
  margin-bottom: 6px;
}
#timer-start-form { padding: 0 16px 14px; }
.timer-type-pills  { display: flex; flex-wrap: wrap; gap: 5px; }
.timer-type-pill {
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: all var(--t);
}
.timer-type-pill:hover { border-color: var(--primary); color: var(--primary); }
.timer-type-pill.active {
  background: var(--pill-bg, #eef2ff);
  border-color: var(--pill-color, #4f46e5);
  color: var(--pill-color, #4f46e5);
  font-weight: 600;
}
#timer-stop-wrap { padding: 0 16px 14px; }
.timer-stop-btn {
  background: #fee2e2; border: 1px solid #fca5a5; color: #dc2626;
  font-weight: 600;
}
.timer-stop-btn:hover { background: #fecaca; }
.timer-break-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
}
.timer-break-btn {
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
  cursor: pointer; transition: all var(--t);
}
.timer-break-btn:hover { border-color: #d97706; color: #b45309; background: #fef3c7; }

/* ── Timers page ─────────────────────────────────────── */
.tm-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}
.tm-team-loading {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-3); font-size: 13.5px;
  padding: 20px 0;
  grid-column: 1/-1;
}
.tm-member-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.tm-member-working { border-left: 3px solid #16a34a; }
.tm-member-break   { border-left: 3px solid #d97706; }
.tm-member-idle    { opacity: .7; }
.tm-member-info    { flex: 1; min-width: 0; }
.tm-member-name    { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.tm-member-status  { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.tm-member-ctx     { font-size: 12.5px; color: var(--text-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-status-working { color: #15803d; }
.tm-status-break   { color: #b45309; }
.tm-status-idle    { color: var(--text-3); }
.tm-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a; flex-shrink: 0;
  animation: timerPulse 1.5s ease infinite;
}

/* Week bar */
.tm-week-bar {
  display: flex; align-items: flex-end; gap: 6px;
  height: 64px; padding: 0 0 0 0; margin-bottom: 16px;
}
.tm-week-col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 3px;
}
.tm-week-bar-wrap {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--border); border-radius: 4px 4px 0 0; min-height: 4px;
  overflow: hidden;
}
.tm-week-bar-fill {
  width: 100%; background: #4f46e5; border-radius: 4px 4px 0 0;
  min-height: 4px; transition: height .4s var(--ease);
}
.tm-week-col.today .tm-week-bar-fill { background: #16a34a; }
.tm-week-day { font-size: 11px; color: var(--text-3); }
.tm-week-col.today .tm-week-day { color: var(--primary); font-weight: 600; }
.tm-week-hrs { font-size: 10px; color: var(--text-3); }

/* Time log entries */
.tm-log { display: flex; flex-direction: column; gap: 4px; }
.tm-log-empty { color: var(--text-3); font-size: 13.5px; padding: 24px 0; text-align: center; }
.tm-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--t);
}
.tm-entry:hover { background: var(--surface-2); }
.tm-entry:hover .tm-delete { opacity: 1; }
.tm-entry.tm-running { border-left: 3px solid #16a34a; }
.tm-break.tm-running { border-left: 3px solid #d97706; }
.tm-entry-time {
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; min-width: 105px;
}
.tm-entry-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-type-badge {
  display: inline-block;
  font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  white-space: nowrap;
}
.tm-entry-ctx { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-ctx-link  { color: var(--primary); text-decoration: none; }
.tm-ctx-link:hover { text-decoration: underline; }
.tm-break-label { font-size: 13px; color: #b45309; }
.tm-entry-dur { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-delete {
  flex-shrink: 0; opacity: 0; transition: opacity var(--t);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; border-radius: var(--radius-sm);
  color: var(--text-3);
}
.tm-delete:hover { background: #fee2e2; color: #dc2626; }

@media (max-width: 680px) {
  .timer-panel { right: -100vw; width: calc(100vw - 20px); }
  .timer-panel.open { right: 10px; }
  .timer-topbar-btn span { display: none; }
  .timer-topbar-btn { padding: 0 10px; }
  .tm-team-grid { grid-template-columns: 1fr; }
}

/* ── Projects ────────────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.proj-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
}
.proj-card:hover { box-shadow: var(--shadow-md); border-color: #c7c5c0; transform: translateY(-1px); }
.proj-card-head { display: flex; align-items: center; justify-content: space-between; }
.proj-card-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-card-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.proj-card-client {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2);
}
.proj-progress { display: flex; align-items: center; gap: 8px; }
.proj-progress-bar {
  flex: 1; height: 6px;
  background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.proj-progress-fill { height: 100%; border-radius: 99px; transition: width .4s var(--ease); }
.proj-progress-label { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.proj-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.proj-due { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.proj-due-overdue { color: #dc2626; }

/* Project detail – editable name */
.proj-name-editable {
  font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.4px;
  line-height: 1.2; outline: none;
  border-radius: var(--radius-sm);
  padding: 2px 4px; margin: -2px -4px;
  transition: background var(--t), box-shadow var(--t);
}
[contenteditable].proj-name-editable:hover { background: var(--bg); }
[contenteditable].proj-name-editable:focus { background: var(--bg); box-shadow: 0 0 0 3px var(--primary-ring); }

/* ── Reminders page ──────────────────────────────────── */
.rem-section { margin-bottom: 24px; }
.rem-section-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 10px;
}
.rem-list { display: flex; flex-direction: column; gap: 6px; }
.rem-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  box-shadow: var(--shadow-xs);
  transition: background var(--t);
}
.rem-card:hover { background: var(--surface-2); }
.rem-card:hover .rem-card-actions { opacity: 1; }
.rem-card-overdue { border-left: 3px solid #dc2626; }
.rem-card-dismissed { opacity: .6; }
.rem-card-body { flex: 1; min-width: 0; }
.rem-card-top {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px;
}
.rem-card-title { font-size: 14px; font-weight: 500; color: var(--text); }
.rem-card-time { font-size: 12.5px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
.rem-card-note { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.rem-ticket-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--primary); text-decoration: none; margin-top: 5px;
}
.rem-ticket-link:hover { text-decoration: underline; }
.rem-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px;
  white-space: nowrap;
}
.rem-badge-overdue  { background: #fee2e2; color: #dc2626; }
.rem-badge-soon     { background: #fef3c7; color: #b45309; }
.rem-badge-tomorrow { background: #dbeafe; color: #1d4ed8; }
.rem-card-actions {
  display: flex; gap: 2px; flex-shrink: 0;
  opacity: 0; transition: opacity var(--t);
}
.rem-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: background var(--t), color var(--t);
}
.rem-action-btn:hover { background: var(--surface-2); color: var(--text); }
.rem-action-btn.rem-delete:hover { background: #fee2e2; color: #dc2626; }
.rem-action-btn.rem-dismiss:hover { background: #dcfce7; color: #16a34a; }
.rem-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 64px 24px; text-align: center; color: var(--text-3);
}
.rem-empty h3 { font-size: 16px; color: var(--text-2); }
.rem-empty p  { font-size: 13.5px; max-width: 320px; }
.rem-dismissed-wrap { margin-top: 24px; }
.rem-dismissed-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-3); cursor: pointer;
  list-style: none; padding: 4px 0;
  user-select: none;
}
.rem-dismissed-toggle::-webkit-details-marker { display: none; }
.rem-dismissed-toggle svg { transition: transform var(--t); }
details[open] .rem-dismissed-toggle svg { transform: rotate(180deg); }

/* ── Client channel ──────────────────────────────────── */
.ch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.ch-header-left { display: flex; align-items: center; gap: 14px; }
.av-lg {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ch-client-name { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ch-client-company { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.ch-header-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 6px;
}
.ch-stat { font-size: 13px; color: var(--text-2); }
.ch-email { color: var(--primary); text-decoration: none; }
.ch-email:hover { text-decoration: underline; }

.ch-sales-snap {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 10px 16px; margin: 0 0 18px; text-decoration: none; color: var(--text-2);
  transition: border-color var(--t), box-shadow var(--t);
}
.ch-sales-snap:hover { border-color: #c7c7f5; box-shadow: var(--shadow-sm); }
.ch-snap-health { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ch-snap-stage { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.ch-snap-item { font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ch-snap-value { font-weight: 600; color: #16a34a; }
.ch-snap-more { font-size: 12px; color: var(--primary); margin-left: auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }

.ch-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}

/* Compose */
.ch-compose {
  margin-bottom: 10px;
  padding: 0;
  overflow: hidden;
}
.ch-compose-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.ch-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t), border-color var(--t);
}
.ch-tab:hover { color: var(--text-2); }
.ch-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ch-form-body { padding: 12px 14px 12px; }
.ch-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  resize: vertical;
  transition: border-color var(--t), box-shadow var(--t);
  line-height: 1.5;
}
.ch-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  background: var(--surface);
}
.ch-form-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ch-task-row { display: flex; gap: 8px; align-items: center; }
.ch-task-sel { flex: 1; }

/* Filter tabs */
.ch-filter-bar {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.ch-filter {
  padding: 5px 12px;
  background: none; border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer;
  font-size: 12.5px; color: var(--text-2);
  transition: all var(--t);
}
.ch-filter:hover { border-color: var(--primary); color: var(--primary); }
.ch-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Feed */
.ch-feed { display: flex; flex-direction: column; gap: 2px; }
.ch-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 24px;
  color: var(--text-3); text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.ch-empty p { font-size: 13.5px; }

/* Feed items */
.ch-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: background var(--t);
}
.ch-item:hover { background: var(--surface-2); }
.ch-item:hover .ch-item-actions { opacity: 1; }
.ch-item-av { flex-shrink: 0; margin-top: 2px; }
.ch-item-body { flex: 1; min-width: 0; }
.ch-item-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-bottom: 4px;
}
.ch-item-author { font-size: 13px; font-weight: 600; color: var(--text); }
.ch-item-time { font-size: 12px; color: var(--text-3); }
.ch-item-text { font-size: 14px; color: var(--text-2); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.ch-pin-badge {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: #b45309; background: #fef3c7;
  padding: 2px 7px; border-radius: 99px;
}
.ch-item-actions { flex-shrink: 0; opacity: 0; transition: opacity var(--t); }
.ch-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: background var(--t), color var(--t);
}
.ch-action-btn:hover { background: #fee2e2; color: #dc2626; }

/* Task items */
.ch-task-item { align-items: flex-start; }
.ch-check {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-top: 3px;
  transition: background var(--t), border-color var(--t);
}
.ch-check:hover { border-color: var(--primary); }
.ch-check.checked { background: #16a34a; border-color: #16a34a; color: #fff; }
/* pre-wrap keeps the newlines and indentation the author typed, while still
   wrapping long lines — tasks are free-text notes, not single-line labels. */
.ch-task-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-task-done .ch-task-title { text-decoration: line-through; color: var(--text-3); }
.ch-task-done { opacity: .65; }
.ch-task-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 3px;
}
.ch-assignee {
  display: flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--text-2);
}
.av-xs {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ch-due {
  font-size: 12px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 99px;
}
.ch-due-overdue { color: #dc2626; background: #fee2e2; border-color: #fca5a5; }

/* Ticket list in sidebar */
.ch-ticket-list { display: flex; flex-direction: column; }
.ch-ticket-item {
  display: block;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--t);
}
.ch-ticket-item:hover { background: var(--surface-2); }
.ch-ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.ch-ticket-title { font-size: 13px; font-weight: 500; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-ticket-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; }

@media (max-width: 900px) {
  .ch-grid { grid-template-columns: 1fr; }
  .ch-sidebar { order: -1; }
}
@media (max-width: 600px) {
  .ch-header { flex-direction: column; }
  .ch-task-row { flex-wrap: wrap; }
}

/* ── Working-on page ─────────────────────────────────── */
.wo-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.wo-title   { font-size: 18px; font-weight: 600; }
.wo-loading {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-3); font-size: 13.5px; padding: 40px 0;
}
.wo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.wo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t);
}
.wo-card-working {
  border-left: 3px solid #22c55e;
}
.wo-card-break {
  border-left: 3px solid #f59e0b;
}
.wo-card-idle {
  opacity: .65;
}
.wo-card-top {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.wo-av {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
}
.wo-card-working .wo-av { background: #dcfce7; color: #16a34a; }
.wo-card-break  .wo-av  { background: #fef3c7; color: #d97706; }
.wo-card-idle   .wo-av  { background: var(--surface-2); color: var(--text-3); }
.wo-name  { font-weight: 600; font-size: 14.5px; }
.wo-role  { text-transform: capitalize; }
.wo-card-body { display: flex; flex-direction: column; gap: 6px; }
.wo-state-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: #16a34a;
}
.wo-state-break { color: #d97706; }
.wo-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
  animation: timerPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
.wo-elapsed {
  font-size: 28px; font-weight: 700; letter-spacing: -.5px;
  color: var(--text); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.wo-elapsed-break { color: #d97706; }
.wo-type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  width: fit-content;
}
.wo-ctx {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: 13px; margin-top: 2px;
}
.wo-ctx-link {
  color: var(--primary); text-decoration: none; font-weight: 500;
}
.wo-ctx-link:hover { text-decoration: underline; }
.wo-sep { color: var(--border); margin: 0 1px; }
.wo-desc { color: var(--text-3); font-size: 12.5px; }
.wo-break-type { font-size: 13.5px; color: var(--text-2); }
.wo-idle-msg   { font-size: 13px; color: var(--text-3); }

@media (max-width: 600px) {
  .wo-grid { grid-template-columns: 1fr; }
}

/* ── Client level progress track ─────────────────────── */
.cl-track-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.cl-inactive-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-3);
  margin-bottom: 14px;
}
.cl-track {
  display: flex; align-items: flex-start;
  min-width: 480px;
}
.cl-track-inactive { opacity: .4; pointer-events: none; }
.cl-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 7px; flex-shrink: 0;
}
.cl-connector {
  flex: 1; height: 2px; background: var(--border);
  margin-top: 17px; min-width: 18px;
  transition: background .3s;
}
.cl-connector-done { background: var(--primary); }
.cl-node {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  background: var(--surface);
  color: var(--text-3);
  transition: all .2s;
  flex-shrink: 0;
}
.cl-node-done {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.cl-node-active {
  color: #fff; border-width: 2px;
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.cl-node-future {
  background: var(--surface);
  color: var(--text-3);
}
.cl-step-label {
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap; color: var(--text-3);
  text-align: center;
}
.cl-step-done   .cl-step-label { color: var(--primary); }
.cl-step-active .cl-step-label { color: var(--text); font-weight: 600; }

@media (max-width: 680px) {
  .cl-track-card { padding: 14px 16px; }
}

/* ── Lucide icon defaults ─────────────────────────────── */
[data-lucide] { display: inline-flex; flex-shrink: 0; }
.nav-item [data-lucide], .nav-item svg { opacity: .55; transition: opacity var(--t); }
.nav-item:hover [data-lucide], .nav-item:hover svg,
.nav-item.active [data-lucide], .nav-item.active svg { opacity: 1; }

/* ── Form control refinements ─────────────────────────── */
.form-control {
  border-radius: var(--radius);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* ── Badge refinement ─────────────────────────────────── */
.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: .01em;
}

/* ── Card refinement ──────────────────────────────────── */
.card {
  border-radius: var(--radius-lg);
}
.card-head {
  padding: 14px 18px;
}
.card-body {
  padding: 18px;
}

/* ── Dropdown refinement ──────────────────────────────── */
.dd-menu { border-radius: var(--radius-lg); }
.dd-item { font-size: 13.5px; padding: 8px 14px; border-radius: 6px; margin: 2px 4px; }

/* ── Modal refinement ─────────────────────────────────── */
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-height: 90vh; overflow-y: auto;
  animation: slideUp .17s var(--ease);
}
.modal-title  { font-size: 16px; font-weight: 700; flex: 1; color: var(--text); letter-spacing: -.25px; }
.modal-close  {
  background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 3px; border-radius: var(--radius-sm);
  flex-shrink: 0; transition: background var(--t), color var(--t);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

/* ── Section head ─────────────────────────────────────── */
.section-title { font-size: 14px; letter-spacing: -.2px; }

/* ── List rows (replaces table rows) ─────────────────── */
.list-rows {
  display: flex;
  flex-direction: column;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px 13px 14px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background var(--t);
  position: relative;
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-2); }
.list-row:hover .lr-title { color: var(--primary); }

/* Priority left accent */
.lr-prio {
  width: 3px; height: 32px;
  border-radius: 99px;
  flex-shrink: 0;
  background: var(--border);
}
.lr-prio-low    { background: #86efac; }
.lr-prio-medium { background: #93c5fd; }
.lr-prio-high   { background: #fdba74; }
.lr-prio-urgent { background: #f87171; }

/* Main block */
.lr-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lr-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t);
}
.lr-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.lr-id      { font-size: 12px; color: var(--text-3); font-weight: 500; flex-shrink: 0; }
.lr-tag, .t-tag { font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.lr-dot     { width: 3px; height: 3px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.lr-client  { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-assignee { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* Right block */
.lr-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.lr-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* Status column */
.lr-status { flex-shrink: 0; }

/* Contact link in list rows */
.lr-contact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.lr-contact:hover { color: var(--primary); }

/* Open ticket count chip */
.cl-open-cnt {
  font-size: 11.5px;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* Quick-view trigger button on rows */
.cl-qv-trigger {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t), color var(--t);
  opacity: 0;
}
.list-row:hover .cl-qv-trigger { opacity: 1; }
.cl-qv-trigger:hover { background: var(--primary-bg); color: var(--primary); }

/* ── Pipeline summary bar ─────────────────────────────── */
.cl-pipe-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}
.cl-pipe-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}
.cl-pipe-stage:hover { background: var(--bg); color: var(--text); }
.cl-pipe-stage.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-ring);
}
.cl-pipe-stage.active .cl-pipe-count { color: var(--primary); }
.cl-pipe-stage-empty { opacity: .45; }
.cl-pipe-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cl-pipe-label { color: inherit; }
.cl-pipe-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 99px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
}
.cl-pipe-arrow {
  color: var(--border);
  flex-shrink: 0;
}
.cl-pipe-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
  flex-shrink: 0;
}

/* ── Client Quick-View Drawer ─────────────────────────── */
.cl-qv {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.cl-qv.open { pointer-events: auto; }

.cl-qv-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.3);
  opacity: 0;
  transition: opacity .22s var(--ease);
  backdrop-filter: blur(1px);
}
.cl-qv.open .cl-qv-backdrop { opacity: 1; }

.cl-qv-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .24s var(--ease);
  overflow: hidden;
}
.cl-qv.open .cl-qv-panel { transform: translateX(0); }

/* Head */
.cl-qv-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
  gap: 12px;
  flex-shrink: 0;
}
.cl-qv-identity { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.cl-qv-name { font-size: 15px; font-weight: 600; color: var(--text); }
.cl-qv-co   { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.cl-qv-close {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t);
}
.cl-qv-close:hover { background: var(--bg); }

/* Body */
.cl-qv-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.cl-qv-section { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.cl-qv-section:last-child { border-bottom: none; }
.cl-qv-sec-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 10px;
}

/* Contacts */
.cl-qv-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t);
  word-break: break-all;
}
.cl-qv-contact + .cl-qv-contact { margin-top: 2px; }
.cl-qv-contact:hover { background: var(--primary-bg); color: var(--primary); }
.cl-qv-contact svg { flex-shrink: 0; }

/* Stepper in drawer */
.cl-qv-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cl-qv-track-inactive { opacity: .4; }
.cl-qv-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 44px;
}
.cl-qv-step:hover .cl-qv-node-future { border-color: var(--primary); color: var(--primary); }
.cl-qv-node {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  background: var(--surface);
  position: relative;
  z-index: 1;
}
.cl-qv-node-done {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.cl-qv-node-active {
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,1), 0 0 0 5px currentColor;
}
.cl-qv-step-lbl {
  font-size: 10.5px;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
  line-height: 1.3;
}
.cl-qv-step-lbl-cur { font-weight: 600; }

/* Stats in drawer */
.cl-qv-stats {
  display: flex;
  gap: 16px;
}
.cl-qv-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cl-qv-stat-n {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.cl-qv-stat-l {
  font-size: 11.5px;
  color: var(--text-3);
}

/* Footer */
.cl-qv-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Connector alignment for smaller nodes in drawer */
.cl-qv-track .cl-connector { margin-top: 14px; min-width: 12px; }

@media (max-width: 600px) {
  .cl-qv-panel { width: 100%; }
  .cl-pipe-bar { gap: 3px; padding: 8px 10px; }
  .cl-pipe-stage { padding: 4px 8px; font-size: 12px; }
}

/* ── Tasks page ────────────────────────────────────────── */
.tk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.tk-tabs { display: flex; gap: 4px; }
.tk-tab {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.tk-tab:hover   { background: var(--bg); color: var(--text); }
.tk-tab.active  { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-ring); }

.tk-toolbar-right { display: flex; align-items: center; gap: 8px; }
.tk-type-pills  { display: flex; gap: 3px; }
.tk-pill {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.tk-pill:hover  { border-color: var(--primary); color: var(--primary); }
.tk-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Loading / empty */
.tk-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 40px;
  justify-content: center;
  color: var(--text-3);
  font-size: 13px;
}
.tk-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 13.5px;
  text-align: center;
}

/* Sections */
.tk-section { margin-bottom: 20px; }
.tk-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 2px;
}
.tk-section-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-3);
}
.tk-section-warn { color: #dc2626; }
.tk-section-count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 99px;
  padding: 1px 7px;
  font-weight: 600;
}
.tk-rows { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
.tk-rows .list-row:last-child { border-bottom: none; }

/* Row elements */
.tk-type-icon {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tk-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t), background var(--t);
  display: flex; align-items: center; justify-content: center;
}
.tk-check:hover { border-color: var(--primary); background: var(--primary-bg); }
.tk-task-badge {
  font-size: 11px;
  font-weight: 600;
  color: #6d28d9;
  background: #ede9fe;
  border-radius: 99px;
  padding: 2px 8px;
}
.tk-note-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-note-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg);
  border-radius: 99px;
  padding: 1px 6px;
  font-weight: 600;
}
.tk-due {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.tk-due-over {
  color: #dc2626;
  font-weight: 600;
}
.tk-expand-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--t), color var(--t);
  opacity: 0;
}
.list-row:hover .tk-expand-btn { opacity: 1; }
.tk-expand-btn:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-ring); }

/* Expandable panel */
.tk-panel {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  border-left: 3px solid var(--primary);
}
.tk-panel-loading { display: flex; justify-content: center; padding: 20px; }
.tk-panel-inner   { padding: 16px 18px 14px 20px; display: flex; flex-direction: column; gap: 12px; }

/* Notes thread */
.tk-notes-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}
.tk-no-notes { font-size: 13px; color: var(--text-3); font-style: italic; }
.tk-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tk-note-help .av { font-size: 14px; }
.tk-note-body { flex: 1; min-width: 0; }
.tk-note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 12px;
}
.tk-note-meta strong { font-weight: 600; color: var(--text); }
.tk-note-meta span   { color: var(--text-3); }
.tk-note-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* Note input row */
.tk-note-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tk-note-input-wrap { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.tk-note-textarea {
  width: 100%;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--t);
  min-height: 58px;
}
.tk-note-textarea:focus { outline: none; border-color: var(--primary); }
.tk-note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tk-note-actions .btn.active { background: var(--primary-bg); color: var(--primary); }

/* Help panel */
.tk-help-panel {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.tk-help-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 10px;
}
.tk-help-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tk-help-sel { flex: 0 0 160px; font-size: 13px; }
.tk-help-msg { flex: 1; min-width: 160px; font-size: 13px; }

/* ── Done / completed item styles ─────────────────────── */
.tk-row-done { opacity: .65; }
.tk-row-done:hover { opacity: 1; }
.tk-title-done {
  text-decoration: line-through;
  color: var(--text-3) !important;
}
.tk-rows-done { border-color: var(--border-soft); }
.tk-rows-done .list-row { background: var(--surface-2); }

.tk-check-done {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.tk-check-done:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.tk-type-done {
  background: #dcfce7;
  color: #16a34a;
}

.tk-section-done {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #16a34a;
}

.tk-done-toggle { gap: 5px; }
.tk-done-toggle.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-ring);
}

/* ── Whiteboards list ──────────────────────────────────── */
.wb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.wb-empty {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 80px 20px;
  color: var(--text-3); font-size: 14px;
}
.wb-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  position: relative;
}
.wb-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); }
.wb-card-preview {
  height: 110px;
  background: linear-gradient(135deg, #eef1ff 0%, #f0fdf4 100%);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); opacity: .5;
}
.wb-card-body { padding: 12px 14px; flex: 1; }
.wb-card-name { font-weight: 600; font-size: 14px; color: var(--text); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.wb-card-lock { color: var(--text-3); flex-shrink: 0; }
.wb-card-viewonly { font-size: 10px; font-weight: 700; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 1px 7px; flex-shrink: 0; }
.wb-vis-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.wb-vis-opt input { margin: 0; }
.wb-card-link {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: var(--text-3); margin-bottom: 6px;
}
.wb-card-meta {
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: var(--text-3);
}
.wb-card-del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.9);
  border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--t), color var(--t);
}
.wb-card:hover .wb-card-del { opacity: 1; }
.wb-card-del:hover { color: #dc2626; }

/* ── Whiteboard canvas page ────────────────────────────────────────
   A dark theme scoped entirely to this page — these redefine the SAME
   custom properties every .wbd-* rule below already references, so the
   whole shell (topbar, tool rail, modals, search bar...) picks up the
   dark palette automatically without needing separate dark-specific rules.
   This doesn't touch the sidebar (a CSS sibling, not a descendant) or any
   other page — the rest of the app stays light. Modeled on the reference
   YouTrack-whiteboard look: dark navy canvas, flat-color cards. */
.wbd-shell {
  --surface:      #21242c;
  --surface-2:    #2a2e38;
  --bg:           #1a1d24;
  --border:       #363b48;
  --border-soft:  #2c303b;
  --text:         #e8e9ed;
  --text-2:       #b8bac2;
  --text-3:       #7d8190;
  --primary:      #5b8bff;
  --primary-h:    #4a76e8;
  --primary-bg:   rgba(91,139,255,.16);
  --primary-ring: rgba(91,139,255,.25);
  --shadow-xs:    0 1px 2px rgba(0,0,0,.3);
  --shadow-sm:    0 2px 8px rgba(0,0,0,.35);
  --shadow-md:    0 8px 24px rgba(0,0,0,.4);
  --shadow-lg:    0 24px 60px rgba(0,0,0,.5);

  position: fixed;
  inset: 0;
  left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  z-index: 50;
}
.wbd-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
  z-index: 10;
}
.wbd-back {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2); text-decoration: none;
  border: 1px solid var(--border);
  transition: background var(--t), color var(--t);
  flex-shrink: 0;
}
.wbd-back:hover { background: var(--bg); color: var(--primary); }
.wbd-title {
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text);
  min-width: 120px;
  max-width: 260px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: background var(--t);
}
.wbd-title:hover, .wbd-title:focus { background: var(--bg); }
.wbd-link-row { display: flex; align-items: center; gap: 6px; }
.wbd-sel {
  font-size: 12.5px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}
.wbd-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wbd-save-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-3);
}
.wbd-readonly-tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 3px 10px;
}
.wbd-share-row { display: flex; align-items: center; gap: 9px; }
.wbd-import-row:hover { background: var(--surface-2); }
.wbd-icon-btn { padding: 6px 8px; }

.wbd-search-bar {
  position: fixed; top: calc(var(--topbar-h, 54px) + 10px); left: 50%; transform: translateX(-50%);
  z-index: 350; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 8px 10px; color: var(--text-3);
}
.wbd-search-bar input { border: none; outline: none; font-size: 13px; width: 220px; font-family: inherit; color: var(--text); background: none; }
.wbd-search-count { font-size: 11.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.wbd-search-bar button { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 3px; border-radius: 6px; display: flex; }
.wbd-search-bar button:hover { background: var(--surface-2); color: var(--text); }

.wbd-layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wbd-layout-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; background: var(--surface-2); transition: border-color var(--t), background var(--t);
}
.wbd-layout-card:hover { border-color: var(--primary); background: var(--primary-bg); }
.wbd-layout-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.wbd-layout-card-desc { font-size: 11.5px; color: var(--text-3); text-align: center; }

.wbd-version-row { display: flex; align-items: center; gap: 9px; padding: 8px 4px; border-bottom: 1px solid var(--border-soft); }
.wbd-version-row:last-child { border-bottom: none; }
.wbd-version-main { flex: 1; min-width: 0; }
.wbd-version-label { font-size: 13px; font-weight: 600; color: var(--text); }
.wbd-version-meta { font-size: 11.5px; color: var(--text-3); }
.wbd-share-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wbd-share-remove { background: none; border: none; cursor: pointer; color: var(--text-3); padding: 4px; border-radius: 6px; display: flex; }
.wbd-share-remove:hover { background: var(--surface-2); color: #dc2626; }

/* Body row */
.wbd-body { display: flex; flex: 1; position: relative; overflow: hidden; }

/* Tools panel */
.wbd-tools {
  width: 52px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 2px;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 5;
}
.wbd-tools::-webkit-scrollbar { display: none; }
.wbd-tool-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wbd-tool-sep { width: 28px; height: 1px; background: var(--border-soft); margin: 6px 0; }
.wbd-tool {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.wbd-tool:hover  { background: var(--bg); color: var(--text); }
.wbd-tool.active { background: var(--primary-bg); color: var(--primary); }

/* Color swatches */
.wbd-colors {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 4px 0;
}
.wbd-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform var(--t), border-color var(--t);
}
.wbd-swatch:hover   { transform: scale(1.15); }
.wbd-swatch.active  { border-color: var(--primary); transform: scale(1.1); }

/* Width buttons */
.wbd-width-group { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0; }
.wbd-w-btn {
  width: 36px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background var(--t), border-color var(--t);
}
.wbd-w-btn:hover  { border-color: var(--primary); }
.wbd-w-btn.active { background: var(--primary-bg); border-color: var(--primary); }
.wbd-w-btn span   { display: block; width: 20px; background: currentColor; border-radius: 2px; }

/* Canvas wrap */
.wbd-canvas-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#wbd-canvas { display: block; touch-action: none; }
.wbd-text-input {
  position: fixed;
  z-index: 20;
  border: 1.5px dashed var(--primary);
  border-radius: 4px;
  background: rgba(33,36,44,.92);
  color: var(--text);
  padding: 4px 6px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 500;
  outline: none;
  resize: none;
  min-height: 28px;
  min-width: 120px;
  max-width: 400px;
  line-height: 1.4;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(91,139,255,.2);
}

/* Zoom controls */
.wbd-zoom {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 6px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
  pointer-events: auto;
}
.wbd-zoom button {
  width: 26px; height: 26px;
  border: none; background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.wbd-zoom button:hover { background: var(--bg); color: var(--primary); }
#wbd-zoom-label { font-size: 12px; font-weight: 600; color: var(--text-3); min-width: 40px; text-align: center; }

@media (max-width: 700px) {
  .wbd-shell { left: 0; }
}

/* ── Work Footer Bar ─────────────────────────────────────────────────── */
.wf-bar {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 40;
  background: #111318;
  border-top: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 -2px 16px rgba(0,0,0,.35);
  min-height: 46px;
  display: flex;
  align-items: stretch;
}

/* Offset page content so footer doesn't overlap */
body:has(#wf-bar:not([style*="display:none"])) .page {
  padding-bottom: calc(46px + 8px) !important;
}

/* Hide footer when whiteboard canvas is open (covers viewport) */
body:has(.wbd-shell) .wf-bar { display: none !important; }

/* ── Working state ── */
.wf-main {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  width: 100%;
  min-height: 46px;
}
.wf-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.wf-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: wf-pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes wf-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  60%  { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.wf-time {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  min-width: 58px;
}
.wf-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.wf-ctx {
  flex: 1;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-acts {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wf-act {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.65);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  white-space: nowrap;
}
.wf-act:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-color: rgba(255,255,255,.22);
}
.wf-act-resolve {
  border-color: rgba(34,197,94,.3);
  color: #4ade80;
}
.wf-act-resolve:hover {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.5);
  color: #86efac;
}
.wf-act-stop {
  border-color: rgba(239,68,68,.3);
  color: #f87171;
}
.wf-act-stop:hover {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.5);
  color: #fca5a5;
}

/* ── Note panel ── */
.wf-note-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  width: 100%;
  min-height: 46px;
}
.wf-note-inp-wrap {
  flex: 1;
}
.wf-note-inp {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
  transition: border-color var(--t);
}
.wf-note-inp::placeholder { color: rgba(255,255,255,.3); }
.wf-note-inp:focus { border-color: var(--primary); }
.wf-note-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wf-close-btn {
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), color var(--t);
}
.wf-close-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Break picker panel ── */
.wf-break-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  width: 100%;
  min-height: 46px;
}
.wf-break-q {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  flex-shrink: 0;
}
.wf-break-opts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wf-break-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  white-space: nowrap;
}
.wf-break-opt:hover {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.25);
  color: #fff;
}

/* ── On-break state ── */
.wf-on-break {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  width: 100%;
  min-height: 46px;
}
.wf-break-ico {
  font-size: 15px;
  flex-shrink: 0;
}
.wf-break-lbl {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  flex-shrink: 0;
}
.wf-break-time {
  font-size: 13px;
  font-weight: 600;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  min-width: 58px;
  flex-shrink: 0;
}
.wf-resume-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(34,197,94,.15);
  border: 1px solid rgba(34,197,94,.3);
  color: #4ade80;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.wf-resume-btn:hover {
  background: rgba(34,197,94,.25);
  border-color: rgba(34,197,94,.5);
}

@media (max-width: 768px) {
  .wf-bar { left: 0; }
  .wf-ctx { display: none; }
  .wf-act span { display: none; }
  .wf-act { padding: 5px 8px; }
}

/* ── Watch / Notify button ───────────────────────────────── */
.watch-active {
  color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
  border-color: color-mix(in srgb, var(--primary) 25%, transparent) !important;
}


/* ══════════════════════════════════════════════════════════════════
   ISSUES MODULE
   ══════════════════════════════════════════════════════════════════ */

/* ── Toolbar ──────────────────────────────────────────────────── */
.iss-toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; flex-wrap: wrap;
}
.iss-views {
  display: flex; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 3px; gap: 2px;
  flex-shrink: 0;
}
.iss-view-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: background var(--t), color var(--t);
}
.iss-view-btn.active { background: var(--primary); color: #fff; }
.iss-view-btn:not(.active):hover { background: var(--bg); color: var(--text); }

.iss-search-wrap {
  position: relative; flex: 1; min-width: 180px; max-width: 340px;
}
.iss-search-ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.iss-search {
  width: 100%; padding: 7px 32px 7px 30px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13.5px; color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}
.iss-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.iss-search-hint {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11px; padding: 1px 5px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-3); pointer-events: none;
}

.iss-filters { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.iss-filter-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: border-color var(--t), background var(--t), color var(--t);
  user-select: none; white-space: nowrap;
}
.iss-filter-chip:hover, .iss-filter-chip.active {
  border-color: var(--primary); color: var(--primary); background: var(--primary-bg);
}

.iss-toolbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* ── Active filter tags ──────────────────────────────────────── */
.iss-active-filters {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.iss-filter-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  background: var(--primary-bg); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  font-size: 12px; color: var(--primary); font-weight: 500;
}
.iss-filter-tag-rm {
  border: none; background: none; cursor: pointer; color: var(--primary);
  font-size: 14px; line-height: 1; padding: 0 1px;
}
.iss-clear-all-btn {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  font-size: 12px; text-decoration: underline; padding: 0;
}

/* ── Saved views bar ─────────────────────────────────────────── */
.iss-saved-views {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.iss-saved-label { font-size: 12px; color: var(--text-3); }
.iss-saved-view-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; cursor: pointer; color: var(--text-2);
  transition: border-color var(--t), color var(--t);
}
.iss-saved-view-btn:hover { border-color: var(--primary); color: var(--primary); }
.iss-saved-del { color: var(--text-3); margin-left: 3px; font-size: 14px; }

/* ── Bulk actions bar ────────────────────────────────────────── */
.iss-bulk-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 10px;
  background: var(--primary); border-radius: var(--radius);
  box-shadow: var(--shadow-md); flex-wrap: wrap;
}
.iss-bulk-count { font-size: 13px; font-weight: 600; color: #fff; margin-right: 4px; }
.iss-bulk-bar .btn { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.2); }
.iss-bulk-bar .btn:hover { background: rgba(255,255,255,.25); }
.iss-bulk-bar .btn.danger { background: rgba(239,68,68,.3); }
.iss-bulk-bar .btn.danger:hover { background: rgba(239,68,68,.5); }

/* ── List view ───────────────────────────────────────────────── */
.iss-list-head {
  display: grid;
  grid-template-columns: 28px 8px 44px 18px 1fr 130px 90px 90px 80px;
  align-items: center; gap: 8px;
  padding: 6px 14px; font-size: 11.5px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.iss-list-row {
  display: grid;
  grid-template-columns: 28px 8px 44px 18px 1fr 130px 90px 90px 80px;
  align-items: center; gap: 8px;
  padding: 10px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-top: none;
  transition: background var(--t);
}
.iss-list-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.iss-list-row:hover { background: var(--surface-2); }

.iss-prio-bar { width: 4px; height: 28px; border-radius: 3px; flex-shrink: 0; }
.iss-prio-bar-critical { background: #dc2626; }
.iss-prio-bar-high     { background: #ea580c; }
.iss-prio-bar-medium   { background: #2563eb; }
.iss-prio-bar-low      { background: #16a34a; }

.iss-chk, .iss-chk-all { display: flex; align-items: center; cursor: pointer; }
.iss-chk input, .iss-chk-all input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

.iss-type-ico { display: flex; align-items: center; flex-shrink: 0; }
.iss-col-id { font-size: 12px; color: var(--text-3); font-weight: 500; white-space: nowrap; }

.iss-col-main { min-width: 0; }
.iss-title {
  font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.iss-row-meta {
  display: flex; align-items: center; gap: 5px; margin-top: 3px; flex-wrap: wrap;
}
.iss-project-tag {
  font-size: 11px; font-weight: 500; color: var(--primary);
  background: var(--primary-bg); padding: 1px 6px; border-radius: 4px;
  white-space: nowrap; text-decoration: none;
}
.iss-meta-stat {
  display: flex; align-items: center; gap: 2px; font-size: 11.5px; color: var(--text-3);
}
.iss-points-badge {
  font-size: 11px; font-weight: 700; color: #7c3aed; background: #ede9fe;
  padding: 1px 6px; border-radius: 4px;
}
.iss-due { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.iss-due-over { color: #dc2626 !important; font-weight: 600; }

.iss-col-status { display: flex; align-items: center; }
.iss-col-prio, .iss-col-assignee, .iss-col-time { display: flex; align-items: center; justify-content: flex-end; }

/* ── Status / priority badges ────────────────────────────────── */
.iss-status-pill {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.iss-prio-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.prio-critical, .iss-prio-badge-critical { color: #dc2626; background: #fee2e2; }
.prio-high,     .iss-prio-badge-high     { color: #ea580c; background: #ffedd5; }
.prio-medium,   .iss-prio-badge-medium   { color: #2563eb; background: #dbeafe; }
.prio-low,      .iss-prio-badge-low      { color: #16a34a; background: #dcfce7; }

/* ── Label chips ─────────────────────────────────────────────── */
.iss-label-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.iss-label-more { background: var(--bg); color: var(--text-3); }

/* ── Board view ──────────────────────────────────────────────── */
.iss-board {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px;
  align-items: flex-start; min-height: 400px;
}
.iss-board-col { flex-shrink: 0; width: 280px; display: flex; flex-direction: column; }
.iss-board-col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  font-size: 13px; font-weight: 600; user-select: none;
}
.iss-board-col-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.iss-board-col-name { flex: 1; }
.iss-board-col-cnt {
  font-size: 11.5px; font-weight: 700; color: var(--text-3);
  background: var(--bg); padding: 1px 6px; border-radius: 99px;
}
.iss-board-cards {
  background: var(--bg); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 80px; padding: 6px;
  display: flex; flex-direction: column; gap: 5px;
  transition: background var(--t), border-color var(--t);
}
.iss-board-cards.drag-over { background: var(--primary-bg); border-color: #a5b4fc; }
.iss-board-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.iss-board-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }
.iss-board-card.dragging { opacity: .4; }
.iss-board-card-type { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.iss-board-card-id { font-size: 11.5px; color: var(--text-3); flex: 1; }
.iss-board-card-prio-dot { width: 7px; height: 7px; border-radius: 50%; }
.iss-board-card-prio-dot.prio-critical { background: #dc2626; }
.iss-board-card-prio-dot.prio-high     { background: #ea580c; }
.iss-board-card-prio-dot.prio-medium   { background: #2563eb; }
.iss-board-card-prio-dot.prio-low      { background: #16a34a; }
.iss-board-card-title { font-size: 13.5px; font-weight: 500; color: var(--text); line-height: 1.4; margin-bottom: 7px; }
.iss-board-card-labels { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 7px; }
.iss-board-card-foot { display: flex; align-items: center; justify-content: space-between; }
.iss-board-card-foot-right { display: flex; align-items: center; gap: 5px; }
.av-xs {
  width: 20px; height: 20px; font-size: 9px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary); font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.iss-board-add-card {
  width: 100%; padding: 7px 10px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); background: none; cursor: pointer;
  font-size: 12.5px; color: var(--text-3); text-align: left;
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
  transition: border-color var(--t), color var(--t), background var(--t);
}
.iss-board-add-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }

/* ── Table view ──────────────────────────────────────────────── */
.iss-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.iss-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 13.5px; }
.iss-table th {
  padding: 9px 12px; text-align: left; font-size: 11.5px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.iss-table th[data-sort]:hover { color: var(--primary); }
.iss-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.iss-table-row { cursor: pointer; transition: background var(--t); }
.iss-table-row:hover { background: var(--surface-2); }
.iss-table-row:last-child td { border-bottom: none; }
.iss-table-title { text-decoration: none; }
.iss-table-title:hover { color: var(--primary); }

/* ── Dropdown panel ──────────────────────────────────────────── */
.iss-dd-overlay { position: fixed; inset: 0; z-index: 90; cursor: default; }
.iss-dd-panel {
  position: absolute; z-index: 100; min-width: 220px; max-width: 320px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; max-height: 380px; overflow-y: auto;
}
.iss-dd-head {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); padding: 5px 8px 8px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px;
}
.iss-dd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; cursor: pointer; color: var(--text);
  transition: background var(--t), color var(--t);
}
.iss-dd-item:hover { background: var(--primary-bg); color: var(--primary); }
.iss-dd-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.iss-dd-check {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: pointer; color: var(--text); transition: background var(--t);
}
.iss-dd-check:hover { background: var(--bg); }
.iss-dd-check input { accent-color: var(--primary); cursor: pointer; }
.iss-dd-empty { padding: 10px; font-size: 13px; color: var(--text-3); text-align: center; }
.iss-sort-panel {
  position: absolute; z-index: 100; width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 10px 12px; font-size: 13px;
}
.iss-sort-options { display: flex; flex-direction: column; gap: 2px; }
.iss-sort-options label, .iss-sort-panel > div > label {
  display: flex; align-items: center; gap: 8px; padding: 5px 4px; cursor: pointer;
}
.iss-sort-options label input { accent-color: var(--primary); }

/* ── Pagination ──────────────────────────────────────────────── */
.iss-pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 0; border-top: 1px solid var(--border);
  background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
  border: 1px solid var(--border); border-top: none;
}
.iss-pg-info { font-size: 13px; color: var(--text-2); }

/* ── Loading / Empty ─────────────────────────────────────────── */
.iss-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-3);
}
.iss-loading-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: iss-spin .8s linear infinite;
}
@keyframes iss-spin { to { transform: rotate(360deg); } }
.iss-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 80px 20px; gap: 12px; text-align: center; color: var(--text-3);
}
.iss-empty h3 { font-size: 18px; color: var(--text-2); margin: 0; }
.iss-empty p { font-size: 14px; margin: 0; }

/* ── New Issue modal ─────────────────────────────────────────── */
.ni-type-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ni-type-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all var(--t);
}
.ni-type-btn:hover { border-color: var(--tc, var(--primary)); color: var(--tc, var(--primary)); }
.ni-type-btn.active { background: var(--tc, var(--primary)); color: #fff; border-color: var(--tc, var(--primary)); }
.ni-title-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 16px; font-weight: 600;
  color: var(--text); outline: none; background: transparent; margin-bottom: 10px;
  transition: border-color var(--t), box-shadow var(--t);
}
.ni-title-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.ni-err { font-size: 12.5px; color: #dc2626; margin-bottom: 8px; }
.ni-desc {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: transparent; resize: vertical; outline: none; font-family: inherit;
  margin-bottom: 12px; transition: border-color var(--t);
}
.ni-desc:focus { border-color: var(--primary); }
.ni-fields-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.ni-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.ni-field select, .ni-field input[type=date], .ni-field input[type=number] {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text); background: var(--surface); outline: none;
}
.ni-labels-row { margin-bottom: 12px; }
.ni-labels-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.ni-labels { display: flex; gap: 5px; flex-wrap: wrap; }
.ni-label-opt { cursor: pointer; }
.ni-label-opt input { display: none; }
.ni-label-opt input:checked + .iss-label-chip { box-shadow: 0 0 0 2px currentColor; }
.ni-open-check {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
}

/* ── Issue detail ────────────────────────────────────────────── */
.iss-detail-wrap {
  display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start;
}
@media (max-width: 960px) { .iss-detail-wrap { grid-template-columns: 1fr; } }

.iss-detail-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.iss-detail-crumb {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3);
}
.iss-parent-link { font-size: 13px; color: var(--primary); text-decoration: none; }
.iss-parent-link:hover { text-decoration: underline; }
.iss-detail-type-name { font-size: 13px; font-weight: 600; }

.iss-detail-title {
  font-size: 22px; font-weight: 700; color: var(--text);
  line-height: 1.3; letter-spacing: -.3px; outline: none;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 3px 5px; margin: -3px -5px;
  transition: border-color var(--t), box-shadow var(--t); word-break: break-word;
}
.iss-detail-title:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }

.iss-detail-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.iss-desc-view {
  font-size: 14px; color: var(--text-2); line-height: 1.7;
  cursor: pointer; min-height: 32px;
  border-radius: var(--radius-sm); padding: 6px 8px; margin: -6px -8px;
  transition: background var(--t);
}
.iss-desc-view:hover { background: var(--bg); }
.iss-desc-empty { color: var(--text-3); font-style: italic; }
.iss-desc-textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  background: transparent; resize: vertical; outline: none; font-family: inherit;
  transition: border-color var(--t);
}
.iss-desc-textarea:focus { border-color: var(--primary); }
.iss-desc-actions { display: flex; gap: 6px; margin-top: 8px; }

.iss-subtask-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; text-decoration: none; color: var(--text);
  border-top: 1px solid var(--border-soft); transition: background var(--t);
}
.iss-subtask-row:first-child { border-top: none; }
.iss-subtask-row:hover { background: var(--surface-2); }
.iss-subtask-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.iss-subtask-title { flex: 1; font-size: 13.5px; }
.iss-subtask-status { font-size: 12px; font-weight: 500; }
.iss-inline-form { display: flex; gap: 6px; align-items: flex-start; }
.iss-inline-form input { flex: 1; }

.iss-relation-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-top: 1px solid var(--border-soft); font-size: 13.5px;
}
.iss-relation-row:first-child { border-top: none; }
.iss-rel-type {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3); white-space: nowrap; min-width: 80px;
}
.iss-rel-link {
  flex: 1; color: var(--primary); text-decoration: none; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.iss-rel-link:hover { text-decoration: underline; }
.iss-rel-rm {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  font-size: 16px; padding: 0 4px; line-height: 1; transition: color var(--t);
}
.iss-rel-rm:hover { color: #dc2626; }
.iss-rel-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 200px; overflow-y: auto;
}
.iss-rel-result {
  padding: 8px 12px; font-size: 13px; cursor: pointer; color: var(--text);
  transition: background var(--t);
}
.iss-rel-result:hover { background: var(--primary-bg); }

.iss-activity-tabs { display: flex; gap: 2px; }
.iss-act-tab {
  padding: 4px 10px; border-radius: var(--radius-sm); border: none;
  background: none; cursor: pointer; font-size: 13px; color: var(--text-2);
  font-weight: 500; transition: background var(--t), color var(--t);
}
.iss-act-tab.active, .iss-act-tab:hover { background: var(--bg); color: var(--text); }
.iss-act-tab.active { color: var(--primary); }

.iss-feed-comment {
  display: flex; gap: 11px; padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.iss-feed-comment:last-child { border-bottom: none; }
.iss-comment-body { flex: 1; min-width: 0; }
.iss-comment-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap;
}
.iss-comment-author { font-size: 13.5px; font-weight: 600; }
.iss-comment-time { font-size: 12.5px; }
.iss-comment-acts { display: none; margin-left: auto; }
.iss-feed-comment:hover .iss-comment-acts { display: flex; gap: 4px; }
.iss-comment-act {
  font-size: 12px; background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 2px 6px; border-radius: 4px;
  transition: background var(--t), color var(--t);
}
.iss-comment-act:hover { background: var(--bg); color: var(--text); }
.iss-comment-text { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.iss-cmt-edit-form { margin-top: 6px; }
.iss-cmt-edit-form textarea {
  width: 100%; resize: vertical; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px;
  font-size: 14px; font-family: inherit; outline: none; color: var(--text);
}
.iss-cmt-edit-form textarea:focus { border-color: var(--primary); }

.iss-feed-event {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; font-size: 13px; color: var(--text-3);
  border-bottom: 1px solid var(--border-soft);
}
.iss-feed-event:last-child { border-bottom: none; }
.iss-feed-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border);
  flex-shrink: 0; margin-left: 7px;
}
.iss-feed-actor { font-weight: 600; color: var(--text-2); }
.iss-feed-text strong { color: var(--text); }
.iss-feed-time { margin-left: auto; white-space: nowrap; }

.iss-comment-form {}
.iss-comment-compose { display: flex; gap: 11px; }
.iss-comment-input-wrap { flex: 1; min-width: 0; }
.iss-comment-textarea {
  width: 100%; resize: vertical; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 14px;
  font-family: inherit; outline: none; color: var(--text); background: transparent;
  min-height: 80px; transition: border-color var(--t), box-shadow var(--t);
}
.iss-comment-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.iss-comment-foot {
  display: flex; align-items: center; justify-content: space-between; margin-top: 8px;
}

/* ── Issue sidebar ───────────────────────────────────────────── */
.iss-detail-sidebar { display: flex; flex-direction: column; gap: 12px; }
.iss-meta-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.iss-meta-card-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.iss-meta-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--border-soft); min-height: 34px;
}
.iss-meta-row:last-child { border-bottom: none; }
.iss-meta-label {
  width: 92px; flex-shrink: 0; font-size: 12px; font-weight: 600;
  color: var(--text-3); padding-top: 5px;
}
.iss-meta-value { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.iss-meta-sel {
  width: 100%; padding: 5px 8px; border: 1px solid transparent;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text);
  background: transparent; cursor: pointer; outline: none;
  transition: border-color var(--t), background var(--t);
}
.iss-meta-sel:hover { border-color: var(--border); background: var(--bg); }
.iss-meta-sel:focus { border-color: var(--primary); background: var(--surface); }
.iss-meta-input {
  padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text); background: transparent; outline: none; width: 100%;
  transition: border-color var(--t);
}
.iss-meta-input:hover { border-color: var(--border); }
.iss-meta-input:focus { border-color: var(--primary); }
.iss-meta-user { display: flex; align-items: center; gap: 7px; }

.iss-label-set { display: flex; flex-wrap: wrap; gap: 5px; }
.iss-label-picker {
  margin-top: 8px; border-top: 1px solid var(--border-soft); padding-top: 8px;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.iss-label-pick-item { cursor: pointer; }
.iss-label-pick-item input { display: none; }
.iss-label-pick-item input:checked + .iss-label-chip { box-shadow: 0 0 0 2px currentColor; }

.iss-time-total {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.iss-time-form { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.iss-time-form-row { display: flex; gap: 8px; }
.iss-time-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); display: block; margin-bottom: 3px; }
.iss-time-form-btns { display: flex; gap: 6px; }
.iss-time-breakdown { border-top: 1px solid var(--border-soft); margin-top: 8px; }
.iss-time-log-row {
  display: flex; align-items: center; gap: 7px; padding: 6px 0;
  font-size: 12.5px; border-bottom: 1px solid var(--border-soft);
}
.iss-time-log-row:last-child { border-bottom: none; }
.iss-time-log-user {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary-bg);
  color: var(--primary); font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.iss-time-log-amt { font-weight: 600; color: var(--text); white-space: nowrap; }
.iss-time-log-desc { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iss-time-log-date { white-space: nowrap; }
.iss-time-del {
  border: none; background: none; cursor: pointer; color: var(--text-3);
  font-size: 15px; padding: 0 3px; transition: color var(--t);
}
.iss-time-del:hover { color: #dc2626; }

/* ── Card head ───────────────────────────────────────────────── */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.badge-count {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  background: var(--bg); padding: 1px 6px; border-radius: 99px;
}

/* ── Analytics ───────────────────────────────────────────────── */
.iss-analytics-panel { margin-bottom: 12px; }
.iss-analytics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
@media(max-width:720px){ .iss-analytics-grid { grid-template-columns: repeat(2,1fr); } }
.iss-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.iss-stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.iss-stat-lbl { font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 2px; }

/* ─── Releases ──────────────────────────────────────────────────────────────── */
.rel-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.rel-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.rel-stat-card:hover { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 12%,transparent); }
.rel-stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.rel-stat-lbl { font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 2px; }

.rel-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.rel-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.rel-tab:hover { color: var(--text); }
.rel-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.rel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.rel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rel-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.rel-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rel-card-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rel-card-ico  { color: var(--primary); flex-shrink: 0; }
.rel-card-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-card-project { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.rel-card-desc { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-card-foot { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.rel-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.rel-overdue { color: var(--danger) !important; }

/* Status badges */
.rel-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.rel-status-unreleased { background: #e0f2fe; color: #0369a1; }
.rel-status-released   { background: #dcfce7; color: #15803d; }
.rel-status-archived   { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }

/* Progress bar */
.rel-progress { display: flex; align-items: center; gap: 8px; }
.rel-progress-track { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.rel-progress-track-lg { height: 10px; }
.rel-progress-fill { height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }
.rel-progress-bar-mid  { background: #f59e0b; }
.rel-progress-bar-done { background: #22c55e; }
.rel-progress-label { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.rel-progress-pct { font-size: 14px; font-weight: 700; color: var(--text); min-width: 38px; }

/* Empty state */
.rel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 12px;
  color: var(--text-3);
  text-align: center;
}
.rel-empty h3 { font-size: 16px; color: var(--text); margin: 0; }
.rel-empty p  { font-size: 13px; margin: 0; }

/* ─── Release detail ─────────────────────────────────────────────────────────── */
.rel-detail-wrap {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px;
  align-items: start;
}
.rel-detail-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.rel-detail-head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.rel-detail-name-row { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.rel-detail-title { font-size: 20px; font-weight: 700; margin: 0; }
.rel-detail-desc { margin: 0 0 14px; font-size: 13px; line-height: 1.6; }
.rel-detail-progress { display: flex; align-items: center; gap: 10px; }
.rel-detail-sidebar { display: flex; flex-direction: column; gap: 12px; }

/* Release issue rows */
.rel-iss-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.rel-iss-row:last-child { border-bottom: none; }
.rel-iss-row:hover { background: var(--bg); }
.rel-iss-type { flex-shrink: 0; }
.rel-iss-title { flex: 1; font-size: 13px; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-iss-title:hover { color: var(--primary); text-decoration: underline; }
.rel-iss-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
}
.rel-iss-rm {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}
.rel-iss-rm:hover { background: var(--danger); color: #fff; }

/* Changelog */
.rel-changelog {
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 900px) {
  .rel-detail-wrap { grid-template-columns: 1fr; }
  .rel-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .rel-stats { grid-template-columns: repeat(2, 1fr); }
  .rel-grid  { grid-template-columns: 1fr; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hide-tablet { display: none !important; }
  .iss-list-head, .iss-list-row {
    grid-template-columns: 28px 8px 40px 16px 1fr 100px 70px;
  }
}
@media (max-width: 600px) {
  .hide-mobile { display: none !important; }
  .iss-list-head, .iss-list-row {
    grid-template-columns: 28px 8px 40px 16px 1fr 90px;
  }
  .iss-toolbar { flex-wrap: wrap; }
  .iss-search-wrap { min-width: 100%; order: 3; }
}

/* ── Action-only list rows: these rows have no data-href (tapping the row
   itself does nothing — the only way to act is the buttons in .lr-right), so
   .hide-mobile must not hide them here the way it correctly does on rows
   that navigate elsewhere (tickets, overview). Wrap instead of hiding. ── */
@media (max-width: 680px) {
  #inv-list .lr-right, #pl-list .lr-right, #exp-list .lr-right,
  #fo-pending-list .lr-right, #fo-ledger .lr-right,
  #emp-list .lr-right, #con-list .lr-right, #tax-list .lr-right {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-end;
    margin-top: 8px;
  }
  #inv-list .list-row, #pl-list .list-row, #exp-list .list-row,
  #fo-pending-list .list-row, #fo-ledger .list-row,
  #emp-list .list-row, #con-list .list-row, #tax-list .list-row {
    flex-wrap: wrap;
  }
}

/* ── Backup ──────────────────────────────────────────────────── */
.bk-setup-card {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.bk-setup-ok   { background: #f0fdf4; border-color: #bbf7d0; }
.bk-setup-warn { background: #fffbeb; border-color: #fde68a; }
.bk-setup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 6px;
}
.bk-setup-card p  { font-size: 13px; color: var(--text-muted); margin: 0; }
.bk-setup-card code { background: var(--surface); padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.bk-setup-steps { font-size: 13px; color: var(--text-muted); padding-left: 18px; margin: 8px 0 0; }
.bk-setup-steps li { margin-bottom: 4px; }
.bk-actions { margin-bottom: 20px; }
.bk-table-wrap { overflow-x: auto; }
.bk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bk-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.bk-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

/* ── Quick Onboarding ─────────────────────────────────────── */
.ob-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100vh - 120px);
}
.ob-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.ob-header-actions { display: flex; gap: 8px; }
.ob-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
}
.ob-subtitle { color: var(--text-muted); font-size: 13px; margin: 0; }
.ob-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  flex: 1;
}
.ob-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ob-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.ob-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ob-panel-title { font-weight: 600; font-size: 14px; }
.ob-label { font-size: 12px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 4px; }
.ob-label .req { color: var(--danger); }
.ob-opt { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.ob-field { display: flex; flex-direction: column; flex: 1; }
.ob-field-row { display: flex; gap: 10px; }
.ob-field-row-2 { gap: 10px; }
.ob-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--primary);
  margin-top: 4px;
}

/* Client toggle */
.ob-client-toggle {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.ob-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ob-toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Existing client search */
.ob-client-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}
.ob-dd-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.ob-dd-item:last-child { border-bottom: none; }
.ob-dd-item:hover { background: var(--bg); }
.ob-dd-name { font-size: 13px; font-weight: 500; }
.ob-dd-sub  { font-size: 11px; color: var(--text-muted); }
.ob-dd-empty { padding: 12px 14px; color: var(--text-muted); font-size: 13px; }
.ob-selected-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ob-selected-name { font-weight: 600; font-size: 13px; }
.ob-selected-meta { font-size: 11px; color: var(--text-muted); }
.ob-clear-btn {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
}
.ob-clear-btn:hover { color: var(--danger); background: var(--bg); }

/* Template grid */
.ob-templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ob-tpl-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
  position: relative;
}
.ob-tpl-card:hover { border-color: var(--primary); background: var(--surface); }
.ob-tpl-card.selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.ob-tpl-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ob-tpl-body { flex: 1; min-width: 0; }
.ob-tpl-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.ob-tpl-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; margin-bottom: 6px; }
.ob-tpl-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ob-tpl-badge {
  font-size: 10px;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 10px;
}
.ob-tpl-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  background: var(--primary);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.ob-tpl-card.selected .ob-tpl-check { display: flex; }
.ob-loading, .ob-error, .ob-empty-tpl {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

/* Task preview */
.ob-task-list { display: flex; flex-direction: column; gap: 6px; }
.ob-task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
}
.ob-task-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--text-muted);
}
.ob-task-info { flex: 1; min-width: 0; }
.ob-task-title { font-weight: 500; color: var(--text); }
.ob-task-desc  { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.ob-task-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ob-task-team {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
}
.ob-task-unassigned {
  background: var(--border);
  color: var(--text-muted);
}
.ob-task-days {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Footer */
.ob-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ob-footer-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.ob-footer-actions { display: flex; gap: 8px; }
.ob-launch-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
}

/* ── Workflow Templates ────────────────────────────────────── */
.wt-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.wt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.wt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.wt-card-inactive { opacity: .6; }
.wt-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 3px solid var(--border);
}
.wt-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wt-card-name { font-size: 14px; font-weight: 600; }
.wt-card-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wt-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.wt-badge-on  { background: #d1fae5; color: #065f46; }
.wt-badge-off { background: var(--border); color: var(--text-muted); }
.wt-card-body { padding: 14px 16px; flex: 1; }
.wt-card-stages {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wt-stage-chip {
  font-size: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}
.wt-mini-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.wt-mini-task:last-child { border-bottom: none; }
.wt-mini-num {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--border);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}
.wt-mini-team {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 8px;
}
.wt-mini-more { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.wt-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.wt-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}
.wt-empty p { margin: 12px 0 16px; font-size: 14px; }

/* Template task editor */
.wt-task-list { display: flex; flex-direction: column; gap: 6px; }
.wt-task-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.wt-task-drag {
  color: var(--text-muted);
  cursor: grab;
  padding-top: 10px;
  flex-shrink: 0;
}
.wt-task-fields { flex: 1; }
.wt-task-del {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px 4px;
  flex-shrink: 0;
  border-radius: 4px;
}
.wt-task-del:hover { color: var(--danger); background: var(--bg); }

/* ── Team Groups ──────────────────────────────────────────── */
.tg-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.tg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.tg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tg-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tg-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tg-card-name { font-weight: 600; font-size: 14px; }
.tg-card-slug { font-size: 11px; color: var(--text-muted); }
.tg-card-slug code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
}
.tg-card-mode {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.tg-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}
.tg-member-chip {
  font-size: 11px;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}
.tg-card-foot {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.tg-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}
.tg-empty p { margin: 12px 0; font-size: 14px; }
.tg-staff-list { display: flex; flex-direction: column; gap: 4px; }
.tg-staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}
.tg-staff-row:last-child { border-bottom: none; }
.tg-staff-name { flex: 1; font-size: 13px; }

/* spin utility */
@keyframes ob-spin { to { transform: rotate(360deg); } }
.spin { animation: ob-spin .7s linear infinite; display: inline-block; }

/* ── Client / Revenue tabs ────────────────────────────────────── */
.cr-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  position: relative;
}
.cr-tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 4px 4px 0 0;
  transition: color .15s;
}
.cr-tab:hover { color: var(--text-1); }
.cr-tab.active { color: var(--primary); }
/* Single sliding underline element instead of each tab drawing its own
   static border — glides to whichever tab is active. */
.cr-ink {
  position: absolute; bottom: -1px; height: 2px;
  background: var(--primary-grad); border-radius: 2px;
  transition: left .3s cubic-bezier(.5,0,.2,1), width .3s cubic-bezier(.5,0,.2,1);
}

/* ── Client revenue layout ────────────────────────────────────── */
.cr-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.cr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.cr-col-main, .cr-col-side { display: flex; flex-direction: column; gap: 0; }

/* ── Revenue form grid ────────────────────────────────────────── */
.cr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cr-fg2 { grid-column: span 2; }

/* ── Revenue table shared styles ─────────────────────────────── */
.rev-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.rev-card-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.rev-card-value { font-size: 20px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.rev-card-sub   { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.rev-card-warn .rev-card-value { color: #dc2626; }
.rev-card-ok   .rev-card-value { color: #16a34a; }

.rev-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rev-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.rev-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rev-table tr:last-child td { border-bottom: none; }
.rev-table tr:hover td { background: var(--surface-2); }
.rev-num { text-align: right; font-variant-numeric: tabular-nums; }
.rev-client-link { font-weight: 500; color: var(--text-1); text-decoration: none; }
.rev-client-link:hover { color: var(--primary); }

.health-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.health-excellent { color: #16a34a; background: #f0fdf4; }
.health-healthy   { color: #2563eb; background: #eff6ff; }
.health-attention { color: #dc2626; background: #fef2f2; }

@media (max-width: 960px) {
  .cr-summary { grid-template-columns: repeat(3, 1fr); }
  .cr-grid    { grid-template-columns: 1fr; }
  .cr-form-grid { grid-template-columns: 1fr; }
  .cr-fg2 { grid-column: span 1; }
}

@media (max-width: 768px) {
  .ob-body { grid-template-columns: 1fr; }
  .ob-templates { grid-template-columns: 1fr; }
  .ob-field-row-2 { flex-direction: column; }
  .wt-grid, .tg-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard rework (5-second-rule layout) ───────────────────── */
.qn-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 22px; }
.qn-card {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 9px 14px 9px 9px; cursor: pointer; box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t), transform var(--t), border-color var(--t);
  position: relative; font-family: inherit;
}
.qn-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: #d5d4cf; }
.qn-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.qn-badge {
  background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 99px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center; margin-left: 2px;
}

/* ── Latest client updates (Dashboard + My Overview) ─────────────
   Deliberately its own table-styled component, separate from the Quick
   Navigation cards above it. Rows stay <div>-based (not real <tr>s) since
   box-shadow doesn't render reliably on table rows across browsers, but
   the header row + aligned columns make it read as a table. */
.cu-table {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; margin-bottom: 22px;
}
.cu-head-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .07em;
}
.cu-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--t);
  position: relative;
}
.cu-row:last-child { border-bottom: none; }
.cu-row:hover { background: var(--surface-2); }
.cu-col-client { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.cu-head-row .cu-col-client { flex: 1; }
.cu-head-row .cu-col-status { width: 140px; }
.cu-head-row .cu-col-count { width: 70px; text-align: right; }
.cu-row .cu-col-status { width: 140px; flex-shrink: 0; }
.cu-row .cu-col-count { width: 70px; flex-shrink: 0; text-align: right; }
.cu-name { font-size: 13.5px; font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-status-muted { font-size: 12px; color: var(--text-3); }
.cu-badge { flex-shrink: 0; position: static; }
.cu-mention-tag {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; color: #be185d;
  background: #fce7f3; padding: 2px 8px; border-radius: 99px;
}
/* Smooth pulsing glow for rows where someone @mentioned the viewer — an
   inset shadow since the row has no border of its own to recolor. */
.cu-row.cu-mention {
  animation: cuMentionPulse 1.8s ease-in-out infinite;
}
@keyframes cuMentionPulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(244,114,182,.5), inset 0 0 12px rgba(244,114,182,.08); }
  50%      { box-shadow: inset 0 0 0 1px rgba(244,114,182,.9), inset 0 0 16px rgba(244,114,182,.22); }
}

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.dash-card .card-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.dash-count {
  background: var(--primary-bg); color: var(--primary); font-size: 11.5px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 99px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
}
.dash-empty { padding: 22px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.dash-more { padding: 10px 16px; border-top: 1px solid var(--border-soft); }
.dash-more a { font-size: 12.5px; color: var(--primary); text-decoration: none; font-weight: 500; }
.dash-type-ico {
  width: 28px; height: 28px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.dash-quicklinks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dash-qlink {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px; font-weight: 500; color: var(--text-2); text-decoration: none;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.dash-qlink:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-ring); }
.dash-suggest { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.dash-suggest-item {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2);
  text-decoration: none; transition: color var(--t);
}
.dash-suggest-item:hover { color: var(--primary); }

/* Quick-nav popup */
.qn-popup {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 380px; max-height: 70vh; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 500;
  display: flex; flex-direction: column; overflow: hidden;
}
.qn-popup-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.qn-popup-name { font-size: 15.5px; font-weight: 700; color: var(--text); }
.qn-popup-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.qn-popup-body { flex: 1; overflow-y: auto; padding: 8px 18px; }
.qn-popup-item { padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.qn-popup-item:last-child { border-bottom: none; }
.qn-popup-item-html { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.qn-popup-item-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.qn-popup-foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.qn-popup-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 495; }

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
}
