/* =============================================================================
   Carpathica client portal - design system
   One tonal scale built from the brand colour #01579b (10% tint and shade
   steps), blue-tinted neutrals, layered surfaces and soft two-part shadows.
   ============================================================================= */

@font-face { font-family: "Inter"; src: url("../fonts/inter-400.c5accfbb8915.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-500.af5fb7a40105.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600.baae0f5ac93f.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../fonts/inter-display-700.5a7efc928d85.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
    /* Brand scale - anchor 700 = #01579b */
    --b-25: #f7fafc;
    --b-50: #f0f5fa;
    --b-100: #e6eef5;
    --b-200: #ccddeb;
    --b-300: #b3cde1;
    --b-400: #80abcd;
    --b-500: #4d89b9;
    --b-600: #1a68a5;
    --b-700: #01579b;
    --b-800: #01467c;
    --b-900: #01345d;
    --b-950: #00233e;
    --b-975: #001a2f;
    --b-990: #00111f;
    --brand-rgb: 1, 87, 155;
    --deep-rgb: 0, 26, 47;

    /* Gold accent from the website, used sparingly */
    --gold: #c9a227;
    --gold-soft: #f5e6b3;

    /* Blue-tinted neutrals */
    --ink-900: #0c2236;
    --ink-700: #2d4459;
    --ink-500: #5a7084;
    --ink-400: #8195a7;
    --line: rgba(var(--brand-rgb), .10);
    --line-strong: rgba(var(--brand-rgb), .18);
    --canvas: var(--b-50);
    --surface: #ffffff;

    /* Status - muted so they sit calmly on the canvas */
    --ok: #0f7f63;
    --ok-bg: rgba(15, 127, 99, .09);
    --warn: #a86b12;
    --warn-bg: rgba(201, 162, 39, .14);
    --err: #b8403a;
    --err-bg: rgba(184, 64, 58, .08);

    /* Gradients */
    --g-brand: linear-gradient(135deg, var(--b-600) 0%, var(--b-700) 48%, var(--b-900) 100%);
    --g-deep: linear-gradient(160deg, var(--b-950) 0%, var(--b-975) 55%, var(--b-990) 100%);
    --g-avatar: linear-gradient(135deg, var(--gold-soft) 0%, var(--gold) 100%);

    /* Radii */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;

    /* Two-part shadows: a tight contact shadow plus a wide ambient one */
    --sh-1: 0 1px 2px rgba(var(--deep-rgb), .05), 0 1px 1px rgba(var(--deep-rgb), .03);
    --sh-2: 0 1px 2px rgba(var(--deep-rgb), .04), 0 10px 28px -10px rgba(var(--deep-rgb), .14);
    --sh-3: 0 2px 6px rgba(var(--deep-rgb), .05), 0 28px 56px -20px rgba(var(--deep-rgb), .24);
    --sh-brand: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 24px -10px rgba(var(--brand-rgb), .65);
    --highlight: inset 0 1px 0 rgba(255, 255, 255, .9);
    --ring: 0 0 0 4px rgba(var(--brand-rgb), .16);

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Inter Display", "Inter", ui-sans-serif, system-ui, sans-serif;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --side-w: 272px;
}

/* ---------------------------------------------------------------- Base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.portal {
    margin: 0;
    min-height: 100vh;
    font: 400 15px/1.55 var(--font);
    color: var(--ink-900);
    background:
        radial-gradient(1100px 520px at 100% -8%, rgba(var(--brand-rgb), .07), transparent 62%),
        radial-gradient(800px 420px at -6% 108%, rgba(201, 162, 39, .05), transparent 60%),
        var(--canvas);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}

a { color: var(--b-700); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--b-900); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }

.skip-link {
    position: absolute; left: 16px; top: -48px; z-index: 100;
    padding: 10px 16px; border-radius: var(--r-sm);
    background: var(--b-900); color: #fff; font-weight: 600;
    transition: top .2s var(--ease);
}
.skip-link:focus { top: 16px; color: #fff; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.tabular { font-variant-numeric: tabular-nums; }
.text-gold { color: var(--gold); }

/* ---------------------------------------------------------------- Type */
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    margin: 0 0 10px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: var(--b-600);
}
.eyebrow::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}

.display {
    margin: 0;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -.028em;
    color: var(--b-975);
}

.lead { margin: 12px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink-500); max-width: 60ch; }

.muted { color: var(--ink-500); }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 46px; padding: 0 20px;
    border: 1px solid transparent; border-radius: var(--r-md);
    font: 600 15px/1 var(--font); letter-spacing: -.005em;
    cursor: pointer; white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn i { font-size: 16px; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { pointer-events: none; opacity: .72; }

/* Primary - same hover as the website's "Start Your Project" button: 2px lift, soft glow, sweeping shine */
.btn-primary {
    position: relative; overflow: hidden;
    height: auto; padding: 16px 24px;
    color: #fff; background: var(--g-brand); box-shadow: var(--sh-brand);
    transition: all 300ms ease;
}
.btn-primary::before {
    content: ""; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .2), transparent);
    transition: left 500ms ease;
}
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 0 20px rgba(var(--brand-rgb), .3); }
.btn-primary:hover::before { left: 100%; }

.btn-quiet {
    color: var(--b-800); background: var(--surface);
    border-color: var(--line-strong); box-shadow: var(--sh-1), var(--highlight);
}
.btn-quiet:hover { color: var(--b-900); border-color: rgba(var(--brand-rgb), .32); background: var(--b-25); }

.btn-glass {
    color: #fff; background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-glass:hover { color: #fff; background: rgba(255, 255, 255, .2); }

.btn-block { width: 100%; }

.btn .spinner {
    display: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
    animation: spin .7s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
.btn.is-loading .btn-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn {
    padding: 0; border: 0; background: none; cursor: pointer;
    font: 600 14px/1.4 var(--font); color: var(--b-700);
}
.link-btn:hover { color: var(--b-900); }
.link-btn[disabled] { color: var(--ink-400); cursor: default; }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: 18px; }
.field-label {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-700);
}
.field-label a { font-weight: 500; font-size: 13px; }
.field-wrap { position: relative; }

.field-input {
    width: 100%; height: 48px; padding: 0 16px;
    font: 400 15px/1 var(--font); color: var(--ink-900);
    background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--r-md);
    box-shadow: inset 0 1px 2px rgba(var(--deep-rgb), .04);
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
    -webkit-appearance: none; appearance: none;
}
.field-input::placeholder { color: var(--ink-400); }
.field-input:hover { border-color: rgba(var(--brand-rgb), .3); }
.field-input:focus { outline: none; border-color: var(--b-600); box-shadow: var(--ring), inset 0 1px 2px rgba(var(--deep-rgb), .04); }
.field-wrap .field-input[data-password] { padding-right: 52px; }

.field-code {
    height: 64px; text-align: center;
    font: 600 28px/1 var(--font); letter-spacing: .42em; text-indent: .42em;
    font-variant-numeric: tabular-nums;
}
.field-code::placeholder { color: var(--b-200); }

.field-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-400);
    cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease);
}
.field-toggle:hover { color: var(--b-700); background: var(--b-50); }

.field-error { margin: 8px 0 0; font-size: 13.5px; color: var(--err); }
.field-help { margin: 8px 0 0; font-size: 13px; color: var(--ink-500); }
.field-help ul { margin: 6px 0 0; padding-left: 18px; }
.has-error .field-input { border-color: rgba(184, 64, 58, .55); }

/* ---------------------------------------------------------------- Notices */
.notice {
    display: flex; gap: 12px; align-items: flex-start;
    margin-bottom: 20px; padding: 12px 14px;
    font-size: 14px; line-height: 1.5;
    border-radius: var(--r-md); border: 1px solid transparent;
}
.notice i { font-size: 16px; line-height: 1.35; }
.notice-error { color: var(--err); background: var(--err-bg); border-color: rgba(184, 64, 58, .16); }
.notice-success { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .16); }
.notice-info { color: var(--b-800); background: var(--b-100); border-color: var(--line); }
.notice-warning { color: var(--warn); background: var(--warn-bg); border-color: rgba(201, 162, 39, .24); }

/* =============================================================================
   Sign-in layout - brand panel + form
   ============================================================================= */
.auth { display: grid; grid-template-columns: minmax(420px, 46%) 1fr; min-height: 100vh; }

.auth-panel {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 56px; color: #fff; background: var(--g-deep);
}
.auth-panel::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(640px 420px at 12% -6%, rgba(26, 104, 165, .55), transparent 64%),
        radial-gradient(520px 380px at 104% 38%, rgba(1, 87, 155, .38), transparent 62%),
        radial-gradient(420px 300px at 30% 112%, rgba(201, 162, 39, .14), transparent 66%);
}
/* Architecture blueprint - full panel, with a soft reading zone behind the copy */
.auth-panel::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    /* Spans from just below the logo block to just above the Panthero badge */
    background: url("../img/blueprint-architecture.5281e9cd028d.svg") center top 108px / auto calc(100% - 216px) no-repeat;
    opacity: .237;
    -webkit-mask-image: radial-gradient(ellipse 52% 30% at 34% 50%, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .34) 55%, #000 100%);
    mask-image: radial-gradient(ellipse 52% 30% at 34% 50%, rgba(0, 0, 0, .2) 0%, rgba(0, 0, 0, .34) 55%, #000 100%);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark {
    display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 12px; background: #fff;
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5), inset 0 -1px 0 rgba(var(--brand-rgb), .12);
}
.brand-mark img { width: 26px; height: 26px; display: block; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; line-height: 1.15; }
.brand-name small { display: block; font-weight: 500; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .58); }

.auth-pitch { max-width: 400px; }
.auth-pitch h2 {
    margin: 0 0 16px;
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(32px, 3vw, 44px); line-height: 1.06; letter-spacing: -.03em;
}
.auth-pitch h2 span {
    background: linear-gradient(120deg, var(--gold-soft) 0%, var(--gold) 60%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-pitch p { margin: 0; font-size: 16px; line-height: 1.65; color: rgba(255, 255, 255, .72); }

.auth-features { display: grid; gap: 10px; margin: 32px 0 0; padding: 0; list-style: none; }
.auth-features li {
    display: flex; align-items: center; gap: 14px; padding: 12px 14px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, rgba(1, 52, 93, .58) 0%, rgba(0, 35, 62, .66) 100%);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 10px 24px -14px rgba(0, 0, 0, .6);
    font-size: 14.5px; color: rgba(255, 255, 255, .88);
}
.auth-features i {
    display: grid; place-items: center; flex: none; width: 34px; height: 34px;
    border-radius: 10px; font-size: 16px; color: #fff;
    background: linear-gradient(135deg, rgba(26, 104, 165, .9), rgba(1, 52, 93, .9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 14px -6px rgba(0, 0, 0, .5);
}

.protected {
    display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
    padding: 8px 14px 8px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .62);
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
    transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.protected:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.protected > i:first-child { color: var(--gold); }
.protected img { width: 22px; height: 22px; border-radius: 6px; opacity: .9; transition: opacity .2s var(--ease); }
.protected:hover img { opacity: 1; }
.protected-name { font-weight: 600; color: #fff; }
.protected-ext { font-size: 11px; opacity: .6; }
.auth-protected-mobile { display: none; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .display { font-size: clamp(30px, 3vw, 38px); }
.auth-card .lead { font-size: 15px; margin-bottom: 30px; }
.auth-mobile-brand { display: none; }

.auth-alt { margin: 26px 0 0; font-size: 14px; color: var(--ink-500); text-align: center; }

.auth-resend {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-top: 22px; padding: 14px 16px;
    border-radius: var(--r-md); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--sh-1), var(--highlight);
    font-size: 14px; color: var(--ink-500);
}

.icon-badge {
    display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px;
    border-radius: 16px; font-size: 22px; color: var(--b-700);
    background: linear-gradient(145deg, #fff 0%, var(--b-100) 100%);
    border: 1px solid var(--line); box-shadow: var(--sh-2), var(--highlight);
}

/* =============================================================================
   App layout - sidebar + topbar + content
   ============================================================================= */
.app {
    display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh;
    /* Sidebar colour runs the full page height, even where the sticky sidebar is not drawn */
    background: linear-gradient(90deg, var(--b-975) var(--side-w), transparent var(--side-w));
}

.side {
    position: sticky; top: 0; height: 100vh; z-index: 40;
    display: flex; flex-direction: column;
    padding: 22px 16px 16px; color: #fff; overflow: hidden; isolation: isolate;
    background: var(--g-deep);
    border-right: 1px solid rgba(255, 255, 255, .05);
}
.side::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(420px 300px at 0% 0%, rgba(26, 104, 165, .42), transparent 68%),
        radial-gradient(320px 260px at 100% 100%, rgba(201, 162, 39, .08), transparent 70%);
}
.side .brand { padding: 4px 8px 22px; }

.side-nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.side-group { margin-bottom: 18px; }
.side-group-label {
    margin: 0 0 8px; padding: 0 12px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
    color: rgba(255, 255, 255, .4);
}
.side-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    height: 42px; padding: 0 12px; margin-bottom: 2px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    font-size: 14.5px; font-weight: 500; color: rgba(255, 255, 255, .7);
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.side-link i { font-size: 17px; width: 20px; text-align: center; opacity: .9; }
.side-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side-link[aria-current="page"] {
    color: #fff;
    background: linear-gradient(90deg, rgba(26, 104, 165, .62) 0%, rgba(26, 104, 165, .16) 100%);
    border-color: rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 18px -12px rgba(0, 0, 0, .6);
}
.side-link[aria-current="page"]::before {
    content: ""; position: absolute; left: -4px; top: 11px; bottom: 11px; width: 3px;
    border-radius: 3px; background: var(--gold); box-shadow: 0 0 12px rgba(201, 162, 39, .6);
}
.side-link.is-soon { color: rgba(255, 255, 255, .42); cursor: default; }
.side-link.is-soon:hover { background: none; }
.side-soon {
    margin-left: auto; padding: 2px 8px; border-radius: 999px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .08);
}

.side-user {
    display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.avatar {
    display: grid; place-items: center; flex: none; width: 38px; height: 38px;
    border-radius: 12px; background: var(--g-avatar);
    font-weight: 600; font-size: 14px; color: var(--b-975);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 14px -6px rgba(0, 0, 0, .45);
}
.side-user-text { min-width: 0; flex: 1; line-height: 1.3; }
.side-user-text strong { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user form { margin: 0; }
.icon-btn {
    display: grid; place-items: center; width: 36px; height: 36px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    background: transparent; color: inherit; cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.side .icon-btn { color: rgba(255, 255, 255, .6); }
.side .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px;
    height: 64px; padding: 0 40px;
    background: rgba(240, 245, 250, .74);
    -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; color: var(--b-900); }
.topbar .menu-btn:hover { background: var(--b-100); }
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink-500); white-space: nowrap; }
.crumbs > a, .crumbs > strong, .crumbs > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumbs > i { flex: none; }
.crumbs strong { color: var(--ink-900); font-weight: 600; }
.crumbs i { font-size: 12px; color: var(--ink-400); }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
    border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-700);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1), var(--highlight);
}
.chip i { color: var(--b-600); }
.chip-staff { color: var(--warn); }
.chip-staff i { color: var(--gold); }

/* Pages use the full width beside the sidebar on every screen size */
.page { width: 100%; padding: 36px 40px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }

/* ---------------------------------------------------------------- Surfaces */
.card {
    position: relative; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--sh-2), var(--highlight);
}

.hero-card {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; min-height: 236px;
    padding: 36px 40px; margin-bottom: 24px;
    border-radius: var(--r-xl); color: #fff; background: var(--g-brand);
    box-shadow: var(--sh-3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.hero-card::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(520px 320px at 88% 10%, rgba(255, 255, 255, .16), transparent 62%),
        radial-gradient(420px 280px at 6% 120%, rgba(0, 17, 31, .45), transparent 66%),
        radial-gradient(300px 220px at 70% 120%, rgba(201, 162, 39, .18), transparent 70%);
}
/* Delivery-lifecycle blueprint on the right, clear of the copy */
.hero-card::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: url("../img/blueprint-lifecycle.da0e07316164.svg") right center / auto 100% no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 28%, rgba(0, 0, 0, .6) 46%, #000 62%);
    mask-image: linear-gradient(90deg, transparent 28%, rgba(0, 0, 0, .6) 46%, #000 62%);
}
.hero-card > div { position: relative; max-width: 52%; }
.hero-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.hero-card p { margin: 0; max-width: 52ch; color: rgba(255, 255, 255, .78); line-height: 1.6; }

.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.stat-icon {
    display: grid; place-items: center; width: 40px; height: 40px;
    border-radius: 12px; font-size: 18px; color: var(--b-700);
    background: linear-gradient(145deg, var(--b-50) 0%, var(--b-100) 100%);
    border: 1px solid var(--line); box-shadow: var(--highlight);
}
.stat-label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink-500); }
.stat-value { margin: 4px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; color: var(--b-975); font-variant-numeric: tabular-nums; }
.stat-value.is-empty { font-family: var(--font); font-weight: 400; color: var(--b-300); }
.stat-foot { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-400); }
.pill {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
    border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
    color: var(--b-700); background: var(--b-50); border: 1px solid var(--line);
}

.panel { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ink-900); }
.panel-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-500); }

.empty {
    display: grid; place-items: center; text-align: center;
    padding: 36px 24px; border-radius: var(--r-md);
    border: 1.5px dashed rgba(var(--brand-rgb), .16);
    background: linear-gradient(180deg, var(--b-25) 0%, rgba(247, 250, 252, 0) 100%);
}
.empty .icon-badge { margin-bottom: 14px; width: 46px; height: 46px; font-size: 19px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-900); }
.empty p { margin: 0; max-width: 38ch; font-size: 14px; color: var(--ink-500); }


.scrim { display: none; }

/* =============================================================================
   Shared components - lists, tables, forms and detail pages
   ============================================================================= */
.page > .card, .page > section.card { margin-bottom: 16px; }
.grid-2, .grid-3 { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-quiet.is-active { color: var(--b-900); border-color: var(--b-600); }
.nowrap { white-space: nowrap; }
.small-text { font-size: 12px; color: var(--ink-500) !important; }
.empty-line { margin: 0; padding: 18px 0 6px; font-size: 14px; color: var(--ink-500); }

/* ---------------------------------------------------------------- Segmented controls + range */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 16px; margin-bottom: 16px; }
.seg {
    display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
    border-radius: var(--r-md); background: var(--b-50); border: 1px solid var(--line);
}
.seg-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 10px;
    font-size: 13px; font-weight: 500; color: var(--ink-700); white-space: nowrap;
}
.seg-item:hover { color: var(--b-900); background: rgba(255, 255, 255, .7); }
.seg-item[aria-current="true"] { color: var(--b-900); background: var(--surface); box-shadow: var(--sh-1), var(--highlight); font-weight: 600; }
.seg-item i { font-size: 11px; }
.range-form { display: inline-flex; align-items: center; gap: 8px; }
.range-input { width: 150px; height: 38px; padding: 0 10px; font-size: 13.5px; border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- Selects + textareas */
select.field-input {
    padding-right: 40px; cursor: pointer; text-overflow: ellipsis;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235a7084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 15px center / 12px;
}
textarea.field-input { height: auto; min-height: 120px; padding: 13px 16px; line-height: 1.6; resize: vertical; }

.status-tabs { margin-bottom: 12px; }
.seg-count {
    display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 2px;
    border-radius: 999px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums;
    color: var(--ink-500); background: rgba(var(--brand-rgb), .07);
}
.seg-item[aria-current="true"] .seg-count { color: #fff; background: var(--b-700); }

/* ---------------------------------------------------------------- List toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; margin-bottom: 12px; }
.toolbar .field-input { height: 44px; font-size: 14px; }
.toolbar-search { position: relative; flex: 1 1 280px; min-width: 0; }
.toolbar-search > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.toolbar-search .field-input { padding-left: 42px; }
.toolbar select.field-input { width: auto; max-width: 220px; }
.toolbar select.field-input.is-set { color: var(--b-900); font-weight: 600; border-color: rgba(var(--brand-rgb), .45); background-color: var(--b-25); }
.toolbar-range {
    display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 6px 0 14px;
    border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
    box-shadow: inset 0 1px 2px rgba(var(--deep-rgb), .04);
}
.toolbar-range.is-set { border-color: rgba(var(--brand-rgb), .45); background: var(--b-25); }
.toolbar-range > span { font-size: 12.5px; font-weight: 600; color: var(--ink-500); margin-right: 4px; }
.toolbar-range input {
    width: 132px; height: 40px; padding: 0 6px; border: 0; background: transparent;
    font: 400 13.5px/1 var(--font); color: var(--ink-900);
}
.toolbar-range input:focus { outline: none; box-shadow: none; }
.toolbar-range:focus-within { border-color: var(--b-600); box-shadow: var(--ring); }
.toolbar .btn-sm { height: 44px; border-radius: var(--r-md); }

.list-meta {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
    margin: 0 4px 12px; font-size: 13.5px; color: var(--ink-500);
}
.list-meta strong { color: var(--ink-900); font-weight: 600; font-variant-numeric: tabular-nums; }
.list-meta-start { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.list-meta .seg-item { padding: 5px 10px; font-size: 12.5px; }
.clear-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.list-card { padding: 20px 24px 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
    padding: 0 12px 10px; text-align: left; white-space: nowrap;
    font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400);
    border-bottom: 1px solid var(--line);
}
.data-table td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink-900); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--b-25); }
.data-table th:first-child, .data-table td:first-child { padding-left: 0; }
.list-card .data-table th:last-child, .list-card .data-table td:last-child { padding-right: 0; }
.data-table td.muted { color: var(--ink-400); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table.is-rows td { padding-top: 15px; padding-bottom: 15px; vertical-align: middle; }
.data-table tr.is-linked { position: relative; cursor: pointer; }
/* The whole row opens the record; the link stays the one focusable element */
.row-cover { color: var(--ink-900); font-weight: 600; }
.row-cover::after { content: ""; position: absolute; inset: 0; }
.row-cover:hover { color: var(--b-700); }
.row-cover:focus-visible { box-shadow: none; }
tr.is-linked:has(.row-cover:focus-visible) td { background: var(--b-50); }
.cell-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--ink-500); }
.row-link { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--b-700); }
.row-link:hover { background: var(--b-100); }
.cell-primary { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.cell-chevron { width: 24px; color: var(--ink-400); text-align: right; }
tr.is-linked:hover .cell-chevron { color: var(--b-700); }

.tag {
    display: inline-flex; align-items: center; gap: 5px; margin: 4px 4px 0 0; padding: 2px 8px;
    border-radius: 999px; font-size: 11.5px; font-weight: 600; vertical-align: middle;
    color: var(--b-700); background: var(--b-50); border: 1px solid var(--line);
}
.tag-warn { color: var(--warn); background: var(--warn-bg); border-color: rgba(201, 162, 39, .24); }
.tag-ok { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .18); }
.tag-gold { color: #7a5c00; background: var(--gold-soft); border-color: rgba(201, 162, 39, .32); }

/* ---------------------------------------------------------------- Status badges */
.status {
    display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px;
    border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    color: var(--ink-700); background: var(--b-50); border: 1px solid var(--line);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.status-active { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .18); }
.status-prospect { color: var(--b-700); background: var(--b-50); border-color: rgba(var(--brand-rgb), .16); }
.status-paused { color: var(--warn); background: var(--warn-bg); border-color: rgba(201, 162, 39, .26); }
.status-former { color: var(--ink-500); background: rgba(90, 112, 132, .08); border-color: rgba(90, 112, 132, .16); }

/* Project and task states share the badge: blue = moving, gold = waiting, green = done, red = stuck */
.status-planned, .status-todo { color: var(--ink-700); background: var(--b-50); border-color: var(--line); }
.status-in_progress { color: var(--b-700); background: var(--b-50); border-color: rgba(var(--brand-rgb), .18); }
.status-on_hold, .status-review { color: var(--warn); background: var(--warn-bg); border-color: rgba(201, 162, 39, .26); }
.status-completed, .status-done { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .18); }
.status-cancelled { color: var(--ink-500); background: rgba(90, 112, 132, .08); border-color: rgba(90, 112, 132, .16); }
.status-blocked { color: var(--err); background: var(--err-bg); border-color: rgba(184, 64, 58, .2); }
.status-sm { height: 21px; padding: 0 8px 0 7px; gap: 6px; font-size: 11px; }
.status-sm::before { width: 6px; height: 6px; box-shadow: none; }

/* ---------------------------------------------------------------- Deltas (+9d, +12%) */
.delta {
    display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
    border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
    color: var(--ink-500); background: var(--b-50); border: 1px solid var(--line);
}
.delta.is-good { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .16); }
.delta.is-bad { color: var(--err); background: var(--err-bg); border-color: rgba(184, 64, 58, .16); }

/* ---------------------------------------------------------------- Progress */
.progress { position: relative; display: block; height: 6px; border-radius: 999px; overflow: hidden; background: var(--b-100); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--b-600), var(--b-700)); box-shadow: 0 0 10px rgba(var(--brand-rgb), .35); }
.progress-lg { height: 8px; margin-top: 10px; }
.progress-cell { display: grid; gap: 6px; min-width: 140px; }
.progress-label { font-size: 12.5px; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.progress-label small { font-weight: 500; color: var(--ink-400); font-size: 12px; }

/* ---------------------------------------------------------------- Monograms */
.mono {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px;
    border-radius: 12px; font: 700 14px/1 var(--font-display); letter-spacing: .02em; color: var(--b-800);
    background: linear-gradient(145deg, var(--b-50) 0%, var(--b-200) 100%);
    border: 1px solid var(--line); box-shadow: var(--highlight);
}
.mono-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12.5px; }

/* ---------------------------------------------------------------- Pager */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 13.5px; }
.pager a, .pager span {
    display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
    border-radius: var(--r-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-700);
}
.pager a { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1), var(--highlight); }
.pager a:hover { color: var(--b-900); border-color: var(--line-strong); }
.pager [aria-current="page"] { color: #fff; background: var(--g-brand); border: 0; box-shadow: var(--sh-brand); }
.pager .is-gap { color: var(--ink-400); }
.pager .is-disabled { color: var(--ink-400); opacity: .6; }

/* ---------------------------------------------------------------- Key/value + facts */
.kv { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.kv li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv li:last-child { border-bottom: 0; }
.kv span { min-width: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: minmax(96px, 120px) 1fr; gap: 10px 16px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--ink-500); font-weight: 500; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink-900); }
.facts .is-blank { color: var(--ink-400); }
.prose { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-700); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Forms */
.form-card { padding: 8px 28px; }
.form-section { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 12px 40px; padding: 28px 0; border-top: 1px solid var(--line); }
.form-section:first-child { border-top: 0; }
.form-section-head h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-900); }
.form-section-head p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-500); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field-optional { font-weight: 400; color: var(--ink-400); }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.check:hover { border-color: rgba(var(--brand-rgb), .3); }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--b-700); }
.check strong { display: block; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.check span { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-500); }
/* Glass action bar: stays in reach while long forms scroll beneath it */
.form-actions {
    position: sticky; bottom: 16px; z-index: 20;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px;
    margin-top: 16px; padding: 12px; border-radius: var(--r-lg);
    background: rgba(255, 255, 255, .74);
    -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid var(--line); box-shadow: var(--sh-3), var(--highlight);
}
.form-actions .form-actions-note { margin-right: auto; padding-left: 8px; font-size: 13px; color: var(--ink-500); }
.form-actions .btn-primary { padding: 13px 22px; }
.form-errors { margin-bottom: 16px; }

/* ---------------------------------------------------------------- Small and quiet actions */
.btn-xs { height: 32px; padding: 0 11px; gap: 7px; font-size: 13px; border-radius: 9px; }
.btn-xs i { font-size: 13px; }
.btn-ghost { color: var(--ink-500); background: transparent; border-color: transparent; }
.btn-ghost:hover { color: var(--b-900); background: var(--b-50); }
.btn-danger { color: var(--err); }
.btn-danger:hover { color: var(--err); background: var(--err-bg); }
.btn-danger-solid { color: #fff; background: linear-gradient(135deg, #c9524b 0%, var(--err) 100%); box-shadow: 0 10px 22px -12px rgba(184, 64, 58, .8), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn-danger-solid:hover { color: #fff; transform: translateY(-1px); }
.icon-btn-quiet { color: var(--ink-400); }
.icon-btn-quiet:hover { color: var(--b-800); background: var(--b-50); border-color: var(--line); }
.spinner-dark { border-color: rgba(var(--brand-rgb), .25) !important; border-top-color: var(--b-700) !important; }
.tag-muted { color: var(--ink-500); background: rgba(90, 112, 132, .08); border-color: rgba(90, 112, 132, .16); }
.icon-badge-danger { color: var(--err); background: linear-gradient(145deg, #fff 0%, #fbeceb 100%); }
.confirm-card { max-width: 640px; padding: 32px; }
.confirm-title { font-size: 20px; margin-bottom: 10px; }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ---------------------------------------------------------------- Detail pages */
.crumb-link { color: var(--ink-500); }
.crumb-link:hover { color: var(--b-700); }

.identity {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; align-items: center; gap: 22px;
    padding: 30px 32px; margin-bottom: 16px; border-radius: var(--r-xl);
    color: #fff; background: var(--g-brand);
    box-shadow: var(--sh-3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.identity::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        radial-gradient(520px 300px at 92% -10%, rgba(255, 255, 255, .17), transparent 62%),
        radial-gradient(420px 260px at 0% 130%, rgba(0, 17, 31, .5), transparent 66%),
        radial-gradient(260px 200px at 72% 130%, rgba(201, 162, 39, .2), transparent 70%);
}
.identity::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .26;
    background: url("../img/blueprint-lifecycle.da0e07316164.svg") right -60px center / auto 130% no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 45%, rgba(0, 0, 0, .7) 70%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 45%, rgba(0, 0, 0, .7) 70%, #000 100%);
}
.identity-mark {
    display: grid; place-items: center; flex: none; width: 68px; height: 68px; border-radius: 20px;
    font: 700 24px/1 var(--font-display); letter-spacing: -.01em; color: var(--b-975);
    background: var(--g-avatar);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 14px 30px -12px rgba(0, 0, 0, .55);
}
.identity-body { min-width: 0; flex: 1; }
.identity .eyebrow { color: rgba(255, 255, 255, .7); margin-bottom: 6px; }
.identity h1 {
    margin: 0; font-family: var(--font-display); font-weight: 700;
    font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere;
}
.identity-sub { margin: 6px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, .72); }
.identity-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.identity-meta li {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
    border-radius: 999px; font-size: 12.5px; font-weight: 500; color: rgba(255, 255, 255, .92);
    background: rgba(255, 255, 255, .11); border: 1px solid rgba(255, 255, 255, .17);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.identity-meta i { color: var(--gold-soft); }
.identity-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: #7fe0c2; box-shadow: 0 0 0 3px rgba(127, 224, 194, .22); }
.identity-meta .dot-prospect { background: #a9d2f5; box-shadow: 0 0 0 3px rgba(169, 210, 245, .22); }
.identity-meta .dot-paused { background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .25); }
.identity-meta .dot-former { background: rgba(255, 255, 255, .5); box-shadow: none; }
.identity-actions { display: flex; flex-wrap: wrap; gap: 10px; align-self: flex-start; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.detail-grid > div { display: grid; gap: 16px; min-width: 0; }
.detail-grid .card { margin: 0; }
.panel-count { margin-left: 8px; font-weight: 500; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.stamp { margin: 16px 4px 0; font-size: 12.5px; color: var(--ink-400); }

/* ---------------------------------------------------------------- People */
.people { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.person { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; padding-top: 0; }
.person-body { min-width: 0; flex: 1; }
.person-name { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-900); }
.person-role { margin: 1px 0 0; font-size: 13px; color: var(--ink-500); }
.person-lines { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.person-lines li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-700); overflow-wrap: anywhere; }
.person-lines i { color: var(--ink-400); }
.person-tags { display: flex; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.person-seen { margin: 4px 0 0 4px; font-size: 12px; color: var(--ink-400); }
.person-note { display: flex; gap: 8px; margin: 10px 0 0; padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-700); background: var(--warn-bg); white-space: pre-line; }
.person-note i { color: var(--warn); }
.person-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.person-actions form { display: flex; gap: 4px; margin: 0; }

/* ---------------------------------------------------------------- Documents */
.docs { display: grid; margin: 0; padding: 0; list-style: none; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; padding-top: 0; }
.doc .tag { margin: 0; flex: none; }
.doc-icon {
    display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px;
    font-size: 17px; color: var(--b-700); background: linear-gradient(145deg, var(--b-25), var(--b-100));
    border: 1px solid var(--line); box-shadow: var(--highlight);
}
.doc-body { min-width: 0; flex: 1; }
.doc-title, .row-title { display: block; font-size: 14px; font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.doc-title:hover, .row-title:hover { color: var(--b-700); }
.doc-meta { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-500); }
.doc-actions { display: flex; gap: 2px; }
.doc-actions form { margin: 0; }
.cell-actions { text-align: right; white-space: nowrap; }
.dropzone {
    position: relative; display: grid; place-items: center; gap: 4px; padding: 36px 20px; text-align: center; cursor: pointer;
    border-radius: var(--r-lg); border: 1.5px dashed rgba(var(--brand-rgb), .3);
    background: linear-gradient(180deg, var(--b-25) 0%, var(--surface) 100%);
    transition: border-color .2s var(--ease), background .2s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--b-600); background: var(--b-50); }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone i { font-size: 30px; color: var(--b-600); }
.dropzone strong { font-size: 15px; color: var(--ink-900); overflow-wrap: anywhere; }
.dropzone span { font-size: 13px; color: var(--ink-500); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.has-error .dropzone { border-color: rgba(184, 64, 58, .55); }

/* ---------------------------------------------------------------- Activity feed */
.feed { margin: 0; padding: 0; list-style: none; }
.feed-item { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.feed-item:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 2px; background: var(--b-100); }
.feed-dot { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--b-300); box-shadow: 0 0 0 3px var(--surface); position: relative; }
.feed-created, .feed-uploaded { background: var(--b-700); }
.feed-access_granted { background: var(--ok); }
.feed-access_revoked, .feed-deleted { background: var(--err); }
.feed-note { background: var(--gold); }
.feed-body { min-width: 0; }
.feed-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-700); overflow-wrap: anywhere; }
.feed-text strong { color: var(--ink-900); font-weight: 600; }
.feed-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-400); }

/* ---------------------------------------------------------------- Team (client-facing) */
.hero-card.hero-compact { min-height: 0; padding: 28px 32px; }
.hero-card.hero-compact::after { opacity: .5; }
.hero-compact .eyebrow { color: rgba(255, 255, 255, .7); }
.hero-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px !important; font-weight: 500; color: #fff !important; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.person-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.person-card.is-me { border-color: rgba(201, 162, 39, .45); box-shadow: var(--sh-2), var(--highlight), 0 0 0 3px rgba(201, 162, 39, .1); }
.person-card-head { display: flex; align-items: center; gap: 12px; }
.person-card .person-lines { margin: 0; flex-direction: column; }
.person-card-action { align-self: flex-start; margin-top: auto; }
.side-user-text:hover strong { color: var(--gold-soft); }
a.side-user-text { color: #fff; }
.form-inline-actions { display: flex; justify-content: flex-end; }

/* ---------------------------------------------------------------- Projects */
.mono-project { font-size: 16px; color: var(--b-700); }
.identity-mark-project { font-size: 28px; }
.identity-link { color: rgba(255, 255, 255, .78); }
.identity-link:hover { color: #fff; }
.identity-meta .dot-active { background: #a9d2f5; box-shadow: 0 0 0 3px rgba(169, 210, 245, .25); }
.identity-meta .dot-planned { background: rgba(255, 255, 255, .7); box-shadow: none; }
.identity-meta .dot-on_hold { background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, .25); }
.identity-meta .dot-completed { background: #7fe0c2; }
.identity-meta .dot-cancelled { background: rgba(255, 255, 255, .45); box-shadow: none; }
.stat-value.stat-value-text { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }

.plan { display: grid; gap: 20px; }
.plan-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.plan-head h3 { margin: 0; flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-900); }
.plan-date { font-size: 12.5px; font-weight: 600; color: var(--ink-500); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plan-diamond { flex: none; width: 12px; height: 12px; transform: rotate(45deg); border-radius: 2px; background: var(--surface); border: 2.5px solid var(--b-700); }
.plan-diamond.is-done { background: var(--ok); border-color: var(--ok); }
.plan-diamond-empty { border-color: var(--b-300); border-style: dashed; }
.plan-empty { padding: 12px 0 0 24px; }
.task-rows { margin: 0; padding: 0; list-style: none; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0 11px 2px; border-bottom: 1px dashed var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-state { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--b-200); }
.task-in_progress { background: var(--b-700); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .14); }
.task-review { background: var(--gold); }
.task-blocked { background: var(--err); box-shadow: 0 0 0 3px rgba(184, 64, 58, .14); }
.task-done { background: var(--ok); }
.task-main { flex: 1; min-width: 0; }
.task-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-900); overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0 0; font-size: 12.5px; color: var(--ink-500); }
.task-blocked-why { color: var(--err); }
.task-meta > span + span::before { content: "·"; margin-right: 6px; color: var(--ink-400); }
.task-due { flex: none; font-size: 12.5px; font-weight: 600; color: var(--ink-500); font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-due.is-late { color: var(--err); }

.project-rows { margin: 0; padding: 0; list-style: none; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 180px; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.project-row:first-child { border-top: 0; padding-top: 0; }

.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-tools { display: inline-flex; align-items: center; gap: 2px; }
.plan-tools form { margin: 0; }
.plan-tools .icon-btn { width: 30px; height: 30px; }
.plan-tools .is-on { color: var(--ok); }
.plan-hidden { margin-right: 4px; color: var(--warn); }
.plan-was { margin-left: 4px; font-weight: 500; color: var(--ink-400); text-decoration: line-through; }
.task-title a { color: inherit; }
.task-title a:hover { color: var(--b-700); }
.task-quick { margin: 0; }
.quick-select {
    height: 30px; padding: 0 26px 0 10px; border-radius: 8px; cursor: pointer;
    font: 600 12px/1 var(--font); color: var(--ink-700);
    border: 1px solid var(--line-strong); -webkit-appearance: none; appearance: none;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%235a7084' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m3 6 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 9px center / 10px;
}
.quick-select:focus { outline: none; box-shadow: var(--ring); }
.quick-in_progress { color: var(--b-700); border-color: rgba(var(--brand-rgb), .3); background-color: var(--b-25); }
.quick-review { color: var(--warn); border-color: rgba(201, 162, 39, .4); }
.quick-blocked { color: var(--err); border-color: rgba(184, 64, 58, .35); }
.quick-done { color: var(--ok); border-color: rgba(15, 127, 99, .3); }
select[multiple].field-input { height: auto; min-height: 120px; padding: 8px; background-image: none; }
select[multiple].field-input option { padding: 6px 8px; border-radius: 6px; }
.freeze { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.freeze .small-text { margin: 8px 0 0; }
.danger-zone { margin-top: 16px; display: flex; justify-content: flex-end; }
.task-display { font-size: clamp(26px, 3vw, 36px); overflow-wrap: anywhere; }
.task-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.task-head-meta .tag { margin: 0; }
.status-switch { margin: 0; }
.status-switch select.field-input { height: 46px; width: auto; min-width: 160px; }
.date-compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.date-col { padding: 14px 16px; border-radius: var(--r-md); background: var(--b-25); border: 1px solid var(--line); }
.date-col.is-forecast { background: linear-gradient(145deg, #fff, var(--b-50)); border-color: rgba(var(--brand-rgb), .22); box-shadow: var(--sh-1), var(--highlight); }
.date-kind { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); }
.date-range { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.date-range .is-late { color: var(--err); }
.date-note { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--warn); }
.dep-label { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); }
.dep-label ~ .dep-label { margin-top: 18px; }
.dep-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dep-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dep-list .task-state { margin: 0; }
.dep-list a { flex: 1; min-width: 0; color: var(--ink-900); font-weight: 500; overflow-wrap: anywhere; }
.dep-list a:hover { color: var(--b-700); }
.dep-empty { padding: 0; font-size: 13px; }

/* ---------------------------------------------------------------- Conversation */
.tag-brand { margin: 0 0 0 2px; padding: 1px 7px; font-size: 10.5px; color: #fff; background: var(--g-brand); border: 0; }
.status-req-open { color: var(--b-700); background: var(--b-50); border-color: rgba(var(--brand-rgb), .18); }
.status-req-accepted { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .18); }
.status-req-declined { color: var(--ink-500); background: rgba(90, 112, 132, .08); border-color: rgba(90, 112, 132, .16); }
.status-req-done { color: #fff; background: var(--ok); border-color: var(--ok); }

.composer { padding: 18px 20px; margin-bottom: 16px; }
.composer .field { margin-bottom: 12px; }
.composer textarea.field-input { min-height: 96px; }
.composer-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.kind-chip { position: relative; cursor: pointer; }
.kind-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kind-chip span {
    display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--ink-700); background: var(--b-50); border: 1px solid var(--line);
    transition: all .2s var(--ease);
}
.kind-chip input:checked + span { color: #fff; background: var(--g-brand); border-color: transparent; box-shadow: var(--sh-brand); }
.kind-chip input:focus-visible + span { box-shadow: var(--ring); }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.composer-bar .btn-post { margin-left: auto; padding: 12px 22px; }
.composer-internal { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--warn); cursor: pointer; }
.composer-internal input { width: 16px; height: 16px; accent-color: var(--warn); }
.attach { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.attach-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-sm);
    font-size: 13px; font-weight: 600; color: var(--b-800); background: var(--surface); border: 1px dashed rgba(var(--brand-rgb), .35); cursor: pointer;
}
.attach-btn:hover { background: var(--b-25); border-color: var(--b-600); }
.attach input:focus-visible + .attach-hint, .attach:focus-within .attach-btn { box-shadow: var(--ring); }
.attach-hint { font-size: 12px; color: var(--ink-400); }
.attach .field-error { flex-basis: 100%; margin: 4px 0 0; }

.entries { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.entry-card { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2), var(--highlight); }
.entry-card.is-internal { background: linear-gradient(180deg, #fffdf6, #fff); border-color: rgba(201, 162, 39, .28); }
.entry-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; font-size: 16px; color: var(--b-700); background: var(--b-50); border: 1px solid var(--line); }
.entry-update .entry-icon { color: #fff; background: var(--g-brand); border-color: transparent; box-shadow: var(--sh-brand); }
.entry-request .entry-icon { color: #7a5c00; background: var(--gold-soft); border-color: rgba(201, 162, 39, .32); }
.entry-icon-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.entry-body { min-width: 0; flex: 1; }
.entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.entry-top .tag { margin: 0; }
.entry-kind { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); }
.entry-title { display: block; font-size: 15px; font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.entry-title:hover { color: var(--b-700); }
.entry-excerpt { margin: 4px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-500); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-400); }
.entry-meta i { font-size: 11px; }

.message { padding: 28px; }
.message-title { margin: 6px 0 0; font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; letter-spacing: -.02em; color: var(--b-975); overflow-wrap: anywhere; }
.message-body { margin-top: 18px; font-size: 15px; color: var(--ink-900); }
.message-files { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.replies { display: grid; gap: 0; margin: 0 0 18px; padding: 0; list-style: none; }
.reply { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.reply:first-child { border-top: 0; padding-top: 0; }
.reply.is-staff .mono { color: #fff; background: var(--g-brand); border-color: transparent; }
.reply-body { min-width: 0; flex: 1; }
.reply-body .entry-meta { margin: 0 0 4px; }
.reply-form { padding: 14px; border-radius: var(--r-md); background: var(--b-25); border: 1px solid var(--line); }
.reply-form .field { margin-bottom: 10px; }
.request-state { margin: 0; }
.request-task { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-700); }
.request-convert { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.request-convert .small-text { margin: 8px 0 0; }

.talk { display: grid; margin: 0; padding: 0; list-style: none; }
.talk-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.talk-item:first-child { border-top: 0; padding-top: 0; }
.talk-body { min-width: 0; flex: 1; }
.talk-title { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-900); overflow-wrap: anywhere; }
.talk-title:hover { color: var(--b-700); }
.talk .entry-meta { margin-top: 2px; }

/* ---------------------------------------------------------------- Report */
.health {
    display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px 0 10px;
    border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap;
    color: var(--ink-700); background: var(--b-50); border: 1px solid var(--line);
}
.health::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.health-on_track, .health-completed { color: var(--ok); background: var(--ok-bg); border-color: rgba(15, 127, 99, .2); }
.health-at_risk { color: var(--warn); background: var(--warn-bg); border-color: rgba(201, 162, 39, .3); }
.health-off_track { color: var(--err); background: var(--err-bg); border-color: rgba(184, 64, 58, .22); }
.health-cancelled, .health-not_planned { color: var(--ink-500); }
.tag-crit { color: #fff; background: linear-gradient(135deg, #c9524b, var(--err)); border: 0; }

.report-hero {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 24px 32px; align-items: start;
    padding: 30px 32px; margin-bottom: 16px; border-radius: var(--r-xl); color: #fff;
    background: var(--g-brand); box-shadow: var(--sh-3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.report-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(520px 300px at 92% -10%, rgba(255, 255, 255, .16), transparent 62%), radial-gradient(420px 260px at 0% 130%, rgba(0, 17, 31, .5), transparent 66%);
}
/* The verdict colours the hero's glow, so the state reads before a word is read */
.report-on_track::after, .report-completed::after, .report-at_risk::after, .report-off_track::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
.report-on_track::after, .report-completed::after { background: radial-gradient(460px 280px at 70% 120%, rgba(127, 224, 194, .32), transparent 70%); }
.report-at_risk::after { background: radial-gradient(460px 280px at 70% 120%, rgba(201, 162, 39, .42), transparent 70%); }
.report-off_track::after { background: radial-gradient(460px 280px at 70% 120%, rgba(232, 104, 96, .45), transparent 70%); }
.report-hero .eyebrow { color: rgba(255, 255, 255, .72); }
.report-hero h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 2.8vw, 36px); line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.report-date { margin: 8px 0 0; font-size: 14px; color: rgba(255, 255, 255, .72); }
.report-verdict { padding: 16px 18px; border-radius: var(--r-lg); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.report-verdict .health { background: #fff; }
.report-reasons { display: grid; gap: 6px; margin: 12px 0 0; padding: 0 0 0 18px; font-size: 13.5px; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.report-actions { display: flex; flex-direction: column; gap: 10px; }
.report-lists .card { padding: 22px; }

/* ---------------------------------------------------------------- Gantt */
/* Without JS (and on phones) the server-rendered timeline shows; the chart takes over when ready */
.gantt { display: none; position: relative; }
.gantt-panel.is-ready .gantt { display: block; }
.gantt-panel.is-ready .vtimeline { display: none; }
.g-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.g-toolbar .seg-item { border: 0; background: none; cursor: pointer; font-family: var(--font); }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-500); }
.g-legend li { display: inline-flex; align-items: center; gap: 7px; }
.g-key { display: inline-block; width: 18px; height: 9px; border-radius: 3px; }
.g-key-bar { background: linear-gradient(90deg, var(--b-600), var(--b-700)); }
.g-key-plan { height: 4px; background: var(--b-300); }
.g-key-today { width: 2px; height: 14px; background: var(--gold); }
.g-key-critical { background: var(--surface); box-shadow: inset 0 0 0 2px var(--err); }
.g-wrap { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.g-names { padding-top: 52px; border-right: 1px solid var(--line); background: linear-gradient(90deg, var(--b-25), var(--surface)); }
.g-name { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; min-width: 0; font-size: 13px; border-top: 1px solid transparent; }
.g-name a, .g-name strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-name a { color: var(--ink-900); }
.g-name a:hover { color: var(--b-700); }
.g-name small { margin-left: auto; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--ink-400); }
.g-name .task-state { margin-top: 0; }
.g-name-milestone { font-weight: 600; color: var(--b-975); background: rgba(var(--brand-rgb), .045); }
.g-name-diamond { flex: none; width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; border: 2.5px solid var(--b-700); background: var(--surface); }
.g-name-diamond.is-done { background: var(--ok); border-color: var(--ok); }
.g-scroll { overflow-x: auto; overflow-y: hidden; }
.g-chart { display: block; font-family: var(--font); }
.g-band { fill: transparent; }
.g-band-alt { fill: rgba(var(--brand-rgb), .018); }
.g-band-ms { fill: rgba(var(--brand-rgb), .045); }
.g-weekend { fill: rgba(var(--brand-rgb), .035); }
.g-grid-month { stroke: var(--line-strong); }
.g-grid-week { stroke: rgba(var(--brand-rgb), .07); }
.g-axis { stroke: var(--line-strong); }
.g-month { font-size: 12px; font-weight: 600; fill: var(--ink-700); }
.g-day { font-size: 10.5px; fill: var(--ink-400); }
.g-day.is-weekend { fill: var(--b-300); }
.g-today { stroke: var(--gold); stroke-width: 2; }
.g-today-badge rect { fill: var(--gold); }
.g-today-badge text { font-size: 10px; font-weight: 700; fill: #fff; }
.g-target { stroke: var(--b-700); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .55; }
.g-plan { fill: var(--b-300); opacity: .9; }
.g-bar { fill: var(--b-700); filter: drop-shadow(0 3px 6px rgba(1, 87, 155, .25)); transition: opacity .2s; }
.g-bar.s-todo { fill: var(--b-400); }
.g-bar.s-review { fill: var(--gold); }
.g-bar.s-blocked { fill: var(--err); }
.g-bar.s-done { fill: var(--ok); }
.g-bar.is-late { stroke: var(--err); stroke-width: 2; }
.g-bar.is-critical { stroke: var(--err); stroke-width: 2.5; stroke-dasharray: none; }
.g-item:focus { outline: none; }
.g-item:focus .g-bar, .g-item:hover .g-bar { opacity: .85; stroke: var(--b-990); stroke-width: 2; }
.g-bar-label { font-size: 11px; font-weight: 600; fill: #fff; pointer-events: none; }
.g-check { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-unscheduled { font-size: 11.5px; font-style: italic; fill: var(--ink-400); }
.g-ms { fill: var(--surface); stroke: var(--b-700); stroke-width: 2.5; cursor: default; }
.g-ms.is-done { fill: var(--ok); stroke: var(--ok); }
.g-ms.is-risk { stroke: var(--gold); }
.g-ms.is-late { stroke: var(--err); fill: var(--err-bg); }
.g-ms:focus { outline: none; stroke-width: 4; }
.g-ms-plan { fill: none; stroke: var(--b-300); stroke-width: 1.5; stroke-dasharray: 3 2; }
.g-link { fill: none; stroke: var(--ink-400); stroke-width: 1.3; }
.g-link.is-conflict { stroke: var(--err); }
.g-arrow-head { fill: var(--ink-400); }
.g-tip {
    position: absolute; z-index: 20; min-width: 220px; max-width: 300px; padding: 12px 14px; pointer-events: none;
    border-radius: var(--r-md); color: #fff; background: rgba(0, 26, 47, .92);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--sh-3);
    font-size: 12.5px; line-height: 1.45;
}
.g-tip strong { display: block; margin-bottom: 6px; font-size: 13.5px; }
.g-tip dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.g-tip dt { color: rgba(255, 255, 255, .6); }
.g-tip dd { margin: 0; }
.g-tip p { margin: 8px 0 0; font-weight: 600; }
.g-tip-late, .g-tip-crit { color: #ff9c94; }
.g-tip-early { color: #7fe0c2; }

.vtimeline { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.vt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.vt-head strong { font-size: 14px; color: var(--ink-900); }
.vt-date { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--ink-500); }
.vt-tasks { position: relative; margin: 0; padding: 4px 0 0 4px; list-style: none; }
.vt-tasks::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--b-100); }
.vt-task { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.vt-task .task-state { position: relative; margin-top: 5px; box-shadow: 0 0 0 3px var(--surface); }
.vt-task a { font-size: 14px; font-weight: 500; color: var(--ink-900); }
.vt-task.is-late a { color: var(--err); }
.vt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 12.5px; color: var(--ink-500); }

/* ---------------------------------------------------------------- Portfolio + dashboard */
.health-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.health-tile {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1), var(--highlight);
}
.health-tile-count { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1; color: var(--b-975); font-variant-numeric: tabular-nums; min-width: 22px; text-align: center; }
.health-tile-off_track .health-tile-count { color: var(--err); }
.health-tile-at_risk .health-tile-count { color: var(--warn); }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.summary-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; overflow: hidden; }
/* A colour edge carries the verdict at a glance */
.summary-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--b-200); }
.summary-on_track::before, .summary-completed::before { background: var(--ok); }
.summary-at_risk::before { background: var(--gold); }
.summary-off_track::before { background: var(--err); }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.summary-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.summary-title a { color: var(--b-975); }
.summary-title a:hover { color: var(--b-700); }
.summary-sub { margin: -6px 0 0; font-size: 13px; color: var(--ink-500); }
.summary-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.summary-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.summary-facts dt { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); }
.summary-facts dd { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-900); overflow-wrap: anywhere; }
.summary-alert { font-weight: 600; color: var(--err); }
.summary-reason { margin: 0; padding: 8px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5; color: var(--ink-700); background: var(--b-25); border: 1px solid var(--line); }
.summary-at_risk .summary-reason { background: var(--warn-bg); border-color: rgba(201, 162, 39, .2); }
.summary-off_track .summary-reason { background: var(--err-bg); border-color: rgba(184, 64, 58, .16); }
.summary-link { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; font-size: 13.5px; font-weight: 600; }

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-grid > .card { margin: 0; }
.dash-wide { grid-column: 1 / -1; }
.section-title { margin: 6px 0 12px 4px; font-size: 16px; font-weight: 600; color: var(--ink-900); }
.dash-list { display: grid; margin: 0; padding: 0; list-style: none; }
.dash-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.dash-row:first-child { border-top: 0; padding-top: 0; }
.dash-main { min-width: 0; flex: 1; }
.dash-links { margin: 16px 0 0; font-size: 13.5px; font-weight: 500; }
.stat-value.is-alert { color: var(--err); }

/* ---------------------------------------------------------------- Invoices */
.new-invoice select.field-input { width: auto; min-width: 220px; height: 52px; }
.new-invoice { align-items: center; }
.invoice-amount { text-align: right; white-space: nowrap; }
.sub-panel { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.sub-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sub-panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.agreement-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.agreement-row form { margin: 0; }
.agreement-row.is-paused .row-title { color: var(--ink-400); }
.money-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.money-tile {
    display: grid; gap: 2px; min-width: 220px; padding: 14px 18px; border-radius: var(--r-lg);
    background: linear-gradient(145deg, #fff, var(--b-25)); border: 1px solid var(--line); box-shadow: var(--sh-2), var(--highlight);
}
.money-label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-400); }
.money-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--b-975); font-variant-numeric: tabular-nums; }
.money-late { font-size: 12.5px; font-weight: 600; color: var(--err); }
.money-ok { font-size: 12.5px; color: var(--ok); }
.data-table td.is-late-cell { color: var(--err); font-weight: 600; }
.identity-meta .meta-amount { font-size: 14px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .18); }
.invoice-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -4px 0 16px 4px; font-size: 13.5px; }
.invoice-lines tfoot td { padding-top: 14px; border-top: 2px solid var(--b-900); border-bottom: 0; font-size: 15px; font-weight: 700; color: var(--b-975); }
.invoice-lines .line-desc { font-weight: 600; }
.invoice-notes { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); }
.pay-box { margin-top: 16px; padding: 14px; border-radius: var(--r-md); background: var(--b-25); border: 1px solid var(--line); }
.paid-form { margin-bottom: 14px; }
.inline-field { display: flex; gap: 8px; }
.inline-field .field-input { height: 38px; font-size: 13.5px; }
.action-row { margin: 0 0 4px; }
.action-note { margin: 10px 0 0; }
.btn-block { width: 100%; }

.form-section-wide { grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); }
.lines-list { display: grid; gap: 10px; }
.line-row {
    display: grid; grid-template-columns: minmax(200px, 1.6fr) 90px 100px 130px minmax(110px, 1fr) 36px; gap: 10px 10px; align-items: start;
    padding: 12px; border-radius: var(--r-md); background: var(--b-25); border: 1px solid var(--line);
}
.line-row.is-removed { opacity: .45; }
.line-row.is-removed .line-cell { text-decoration: line-through; }
.line-cell { display: grid; gap: 6px; min-width: 0; }
.line-cell .field-input { height: 40px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.line-desc-cell { grid-column: 1 / 6; }
.line-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-400); }
.line-amount output { display: flex; align-items: center; height: 40px; font-weight: 700; color: var(--ink-900); font-variant-numeric: tabular-nums; justify-content: flex-end; }
.line-amount .line-label { text-align: right; }
.line-remove { position: relative; grid-column: 6; display: grid; place-items: center; width: 36px; height: 36px; margin-top: 23px; border-radius: var(--r-sm); color: var(--ink-400); cursor: pointer; }
.line-remove:hover { color: var(--err); background: var(--err-bg); }
.line-remove input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.line-remove:has(input:checked) { color: #fff; background: var(--err); }
.line-remove:has(input:focus-visible) { box-shadow: var(--ring); }
.lines-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.lines-total { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-700); }
.lines-total output { margin-left: 8px; font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--b-975); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Notes */
.note-form { margin-bottom: 18px; padding: 12px; border-radius: var(--r-md); background: var(--b-25); border: 1px solid var(--line); }
.note-form textarea.field-input { min-height: 84px; }
.note-form-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.note-form-bar select.field-input { width: auto; height: 38px; font-size: 13.5px; border-radius: var(--r-sm); }
.notes { display: grid; margin: 0; padding: 0; list-style: none; }
.note { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.note:first-child { border-top: 0; }
.note form { margin: 0; }
.note-body { min-width: 0; flex: 1; }
.note-meta { margin: 0 0 4px; font-size: 12.5px; color: var(--ink-500); }
.note-meta strong { color: var(--ink-900); font-weight: 600; }
.note-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; font-size: 14px; color: var(--b-700); background: var(--b-50); border: 1px solid var(--line); }
.note-call { color: var(--ok); background: var(--ok-bg); }
.note-meeting { color: #7a5c00; background: var(--gold-soft); border-color: rgba(201, 162, 39, .3); }

/* ---------------------------------------------------------------- Motion */
.rise { animation: rise .6s var(--ease) both; }
.rise-2 { animation-delay: .06s; }
.rise-3 { animation-delay: .12s; }
.rise-4 { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Responsive */
/* Blueprints step aside when their containers narrow */
/* Wide screens: forms fill the width in four columns instead of stretching each input */
@media (min-width: 1600px) {
    .form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-grid .span-2 { grid-column: span 2; }
    .form-grid .field:has(textarea), .form-grid .form-inline-actions { grid-column: 1 / -1; }
}

@media (max-width: 1400px) {
    .hero-card { padding-bottom: 168px; min-height: 0; }
    .hero-card > div { max-width: 640px; }
    .hero-card::after {
        background-position: right 12px bottom 8px; background-size: auto 156px;
        -webkit-mask-image: none; mask-image: none;
    }
}

@media (max-width: 1220px) {
    .auth-panel::after { opacity: .177; }
}

@media (max-width: 1180px) {
    .dash-grid { grid-template-columns: 1fr; }
    .report-hero { grid-template-columns: 1fr 1fr; }
    .report-actions { grid-column: 1 / -1; flex-direction: row; }
    .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-section, .form-section-wide { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 1024px) {
    .app { grid-template-columns: 1fr; background: none; }
    .side {
        position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--side-w), 86vw);
        transform: translateX(-102%); visibility: hidden;
        transition: transform .35s var(--ease), visibility 0s linear .35s;
    }
    .side.is-open {
        transform: none; visibility: visible; transition: transform .35s var(--ease);
        box-shadow: 24px 0 48px -24px rgba(0, 0, 0, .5);
    }
    .scrim {
        display: block; position: fixed; inset: 0; z-index: 35;
        background: rgba(0, 17, 31, .42);
        -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
        opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
    }
    .scrim.is-open { opacity: 1; pointer-events: auto; }
    .topbar { padding: 0 20px; }
    .topbar .menu-btn { display: grid; }
    .page { padding: 28px 20px 48px; }
}

@media (max-width: 960px) {
    .auth { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .auth-main { align-items: flex-start; padding: 32px 20px 48px; }
    .auth-mobile-brand {
        display: flex; align-items: center; justify-content: space-between;
        margin: -32px -20px 32px; padding: 18px 20px;
        background: var(--g-deep); position: relative; overflow: hidden;
    }
    .auth-mobile-brand::before {
        content: ""; position: absolute; inset: 0;
        background: radial-gradient(360px 180px at 0% 0%, rgba(26, 104, 165, .55), transparent 70%);
    }
    .auth-mobile-brand::after {
        content: ""; position: absolute; inset: 0; pointer-events: none;
        background: url("../img/blueprint-architecture.5281e9cd028d.svg") right -40px top -70px / 300px auto no-repeat;
        opacity: .184;
    }
    .auth-mobile-brand .brand { position: relative; }
    .auth-protected-mobile { display: flex; justify-content: center; margin-top: 28px; }
    .auth-protected-mobile .protected { color: var(--ink-500); background: var(--surface); border-color: var(--line); box-shadow: var(--sh-1), var(--highlight); }
    .auth-protected-mobile .protected:hover { color: var(--ink-900); border-color: var(--line-strong); }
    .auth-protected-mobile .protected-name { color: var(--b-900); }
    .auth-protected-mobile .protected img { padding: 3px; background: var(--g-deep); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
}

@media (max-width: 720px) {
    .filter-bar { padding: 12px; }
    .range-form { flex-wrap: wrap; }
    .range-input { width: 140px; }
    .table-wrap { margin: 0 -16px; padding: 0 16px; }
    .facts { grid-template-columns: 1fr; gap: 2px; }
    .facts dd { margin-bottom: 8px; }

    .toolbar { padding: 10px; }
    .toolbar-search { flex-basis: 100%; }
    .toolbar select.field-input { flex: 1 1 calc(50% - 5px); max-width: none; }
    .toolbar-range { flex: 1 1 100%; justify-content: space-between; min-width: 0; padding: 0 4px 0 12px; }
    .toolbar-range input { flex: 1 1 0; width: 0; min-width: 0; padding: 0 2px; font-size: 13px; }
    .status-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .status-tabs::-webkit-scrollbar { display: none; }
    .toolbar .btn-sm { flex: 1 1 100%; }

    /* Lists become stacked cards: one card per record, labels from data-label */
    .list-card { padding: 0; background: none; border: 0; box-shadow: none; }
    .data-table.stack thead { display: none; }
    .data-table.stack, .data-table.stack tbody, .data-table.stack tr, .data-table.stack td { display: block; width: 100%; }
    .data-table.stack tr {
        padding: 14px 16px; margin-bottom: 10px; border-radius: var(--r-lg);
        background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2), var(--highlight);
    }
    .data-table.stack tbody tr:hover td { background: none; }
    .data-table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 7px 0; border: 0; text-align: right; }
    .data-table.stack td::before { content: attr(data-label); flex: none; font-size: 12.5px; font-weight: 500; color: var(--ink-500); text-align: left; }
    .data-table.stack td.cell-head { display: block; padding: 0 28px 12px 0; margin-bottom: 6px; border-bottom: 1px solid var(--line); text-align: left; }
    .data-table.stack td.cell-head::before, .data-table.stack td.cell-chevron::before, .data-table.stack td:empty { display: none; }
    .data-table.stack td.cell-chevron { position: absolute; top: 18px; right: 14px; width: auto; padding: 0; }
    .data-table.stack .cell-primary { min-width: 0; }
    .data-table.stack .num { white-space: normal; }

    .form-card { padding: 4px 18px; }
    .form-section { padding: 22px 0; }
    .form-grid { grid-template-columns: 1fr; }
    .form-actions { bottom: 10px; padding: 10px; }
    .form-actions .btn { flex: 1 1 auto; }
    .form-actions .form-actions-note { flex-basis: 100%; padding: 0 4px 4px; }

    .identity { flex-direction: column; align-items: flex-start; gap: 16px; padding: 24px 20px; }
    .person { flex-wrap: wrap; }
    .line-row { grid-template-columns: 1fr 1fr; }
    .line-desc-cell { grid-column: 1; }
    .line-remove { justify-self: end; grid-column: 2; }
    .new-invoice { width: 100%; }
    .new-invoice select.field-input { flex: 1; min-width: 0; }
    .money-tile { flex: 1 1 100%; }
    .gantt-panel.is-ready .gantt { display: none; }
    .gantt-panel.is-ready .vtimeline { display: grid; }
    .report-hero { grid-template-columns: 1fr; padding: 24px 20px; }
    .report-actions { flex-direction: row; flex-wrap: wrap; }
    /* Phones: only the last two levels of the trail, on one line */
    .crumbs > *:not(:nth-last-child(-n+3)) { display: none; }
    .composer-bar .btn-post { flex: 1 1 100%; margin-left: 0; }
    .entry-card { padding: 14px; }
    .message { padding: 22px 18px; }
    .date-compare { grid-template-columns: 1fr; }
    .task-row { flex-wrap: wrap; }
    .task-quick { order: 3; margin-left: 22px; }
    .project-row { grid-template-columns: minmax(0, 1fr) auto; }
    .project-row .progress-cell { grid-column: 1 / -1; }
    .person-actions { width: 100%; padding-left: 48px; }
    .form-actions .btn-danger { order: 3; flex-basis: 100%; }
    .identity-mark { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }
    .identity-actions { width: 100%; }
    .identity-actions .btn { flex: 1; }
    .list-meta { margin-left: 2px; margin-right: 2px; }

    .hero-card { padding: 28px 24px 150px; }
    .hero-card > div { max-width: none; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .topbar-end .chip-date { display: none; }
}

@media (max-width: 520px) {
    .grid-stats { gap: 12px; }
    .stat { padding: 16px; }
    .stat-top { margin-bottom: 14px; }
    .stat-top .pill { display: none; }
    .stat-value { font-size: 24px; }
}

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

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- Print (reports) */
@media print {
    @page { size: A4; margin: 14mm; }
    body.portal { background: #fff !important; font-size: 12px; }
    .side, .topbar, .scrim, .skip-link, .no-print, .form-actions, .danger-zone { display: none !important; }
    .app { display: block; background: none; }
    .page { padding: 0; }
    .card, .report-hero { box-shadow: none !important; break-inside: avoid; }
    .card { border-color: #d6e2ec; }
    .rise { animation: none !important; }
    .report-hero { color: #001a2f; background: #fff !important; border: 2px solid #01579b; }
    .report-hero::before, .report-hero::after { display: none; }
    .report-hero .eyebrow, .report-date, .report-reasons { color: #2d4459 !important; }
    .report-verdict { background: #f0f5fa; border-color: #d6e2ec; }
    .grid-stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .stat { padding: 12px; }
    .stat-value { font-size: 20px; }
    .stat-icon { display: none; }
    .report-hero { grid-template-columns: 1.2fr 1fr; padding: 18px 20px; }
    .report-hero h1 { font-size: 22px; }
    /* A4 is narrower than the phone breakpoint: keep real tables, no scrollbars */
    .table-wrap { overflow: visible !important; margin: 0 !important; padding: 0 !important; }
    .data-table.stack { display: table; }
    .data-table.stack thead { display: table-header-group; }
    .data-table.stack tbody { display: table-row-group; }
    .data-table.stack tr { display: table-row; padding: 0; margin: 0; border: 0; box-shadow: none; }
    .data-table.stack td { display: table-cell; padding: 7px 8px; border-bottom: 1px solid #d6e2ec; text-align: left; }
    .data-table.stack td::before { display: none; }
    .data-table td, .data-table th { white-space: nowrap; font-size: 11px; }
    .data-table .cell-primary { min-width: 0; }
    .report-lists .card { padding: 12px; }
    .gantt-panel { break-before: page; }
    .g-wrap { break-inside: avoid; }
    .gantt-panel.is-ready .gantt { display: block !important; }
    .gantt-panel.is-ready .vtimeline { display: none !important; }
    .g-toolbar .seg { display: none; }
    .g-scroll { overflow: visible; }
    .g-wrap { grid-template-columns: 170px 1fr; }
    .g-bar { filter: none; }
    a { color: inherit; }
}

/* ---------------------------------------------------------------- Outreach */
.email-preview { overflow-x: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #1f2933; }
.email-preview p { max-width: none; }
.compose-fields { display: grid; gap: 4px; }
.compose-fields textarea { min-height: 150px; }
.compose-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.compose-actions .btn { flex: 1 1 auto; justify-content: center; }
.outreach-sent { display: grid; margin: 0; padding: 0; list-style: none; }
.outreach-sent li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.outreach-sent li:first-child { border-top: 0; }
.outreach-sent a { font-weight: 600; }
.outreach-outcome { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.batch-preview { margin-bottom: 16px; }
.batch-preview > summary { cursor: pointer; list-style: none; }
.batch-preview > summary::-webkit-details-marker { display: none; }
.batch-preview > summary::after { content: "\f282"; font-family: bootstrap-icons; margin-left: auto; color: var(--ink-500); transition: transform .15s; }
.batch-preview[open] > summary::after { transform: rotate(180deg); }
.batch-preview:not([open]) > summary { margin-bottom: 0; }
.batch-pick { width: 36px; }
.batch-pick input { width: 18px; height: 18px; accent-color: var(--b-700); cursor: pointer; }
