/* ==========================================================================
   Projexa – design system
   Jégmadár (Alcedo atthis): fémes kék hát, türkiz derék, narancs-rozsdás has, mély kékeszöld szárny.
   Light / dark: data-theme="light|dark" a <html>-en, egyébként a rendszer beállítása.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --blue: #0a85c2; --blue-600: #076a9c; --blue-700: #075580; --blue-900: #062330;
    --teal: #17b8c4; --teal-600: #0f9aa5;
    --orange: #ef7d2b; --orange-600: #d4651a; --orange-300: #ffb26b;
    --green: #12a27a; --red: #e0475b; --violet: #6c5ce7; --amber: #f2b33d;

    --c1: #0a85c2; --c2: #17b8c4; --c3: #ef7d2b; --c4: #6c5ce7; --c5: #12a27a; --c6: #e0475b; --c7: #075580; --c8: #f2b33d;

    --grad: linear-gradient(135deg, #075580 0%, #0a85c2 48%, #17b8c4 100%);
    --grad-deep: linear-gradient(150deg, #04161f 0%, #062330 35%, #075580 100%);
    --grad-warm: linear-gradient(135deg, #0a85c2 0%, #17b8c4 55%, #ef7d2b 120%);
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
    --r: 16px; --r-s: 10px; --r-xs: 7px;
    --side: 264px;

    color-scheme: light;
    --bg: #f1f5f8; --bg-2: #e9f0f4;
    --surface: #ffffff; --surface-2: #f6f9fb; --surface-3: #eef4f7;
    --border: #e0e9ee; --border-2: #cdd9e0;
    --ink: #0b1c24; --ink-2: #2a4250; --muted: #5c7482; --muted-2: #8ea2ae;
    --track: #e6eef2;
    --primary: var(--blue); --primary-ink: #fff;
    --primary-50: #e8f4fb; --primary-100: #cfe8f5;
    --hover: #f3f8fb;
    --topbar: rgba(241, 245, 248, .8);
    --ok-bg: #e7f7f1; --ok-bd: #a6e0cc; --ok-ink: #0a6b51;
    --warn-bg: #fff3e8; --warn-bd: #f7c9a1; --warn-ink: #a84d0e;
    --danger-bg: #fdecef; --danger-bd: #f4bac4; --danger-ink: #a5243a;
    --info-bg: #e8f4fb; --info-bd: #cfe8f5; --info-ink: #075580;
    --violet-bg: #efedfd; --violet-ink: #4b3fc2; --teal-bg: #e3f7f8; --teal-ink: #0b7780; --orange-bg: #fff1e6; --orange-ink: #b4520f;
    --sh-xs: 0 1px 2px rgba(6, 35, 48, .05);
    --sh-s: 0 1px 2px rgba(6, 35, 48, .04), 0 4px 14px -4px rgba(6, 35, 48, .08);
    --sh-m: 0 2px 4px rgba(6, 35, 48, .04), 0 14px 34px -10px rgba(6, 35, 48, .18);
    --sh-l: 0 30px 70px -18px rgba(6, 35, 48, .35);
    --ring: 0 0 0 3px rgba(10, 133, 194, .25);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #061118; --bg-2: #08161e;
    --surface: #0c1c24; --surface-2: #10232d; --surface-3: #142b36;
    --border: #1a313c; --border-2: #25414e;
    --ink: #e4f1f6; --ink-2: #bdd2db; --muted: #86a2af; --muted-2: #5b7886;
    --track: #16303b;
    --primary: #2aa7e0; --primary-50: rgba(42, 167, 224, .12); --primary-100: rgba(42, 167, 224, .24);
    --hover: rgba(42, 167, 224, .06);
    --topbar: rgba(6, 17, 24, .78);
    --ok-bg: rgba(18, 162, 122, .14); --ok-bd: rgba(18, 162, 122, .36); --ok-ink: #5fd4af;
    --warn-bg: rgba(239, 125, 43, .14); --warn-bd: rgba(239, 125, 43, .38); --warn-ink: #f6a76c;
    --danger-bg: rgba(224, 71, 91, .14); --danger-bd: rgba(224, 71, 91, .38); --danger-ink: #f28a99;
    --info-bg: rgba(42, 167, 224, .12); --info-bd: rgba(42, 167, 224, .3); --info-ink: #7fcbee;
    --violet-bg: rgba(108, 92, 231, .16); --violet-ink: #b3aaf7; --teal-bg: rgba(23, 184, 196, .14); --teal-ink: #6fdbe3; --orange-bg: rgba(239, 125, 43, .14); --orange-ink: #f6a76c;
    --sh-xs: 0 1px 2px rgba(0, 0, 0, .3);
    --sh-s: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px -4px rgba(0, 0, 0, .4);
    --sh-m: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 34px -10px rgba(0, 0, 0, .55);
    --sh-l: 0 30px 70px -18px rgba(0, 0, 0, .75);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #061118; --bg-2: #08161e;
        --surface: #0c1c24; --surface-2: #10232d; --surface-3: #142b36;
        --border: #1a313c; --border-2: #25414e;
        --ink: #e4f1f6; --ink-2: #bdd2db; --muted: #86a2af; --muted-2: #5b7886;
        --track: #16303b;
        --primary: #2aa7e0; --primary-50: rgba(42, 167, 224, .12); --primary-100: rgba(42, 167, 224, .24);
        --hover: rgba(42, 167, 224, .06);
        --topbar: rgba(6, 17, 24, .78);
        --ok-bg: rgba(18, 162, 122, .14); --ok-bd: rgba(18, 162, 122, .36); --ok-ink: #5fd4af;
        --warn-bg: rgba(239, 125, 43, .14); --warn-bd: rgba(239, 125, 43, .38); --warn-ink: #f6a76c;
        --danger-bg: rgba(224, 71, 91, .14); --danger-bd: rgba(224, 71, 91, .38); --danger-ink: #f28a99;
        --info-bg: rgba(42, 167, 224, .12); --info-bd: rgba(42, 167, 224, .3); --info-ink: #7fcbee;
        --violet-bg: rgba(108, 92, 231, .16); --violet-ink: #b3aaf7; --teal-bg: rgba(23, 184, 196, .14); --teal-ink: #6fdbe3; --orange-bg: rgba(239, 125, 43, .14); --orange-ink: #f6a76c;
        --sh-xs: 0 1px 2px rgba(0, 0, 0, .3);
        --sh-s: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px -4px rgba(0, 0, 0, .4);
        --sh-m: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 34px -10px rgba(0, 0, 0, .55);
        --sh-l: 0 30px 70px -18px rgba(0, 0, 0, .75);
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 750; font-family: var(--font-display); }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0 0 .8em; }
img, svg { vertical-align: middle; }
.ic { flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
::selection { background: rgba(10, 133, 194, .22); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 8px; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .gap-s { gap: 4px; } .gap-l { gap: 16px; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; } .m0 { margin: 0; }
.ok-ink { color: var(--ok-ink); } .warn-ink { color: var(--warn-ink); } .danger-ink { color: var(--danger-ink); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; color: inherit; }
.logo-mark { border-radius: 11px; filter: drop-shadow(0 4px 10px rgba(10, 133, 194, .35)); }
.logo__word { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -.03em; color: var(--ink); }
.logo__word b { font-weight: 700; background: linear-gradient(135deg, #ffb26b, #e2611c); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--grad-deep); color: #cfe3ec; overflow: hidden; z-index: 40; }
.side::before { content: ''; position: absolute; inset: auto -40% -30% -40%; height: 60%; background: radial-gradient(closest-side, rgba(23, 184, 196, .22), transparent 70%); pointer-events: none; }
.side::after { content: ''; position: absolute; top: -120px; right: -120px; width: 260px; height: 260px; background: radial-gradient(closest-side, rgba(239, 125, 43, .16), transparent 70%); pointer-events: none; }
.side__head { padding: 18px 18px 10px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.side__head .logo__word { color: #fff; }
.side__tenant { margin: 4px 14px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); position: relative; z-index: 1; }
.side__tenant b { display: block; color: #fff; font-size: 13px; font-weight: 650; }
.side__tenant span { font-size: 11.5px; color: #8fb3c4; }
.side__nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; position: relative; z-index: 1; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.side__group { margin-top: 14px; }
.side__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #6f97a9; font-weight: 700; padding: 0 10px 6px; }
.side__link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: #c4dbe5; font-weight: 520; font-size: 13.5px; text-decoration: none !important; position: relative; transition: background .15s, color .15s; }
.side__link .ic { opacity: .82; }
.side__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side__link.is-active { background: linear-gradient(90deg, rgba(23, 184, 196, .22), rgba(10, 133, 194, .12)); color: #fff; box-shadow: inset 0 0 0 1px rgba(23, 184, 196, .25); }
.side__link.is-active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(#17b8c4, #ef7d2b); }
.side__link .lock { margin-left: auto; opacity: .55; }
.side__count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--orange); color: #fff; border-radius: 20px; padding: 1px 7px; }
.side__foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 11.5px; color: #6f97a9; position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.side__foot a { color: #9cc3d3; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--topbar); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.top__burger { display: none; }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; text-align: left; box-shadow: var(--sh-xs); }
.search-trigger:hover { border-color: var(--border-2); }
.search-trigger kbd { margin-left: auto; }
kbd { font-family: inherit; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface); border-color: var(--border); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex-shrink: 0; letter-spacing: .02em; }
.avatar--s { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.avatar--l { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.avatars { display: flex; } .avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; } .avatars .avatar:first-child { margin-left: 0; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--ink); font: inherit; }
.user-btn:hover { background: var(--surface); border-color: var(--border); }
.user-btn span { font-weight: 600; font-size: 13px; }

.content { padding: 24px 28px 48px; width: 100%; max-width: 1560px; margin: 0 auto; flex: 1; }
.trial-bar { display: flex; align-items: center; gap: 12px; padding: 9px 28px; background: linear-gradient(90deg, #062330, #075580 60%, #0a85c2); color: #dff2fa; font-size: 13px; }
.trial-bar b { color: #fff; } .trial-bar .btn { margin-left: auto; }
.trial-bar .meter { width: 120px; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.trial-bar .meter i { display: block; height: 100%; background: linear-gradient(90deg, #17b8c4, #ffb26b); }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head__title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-head__icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 8px 22px -8px rgba(10, 133, 194, .65); flex-shrink: 0; }
.page-head__sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); }

/* ---------- Buttons ---------- */
.btn { --b: var(--border); display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--b); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .08s, box-shadow .15s, background .15s, border-color .15s; box-shadow: var(--sh-xs); }
.btn:hover { border-color: var(--border-2); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(10, 133, 194, .7), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn--primary:hover { background: var(--grad); filter: brightness(1.06); border-color: transparent; }
.btn--accent { background: linear-gradient(135deg, #ffb26b, #e2611c); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(226, 97, 28, .7); }
.btn--accent:hover { filter: brightness(1.05); background: linear-gradient(135deg, #ffb26b, #e2611c); }
.btn--danger { color: var(--danger-ink); border-color: var(--danger-bd); background: var(--danger-bg); }
.btn--danger:hover { background: var(--danger-bg); border-color: var(--red); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn--ghost:hover { background: var(--hover); border-color: transparent; }
.btn--s { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn--xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 8px; }
.btn--l { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn--icon { width: 38px; padding: 0; } .btn--s.btn--icon { width: 30px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: 11px; padding: 3px; background: var(--surface-2); gap: 2px; }
.btn-group a, .btn-group button { height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--muted); text-decoration: none !important; border: 0; background: none; cursor: pointer; font-family: inherit; }
.btn-group a:hover, .btn-group button:hover { color: var(--ink); }
.btn-group .is-active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-s); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-s); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 0; }
.card__head h2, .card__head h3 { display: flex; align-items: center; gap: 8px; }
.card__head .ic { color: var(--primary); }
.card__body { padding: 16px 18px 18px; }
.card__foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.card--flush .card__body { padding: 0; }
.card--glow { position: relative; overflow: hidden; }
.card--glow::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, rgba(23, 184, 196, .6), transparent 40%, rgba(239, 125, 43, .45)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; padding: 16px 18px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-s); text-decoration: none !important; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-m); }
.kpi__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__label { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi__icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.kpi__icon--teal { background: var(--teal-bg); color: var(--teal-ink); } .kpi__icon--orange { background: var(--orange-bg); color: var(--orange-ink); }
.kpi__icon--green { background: var(--ok-bg); color: var(--ok-ink); } .kpi__icon--red { background: var(--danger-bg); color: var(--danger-ink); } .kpi__icon--violet { background: var(--violet-bg); color: var(--violet-ink); }
.kpi__value { font-family: var(--font-display); font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi__value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi__meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.kpi .spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42px; opacity: .9; pointer-events: none; }
.kpi--spark { padding-bottom: 46px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 20px; }
.delta--up { color: var(--ok-ink); background: var(--ok-bg); } .delta--down { color: var(--danger-ink); background: var(--danger-bg); } .delta--flat { color: var(--muted); background: var(--surface-3); }

/* ---------- Badges / chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; white-space: nowrap; border: 1px solid transparent; background: var(--surface-3); color: var(--ink-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge--plain::before { display: none; }
.badge--ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-bd); }
.badge--warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-bd); }
.badge--danger { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-bd); }
.badge--info, .badge--primary { background: var(--info-bg); color: var(--info-ink); border-color: var(--info-bd); }
.badge--violet { background: var(--violet-bg); color: var(--violet-ink); }
.badge--teal { background: var(--teal-bg); color: var(--teal-ink); }
.badge--orange { background: var(--orange-bg); color: var(--orange-ink); }
.badge--neutral { background: var(--surface-3); color: var(--muted); border-color: var(--border); }
.prio { display: inline-flex; width: 8px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.prio--low { background: var(--muted-2); } .prio--normal { background: var(--blue); } .prio--high { background: var(--orange); } .prio--urgent, .prio--critical { background: var(--red); box-shadow: 0 0 0 3px var(--danger-bg); }
.tag { display: inline-block; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.color-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 6px; background: var(--track); overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; border-radius: 6px; background: var(--grad); }
.progress--warm i { background: linear-gradient(90deg, #17b8c4, #ef7d2b); }
.progress--danger i { background: linear-gradient(90deg, #ef7d2b, #e0475b); }
.progress--ok i { background: linear-gradient(90deg, #17b8c4, #12a27a); }
.progress .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 2px; opacity: .55; }
.progress--l { height: 12px; border-radius: 8px; }
.stackbar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--track); gap: 2px; }
.stackbar i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .gl { stroke: var(--border); stroke-dasharray: 3 4; stroke-width: 1; }
.chart .axis { fill: var(--muted-2); font-size: 11px; font-family: var(--font); }
.donut__v { fill: var(--ink); font-size: 22px; font-weight: 750; font-family: var(--font-display); }
.donut__s { fill: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.gauge { width: 100%; max-width: 220px; }
.gauge__v { fill: var(--ink); font-size: 26px; font-weight: 750; font-family: var(--font-display); }
.gauge__s { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-list { flex: 1; min-width: 150px; display: grid; gap: 7px; font-size: 13px; }
.donut-list div { display: flex; align-items: center; gap: 8px; }
.donut-list b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.t th:first-child { border-top-left-radius: var(--r); } .t th:last-child { border-top-right-radius: var(--r); }
.t th a { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tbody tr { transition: background .1s; }
.t tbody tr:hover { background: var(--hover); }
.t tbody tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.t .row-link { color: var(--ink); font-weight: 600; }
.t .row-link:hover { color: var(--primary); }
.t--compact td, .t--compact th { padding: 8px 12px; }
.t .actions { display: flex; gap: 4px; justify-content: flex-end; }
.row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
tr.is-muted td { opacity: .55; }
tr.is-danger td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.is-warn td:first-child { box-shadow: inset 3px 0 0 var(--orange); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--span2 { grid-column: span 2; } .field--span3, .field--full { grid-column: 1 / -1; }
.field > label, .label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.field .req { color: var(--orange); }
.field .help { font-size: 12px; color: var(--muted); }
.field .err, .err { font-size: 12px; color: var(--danger-ink); font-weight: 600; }
.input, .select, .textarea, input[type=text].input, input[type=email].input { width: 100%; height: 40px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--border-2); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s; box-shadow: inset 0 1px 2px rgba(6, 35, 48, .03); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c7482' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select[multiple] { height: auto; min-height: 120px; padding: 6px; background-image: none; }
.input--s, .select--s { height: 32px; font-size: 13px; border-radius: 9px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 11px 11px 0; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 550; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 20px; background: var(--border-2); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section { margin-top: 22px; }
.form-section > h3 { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; color: var(--ink-2); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { height: 36px; width: auto; min-width: 160px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search .input { width: 100%; padding-left: 36px; }
.toolbar .search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Alerts / flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-weight: 520; animation: slide-in .3s ease; }
.flash--success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-ink); }
.flash--error { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger-ink); }
.flash--warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-ink); }
.flash--info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-ink); }
.flash .x { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.alert-list { display: grid; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-decoration: none !important; color: inherit; transition: border-color .15s, transform .15s; position: relative; }
.alert:hover { border-color: var(--border-2); transform: translateX(2px); }
.alert__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.alert--critical .alert__icon { background: var(--danger-bg); color: var(--danger-ink); }
.alert--warning .alert__icon { background: var(--warn-bg); color: var(--warn-ink); }
.alert--info .alert__icon { background: var(--info-bg); color: var(--info-ink); }
.alert--critical { border-left: 3px solid var(--red); } .alert--warning { border-left: 3px solid var(--orange); } .alert--info { border-left: 3px solid var(--blue); }
.alert .grow { min-width: 0; }
.alert__title { font-weight: 650; font-size: 13.5px; } .alert__text { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.alert__x { margin-left: auto; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; font-size: 13.5px; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { font-size: 11px; background: var(--surface-3); color: var(--muted); padding: 0 7px; border-radius: 10px; }

/* ---------- Dropdown / popover ---------- */
.dd { position: relative; }
.dd__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--sh-l); padding: 6px; z-index: 60; display: none; }
.dd.is-open .dd__menu { display: block; animation: pop .14s ease; }
.dd__menu a, .dd__menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none !important; }
.dd__menu a:hover, .dd__menu button:hover { background: var(--hover); }
.dd__menu hr { margin: 6px 0; }
.dd__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dd__menu--wide { width: 380px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Dialog ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--sh-l); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog.modal--wide { width: min(860px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(4, 18, 26, .55); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: pop .18s ease; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal__body { padding: 16px 20px; overflow-y: auto; max-height: calc(100vh - 200px); }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); }

/* ---------- Command palette ---------- */
.palette { width: min(660px, calc(100vw - 24px)); }
.palette__input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette__input input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.palette__results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.palette__group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; display: flex; gap: 6px; align-items: center; }
.palette__item { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none !important; }
.palette__item small { color: var(--muted); }
.palette__item:hover, .palette__item.is-active { background: var(--primary-50); }
.palette__empty { padding: 26px; text-align: center; color: var(--muted); }

/* ---------- Lists / misc ---------- */
.list { display: grid; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); text-decoration: none !important; color: inherit; min-width: 0; }
.list__item:first-child { border-top: 0; }
a.list__item:hover { background: var(--hover); }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty__icon { width: 56px; height: 56px; border-radius: 18px; display: inline-grid; place-items: center; background: var(--primary-50); color: var(--primary); margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); font-weight: 550; }
.dl dd { margin: 0; font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.stat-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stat-row > div { display: flex; flex-direction: column; }
.stat-row b { font-family: var(--font-display); font-size: 20px; font-variant-numeric: tabular-nums; }
.stat-row span { font-size: 12px; color: var(--muted); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline__item { position: relative; padding-bottom: 16px; }
.timeline__item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.timeline__item--ok::before { border-color: var(--green); } .timeline__item--warn::before { border-color: var(--orange); } .timeline__item--danger::before { border-color: var(--red); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-2); font-size: 13px; color: var(--ink-2); }
.callout { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--r); background: linear-gradient(120deg, var(--primary-50), transparent 70%), var(--surface); border: 1px solid var(--info-bd); }
.prose { line-height: 1.65; }
.prose h2 { margin: 24px 0 8px; font-size: 18px; } .prose h3 { margin: 18px 0 6px; } .prose ul { padding-left: 20px; } .prose li { margin: 3px 0; }
.prose code { font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager__links { display: flex; gap: 4px; }
.pager__links a, .pager__links span { min-width: 32px; height: 32px; padding: 0 8px; display: grid; place-items: center; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); text-decoration: none !important; border: 1px solid transparent; }
.pager__links a:hover { background: var(--hover); border-color: var(--border); }
.pager__links .is-active { background: var(--primary); color: #fff; }
.pager__links .is-disabled { opacity: .4; }

/* ---------- Project cards ---------- */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pcard { position: relative; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-s); display: flex; flex-direction: column; gap: 12px; text-decoration: none !important; color: inherit; transition: transform .15s, box-shadow .15s; overflow: hidden; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--sh-m); }
.pcard::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--pc, var(--blue)); }
.pcard__code { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.pcard__title { font-weight: 700; font-size: 15.5px; line-height: 1.3; margin-top: 2px; }
.pcard__meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pcard__meta span { display: inline-flex; align-items: center; gap: 5px; }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }

/* ---------- Kanban ---------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 230px); }
.col__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); }
.col__head .n { margin-left: auto; font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 8px; color: var(--muted); }
.col__body { padding: 10px; display: grid; gap: 9px; overflow-y: auto; align-content: start; flex: 1; min-height: 80px; }
.col.is-over { border-color: var(--primary); background: var(--primary-50); }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; box-shadow: var(--sh-xs); cursor: grab; display: grid; gap: 8px; position: relative; }
.tcard:hover { border-color: var(--border-2); box-shadow: var(--sh-s); }
.tcard.is-dragging { opacity: .45; }
.tcard__title { font-weight: 600; font-size: 13.5px; line-height: 1.35; color: var(--ink); text-decoration: none !important; }
.tcard__project { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tcard__foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tcard__foot .due { margin-left: auto; font-weight: 600; }
.due--late { color: var(--danger-ink) !important; } .due--soon { color: var(--warn-ink) !important; }

/* ---------- Gantt ---------- */
.gantt { position: relative; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.gantt__wrap { display: grid; grid-template-columns: 280px 1fr; }
.gantt__names { border-right: 1px solid var(--border); background: var(--surface-2); }
.gantt__scroll { overflow-x: auto; position: relative; }
.gantt__head { height: 52px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface-2); z-index: 2; }
.gantt__row { height: 38px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 12px; gap: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; }
.gantt__row--phase { font-weight: 700; background: var(--surface-3); }
.gantt__row--milestone { font-weight: 650; color: var(--orange-ink); }
.gantt__row a { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.gantt__canvas { position: relative; }
.gantt__bar { position: absolute; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #0a85c2, #17b8c4); box-shadow: 0 3px 10px -4px rgba(10, 133, 194, .7); cursor: grab; display: flex; align-items: center; overflow: hidden; color: #fff; font-size: 11px; font-weight: 650; padding: 0 8px; white-space: nowrap; user-select: none; }
.gantt__bar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .28); pointer-events: none; }
.gantt__bar span { position: relative; }
.gantt__bar--phase { height: 10px; border-radius: 3px; background: var(--ink-2); box-shadow: none; cursor: default; padding: 0; }
.gantt__bar--done { background: linear-gradient(135deg, #12a27a, #17b8c4); }
.gantt__bar--late { background: linear-gradient(135deg, #ef7d2b, #e0475b); }
.gantt__bar--blocked { background: repeating-linear-gradient(135deg, #e0475b, #e0475b 6px, #c22f44 6px, #c22f44 12px); }
.gantt__bar--project { background: var(--pc, linear-gradient(135deg, #0a85c2, #17b8c4)); }
.gantt__baseline { position: absolute; height: 5px; border-radius: 3px; background: var(--muted-2); opacity: .55; pointer-events: none; }
.gantt__ms { position: absolute; width: 14px; height: 14px; transform: rotate(45deg); background: linear-gradient(135deg, #ffb26b, #e2611c); border-radius: 3px; }
.gantt__today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); z-index: 1; pointer-events: none; }
.gantt__today::before { content: attr(data-label); position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--orange-ink); background: var(--surface); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.gantt__month { position: absolute; top: 0; height: 26px; border-left: 1px solid var(--border); font-size: 11.5px; font-weight: 700; padding: 5px 8px; color: var(--ink-2); white-space: nowrap; }
.gantt__day { position: absolute; top: 26px; height: 26px; font-size: 10.5px; color: var(--muted-2); text-align: center; line-height: 26px; }
.gantt__gridline { position: absolute; top: 52px; bottom: 0; width: 1px; background: var(--border); opacity: .6; }
.gantt__weekend { position: absolute; top: 52px; bottom: 0; background: var(--surface-2); }
.gantt__dep { position: absolute; pointer-events: none; overflow: visible; }
.gantt__dep path { fill: none; stroke: var(--muted-2); stroke-width: 1.4; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--border); gap: 1px; }
.cal__dow { background: var(--surface-2); padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal__day { background: var(--surface); min-height: 118px; padding: 6px 7px; display: flex; flex-direction: column; gap: 3px; text-decoration: none !important; color: inherit; min-width: 0; }
.cal__day:hover { background: var(--hover); }
.cal__day.is-out { background: var(--surface-2); } .cal__day.is-out .cal__n { color: var(--muted-2); }
.cal__day.is-today .cal__n { background: var(--grad); color: #fff; }
.cal__day.is-selected { box-shadow: inset 0 0 0 2px var(--primary); }
.cal__n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.cal__ev { font-size: 11.5px; padding: 2px 6px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; background: var(--info-bg); color: var(--info-ink); }
.cal__ev--task { background: var(--surface-3); color: var(--ink-2); border-left: 3px solid var(--ec, var(--blue)); }
.cal__ev--comm { background: var(--teal-bg); color: var(--teal-ink); }
.cal__ev--delivery { background: var(--orange-bg); color: var(--orange-ink); }
.cal__ev--deadline { background: var(--danger-bg); color: var(--danger-ink); }
.cal__more { font-size: 11px; color: var(--muted); padding-left: 6px; }

/* ---------- Agenda ---------- */
.agenda-day { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.agenda-day:first-child { border-top: 0; }
.agenda-day__date b { font-family: var(--font-display); font-size: 26px; line-height: 1; display: block; }
.agenda-day__date span { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.agenda-day.is-today .agenda-day__date b { color: var(--primary); }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 7px; }
.agenda-item__kind { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.k-task { background: var(--info-bg); color: var(--info-ink); } .k-event { background: var(--violet-bg); color: var(--violet-ink); } .k-comm { background: var(--teal-bg); color: var(--teal-ink); }
.k-delivery { background: var(--orange-bg); color: var(--orange-ink); } .k-receipt { background: var(--ok-bg); color: var(--ok-ink); } .k-milestone { background: var(--warn-bg); color: var(--warn-ink); } .k-invoice { background: var(--danger-bg); color: var(--danger-ink); }
.task-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--border-2); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: transparent; flex-shrink: 0; padding: 0; }
.task-check:hover { border-color: var(--green); color: var(--green); }
.task-check.is-done { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Line editor ---------- */
.lines { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.lines th { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: 0 6px; }
.lines td { padding: 0 3px; vertical-align: top; }
.lines .input, .lines .select { height: 36px; font-size: 13px; padding: 0 9px; }
.lines .line-total { text-align: right; font-weight: 650; padding-top: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals { margin-left: auto; width: min(360px, 100%); display: grid; gap: 6px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 19px; font-weight: 750; font-family: var(--font-display); padding-top: 8px; border-top: 1px solid var(--border); }

/* ---------- Permission matrix ---------- */
.perm-matrix td, .perm-matrix th { text-align: center; }
.perm-matrix td:first-child, .perm-matrix th:first-child { text-align: left; }
.perm-matrix input { width: 17px; height: 17px; accent-color: var(--primary); }

/* ---------- Upgrade / plan ---------- */
.upgrade { max-width: 680px; margin: 40px auto; text-align: center; padding: 40px; border-radius: 24px; background: radial-gradient(120% 80% at 50% 0%, var(--primary-50), transparent 70%), var(--surface); border: 1px solid var(--border); box-shadow: var(--sh-m); }
.plan-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-tile { border: 1px solid var(--border); border-radius: var(--r); padding: 18px; background: var(--surface); position: relative; }
.plan-tile.is-current { border-color: var(--primary); box-shadow: var(--ring); }
.plan-tile.is-popular::before { content: attr(data-badge); position: absolute; top: -10px; right: 14px; font-size: 11px; font-weight: 750; padding: 2px 10px; border-radius: 20px; background: linear-gradient(135deg, #ffb26b, #e2611c); color: #fff; }
.plan-tile__price { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 8px 0 2px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--sh-l); font-weight: 600; font-size: 13.5px; animation: slide-in .25s ease; max-width: 380px; }
.toast--error { background: var(--red); color: #fff; }

/* ---------- Auth (in-app) ---------- */
.auth-card { max-width: 460px; margin: 40px auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-main, .g-main-r { grid-template-columns: minmax(0, 1fr); }
    .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--sh-l); }
    body.nav-open .side { transform: none; }
    body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(4, 18, 26, .5); z-index: 35; }
    .top__burger { display: inline-grid; }
    .top, .content { padding-left: 16px; padding-right: 16px; }
    .trial-bar { padding: 9px 16px; flex-wrap: wrap; }
    .g2, .g3, .plan-tiles { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid--2, .form-grid--4 { grid-template-columns: minmax(0, 1fr); }
    .field--span2 { grid-column: auto; }
    .gantt__wrap { grid-template-columns: 170px 1fr; }
    .user-btn span { display: none; }
    .search-trigger kbd { display: none; }
    .agenda-day { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 600px) {
    .g4 { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi__value { font-size: 21px; }
    .page-head__icon { display: none; }
    .cal__day { min-height: 74px; } .cal__ev { font-size: 10px; padding: 1px 4px; }
    .dd__menu--wide { width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
    .side, .top, .trial-bar, .page-head__actions, .toolbar, .btn { display: none !important; }
    .shell { display: block; } .content { padding: 0; } .card { box-shadow: none; break-inside: avoid; }
}
