/* ==========================================================================
   WorkPlan design system
   Refined, professional product UI on the Clear View brand
   (confident blue, disciplined purple accent, cool-slate neutrals).
   Type: Hanken Grotesk (UI) + JetBrains Mono (IDs, timestamps, code).
   ========================================================================== */

/* ----- Fonts (vendored, self-hosted) ----- */
@font-face { font-family:'Hanken Grotesk'; font-style:normal; font-weight:400; font-display:swap;
    src:url('../fonts/hanken-grotesk-400.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-style:normal; font-weight:500; font-display:swap;
    src:url('../fonts/hanken-grotesk-500.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-style:normal; font-weight:600; font-display:swap;
    src:url('../fonts/hanken-grotesk-600.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-style:normal; font-weight:700; font-display:swap;
    src:url('../fonts/hanken-grotesk-700.woff2') format('woff2'); }
@font-face { font-family:'Hanken Grotesk'; font-style:normal; font-weight:800; font-display:swap;
    src:url('../fonts/hanken-grotesk-800.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:400; font-display:swap;
    src:url('../fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family:'JetBrains Mono'; font-style:normal; font-weight:500; font-display:swap;
    src:url('../fonts/jetbrains-mono-500.woff2') format('woff2'); }

/* ----- Tokens ----- */
:root {
    --font-sans: 'Hanken Grotesk', system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, "SFMono-Regular", Menlo, monospace;

    --brand-50:#eef3fe; --brand-100:#dbe6fd; --brand-500:#5b8bf8;
    --brand:#2f6df6; --brand-600:#2f6df6; --brand-700:#1f57db; --brand-800:#1846b4;
    --accent:#7c5cff; --accent-600:#6c4aef; --accent-50:#f2eeff;

    --ink-900:#131a2b; --ink-800:#1f2a44; --ink-700:#33415c; --ink-600:#4d5a76;
    --ink-500:#697693; --ink-400:#909cb5; --ink-300:#bcc6d8;
    --ink-200:#dde3ee; --ink-100:#e9edf5;

    --bg:#f3f6fc; --surface:#ffffff; --surface-2:#f9fafe;
    --line:#e7ebf3; --line-strong:#d8dfeb;

    --ok:#16a34a; --ok-bg:#e7f6ec; --ok-ink:#136a36;
    --warn:#e0820a; --warn-bg:#fdf2dd; --warn-ink:#92560a;
    --danger:#e5484d; --danger-bg:#fdeaea; --danger-ink:#a02128;
    --info:#2f6df6; --info-bg:#e9f1ff; --info-ink:#1846b4;

    --st-todo:#6b7894; --st-todo-bg:#eef1f7;
    --st-prog:#2f6df6; --st-prog-bg:#e9f1ff;
    --st-rev:#e0820a;  --st-rev-bg:#fdf2dd;
    --st-test:#7c5cff; --st-test-bg:#efeaff;
    --st-uat:#0ea5b7;  --st-uat-bg:#e2f5f7;
    --st-prod:#db2777; --st-prod-bg:#fce8f1;
    --st-done:#16a34a; --st-done-bg:#e7f6ec;

    --pr-low:#7c899e; --pr-med:#3b82f6; --pr-high:#f97316; --pr-urgent:#e5484d;

    --r-sm:7px; --r:10px; --r-md:14px; --r-lg:18px; --r-pill:999px;
    --shadow-sm:0 1px 2px rgba(20,26,42,.06), 0 1px 1px rgba(20,26,42,.03);
    --shadow:0 4px 16px rgba(20,26,42,.07);
    --shadow-md:0 12px 32px rgba(20,26,42,.10);
    --shadow-lg:0 26px 64px rgba(20,26,42,.18);
    --ring:0 0 0 3px rgba(47,109,246,.18);
    --t:140ms cubic-bezier(.4,0,.2,1);
    --sidebar-w:248px; --topbar-h:60px;
}

/* ----- Reset / base ----- */
*,*::before,*::after { box-sizing:border-box; }
* { margin:0; }
html { -webkit-text-size-adjust:100%; }
body {
    font-family:var(--font-sans);
    font-size:15px; line-height:1.55; color:var(--ink-700);
    background:var(--bg);
    -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
h1,h2,h3,h4,h5 { color:var(--ink-900); font-weight:700; line-height:1.25; letter-spacing:-.01em; }
a { color:var(--brand-700); text-decoration:none; }
a:hover { text-decoration:underline; }
button,input,select,textarea { font:inherit; color:inherit; }
svg { display:block; }
::selection { background:var(--brand-100); }
.mono { font-family:var(--font-mono); font-feature-settings:"tnum" 1; }
.muted { color:var(--ink-500); }
.small { font-size:13px; }
.tiny { font-size:12px; }
.nowrap { white-space:nowrap; }
hr { border:0; border-top:1px solid var(--line); margin:18px 0; }

/* ----- Buttons ----- */
.btn {
    --bg:var(--surface); --fg:var(--ink-800); --bd:var(--line-strong);
    display:inline-flex; align-items:center; justify-content:center; gap:8px;
    padding:9px 15px; font-size:14px; font-weight:600; line-height:1;
    background:var(--bg); color:var(--fg); border:1px solid var(--bd);
    border-radius:var(--r-sm); cursor:pointer; white-space:nowrap;
    transition:background var(--t), border-color var(--t), box-shadow var(--t), transform var(--t);
}
.btn:hover { text-decoration:none; background:var(--surface-2); border-color:var(--ink-300); }
.btn:active { transform:translateY(.5px); }
.btn:focus-visible { outline:none; box-shadow:var(--ring); }
.btn svg { width:16px; height:16px; }
.btn--primary { --bg:var(--brand); --fg:#fff; --bd:transparent; box-shadow:0 1px 2px rgba(31,87,219,.35); }
.btn--primary:hover { --bg:var(--brand-700); border-color:transparent; }
.btn--accent { --bg:var(--accent); --fg:#fff; --bd:transparent; }
.btn--ghost { --bg:transparent; --bd:transparent; --fg:var(--ink-600); }
.btn--ghost:hover { background:var(--ink-100); }
.btn--danger { --bg:#fff; --fg:var(--danger-ink); --bd:#f3c7c8; }
.btn--danger:hover { background:var(--danger-bg); border-color:#e9a9ab; }
.btn--sm { padding:6px 11px; font-size:13px; }
.btn--lg { padding:12px 20px; font-size:15px; }
.btn--block { display:flex; width:100%; }
.btn--icon { padding:8px; }
.btn[disabled] { opacity:.55; cursor:not-allowed; }

/* ----- Forms ----- */
.field { margin-bottom:16px; }
.label { display:block; font-weight:600; font-size:13.5px; color:var(--ink-700); margin-bottom:6px; }
.input,.select,.textarea {
    width:100%; padding:10px 12px; font-size:14.5px; background:var(--surface);
    border:1px solid var(--line-strong); border-radius:var(--r-sm); color:var(--ink-800);
    transition:border-color var(--t), box-shadow var(--t);
}
.textarea { resize:vertical; min-height:90px; line-height:1.5; }
.input:focus,.select:focus,.textarea:focus { outline:none; border-color:var(--brand); box-shadow:var(--ring); }
.input::placeholder,.textarea::placeholder { color:var(--ink-400); }
.field__error { color:var(--danger-ink); font-size:12.5px; margin-top:5px; }
.field__hint { color:var(--ink-500); font-size:12.5px; margin-top:5px; }
.input--error,.select--error { border-color:var(--danger); }

/* ----- Cards / surfaces ----- */
.card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--shadow-sm); }
.card__pad { padding:20px 22px; }
.card__head { padding:16px 22px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card__title { font-size:15px; font-weight:700; color:var(--ink-900); }

/* ----- Badges, chips, status, priority ----- */
.badge { display:inline-flex; align-items:center; gap:6px; padding:3px 9px; font-size:12px; font-weight:600;
    border-radius:var(--r-pill); background:var(--ink-100); color:var(--ink-700); line-height:1.4; }
.badge--dot::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }

.status { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; font-size:12px; font-weight:600; border-radius:var(--r-pill); }
.status::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.status--todo { color:var(--st-todo); background:var(--st-todo-bg); }
.status--in_progress { color:var(--st-prog); background:var(--st-prog-bg); }
.status--in_review { color:var(--st-rev); background:var(--st-rev-bg); }
.status--testing { color:var(--st-test); background:var(--st-test-bg); }
.status--uat { color:var(--st-uat); background:var(--st-uat-bg); }
.status--production { color:var(--st-prod); background:var(--st-prod-bg); }
.status--done { color:var(--st-done); background:var(--st-done-bg); }

.prio { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; font-weight:600; color:var(--ink-600); }
.prio::before { content:""; width:9px; height:9px; border-radius:2px; }
.prio--low::before { background:var(--pr-low); }
.prio--med::before { background:var(--pr-med); }
.prio--high::before { background:var(--pr-high); }
.prio--urgent::before { background:var(--pr-urgent); }

.chip { display:inline-flex; align-items:center; gap:5px; padding:2px 9px; font-size:12px; font-weight:600;
    border-radius:var(--r-pill); background:var(--ink-100); color:var(--ink-700); }
.chip__dot { width:8px; height:8px; border-radius:50%; }

/* ----- Avatars ----- */
.avatar { display:inline-flex; align-items:center; justify-content:center; flex:none;
    width:30px; height:30px; border-radius:50%; color:#fff; font-size:12px; font-weight:700;
    background:var(--brand); box-shadow:inset 0 0 0 1px rgba(255,255,255,.15); }
.avatar--sm { width:24px; height:24px; font-size:10.5px; }
.avatar--lg { width:40px; height:40px; font-size:15px; }
.avatar-stack { display:inline-flex; }
.avatar-stack .avatar { margin-left:-7px; box-shadow:0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left:0; }

/* ----- Progress ----- */
.progress { height:7px; background:var(--ink-100); border-radius:var(--r-pill); overflow:hidden; }
.progress__bar { height:100%; background:linear-gradient(90deg,var(--brand),var(--brand-500)); border-radius:inherit; transition:width var(--t); }
.progress--done .progress__bar { background:linear-gradient(90deg,var(--ok),#34c46a); }

/* ----- Tables ----- */
.table { width:100%; border-collapse:collapse; font-size:14px; }
.table th { text-align:left; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
    color:var(--ink-500); padding:10px 14px; border-bottom:1px solid var(--line); }
.table td { padding:12px 14px; border-bottom:1px solid var(--line); color:var(--ink-700); vertical-align:middle; }
.table tbody tr { transition:background var(--t); }
.table tbody tr:hover { background:var(--surface-2); }
.table tbody tr:last-child td { border-bottom:0; }

/* ----- App shell ----- */
.app { display:flex; min-height:100vh; }
.sidebar {
    width:var(--sidebar-w); flex:none; position:sticky; top:0; height:100vh;
    display:flex; flex-direction:column; background:linear-gradient(180deg,#ffffff, #fbfcff);
    border-right:1px solid var(--line); z-index:40;
}
.sidebar__brand { display:flex; align-items:center; gap:11px; padding:18px 20px 16px; }
.brand-mark { width:34px; height:34px; border-radius:10px; flex:none;
    background:linear-gradient(135deg,var(--brand),var(--accent)); box-shadow:0 6px 14px rgba(47,109,246,.35);
    position:relative; }
.brand-mark::after { content:""; position:absolute; inset:0;
    background:no-repeat center / 19px url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'><polyline points='4 9 8 19 12 6 16 19 20 9'/></svg>"); }
.brand-word { font-weight:800; font-size:18px; color:var(--ink-900); letter-spacing:-.02em; }
.brand-word span { color:var(--brand); }
.sidebar__nav { padding:8px 12px; overflow-y:auto; flex:1; }
.nav-section { margin-top:16px; padding:0 10px 6px; font-size:11px; font-weight:700; letter-spacing:.07em;
    text-transform:uppercase; color:var(--ink-400); }
.nav-link { display:flex; align-items:center; gap:11px; padding:9px 11px; margin:2px 0; border-radius:var(--r-sm);
    color:var(--ink-600); font-weight:600; font-size:14px; position:relative; transition:background var(--t),color var(--t); }
.nav-link:hover { background:var(--ink-100); color:var(--ink-900); text-decoration:none; }
.nav-link svg { width:18px; height:18px; flex:none; color:var(--ink-400); transition:color var(--t); }
.nav-link:hover svg { color:var(--ink-600); }
.nav-link.is-active { background:var(--brand-50); color:var(--brand-800); }
.nav-link.is-active svg { color:var(--brand); }
.nav-link.is-active::before { content:""; position:absolute; left:-12px; top:8px; bottom:8px; width:3px;
    border-radius:0 3px 3px 0; background:var(--brand); }
.nav-link__count { margin-left:auto; font-size:11.5px; font-weight:700; color:var(--ink-500);
    background:var(--ink-100); border-radius:var(--r-pill); padding:1px 7px; }
.sidebar__foot { border-top:1px solid var(--line); padding:10px 12px; }

/* ----- Main / topbar ----- */
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { position:sticky; top:0; height:var(--topbar-h); display:flex; align-items:center; gap:14px;
    padding:0 22px; background:rgba(255,255,255,.82); backdrop-filter:saturate(1.4) blur(10px);
    border-bottom:1px solid var(--line); z-index:30; }
.topbar__title { font-size:16px; font-weight:700; color:var(--ink-900); letter-spacing:-.01em; }
.topbar__spacer { flex:1; }
.search { position:relative; width:min(360px,38vw); }
.search input { width:100%; padding:8px 12px 8px 34px; font-size:13.5px; background:var(--surface-2);
    border:1px solid var(--line); border-radius:var(--r-pill); }
.search input:focus { outline:none; background:#fff; border-color:var(--brand); box-shadow:var(--ring); }
.search svg { position:absolute; left:11px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--ink-400); }
.icon-btn { display:inline-flex; align-items:center; justify-content:center; width:38px; height:38px; flex:none;
    border-radius:var(--r-sm); color:var(--ink-600); background:transparent; border:0; cursor:pointer; position:relative;
    transition:background var(--t),color var(--t); }
.icon-btn:hover { background:var(--ink-100); color:var(--ink-900); }
.icon-btn svg { width:19px; height:19px; }
.icon-btn__badge { position:absolute; top:6px; right:6px; min-width:16px; height:16px; padding:0 4px;
    background:var(--danger); color:#fff; font-size:10px; font-weight:700; border-radius:var(--r-pill);
    display:flex; align-items:center; justify-content:center; box-shadow:0 0 0 2px #fff; }
.hamburger { display:none; }

.content { padding:24px 28px 48px; width:100%; max-width:1180px; margin:0 auto; }
.content--wide { max-width:none; }
.page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap; }
.page-head__title { font-size:24px; font-weight:800; letter-spacing:-.02em; }
.page-head__sub { color:var(--ink-500); margin-top:2px; }

/* ----- Dropdown menu ----- */
.menu { position:relative; }
.menu__pop { position:absolute; right:0; top:calc(100% + 8px); min-width:210px; background:var(--surface);
    border:1px solid var(--line); border-radius:var(--r-md); box-shadow:var(--shadow-md); padding:6px;
    opacity:0; transform:translateY(-6px) scale(.98); pointer-events:none; transition:opacity var(--t),transform var(--t); z-index:50; }
.menu.is-open .menu__pop { opacity:1; transform:none; pointer-events:auto; }
.menu__pop--up { top:auto; bottom:calc(100% + 8px); left:0; right:0; }
.menu__item { display:flex; align-items:center; gap:10px; width:100%; text-align:left; padding:9px 11px;
    border-radius:var(--r-sm); font-size:14px; font-weight:500; color:var(--ink-700); background:none; border:0; cursor:pointer; }
.menu__item:hover { background:var(--ink-100); color:var(--ink-900); text-decoration:none; }
.menu__item svg { width:16px; height:16px; color:var(--ink-400); }
.menu__sep { height:1px; background:var(--line); margin:6px 4px; }
.menu__head { padding:9px 11px 6px; }
.menu__head b { color:var(--ink-900); font-size:14px; }
.menu__head span { color:var(--ink-500); font-size:12.5px; }

/* ----- Modal ----- */
.modal-overlay { position:fixed; inset:0; background:rgba(19,26,43,.42); backdrop-filter:blur(2px);
    display:flex; align-items:flex-start; justify-content:center; padding:8vh 16px; opacity:0; pointer-events:none;
    transition:opacity var(--t); z-index:100; }
.modal-overlay.is-open { opacity:1; pointer-events:auto; }
.modal { width:100%; max-width:520px; background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--shadow-lg);
    transform:translateY(10px) scale(.99); transition:transform var(--t); overflow:hidden; }
.modal-overlay.is-open .modal { transform:none; }
.modal__head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--line); }
.modal__title { font-size:17px; font-weight:700; }
.modal__body { padding:22px; max-height:64vh; overflow-y:auto; }
.modal__foot { display:flex; justify-content:flex-end; gap:10px; padding:16px 22px; border-top:1px solid var(--line); background:var(--surface-2); }

/* ----- Toasts ----- */
.toast-wrap { position:fixed; right:18px; bottom:18px; display:flex; flex-direction:column; gap:10px; z-index:200; }
.toast { display:flex; align-items:center; gap:10px; padding:12px 15px; background:var(--ink-900); color:#fff;
    border-radius:var(--r); box-shadow:var(--shadow-md); font-size:14px; font-weight:500; min-width:230px;
    transform:translateX(120%); transition:transform .28s cubic-bezier(.2,.8,.2,1); }
.toast.is-in { transform:none; }
.toast--success { background:#10693a; } .toast--error { background:#a8252b; } .toast--info { background:var(--ink-900); }

/* ----- Flash (server-rendered) ----- */
.flash-stack { display:flex; flex-direction:column; gap:8px; margin-bottom:18px; }
.flash { display:flex; align-items:center; gap:9px; padding:11px 15px; border-radius:var(--r); font-size:14px; font-weight:500; }
.flash--success { background:var(--ok-bg); color:var(--ok-ink); }
.flash--error { background:var(--danger-bg); color:var(--danger-ink); }
.flash--info { background:var(--info-bg); color:var(--info-ink); }

/* ----- Empty state ----- */
.empty { text-align:center; padding:54px 24px; color:var(--ink-500); }
.empty__icon { width:54px; height:54px; margin:0 auto 14px; border-radius:var(--r-md);
    display:flex; align-items:center; justify-content:center; background:var(--brand-50); color:var(--brand); }
.empty__icon svg { width:26px; height:26px; }
.empty h3 { color:var(--ink-800); margin-bottom:5px; }

/* ----- Stat cards ----- */
.stat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; }
.stat { padding:18px 20px; }
.stat__label { font-size:12.5px; font-weight:600; color:var(--ink-500); text-transform:uppercase; letter-spacing:.04em; }
.stat__value { font-size:30px; font-weight:800; color:var(--ink-900); letter-spacing:-.02em; margin-top:6px; }
.stat__meta { font-size:13px; margin-top:4px; }

/* ----- Utilities ----- */
.row { display:flex; align-items:center; gap:10px; }
.row--between { justify-content:space-between; }
.row--wrap { flex-wrap:wrap; }
.col { display:flex; flex-direction:column; gap:10px; }
.gap-sm { gap:6px; } .gap-lg { gap:18px; }
.grow { flex:1; min-width:0; }
.mt-0{margin-top:0}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:8px}.mb-4{margin-bottom:16px}
.text-right{text-align:right}.hidden{display:none!important}

/* ----- Auth pages ----- */
.auth { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
    background:radial-gradient(1100px 600px at 80% -10%, var(--brand-50), transparent 60%),
               radial-gradient(900px 500px at -10% 110%, var(--accent-50), transparent 55%), var(--bg); }
.auth__wrap { width:100%; max-width:404px; }
.auth-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
    padding:32px 32px 30px; box-shadow:var(--shadow-md); }
.auth-card__brand { display:flex; align-items:center; gap:11px; margin-bottom:22px; }
.auth-card__title { font-size:22px; font-weight:800; letter-spacing:-.02em; }
.auth-card__sub { margin:2px 0 22px; color:var(--ink-500); }

/* ----- Error page ----- */
.error-card { max-width:460px; margin:0 auto; text-align:center; }
.error-card__code { font-family:var(--font-mono); font-size:64px; font-weight:500; color:var(--brand); line-height:1; }
.error-card__title { margin:10px 0 6px; }
.error-card__msg { color:var(--ink-500); margin-bottom:18px; }

/* ----- Responsive ----- */
@media (max-width:900px) {
    .sidebar { position:fixed; left:0; top:0; transform:translateX(-100%); transition:transform var(--t); box-shadow:var(--shadow-lg); }
    .app.nav-open .sidebar { transform:none; }
    .nav-scrim { position:fixed; inset:0; background:rgba(19,26,43,.4); opacity:0; pointer-events:none; transition:opacity var(--t); z-index:39; }
    .app.nav-open .nav-scrim { opacity:1; pointer-events:auto; }
    .hamburger { display:inline-flex; }
    .content { padding:18px 16px 40px; }
    .search { display:none; }
}
@media (min-width:901px) { .nav-scrim { display:none; } }

/* ----- Projects ----- */
.project-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(282px,1fr)); gap:16px; }
.project-card { padding:18px 20px; display:flex; flex-direction:column; transition:transform var(--t),box-shadow var(--t),border-color var(--t); }
.project-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--line-strong); }
.project-card.is-archived { opacity:.72; }
.project-card__top { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:12px; min-height:30px; }
.project-badge { font-size:12px; font-weight:700; padding:4px 9px; border-radius:var(--r-sm); letter-spacing:.03em; }
.project-card__link { display:block; color:inherit; }
.project-card__link:hover { text-decoration:none; }
.project-card__link h3 { font-size:16px; color:var(--ink-900); margin-bottom:4px; }
.project-card__desc { color:var(--ink-500); font-size:13px; line-height:1.5; min-height:40px; margin-bottom:14px; }
.project-card .progress { margin-top:auto; }
.project-card__foot { display:flex; align-items:center; justify-content:space-between; font-size:12.5px; color:var(--ink-500); margin-top:9px; }

/* Colour swatches */
.swatches { display:flex; gap:11px; flex-wrap:wrap; }
.swatch { cursor:pointer; line-height:0; }
.swatch input { position:absolute; opacity:0; width:0; height:0; }
.swatch span { display:block; width:28px; height:28px; border-radius:50%; background:var(--c); box-shadow:0 0 0 2px #fff, 0 0 0 3px var(--line); transition:box-shadow var(--t),transform var(--t); }
.swatch:hover span { transform:scale(1.08); }
.swatch input:checked + span { box-shadow:0 0 0 2px #fff, 0 0 0 3px var(--c); }
.swatch input:focus-visible + span { box-shadow:0 0 0 2px #fff, 0 0 0 3px var(--c), var(--ring); }

/* ----- Segmented control ----- */
.seg { display:inline-flex; background:var(--ink-100); border-radius:var(--r-sm); padding:3px; }
.seg__item { display:inline-flex; align-items:center; gap:6px; padding:6px 12px; font-size:13px; font-weight:600; color:var(--ink-600); border-radius:6px; }
.seg__item:hover { text-decoration:none; color:var(--ink-900); }
.seg__item svg { width:15px; height:15px; }
.seg__item.is-active { background:var(--surface); color:var(--ink-900); box-shadow:var(--shadow-sm); }

/* ----- Filters bar ----- */
.filters { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:18px; }
.filters__search { width:240px; }
.filters__select { width:auto; min-width:148px; padding:8px 12px; font-size:13.5px; }

/* ----- Board ----- */
.board { display:flex; gap:14px; align-items:flex-start; overflow-x:auto; padding-bottom:10px; }
.board-col { flex:1 1 0; min-width:286px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r-md); display:flex; flex-direction:column; max-height:calc(100vh - 232px); }
.board-col__head { display:flex; align-items:center; justify-content:space-between; padding:12px 14px 10px; font-weight:700; font-size:13.5px; color:var(--ink-800); }
.board-col__count { font-size:12px; font-weight:700; color:var(--ink-500); background:var(--ink-100); border-radius:var(--r-pill); padding:1px 9px; }
.board-col__list { display:flex; flex-direction:column; gap:9px; padding:2px 10px 8px; overflow-y:auto; flex:1; min-height:24px; }
.quick-add { padding:8px 10px 12px; }
.quick-add__input { width:100%; padding:8px 11px; border:1px dashed var(--line-strong); border-radius:var(--r-sm); background:transparent; font-size:13.5px; transition:border-color var(--t),background var(--t),box-shadow var(--t); }
.quick-add__input:focus { outline:none; border-style:solid; border-color:var(--brand); background:var(--surface); box-shadow:var(--ring); }

/* ----- Task card ----- */
.task-card { background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:11px 12px; box-shadow:var(--shadow-sm); cursor:grab; transition:border-color var(--t),box-shadow var(--t),transform var(--t); }
.task-card:hover { border-color:var(--line-strong); box-shadow:var(--shadow); }
.task-card:active { cursor:grabbing; }
.task-card.is-ghost { opacity:.4; }
.task-card.is-chosen { box-shadow:var(--shadow-md); }
.task-card.is-drag { transform:rotate(1.5deg); }
.task-card__top { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.task-card__id { font-size:11.5px; color:var(--ink-500); font-weight:500; }
.task-card__id:hover { color:var(--brand); text-decoration:none; }
.task-card__title { display:block; color:var(--ink-900); font-weight:600; font-size:14px; line-height:1.4; }
.task-card__title:hover { color:var(--brand); text-decoration:none; }
.task-card__labels { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.task-card__labels .chip { font-size:11px; padding:1px 8px; }
.task-card__foot { display:flex; align-items:center; justify-content:space-between; margin-top:10px; }
.task-card__meta { display:flex; align-items:center; gap:11px; color:var(--ink-500); font-size:12px; }
.task-meta { display:inline-flex; align-items:center; gap:4px; }
.task-meta svg { width:13px; height:13px; }
.task-meta.is-overdue, td.is-overdue { color:var(--danger); font-weight:600; }
.avatar--empty { background:var(--ink-100); color:var(--ink-400); box-shadow:inset 0 0 0 1px var(--line-strong); }

/* ----- Checkbox rows ----- */
.checks { display:flex; flex-wrap:wrap; gap:8px 14px; }
.check { display:inline-flex; align-items:center; gap:7px; cursor:pointer; font-size:13px; }
.table .chip { margin-left:6px; }

/* ----- Task detail ----- */
.task-detail { display:grid; grid-template-columns:minmax(0,1fr) 322px; gap:26px; align-items:start; }
.task-title { font-size:24px; font-weight:800; letter-spacing:-.02em; line-height:1.25; margin-bottom:4px; }
.task-section { margin-top:26px; }
.task-section__head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.task-section__head h3 { font-size:14px; font-weight:700; color:var(--ink-800); }
.task-desc { color:var(--ink-700); line-height:1.6; white-space:pre-wrap; }
.checklist { display:flex; flex-direction:column; gap:2px; margin-bottom:10px; }
.checklist__row { display:flex; align-items:center; gap:10px; padding:6px; border-radius:var(--r-sm); }
.checklist__row:hover { background:var(--surface-2); }
.checklist__del { opacity:0; transition:opacity var(--t); margin-left:auto; }
.checklist__row:hover .checklist__del { opacity:1; }
.checklist__title { flex:1; font-size:14px; }
.checklist__row.is-done .checklist__title { color:var(--ink-400); text-decoration:line-through; }
.checkbox { width:20px; height:20px; border:1.5px solid var(--ink-300); border-radius:6px; background:var(--surface); cursor:pointer; display:flex; align-items:center; justify-content:center; color:#fff; padding:0; flex:none; }
.checklist__row.is-done .checkbox { background:var(--ok); border-color:var(--ok); }
.checkbox svg { width:13px; height:13px; }
.checklist__add .input { margin-top:4px; }
.attach-list { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.attach { display:flex; align-items:center; gap:10px; padding:9px 11px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface); }
.attach__icon { color:var(--ink-400); display:flex; } .attach__icon svg { width:18px; height:18px; }
.attach__name { font-weight:600; font-size:13.5px; }
.attach form { margin-left:auto; }
.attach-upload { display:flex; align-items:center; gap:10px; }
.attach-file { font-size:13px; }
.timeline { display:flex; flex-direction:column; gap:16px; }
.tl-item { display:flex; gap:11px; }
.tl-body { flex:1; min-width:0; }
.tl-meta { font-size:13.5px; }
.comment-bubble { margin-top:5px; background:var(--surface-2); border:1px solid var(--line); border-radius:var(--r); padding:10px 13px; font-size:14px; line-height:1.55; color:var(--ink-700); }
.tl-item--event { align-items:center; }
.tl-dot { width:24px; height:24px; border-radius:50%; background:var(--ink-100); color:var(--ink-400); display:flex; align-items:center; justify-content:center; flex:none; }
.tl-dot svg { width:13px; height:13px; }
.task-detail__side .card__pad { padding:4px 18px; }
.side-field { padding:13px 0; border-bottom:1px solid var(--line); }
.side-field--last { border-bottom:0; }
.side-field__label { display:block; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-500); margin-bottom:6px; }
@media (max-width:860px){ .task-detail { grid-template-columns:1fr; } }

/* ----- Mentions, comment composer, feed ----- */
.mention { color:var(--brand-700); font-weight:600; background:var(--brand-50); padding:0 3px; border-radius:4px; }
.mention--hit { color:var(--accent-600); background:var(--accent-50); }
.comment-form { margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
.feed { display:flex; flex-direction:column; }
.feed__item { display:flex; gap:11px; padding:12px 2px; border-bottom:1px solid var(--line); }
.feed__item:last-child { border-bottom:0; }
.feed__body { flex:1; min-width:0; line-height:1.5; }
.feed__body .mono { color:var(--brand-700); }
.notif { color:inherit; }
.notif:hover { text-decoration:none; background:var(--surface-2); }
.notif.is-unread { background:var(--brand-50); }
.notif.is-unread:hover { background:var(--brand-100); }
.notif__dot { width:8px; height:8px; border-radius:50%; background:var(--brand); align-self:center; flex:none; }

/* ----- My Work / Dashboard ----- */
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; align-items:start; }
@media (max-width:900px){ .dash-grid { grid-template-columns:1fr; } }
.task-rows { display:flex; flex-direction:column; }
.task-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); color:inherit; }
.task-row:last-child { border-bottom:0; }
.task-row:hover { background:var(--surface-2); text-decoration:none; }
.task-row__main { min-width:0; flex:1; }
.task-row__head { display:flex; align-items:center; gap:9px; min-width:0; }
.task-row__title { font-weight:600; font-size:14px; color:var(--ink-900); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.task-row__labels { display:flex; gap:5px; margin-top:6px; flex-wrap:wrap; }
.task-row__labels .chip { font-size:11px; padding:1px 7px; }
.task-row__side { display:flex; align-items:center; gap:14px; flex:none; }
.mywork-section { margin-bottom:22px; }
.mywork-section__head { display:flex; align-items:center; gap:8px; font-weight:700; font-size:13.5px; color:var(--ink-800); margin-bottom:10px; }
a.stat { color:inherit; transition:transform var(--t),box-shadow var(--t); }
a.stat:hover { text-decoration:none; box-shadow:var(--shadow-md); transform:translateY(-2px); }
.proj-progress { display:flex; flex-direction:column; gap:2px; }
.proj-progress__row { display:flex; align-items:center; gap:12px; padding:9px 6px; border-radius:var(--r-sm); color:inherit; }
.proj-progress__row:hover { background:var(--surface-2); text-decoration:none; }
.proj-progress__name { flex:1; font-weight:600; font-size:13.5px; color:var(--ink-800); min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.workload-pill { display:inline-block; padding:3px 10px; border-radius:var(--r-pill); font-size:12.5px; font-weight:700; background:var(--brand-50); color:var(--brand-800); }
.workload-pill:hover { text-decoration:none; background:var(--brand-100); }
.workload-pill.is-zero { background:var(--ink-100); color:var(--ink-500); font-weight:600; }
a.proj-progress__name:hover { color:var(--brand-700); text-decoration:none; }
.board-col--unassigned { border-style:dashed; }
.board-col--unassigned .board-col__head { color:var(--ink-500); }
.reassign-select { width:100%; margin-top:9px; padding:5px 8px; font-size:12px; color:var(--ink-500);
    border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); cursor:pointer; }
.reassign-select:hover { border-color:var(--line-strong); color:var(--ink-700); }
.reassign-select:focus { outline:none; border-color:var(--brand); box-shadow:var(--ring); color:var(--ink-700); }

/* ----- Client portal ----- */
.portal-top { display:flex; align-items:center; justify-content:space-between; height:var(--topbar-h); padding:0 22px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:30; }
.portal-brand { display:flex; align-items:center; gap:10px; }
.portal-brand:hover { text-decoration:none; }
.portal-main { max-width:1000px; margin:0 auto; padding:26px 24px 48px; }
@media (max-width:640px){ .portal-main { padding:18px 14px 40px; } }
