@font-face {
    font-family: "Inter";
    src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter Ext";
    src: url("../vendor/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e5e9f0;
    --line-strong: #d5dce8;
    --navy: #0b1220;
    --navy-2: #111c33;
    --accent: #0d9488;
    --accent-2: #0f766e;
    --mint: #6ee7b7;
    --mint-soft: #d1fae5;
    --coral: #fb7185;
    --amber: #f59e0b;
    --violet: #8b5cf6;
    --blue: #3b82f6;
    --radius: 16px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
    --shadow-md: 0 16px 48px rgba(15, 23, 42, .10);
    --sidebar-w: 272px;
    --font: "Inter", "Inter Ext", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    background:
        radial-gradient(900px 500px at 110% -10%, rgba(13, 148, 136, .07), transparent 60%),
        radial-gradient(700px 450px at -10% 110%, rgba(139, 92, 246, .05), transparent 60%),
        var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4, h5 { letter-spacing: -.02em; font-weight: 700; }
p { margin-top: 0; }
::selection { background: var(--mint-soft); color: var(--navy); }
.mono { font-variant-numeric: tabular-nums; }
.text-muted { color: var(--muted) !important; }
.tiny { font-size: 11.5px; }
.small { font-size: 12.5px; }

/* ---------- Shell & sidebar ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(400px 300px at 100% 0%, rgba(13, 148, 136, .18), transparent 60%),
        linear-gradient(180deg, #0b1220 0%, #0e1729 55%, #0a101c 100%);
    color: #cbd5e1;
    padding: 22px 16px 16px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #243047 transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 13px;
    display: grid; place-items: center;
    background: linear-gradient(145deg, rgba(110, 231, 183, .24), rgba(13, 148, 136, .2));
    border: 1px solid rgba(110, 231, 183, .36);
    box-shadow: 0 8px 22px rgba(13, 148, 136, .22);
}
.brand-mark span {
    font-weight: 800; font-size: 19px; color: var(--mint);
    transform: skew(-9deg);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 17px; letter-spacing: -.02em; }
.brand-text small { color: #7f8da6; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }

.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
    display: block;
    padding: 0 10px;
    font-size: 9.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #66748c;
    font-weight: 600;
    margin: 14px 0 7px;
}
.nav-label-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.nav-label-row .nav-label { margin: 0 0 0; }
.nav-mini {
    width: 22px; height: 22px; display: grid; place-items: center;
    border-radius: 7px; color: #94a3b8; background: rgba(148, 163, 184, .1);
    font-size: 11px; margin-right: 6px;
}
.nav-mini:hover { background: rgba(110, 231, 183, .16); color: var(--mint); }
.nav-link {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: #a9b6ca;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-link i { font-size: 16px; width: 19px; text-align: center; color: #7e8ca2; transition: color .16s ease; }
.nav-link:hover { background: rgba(148, 163, 184, .09); color: #fff; }
.nav-link:hover i { color: var(--mint); }
.nav-link.active {
    background: linear-gradient(90deg, rgba(110, 231, 183, .14), rgba(110, 231, 183, .03));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(110, 231, 183, .12);
}
.nav-link.active::before {
    content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px;
    width: 3px; border-radius: 0 4px 4px 0; background: var(--mint);
}
.nav-link.active i { color: var(--mint); }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px;
    display: inline-grid; place-items: center; padding: 0 6px;
    background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
}
.nav-spaces { margin-top: 2px; }
.space-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 11px; border-radius: 9px;
    color: #9aa8bd; font-size: 12.8px;
    transition: background .15s ease, color .15s ease;
}
.space-link:hover, .space-link.active { background: rgba(148, 163, 184, .09); color: #fff; }
.space-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }
.sidebar-empty { color: #66748c; font-size: 12px; padding: 5px 11px; margin: 0; }

.sidebar-bottom { margin-top: auto; padding-top: 18px; }
.status-row { display: flex; gap: 6px; padding: 10px 6px 12px; flex-wrap: wrap; }
.status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase;
    color: #7f8da6; border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 999px; padding: 4px 8px;
}
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: #64748b; }
.status-pill.ok .dot { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.status-pill.off .dot { background: var(--coral); }
.user-box {
    display: flex; align-items: center; gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, .12);
    padding: 13px 7px 2px;
}
.avatar {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(145deg, #1e293b, #0f172a); color: var(--mint);
    font-weight: 700; border: 1px solid rgba(110, 231, 183, .18);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-meta strong { color: #e2e8f0; font-size: 12.5px; font-weight: 600; }
.user-meta small { color: #66748c; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box form { margin-left: auto; }
.icon-btn {
    width: 32px; height: 32px; display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: inherit; cursor: pointer; font-size: 16px;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: rgba(148, 163, 184, .1); color: #fff; }
.sidebar-backdrop { display: none; }

/* ---------- Main / topbar ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; padding: 15px 34px;
    background: rgba(244, 246, 249, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(229, 233, 240, .8);
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-heading { min-width: 0; }
.eyebrow {
    font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
    color: var(--muted-2); font-weight: 600; margin-bottom: 3px;
}
.page-heading h1 { font-size: 23px; margin: 0; line-height: 1.15; color: var(--ink); }
.page-subtitle { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.mobile-menu { display: none; color: var(--ink); border-color: var(--line); background: var(--surface); }

.content { padding: 26px 34px 56px; width: 100%; max-width: 1540px; margin: 0 auto; }
.flash {
    display: flex; align-items: center; gap: 10px;
    border-radius: 12px; padding: 12px 14px; margin-bottom: 18px;
    font-size: 13px; border: 1px solid transparent;
    animation: slideIn .25s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.flash i { font-size: 16px; }
.flash span { flex: 1; }
.flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash-error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-close { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; font-size: 15px; }
.flash-close:hover { opacity: 1; }

/* ---------- Buttons, badges ---------- */
.btn {
    font-family: var(--font);
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    padding: 8px 13px;
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid transparent;
    transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    border-color: var(--accent-2);
    color: #fff;
    box-shadow: 0 5px 14px rgba(13, 148, 136, .2);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, #0b5f59, var(--accent-2)); border-color: #0b5f59; color: #fff; }
.btn-dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.btn-soft { background: #eef2f7; color: var(--ink-soft); border-color: transparent; }
.btn-soft:hover { background: #e4eaf2; color: var(--ink); }
.btn-outline { background: var(--surface); color: var(--ink-soft); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-2); background: #f8fafb; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: #eef2f7; color: var(--ink); }
.btn-danger-soft { background: #fff1f2; color: #be123c; border-color: transparent; }
.btn-danger-soft:hover { background: #ffe4e6; color: #9f1239; }
.btn-sm { padding: 7px 11px; font-size: 11.8px; border-radius: 9px; }
.btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 12px; }
.btn-icon { padding: 7px 9px; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 999px;
    font-size: 10.5px; font-weight: 600;
    background: #f1f5f9; color: var(--muted);
    border: 1px solid transparent;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-green { background: #ecfdf5; color: #047857; }
.chip-red { background: #fff1f2; color: #be123c; }
.chip-amber { background: #fffbeb; color: #b45309; }
.chip-blue { background: #eff6ff; color: #1d4ed8; }
.chip-violet { background: #f5f3ff; color: #6d28d9; }
.chip-slate { background: #f1f5f9; color: #475569; }
.chip-teal { background: #f0fdfa; color: #0f766e; }
.chip-outline { background: transparent; border-color: var(--line-strong); color: var(--muted); }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.status-backlog { background: #f1f5f9; color: #475569; }
.status-todo { background: #eff6ff; color: #1d4ed8; }
.status-in_progress { background: #fffbeb; color: #b45309; }
.status-review { background: #f5f3ff; color: #6d28d9; }
.status-done { background: #ecfdf5; color: #047857; }
.status-queued { background: #f0fdfa; color: #0f766e; }
.status-running { background: #eff6ff; color: #1d4ed8; }
.status-failed { background: #fff1f2; color: #be123c; }
.status-cancelled { background: #f1f5f9; color: #64748b; }

.priority-urgent { color: #be123c; }
.priority-high { color: #b45309; }
.priority-normal { color: #475569; }
.priority-low { color: #64748b; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.priority-dot.urgent { background: #e11d48; box-shadow: 0 0 0 3px rgba(225, 29, 72, .1); }
.priority-dot.high { background: #f59e0b; }
.priority-dot.normal { background: #94a3b8; }
.priority-dot.low { background: #cbd5e1; }

/* ---------- Panels / cards ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 17px 20px;
    border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel-head h3 { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 12px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.panel-flush { overflow: hidden; }
.panel-flush .panel-body { padding: 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 17px 18px; display: flex; align-items: flex-start; gap: 13px;
    box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15, 23, 42, .07); }
.kpi-card::after { content: ""; position: absolute; right: -30px; top: -40px; width: 110px; height: 110px; border-radius: 50%; background: rgba(13, 148, 136, .045); }
.kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; background: #ecfdf5; color: var(--accent-2); flex: 0 0 38px; }
.kpi-icon.blue { background: #eff6ff; color: #1d4ed8; }
.kpi-icon.amber { background: #fffbeb; color: #b45309; }
.kpi-icon.violet { background: #f5f3ff; color: #6d28d9; }
.kpi-icon.coral { background: #fff1f2; color: #be123c; }
.kpi-value { font-size: 25px; font-weight: 750; letter-spacing: -.04em; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.kpi-foot { font-size: 10.5px; color: var(--muted-2); margin-top: 5px; }
.kpi-foot strong { color: var(--accent-2); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
.main, .content { min-width: 0; }
.panel { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.rowline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rowline.wrap { flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.dashboard-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 22px;
    margin-bottom: 22px; padding: 22px 24px;
    background:
        radial-gradient(500px 200px at 100% 0%, rgba(110, 231, 183, .12), transparent 70%),
        linear-gradient(120deg, #0b1220, #12203a 70%);
    color: #fff; border-radius: 20px; position: relative; overflow: hidden;
    box-shadow: 0 18px 40px rgba(11, 18, 32, .18);
}
.dashboard-hero::after {
    content: ""; position: absolute; right: -60px; bottom: -110px;
    width: 300px; height: 300px; border-radius: 50%;
    border: 1px solid rgba(110, 231, 183, .18);
    box-shadow: 0 0 0 38px rgba(110, 231, 183, .035), 0 0 0 78px rgba(110, 231, 183, .02);
}
.dashboard-hero h2 { font-size: 24px; margin: 0 0 6px; color: #fff; }
.dashboard-hero p { color: #9fb0c8; margin: 0; font-size: 13px; max-width: 620px; }
.dashboard-hero .hero-date { color: var(--mint); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; margin-bottom: 9px; }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; position: relative; z-index: 1; }
.hero-actions .btn-outline { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.16); color: #e2e8f0; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }
.hero-actions .btn-primary { box-shadow: 0 8px 20px rgba(13, 148, 136, .3); }

.focus-card {
    display: flex; gap: 13px; align-items: flex-start;
    padding: 14px 16px; border-radius: 13px;
    background: linear-gradient(120deg, #f0fdfa, #f8fafc);
    border: 1px solid #ccfbf1;
}
.focus-card i { color: var(--accent-2); font-size: 18px; margin-top: 1px; }
.focus-card h4 { font-size: 12.5px; margin: 0 0 3px; }
.focus-card p { font-size: 11.5px; color: var(--muted); margin: 0; }

.space-card {
    display: flex; flex-direction: column; gap: 13px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 17px; box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.space-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15, 23, 42, .08); border-color: var(--line-strong); }
.space-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--space-color, var(--accent)); }
.space-card-head { display: flex; align-items: flex-start; gap: 11px; }
.space-avatar { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 750; font-size: 13px; color: #0b1220; background: var(--space-color, var(--mint)); flex: 0 0 36px; }
.space-card h3 { font-size: 14px; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-card .client { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-card .desc { font-size: 12px; color: var(--muted); line-height: 1.45; min-height: 34px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.progress-line { height: 5px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: 999px; background: var(--space-color, var(--accent)); transition: width .4s ease; }
.space-card-foot { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.space-card-foot .counts { display: flex; gap: 9px; }
.space-card-foot strong { color: var(--ink); font-weight: 650; }

.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { display: flex; gap: 11px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-clean li:last-child { border-bottom: 0; }
.list-clean li:first-child { padding-top: 2px; }
.item-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f1f5f9; color: var(--muted); font-size: 13px; flex: 0 0 30px; }
.item-icon.teal { background: #f0fdfa; color: var(--accent-2); }
.item-icon.amber { background: #fffbeb; color: #b45309; }
.item-icon.violet { background: #f5f3ff; color: #6d28d9; }
.item-icon.coral { background: #fff1f2; color: #be123c; }
.list-main { min-width: 0; flex: 1; }
.list-title { font-size: 12.5px; font-weight: 600; color: var(--ink); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-title:hover { color: var(--accent-2); }
.list-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list-side { font-size: 10.5px; color: var(--muted-2); text-align: right; flex-shrink: 0; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty i { font-size: 26px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.empty p { margin: 0 0 12px; font-size: 12.5px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px;
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.tab .count { font-size: 10px; background: #f1f5f9; color: var(--muted); padding: 1px 6px; border-radius: 999px; }
.tab.active .count { background: #ccfbf1; color: var(--accent-2); }

/* ---------- Tasks ---------- */
.task-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.task-toolbar .form-control, .task-toolbar .form-select { max-width: 210px; }
.task-list { display: flex; flex-direction: column; }
.task-row {
    display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px;
    border-bottom: 1px solid var(--line); transition: background .13s ease;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: #fafbfd; }
.task-check {
    width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid #cbd5e1;
    background: #fff; flex: 0 0 19px; margin-top: 1px; cursor: pointer;
    display: grid; place-items: center; color: transparent; font-size: 10px;
    transition: all .14s ease;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 600; color: var(--ink); display: inline-block; }
.task-title:hover { color: var(--accent-2); }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted-2); }
.task-desc { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.task-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-top: 1px; }
.task-due { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.task-due.overdue { color: #be123c; font-weight: 600; }
.task-due.today { color: #b45309; font-weight: 600; }
.task-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .13s ease; }
.task-row:hover .task-actions { opacity: 1; }
.task-actions .icon-btn { width: 27px; height: 27px; font-size: 13px; color: var(--muted); }
.task-actions .icon-btn:hover { background: #eef2f7; color: var(--ink); }

.quick-add { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.quick-add input { flex: 1; }

/* ---------- Kanban ---------- */
.kanban-wrap { overflow-x: auto; padding-bottom: 10px; }
.kanban-board { display: flex; gap: 13px; align-items: flex-start; min-width: max-content; }
.kanban-column {
    width: 272px; flex: 0 0 272px; background: #eef1f5;
    border: 1px solid #e4e9f0; border-radius: 14px; padding: 10px;
    transition: background .15s ease, box-shadow .15s ease;
}
.kanban-column.drag-over { background: #e0f2ef; box-shadow: inset 0 0 0 2px rgba(13, 148, 136, .28); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 5px 10px; }
.kanban-head h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #475569; margin: 0; display: flex; align-items: center; gap: 7px; }
.kanban-count { font-size: 10px; background: #fff; color: var(--muted); border-radius: 999px; padding: 1px 7px; border: 1px solid var(--line-strong); }
.kanban-cards { display: flex; flex-direction: column; gap: 8px; min-height: 46px; }
.kanban-card {
    background: #fff; border: 1px solid #e0e6ee; border-radius: 11px;
    padding: 11px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(15, 23, 42, .08); border-color: #cdd7e4; }
.kanban-card.dragging { opacity: .45; cursor: grabbing; transform: rotate(1.5deg); }
.kanban-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.kanban-space { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.kanban-space-name { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.kanban-card h4 { font-size: 12.3px; line-height: 1.35; margin: 0 0 8px; font-weight: 600; }
.kanban-card h4 a { color: var(--ink); }
.kanban-card h4 a:hover { color: var(--accent-2); }
.kanban-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-meta { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); flex-wrap: wrap; }
.kanban-empty { border: 1px dashed #cfd8e3; border-radius: 10px; padding: 16px 9px; text-align: center; color: #94a3b8; font-size: 10.5px; }
.kanban-done .kanban-card { opacity: .72; }
.kanban-done .kanban-card h4 { text-decoration: line-through; color: var(--muted); }

/* ---------- Calendar ---------- */
.calendar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.calendar-title { display: flex; align-items: center; gap: 10px; }
.calendar-title h2 { font-size: 16px; margin: 0; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 5px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekday { padding: 9px 10px; font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; background: #fafbfd; border-bottom: 1px solid var(--line); }
.calendar-day { min-height: 128px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; min-width: 0; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.out { background: #fafbfd; }
.calendar-day.today { background: #f0fdfa; box-shadow: inset 0 0 0 1px rgba(13, 148, 136, .25); }
.day-number { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 7px; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.calendar-day.today .day-number { background: var(--accent); color: #fff; }
.calendar-day.out .day-number { color: #cbd5e1; }
.day-events { display: flex; flex-direction: column; gap: 3px; }
.cal-event {
    display: block; padding: 3px 6px; border-radius: 5px;
    font-size: 9.8px; line-height: 1.3; color: #334155;
    background: color-mix(in srgb, var(--event-color, #0d9488) 11%, #fff);
    border-left: 2.5px solid var(--event-color, #0d9488);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-event:hover { background: color-mix(in srgb, var(--event-color, #0d9488) 19%, #fff); color: #0f172a; }
.cal-event.agent { border-left-style: dashed; font-style: italic; }
.cal-event.file { opacity: .9; }
.cal-event .ev-time { color: var(--muted-2); font-size: 8.5px; margin-right: 3px; }
.cal-event.overdue { box-shadow: inset 0 -1.5px 0 #fb7185; }
.cal-more { font-size: 9px; color: var(--muted-2); padding-left: 3px; }
.calendar-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 11px 18px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); }
.legend-swatch.agent { background: #8b5cf6; }
.legend-swatch.file { background: #3b82f6; }

/* ---------- Queue ---------- */
.job-row { display: flex; align-items: flex-start; gap: 13px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-row:hover { background: #fafbfd; }
.job-status-icon { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; background: #f1f5f9; color: var(--muted); }
.job-status-icon.running { background: #eff6ff; color: #1d4ed8; }
.job-status-icon.done { background: #ecfdf5; color: #047857; }
.job-status-icon.failed { background: #fff1f2; color: #be123c; }
.job-status-icon.queued { background: #f0fdfa; color: #0f766e; }
.job-main { flex: 1; min-width: 0; }
.job-title { font-size: 12.5px; font-weight: 600; }
.job-prompt { font-size: 11.5px; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.job-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; align-items: center; font-size: 10px; color: var(--muted-2); }
.job-side { text-align: right; flex-shrink: 0; }
.progress { height: 5px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress-bar { background: linear-gradient(90deg, var(--accent), var(--mint)); transition: width .35s ease; }
.progress-bar.bg-danger { background: var(--coral); }
.job-progress { width: 92px; margin-top: 7px; }
.job-output { white-space: pre-wrap; font-size: 12px; color: var(--ink-soft); background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; }
.action-list { display: flex; flex-direction: column; gap: 0; }
.action-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.action-item:last-child { border-bottom: 0; }
.action-item .ok { color: #047857; }
.action-item .fail { color: #be123c; }
.action-time { color: var(--muted-2); font-size: 10px; margin-left: auto; white-space: nowrap; }

/* ---------- Forms ---------- */
.form-label { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.form-control, .form-select {
    font-family: var(--font); font-size: 12.5px;
    border: 1px solid var(--line-strong); border-radius: 9px;
    padding: 8px 11px; color: var(--ink); background-color: #fff;
    box-shadow: none;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 148, 136, .1);
}
.form-control::placeholder { color: #a8b3c2; }
textarea.form-control { line-height: 1.55; }
.form-hint { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.form-group { margin-bottom: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-check-label { font-size: 12px; }
.input-group-text { font-size: 11px; background: #f8fafc; border-color: var(--line-strong); color: var(--muted); }

/* ---------- Space view ---------- */
.space-hero {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    padding: 22px 24px; margin-bottom: 20px; position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.space-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--space-color, var(--accent)); }
.space-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.space-hero-identity { display: flex; gap: 14px; align-items: flex-start; }
.space-hero-avatar { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--space-color, #34d399) 22%, #fff); color: #0b1220; font-weight: 750; font-size: 19px; border: 1px solid color-mix(in srgb, var(--space-color, #34d399) 35%, #fff); }
.space-hero h1 { font-size: 23px; margin: 0 0 3px; }
.space-hero .client { font-size: 12px; color: var(--muted); }
.space-hero .desc { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; max-width: 800px; }
.space-stats { display: flex; gap: 20px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.space-stat { min-width: 90px; }
.space-stat strong { display: block; font-size: 18px; letter-spacing: -.03em; }
.space-stat span { font-size: 10.5px; color: var(--muted); }
.space-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.health-callout { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; background: #fffbeb; border: 1px solid #fef3c7; color: #92400e; padding: 9px 11px; border-radius: 9px; font-size: 11.5px; }
.health-callout i { margin-top: 1px; }

.space-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.space-side { display: flex; flex-direction: column; gap: 16px; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mini-stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.mini-stat strong { display: block; font-size: 16px; }
.mini-stat span { font-size: 10px; color: var(--muted); }

/* files */
.file-row { display: flex; align-items: center; gap: 11px; padding: 10px 15px; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row:hover { background: #fafbfd; }
.file-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #f1f5f9; color: var(--muted); font-size: 14px; flex: 0 0 30px; }
.file-icon.dir { background: #fffbeb; color: #b45309; }
.file-icon.docx { background: #eff6ff; color: #1d4ed8; }
.file-icon.xlsx { background: #ecfdf5; color: #047857; }
.file-icon.pdf { background: #fff1f2; color: #be123c; }
.file-name { font-size: 12.5px; font-weight: 500; }
.file-meta { font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.file-side { margin-left: auto; display: flex; gap: 5px; align-items: center; }
.breadcrumb-path { display: flex; gap: 5px; align-items: center; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.breadcrumb-path a { color: var(--muted); }
.breadcrumb-path a:hover { color: var(--accent-2); }

/* task detail */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) 340px; gap: 18px; align-items: start; }
.detail-title { font-size: 22px; margin: 0 0 6px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.detail-section { margin-top: 20px; }
.detail-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.prose { font-size: 13px; color: var(--ink-soft); white-space: pre-wrap; line-height: 1.65; }
.ai-brief-box { background: linear-gradient(135deg, #f0fdfa, #f8fafc); border: 1px solid #ccfbf1; border-radius: 12px; padding: 14px 16px; }
.ai-brief-box .prose { font-size: 12.5px; }

/* ---------- Instructions / playbook ---------- */
.playbook-hero {
    background:
        radial-gradient(600px 240px at 95% 0%, rgba(110, 231, 183, .16), transparent 60%),
        linear-gradient(120deg, #0b1220, #14243f 75%);
    color: #fff; border-radius: 20px; padding: 30px 32px; margin-bottom: 22px;
    box-shadow: 0 20px 44px rgba(11, 18, 32, .2); position: relative; overflow: hidden;
}
.playbook-hero::after { content: ""; position: absolute; right: -80px; bottom: -140px; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(110, 231, 183, .16); box-shadow: 0 0 0 48px rgba(110, 231, 183, .03), 0 0 0 96px rgba(110, 231, 183, .018); }
.playbook-hero .kicker { color: var(--mint); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; }
.playbook-hero h1 { font-size: 30px; margin: 0 0 10px; color: #fff; letter-spacing: -.035em; max-width: 760px; }
.playbook-hero p { color: #a8b8ce; font-size: 13.5px; max-width: 760px; margin: 0; }
.playbook-stats { display: flex; gap: 26px; margin-top: 22px; position: relative; z-index: 1; flex-wrap: wrap; }
.playbook-stat strong { display: block; font-size: 22px; color: #fff; letter-spacing: -.03em; }
.playbook-stat span { font-size: 10px; color: #7f92ad; text-transform: uppercase; letter-spacing: .08em; }

.playbook-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.playbook-nav { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px; box-shadow: var(--shadow-sm); }
.playbook-nav a { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; color: var(--muted); font-size: 11.8px; font-weight: 500; }
.playbook-nav a:hover { background: #f1f5f9; color: var(--ink); }
.playbook-nav .sep { height: 1px; background: var(--line); margin: 8px 5px; }
.playbook-nav .nav-title { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; padding: 8px 9px 4px; }
.playbook-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.playbook-section { scroll-margin-top: 90px; }
.playbook-section h2 { font-size: 20px; margin: 0 0 12px; }
.playbook-section h2 .num { color: var(--muted-2); font-weight: 500; margin-right: 7px; }
.principle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.principle-card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px 16px; box-shadow: var(--shadow-sm); }
.principle-card h4 { font-size: 12.5px; margin: 0 0 5px; display: flex; align-items: center; gap: 7px; }
.principle-card p { font-size: 11.8px; color: var(--muted); margin: 0; line-height: 1.55; }
.principle-card .ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #f0fdfa; color: var(--accent-2); font-size: 13px; }
.principle-card.warn .ico { background: #fff1f2; color: #be123c; }
.principle-card.warn h4 { color: #9f1239; }

.process-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.process-head { display: flex; gap: 15px; padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.process-number { font-size: 12px; font-weight: 750; color: var(--accent-2); background: #f0fdfa; border: 1px solid #ccfbf1; border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 36px; }
.process-head h3 { font-size: 15.5px; margin: 0 0 4px; }
.process-head p { font-size: 12px; color: var(--muted); margin: 0; }
.process-badges { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.process-body { padding: 16px 20px 18px; }
.process-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.process-steps li { position: relative; padding: 0 0 14px 34px; font-size: 12.3px; color: var(--ink-soft); counter-increment: step; }
.process-steps li:last-child { padding-bottom: 0; }
.process-steps li::before {
    content: counter(step); position: absolute; left: 0; top: 0;
    width: 22px; height: 22px; border-radius: 50%;
    background: #f1f5f9; border: 1px solid var(--line-strong); color: var(--muted);
    font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
}
.process-steps li::after { content: ""; position: absolute; left: 11px; top: 24px; bottom: 2px; width: 1px; background: var(--line); }
.process-steps li:last-child::after { display: none; }
.process-steps .step-link { font-size: 10.5px; display: inline-flex; align-items: center; gap: 3px; margin-left: 5px; font-weight: 600; }
.process-outcome { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.outcome-box { background: #f8fafc; border-radius: 9px; padding: 10px 12px; }
.outcome-box span { font-size: 9px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted-2); font-weight: 600; display: block; margin-bottom: 3px; }
.outcome-box p { font-size: 11.5px; margin: 0; color: var(--ink-soft); }
.outcome-box.guard { background: #fffbeb; }
.outcome-box.guard p { color: #92400e; }

.rhythm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rhythm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.rhythm-card .day { font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); font-weight: 700; margin-bottom: 5px; }
.rhythm-card h4 { font-size: 12.5px; margin: 0 0 4px; }
.rhythm-card p { font-size: 11.3px; color: var(--muted); margin: 0; }
.kpi-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kpi-table th { text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); padding: 9px 11px; border-bottom: 1px solid var(--line); }
.kpi-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.kpi-table tr:last-child td { border-bottom: 0; }
.kpi-table td strong { color: var(--ink); }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.integration-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.integration-row:last-child { border-bottom: 0; }
.integration-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #f1f5f9; font-size: 15px; color: var(--muted); }
.integration-icon.ok { background: #ecfdf5; color: #047857; }
.integration-main { flex: 1; min-width: 0; }
.integration-main strong { font-size: 12px; display: block; }
.integration-main small { font-size: 10.5px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-result { font-size: 11px; margin-top: 8px; padding: 8px 10px; border-radius: 8px; display: none; }
.test-result.show { display: block; }
.test-result.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.test-result.fail { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* ---------- Login ---------- */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand {
    position: relative; overflow: hidden; padding: 54px 56px; color: #fff;
    background:
        radial-gradient(700px 500px at 90% 0%, rgba(13, 148, 136, .3), transparent 60%),
        radial-gradient(500px 500px at 0% 100%, rgba(139, 92, 246, .15), transparent 60%),
        linear-gradient(145deg, #0b1220, #101e35 70%, #0b1220);
    display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand::after { content: ""; position: absolute; right: -140px; bottom: -180px; width: 520px; height: 520px; border-radius: 50%; border: 1px solid rgba(110, 231, 183, .16); box-shadow: 0 0 0 60px rgba(110, 231, 183, .03), 0 0 0 120px rgba(110, 231, 183, .018); }
.auth-brand .brand { padding: 0; }
.auth-copy { position: relative; z-index: 1; max-width: 520px; }
.auth-copy .kicker { color: var(--mint); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-bottom: 14px; }
.auth-copy h1 { font-size: 38px; line-height: 1.13; letter-spacing: -.04em; color: #fff; margin: 0 0 16px; }
.auth-copy p { color: #9fb0c8; font-size: 14px; line-height: 1.65; max-width: 450px; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 11px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: #c3cfdf; }
.auth-points i { color: var(--mint); font-size: 14px; margin-top: 1px; }
.auth-foot { color: #66748c; font-size: 10.5px; position: relative; z-index: 1; }
.auth-panel { display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card h2 { font-size: 24px; margin: 0 0 5px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 24px; }
.auth-error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; padding: 10px 12px; border-radius: 9px; font-size: 12px; margin-bottom: 15px; }

/* ---------- Utilities / responsive ---------- */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font-size: 14px; margin: 0; }
.section-title .muted { font-size: 11px; color: var(--muted); }
.badge-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f1f5f9; color: var(--muted); font-size: 10px; font-weight: 600; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 6px !important; } .mt-2 { margin-top: 12px !important; } .mt-3 { margin-top: 18px !important; } .mt-4 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 6px !important; } .mb-2 { margin-bottom: 12px !important; } .mb-3 { margin-bottom: 18px !important; } .mb-4 { margin-bottom: 24px !important; }
.w-100 { width: 100%; }
.flex { display: flex; } .flex-1 { flex: 1; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 6px; } .gap-2 { gap: 12px; }
.nowrap { white-space: nowrap; }
.hr-soft { border: 0; border-top: 1px solid var(--line); margin: 15px 0; }

@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .space-layout { grid-template-columns: minmax(0, 1fr) 290px; }
    .playbook-layout { grid-template-columns: 210px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: none; }
    .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 18, 32, .48); z-index: 1035; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
    .main { margin-left: 0; }
    .mobile-menu { display: inline-grid; }
    .grid-2, .detail-grid, .space-layout, .settings-grid { grid-template-columns: 1fr; }
    .space-side { order: 2; }
    .topbar { padding: 13px 20px; }
    .content { padding: 20px 20px 48px; }
    .playbook-layout { grid-template-columns: 1fr; }
    .playbook-nav { position: static; display: flex; gap: 4px; overflow-x: auto; padding: 7px; }
    .playbook-nav .nav-title, .playbook-nav .sep { display: none; }
    .playbook-nav a { white-space: nowrap; }
}
@media (max-width: 760px) {
    .topbar { flex-wrap: wrap; }
    .topbar-actions { width: 100%; justify-content: flex-end; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3, .grid-4, .principle-grid, .rhythm-grid, .form-grid, .form-grid.three, .process-outcome { grid-template-columns: 1fr; }
    .dashboard-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
    .dashboard-hero h2 { font-size: 21px; }
    .hero-actions { width: 100%; }
    .calendar-grid { min-width: 720px; }
    .calendar-card { overflow-x: auto; }
    .space-hero { padding: 18px; }
    .space-hero-top { flex-direction: column; }
    .playbook-hero { padding: 24px 20px; }
    .playbook-hero h1 { font-size: 24px; }
    .process-head { flex-wrap: wrap; }
    .process-badges { margin-left: 0; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-panel { min-height: 100vh; }
    .task-row { flex-wrap: wrap; }
    .task-side { width: 100%; justify-content: flex-end; }
    .page-heading h1 { font-size: 19px; }
    .kpi-value { font-size: 22px; }
    .cal-event:nth-child(n+3) { display: none; }
}

/* ---------- File manager / comments ---------- */
.file-menu { min-width: 245px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(15,23,42,.14); }
.file-menu .dropdown-item { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 10px; border-radius: 7px; }
.file-menu .dropdown-item i { width: 16px; color: var(--muted); }
.file-menu .dropdown-item:hover { background: #f1f5f9; }
.file-menu .dropdown-divider { margin: 5px 0; }
.file-comment-snippet { margin-top: 4px; font-size: 10.5px; color: var(--muted); background: #f8fafc; border-radius: 6px; padding: 3px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-comment-snippet strong { color: var(--ink-soft); }
.comment-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-item:first-child { padding-top: 2px; }
.comment-body { font-size: 12.5px; color: var(--ink-soft); white-space: pre-wrap; line-height: 1.55; margin-top: 6px; }
.comment-mini { padding: 11px 0; border-bottom: 1px solid var(--line); }
.comment-mini:last-child { border-bottom: 0; }
.comment-mini-author { font-size: 10px; color: var(--muted-2); margin-top: 3px; }
.comment-mini-body { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Public share ---------- */
.public-body { background: radial-gradient(700px 400px at 95% 0%, rgba(13,148,136,.12), transparent 60%), #f4f6f9; min-height: 100vh; }
.public-shell { max-width: 900px; margin: 0 auto; padding: 28px 20px 56px; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: linear-gradient(120deg,#0b1220,#12203a); border-radius: 18px; padding: 16px 20px; box-shadow: 0 16px 38px rgba(11,18,32,.2); }
.public-header .brand { padding: 0; }
.public-main { margin-top: 20px; }
.public-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); overflow: visible; }
.public-file-head { display: flex; align-items: center; gap: 15px; padding: 22px; flex-wrap: wrap; }
.public-file-head h1 { font-size: 22px; margin: 0 0 3px; letter-spacing: -.03em; }
.public-breadcrumb { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--muted); background: #fafbfd; padding: 10px 22px; border-top: 1px solid var(--line); }
.public-breadcrumb a { color: var(--muted); }
.public-foot { text-align: center; color: var(--muted-2); font-size: 10.5px; margin-top: 22px; }
@media (max-width: 640px) {
    .public-file-head { align-items: flex-start; }
    .public-file-head .btn { font-size: 11px; }
    .public-shell { padding: 14px 12px 40px; }
}

/* ---------- ONLYOFFICE editor shell ---------- */
.editor-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 210px);
    min-height: 520px;
}
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}
.editor-back { flex: 0 0 auto; }
.editor-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.editor-title strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-subtitle { font-size: 10px; color: var(--muted); }
.editor-actions { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.editor-canvas { flex: 1 1 auto; min-height: 0; position: relative; background: #fff; }
.editor-canvas iframe { width: 100%; height: 100%; border: 0; display: block; }
.editor-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; gap: 8px; background: #fff; z-index: 2; }

.editor-shell.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 3000;
    height: 100vh;
    min-height: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
}
.editor-shell.is-fullscreen .editor-toolbar {
    padding: 7px 12px;
    background: #0b1220;
    border-bottom-color: #1e293b;
    color: #fff;
}
.editor-shell.is-fullscreen .editor-title strong { color: #fff; }
.editor-shell.is-fullscreen .editor-subtitle { color: #94a3b8; }
.editor-shell.is-fullscreen .editor-back { color: #cbd5e1; }
.editor-shell.is-fullscreen .editor-back:hover { background: rgba(255,255,255,.08); color: #fff; }
.editor-shell.is-fullscreen .btn-outline { background: transparent; border-color: #334155; color: #cbd5e1; }
.editor-shell.is-fullscreen .btn-soft { background: rgba(255,255,255,.08); color: #e2e8f0; }
body.editor-fullscreen-body { overflow: hidden; }

@media (max-width: 760px) {
    .editor-shell { height: calc(100vh - 250px); min-height: 420px; }
    .editor-title { display: none; }
    .editor-actions .btn span { display: none; }
}

/* Fullscreen: leave only back and minimize navigation icons. */
.editor-shell.is-fullscreen .editor-title { display: none; }
.editor-shell.is-fullscreen .editor-actions .btn-outline { display: none; }
.editor-shell.is-fullscreen .editor-back span,
.editor-shell.is-fullscreen [data-editor-exit] span { display: none; }
.editor-shell.is-fullscreen .editor-toolbar { justify-content: space-between; }
