/* ============================================================
   NovaTeams — base stylesheet
   Distilled from the Webnova internal branding guide.
   Glass + Nordic palette, Sora display, Plus Jakarta body.
   ============================================================ */

:root {
    /* Light mode (default) */
    --bg:            #ffffff;
    --bg-alt:        #eeece5;
    --bg-tint:       #eef1f3;
    --bg-warm:       #f7f6f2;
    --ink:           #0e1014;
    --ink-2:         #2a2d33;
    --ink-muted:     #6b6e75;
    --ink-faint:     #a7a9ae;
    --line:          rgba(14,16,20,0.08);
    --line-strong:   rgba(14,16,20,0.16);
    --surface:       rgba(255,255,255,0.55);
    --surface-strong:rgba(255,255,255,0.78);
    --surface-flat:  #ffffff;
    --glass-border:  rgba(255,255,255,0.55);
    --glass-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 -1px 0 0 rgba(255,255,255,0.10) inset,
        0 20px 40px -20px rgba(14,16,20,0.18),
        0 6px 16px -8px rgba(14,16,20,0.08);
    --shadow-card:
        0 22px 44px -20px rgba(14,16,20,0.18),
        0 6px 18px -8px rgba(14,16,20,0.08);
    --code-bg:       rgba(14,16,20,0.04);

    /* Brand accents (constant) */
    --accent:        #191930;
    --accent-soft:   #a8d4dc;
    --accent-tint:   rgba(25,25,48,0.10);
    --cyan:          #02d9ff;
    --purple:        #7b61ff;
    --gradient:      linear-gradient(135deg,#02d9ff,#7b61ff);
    --gradient-soft: linear-gradient(135deg,rgba(2,217,255,0.10),rgba(123,97,255,0.10));

    /* Status */
    --green:         #2ecc71;
    --amber:         #ffb547;
    --red:           #ff5d6c;

    /* Type */
    --font-display:  'Sora', sans-serif;
    --font-body:     'Plus Jakarta Sans', sans-serif;

    /* Radii */
    --r-sm: 10px;
    --r-md: 18px;
    --r-lg: 24px;
    --r-xl: 32px;
    --r-pill: 999px;

    /* Spacing */
    --s-1: 0.5rem;
    --s-2: 1rem;
    --s-3: 1.5rem;
    --s-4: 2.5rem;
    --s-5: 4rem;
    --gutter: clamp(1.25rem,4vw,3rem);
    --max:    1480px;

    /* Motion */
    --ease:     cubic-bezier(0.22,0.61,0.36,1);
    --ease-out: cubic-bezier(0.16,1,0.30,1);
    --t-fast:   240ms;
    --t-med:    480ms;
}

[data-theme="dark"] {
    --bg:            #0d1015;
    --bg-alt:        #141922;
    --bg-tint:       #101018;
    --bg-warm:       #16161f;
    --ink:           #f7f6f2;
    --ink-2:         rgba(247,246,242,0.84);
    --ink-muted:     rgba(247,246,242,0.58);
    --ink-faint:     rgba(247,246,242,0.32);
    --line:          rgba(247,246,242,0.10);
    --line-strong:   rgba(247,246,242,0.20);
    --surface:       rgba(20,25,34,0.48);
    --surface-strong:rgba(20,25,34,0.72);
    --surface-flat:  #16161f;
    --glass-border:  rgba(255,255,255,0.08);
    --glass-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 20px 40px -20px rgba(0,0,0,0.60);
    --shadow-card:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 30px 80px -30px rgba(0,0,0,0.60);
    --code-bg:       rgba(247,246,242,0.05);
    /* --accent is a constant navy in :root — invisible on dark. Lift it so every
       icon/border/focus that uses it stays visible. (--accent-tint kept as-is.) */
    --accent:        #e9edf4;
}

/* ─── Reset ─────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
    overflow-x: hidden;
}
img,svg { display:block; max-width:100%; }
h1,h2,h3,h4,h5,h6 { margin:0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink); }
p { margin: 0 0 1em; color: var(--ink-2); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul { list-style: none; padding: 0; margin: 0; }
input, textarea, select { font: inherit; color: inherit; }

/* ─── Ambient backdrop (glow orbs) ──────────────────────── */
.bg-orbs {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none; overflow: hidden;
}
.orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.6;
    animation: drift 24s ease-in-out infinite;
}
.orb-1 { top: -160px; right: -120px; width: 620px; height: 620px;
    background: radial-gradient(circle, rgba(2,217,255,0.32) 0%, transparent 70%); }
.orb-2 { bottom: -140px; left: -100px; width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(123,97,255,0.28) 0%, transparent 70%);
    animation-delay: -8s; }
.orb-3 { top: 40%; left: 30%; width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(25,25,48,0.22) 0%, transparent 70%);
    animation-delay: -14s; }
/* Both themes use a static gradient wash on the fixed .bg-orbs layer (the
   drifting orbs are hidden) so the glass surfaces float on a calm backdrop. */
.orb { display: none; }

/* Light — cyan ↖ → purple ↘, but with a large soft white wash through the
   middle so the centre reads calm and only the corners keep the gradient. */
[data-theme="light"] .bg-orbs {
    background:
        radial-gradient(ellipse 95% 88% at 50% 50%, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.64) 46%, transparent 82%),
        radial-gradient(ellipse at 12% 18%, rgba(2,217,255,0.20), transparent 58%),
        radial-gradient(ellipse at 88% 84%, rgba(123,97,255,0.18), transparent 58%),
        linear-gradient(135deg, rgba(2,217,255,0.12), rgba(123,97,255,0.12));
}

/* Dark — borrowed from the webnova .wn-stats section: teal ↖, purple →,
   peach ↓ over a navy base, plus its soft blurred glow overlay. */
[data-theme="dark"] .bg-orbs {
    background:
        radial-gradient(ellipse at 20% 20%, rgba(63,152,166,0.35), transparent 55%),
        radial-gradient(ellipse at 80% 70%, rgba(130,90,180,0.28), transparent 60%),
        radial-gradient(ellipse at 50% 100%, rgba(255,150,120,0.15), transparent 55%),
        linear-gradient(180deg, #0d1015 0%, #16202b 100%);
}
[data-theme="dark"] .bg-orbs::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 40%, rgba(255,255,255,0.08) 0, transparent 30%),
        radial-gradient(circle at 70% 80%, rgba(63,152,166,0.40) 0, transparent 40%);
    filter: blur(80px);
    pointer-events: none;
}
@keyframes drift {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(40px,-30px) scale(1.05); }
}

/* ─── Brand wordmark ────────────────────────────────────── */
.brand {
    display: inline-flex; align-items: baseline; gap: 0;
    font-family: var(--font-display);
    font-size: 1.35rem; letter-spacing: -0.5px;
    color: var(--ink);
}
.brand b { font-weight: 600; }
.brand .nova { font-weight: 200; }
.brand.gradient {
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.eyebrow {
    display: inline-flex; align-items: center; gap: 0.6rem;
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--accent);
}
.eyebrow::before { content:''; width:22px; height:1px; background: currentColor; opacity:0.7; }
/* --accent flips to a light fill in dark mode (see the dark :root). The eyebrow
   reads a touch more muted, and solid-accent chips/badges need dark text on it. */
[data-theme="dark"] .eyebrow { color: var(--ink-2); }
[data-theme="dark"] .nav-badge,
[data-theme="dark"] .lf-chip.is-on { color: var(--bg); }

/* ─── Theme toggle pill ─────────────────────────────────── */
.theme-toggle {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 1rem;
    border-radius: var(--r-pill);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.82rem; font-weight: 500;
    transition: all var(--t-fast) var(--ease);
}
.theme-toggle:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.theme-toggle i { font-size: 1.1rem; color: var(--accent); }
[data-theme="dark"] .theme-toggle .icon-sun,
[data-theme="light"] .theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ─── Glass + card primitives ───────────────────────────── */
.glass {
    background: var(--surface);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--r-md);
    position: relative;
    overflow: hidden;
}
.glass::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.08) 100%);
    pointer-events: none; mix-blend-mode: overlay;
}
[data-theme="dark"] .glass::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.06) 100%);
}
.card {
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-card);
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--r-pill);
    font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 500;
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
}
.btn i { font-size: 1.05rem; transition: transform var(--t-fast) var(--ease); }
.btn:hover i { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-glass {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(1.6);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    color: var(--ink);
    box-shadow: var(--glass-shadow);
}
.btn-glass:hover { background: var(--surface-strong); transform: translateY(-1px); }
.btn-gradient {
    background: var(--gradient);
    color: #08080d;
    font-weight: 600;
}
.btn-gradient:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-block { width: 100%; }

/* Light mode: every pill button is outline-only — no fill, just a border and
   centred text. Fills in on hover for feedback. Overrides all .btn variants. */
[data-theme="light"] .btn {
    background: transparent;
    border-color: var(--ink-muted);
    color: var(--ink);
}
[data-theme="light"] .btn:hover {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
    filter: none;
}

/* ─── Inputs ────────────────────────────────────────────── */
.input {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--r-pill);
    background: var(--code-bg);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.88rem;
    transition: all var(--t-fast) var(--ease);
}
.input:focus-within { border-color: var(--accent); background: var(--surface-flat); }
.input i { color: var(--ink-muted); font-size: 1.1rem; }
.input input { background: transparent; border: 0; outline: 0; color: inherit; flex: 1; font: inherit; }
.input input::placeholder { color: var(--ink-faint); }

.field-label {
    font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 500;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 0.45rem;
    display: block;
}

/* ─── Alerts ────────────────────────────────────────────── */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--r-sm);
    font-size: 0.86rem;
    border: 1px solid var(--line);
    background: var(--code-bg);
    margin-bottom: 1rem;
}
.alert-error { border-color: rgba(255,93,108,0.32); background: rgba(255,93,108,0.08); color: var(--red); }

/* ─── Login page ────────────────────────────────────────── */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--gutter);
    position: relative;
    z-index: 1;
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.6rem 2.4rem 2.4rem;
}
.login-card .login-brand {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem;
}
.login-card h1 {
    font-size: 1.6rem; font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}
.login-card .lead {
    font-size: 0.92rem;
    color: var(--ink-muted);
    margin-bottom: 1.6rem;
}
.login-card form { display: flex; flex-direction: column; gap: 1rem; }
.login-card .field { display: flex; flex-direction: column; }
.login-card .honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.login-card .login-meta {
    margin-top: 1.4rem;
    font-size: 0.75rem;
    color: var(--ink-muted);
    text-align: center;
}

/* ===========================================================
   ADMIN AREA — sidebar + main layout
   =========================================================== */
.admin-frame {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    position: relative;
    z-index: 1;
}
@media (max-width: 1100px) {
    .admin-frame { grid-template-columns: 72px 1fr; }
    .sidebar .nav-label, .sidebar .sb-section, .sidebar .user-meta, .sidebar .sb-cta { display: none; }
    .sidebar .nav-link { justify-content: center; padding: 0.7rem; }
    .sidebar { padding: 1rem 0.5rem; }
}
@media (max-width: 760px) {
    .admin-frame { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

/* Sidebar */
.sidebar {
    padding: 1.4rem 1rem;
    border-right: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    display: flex; flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sb-brand {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 1.6rem;
}
.sb-brand .brand { font-size: 1.2rem; }
.sb-section {
    font-family: var(--font-display);
    font-size: 0.65rem; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--ink-faint);
    padding: 0.6rem 0.8rem 0.4rem;
}
.nav-link {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-size: 0.88rem;
    margin-bottom: 0.15rem;
    transition: all var(--t-fast) var(--ease);
    position: relative;
    cursor: pointer;
}
.nav-link i { font-size: 1.25rem; color: var(--ink-muted); }
.nav-link:hover { background: var(--code-bg); color: var(--ink); }
.nav-link.active {
    background: var(--accent-tint);
    color: var(--ink);
}
.nav-link.active i { color: var(--accent); }
.nav-link.active::before {
    content: ''; position: absolute; left: -1rem; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.nav-badge {
    margin-left: auto;
    font-size: 0.7rem; font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: #fff;
}
.nav-badge.muted { background: var(--code-bg); color: var(--ink-muted); }

.sb-user {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem;
    margin-top: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--surface-flat);
}
.sb-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700; font-size: 0.78rem;
    color: #08080d;
    flex-shrink: 0;
}
.user-meta { line-height: 1.2; min-width: 0; }
.user-meta strong { font-size: 0.82rem; display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 0.7rem; color: var(--ink-muted); }

/* Main */
.admin-main {
    padding: 2rem 2.4rem;
    overflow: auto;
    position: relative;
}
@media (max-width: 760px) { .admin-main { padding: 1.4rem 1.2rem; } }

.admin-topbar {
    display: flex; align-items: center; gap: 1rem;
    padding-bottom: 1.6rem;
    margin-bottom: 2.2rem;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.admin-topbar .greeting { flex: 1; min-width: 220px; }
.admin-topbar .greeting h1 {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}
.admin-topbar .greeting p { color: var(--ink-muted); font-size: 0.92rem; margin: 0; }

.searchbox {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: var(--surface);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-pill);
    box-shadow: var(--glass-shadow);
    width: 280px;
    max-width: 40vw;
}
.searchbox i { color: var(--ink-muted); font-size: 1.1rem; }
.searchbox input { background: transparent; border: 0; outline: 0; color: inherit; flex: 1; font: inherit; font-size: 0.85rem; }
.searchbox kbd {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--ink-muted);
}

.icon-button {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--glass-border);
    color: var(--ink);
    transition: all var(--t-fast) var(--ease);
    position: relative;
}
.icon-button:hover { transform: translateY(-1px); }
.icon-button i { font-size: 1.2rem; }

/* Footer */
.app-footer {
    margin-top: 3rem;
    padding: 2rem 2.4rem 2.4rem;
    border-top: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: 0.78rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    flex-wrap: wrap;
}
.app-footer a { color: var(--ink-2); }
.app-footer a:hover { color: var(--ink); }

/* ===========================================================
   MODAL — glass dialog, blurred backdrop
   =========================================================== */
.modal-backdrop {
    position: fixed; inset: 0;
    z-index: 80;
    background: rgba(8, 8, 13, 0.55);
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    display: grid; place-items: center;
    padding: clamp(1rem, 4vw, 2.5rem);
    animation: backdrop-in 220ms var(--ease-out);
}
/* The `hidden` attribute must beat `display: grid` above — otherwise every
   modal (new/edit client, new/edit lead) renders on page load, stacked and
   blocking the board. JS toggles `.hidden` to open/close. */
.modal-backdrop[hidden] { display: none; }
@keyframes backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.8rem 1.8rem 1.4rem;
    position: relative;
    animation: modal-in 240ms var(--ease-out);
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}
.modal-head h3 {
    font-size: 1.4rem; font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}
.modal-head .modal-sub {
    color: var(--ink-muted);
    font-size: 0.86rem;
    margin: 0;
}
.modal-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--code-bg);
    color: var(--ink-muted);
    transition: all var(--t-fast) var(--ease);
    flex-shrink: 0;
}
.modal-close:hover { background: var(--ink); color: var(--bg); }
.modal-close i { font-size: 1.2rem; }

/* ===========================================================
   CLIENT FORM (used inside modal + on /clients/new)
   =========================================================== */
.client-form { display: flex; flex-direction: column; gap: 1.4rem; }
.cf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.95rem 1.1rem;
}
.cf-col-2 { grid-column: span 2; }
@media (max-width: 640px) {
    .cf-grid { grid-template-columns: 1fr; }
    .cf-col-2 { grid-column: span 1; }
}

.cf-grid .field { display: flex; flex-direction: column; gap: 0.3rem; }
.cf-grid select { background: transparent; border: 0; outline: 0; color: inherit; flex: 1; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }
.cf-grid input[type="date"] { background: transparent; border: 0; outline: 0; color: inherit; flex: 1; font: inherit; }
.cf-grid textarea {
    width: 100%;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 0.85rem 1rem;
    color: var(--ink);
    font: inherit;
    resize: vertical;
    transition: all var(--t-fast) var(--ease);
}
.cf-grid textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-flat);
}

.cf-position { padding: 0; border: 0; margin: 0; }
.seg {
    display: inline-flex;
    background: var(--code-bg);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    padding: 0.2rem;
    gap: 0.15rem;
}
.seg-opt { position: relative; cursor: pointer; flex: 1; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt > span {
    display: inline-flex; align-items: center; gap: 0.4rem; justify-content: center;
    padding: 0.45rem 0.95rem;
    border-radius: var(--r-pill);
    font-size: 0.82rem; font-weight: 500;
    color: var(--ink-muted);
    transition: all var(--t-fast) var(--ease);
    white-space: nowrap;
}
.seg-opt > span i { font-size: 1rem; }
.seg-opt input:checked + span {
    background: var(--surface-flat);
    color: var(--ink);
    box-shadow: 0 1px 4px rgba(14,16,20,0.10);
}
.seg-opt:hover > span { color: var(--ink); }

.cf-foot {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--line);
}

/* ===========================================================
   FLASH MESSAGES (above page content)
   =========================================================== */
.flash-stack {
    display: flex; flex-direction: column; gap: 0.6rem;
    margin-bottom: 1.4rem;
}
.flash {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: var(--r-md);
    font-size: 0.86rem;
    border: 1px solid var(--line);
    background: var(--surface-flat);
    box-shadow: var(--shadow-card);
}
.flash i { font-size: 1.2rem; flex-shrink: 0; }
.flash-success { border-color: rgba(46,204,113,0.32); background: rgba(46,204,113,0.06); color: var(--green); }
.flash-error   { border-color: rgba(255,93,108,0.32); background: rgba(255,93,108,0.06); color: var(--red); }
.flash-info    { border-color: var(--line-strong); background: var(--code-bg); color: var(--ink-2); }

/* ===========================================================
   ADMIN — Team management form
   =========================================================== */
.user-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 880px;
}

.user-card {
    padding: 1.4rem 1.4rem 1.2rem;
    display: flex; flex-direction: column; gap: 1.1rem;
}
.uc-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.7rem;
}
.uc-identity { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.uc-email {
    font-size: 0.95rem; font-weight: 600;
    display: block;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 360px;
}
.uc-meta { font-size: 0.74rem; color: var(--ink-muted); }

.uc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem 1.1rem;
}
@media (max-width: 720px) { .uc-grid { grid-template-columns: 1fr; } }

.uc-grid .field { display: flex; flex-direction: column; gap: 0.3rem; }
.field-hint {
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-top: 0.1rem;
}

.input-prefix {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink-muted);
    margin-right: -0.2rem;
}

.input select {
    background: transparent; border: 0; outline: 0;
    color: inherit; flex: 1; font: inherit;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.input select:disabled { color: var(--ink-muted); cursor: not-allowed; }

/* Native dropdown list (the popup of options) must be readable in both themes.
   Options otherwise inherit the light text colour → white-on-white on dark. */
select option {
    color: var(--ink);
    background: var(--surface-flat);
}
[data-theme="light"] select option { background: #ffffff; color: #12151b; }
[data-theme="dark"]  select option { background: #141a24; color: #e8ecf2; }

/* iOS-style switch */
.switch-field {
    flex-direction: column;
    gap: 0.5rem;
}
.switch {
    display: inline-block;
    position: relative;
    width: 44px; height: 24px;
    flex-shrink: 0;
}
.switch input {
    position: absolute; opacity: 0;
    width: 0; height: 0;
}
.switch-track {
    position: absolute; inset: 0;
    background: var(--code-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    transition: all var(--t-fast) var(--ease);
    cursor: pointer;
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: var(--ink);
    border-radius: 50%;
    transition: all var(--t-fast) var(--ease);
}
.switch input:checked + .switch-track {
    background: var(--gradient);
    border-color: transparent;
}
.switch input:checked + .switch-track::after {
    transform: translateX(20px);
    background: #08080d;
}
.switch input:disabled + .switch-track { cursor: not-allowed; opacity: 0.65; }

.uc-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--line);
}
.uc-mcp {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: 0.78rem; color: var(--ink-muted);
}
.uc-mcp i { color: var(--accent); font-size: 1rem; }

/* Member-card actions + password field (add-member / change-password) */
.uc-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pw-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; padding: 0.15rem 0.3rem;
    color: var(--ink-muted); cursor: pointer; font-size: 1.05rem;
    border-radius: 6px; transition: color var(--t-fast) var(--ease);
}
.pw-btn:hover { color: var(--accent); }
.pw-input .pw-field { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.02em; }

/* ===========================================================
   BOARD — kanban columns + cards
   =========================================================== */
.board-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 1.4rem; flex-wrap: wrap;
    margin-bottom: 1.6rem;
}
.board-title {
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}
.board-sub {
    color: var(--ink-muted);
    font-size: 0.92rem;
    margin: 0;
    max-width: 56ch;
}
.board-actions { display: inline-flex; gap: 0.6rem; }
.board-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none !important; }

.board-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 1fr);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 3rem;
    scroll-snap-type: x proximity;
}
.board-grid::-webkit-scrollbar { height: 10px; }
.board-grid::-webkit-scrollbar-track { background: transparent; }
.board-grid::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-pill); }

.board-column {
    scroll-snap-align: start;
    background: var(--surface);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--r-lg);
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    position: relative;
    overflow: hidden;
}
.board-column::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.18) 100%);
    pointer-events: none; mix-blend-mode: overlay;
}
[data-theme="dark"] .board-column::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0) 30%, rgba(255,255,255,0) 70%, rgba(255,255,255,0.06) 100%);
}
.board-column-mine {
    border-color: rgba(2,217,255,0.32);
    box-shadow:
        0 0 0 1px rgba(2,217,255,0.20) inset,
        var(--glass-shadow);
}

.board-column-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.7rem;
    padding: 0.4rem 0.4rem 0.9rem;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 0.85rem;
    position: relative;
}
.bc-identity { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.bc-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
    font-weight: 700; font-size: 0.82rem;
    color: #08080d;
    flex-shrink: 0;
}
.bc-meta { line-height: 1.2; min-width: 0; }
.bc-meta strong { font-size: 0.95rem; font-weight: 600; display: block; }
.bc-meta small { font-size: 0.74rem; color: var(--ink-muted); }
.bc-you {
    font-family: var(--font-display);
    font-size: 0.6rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.18em;
    background: var(--accent-tint); color: var(--accent);
    padding: 0.1rem 0.45rem;
    border-radius: var(--r-pill);
    margin-left: 0.4rem;
    vertical-align: 2px;
}
.bc-role {
    color: var(--accent);
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--accent-tint);
    flex-shrink: 0;
}
.bc-role i { font-size: 1.1rem; }

.board-cards {
    display: flex; flex-direction: column; gap: 0.7rem;
    flex: 1;
    position: relative;
}

.board-empty {
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    padding: 1.6rem 1rem;
    text-align: center;
    color: var(--ink-muted);
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.board-empty i { font-size: 1.8rem; color: var(--accent); }
.board-empty strong { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.board-empty small { font-size: 0.78rem; }

/* ─── Card ─────────────────────────────────────────────── */
.board-card {
    background: var(--surface-flat);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 0.95rem 1rem 0.85rem;
    transition: all var(--t-fast) var(--ease);
    cursor: grab;
    position: relative;
    display: flex; flex-direction: column; gap: 0.55rem;
    box-shadow: var(--shadow-card);
}
.board-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow:
        0 22px 44px -22px rgba(2,217,255,0.20),
        var(--shadow-card);
}
.board-card:active { cursor: grabbing; }

.bc-top {
    display: flex; align-items: center; justify-content: space-between;
}
.plan-badge {
    font-family: var(--font-display);
    font-size: 0.62rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.16em;
    padding: 0.25rem 0.55rem;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
}
.plan-starter    { background: rgba(255,181,71,0.14);  color: var(--amber);  border-color: rgba(255,181,71,0.28); }
.plan-growth     { background: rgba(2,217,255,0.10);   color: var(--cyan);   border-color: rgba(2,217,255,0.28); }
.plan-accelerate { background: rgba(123,97,255,0.12);  color: var(--purple); border-color: rgba(123,97,255,0.30); }
.plan-custom_monthly { background: rgba(46,204,113,0.12); color: var(--green);     border-color: rgba(46,204,113,0.30); }
.plan-custom_once    { background: rgba(46,204,113,0.06); color: var(--ink-muted); border-color: var(--line-strong); }

.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 4px var(--surface-flat);
}
.status-active  { background: var(--green); }
.status-paused  { background: var(--amber); }
.status-churned { background: var(--red); }

.bc-name {
    font-family: var(--font-display);
    font-size: 0.98rem; font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--ink);
    margin: 0;
}

.bc-url {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.76rem;
    color: var(--ink-muted);
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-url i { font-size: 0.95rem; color: var(--accent); flex-shrink: 0; }
.bc-url:hover { color: var(--ink); }

.bc-foot {
    display: flex; flex-direction: column; align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.15rem;
}
.bc-money {
    font-family: var(--font-display);
    font-size: 0.84rem; font-weight: 600;
    color: var(--ink);
}

.work-pill-wrap { position: relative; display: inline-block; }
.work-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.66rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.14em;
    padding: 0.3rem 0.65rem;
    border-radius: var(--r-pill);
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    font-family: var(--font-body);
}
.work-pill:hover { transform: translateY(-1px); }
.work-pill.is-open { transform: translateY(-1px); box-shadow: 0 0 0 3px var(--accent-tint); }
.work-pill .wp-caret { font-size: 0.85rem; opacity: 0.65; margin-left: 0.05rem; }
.work-pill > i:first-child { font-size: 0.95rem; }
.work-pill-locked { cursor: default; opacity: 0.85; }
.work-pill-locked:hover { transform: none; }

/* Status dropdown stacking: while the popover is open (board.js adds
   `.is-open` to the pill), lift its card above sibling cards — the card's
   hover transform otherwise traps the popover in its own stacking context —
   and let the column stop clipping so the dropdown isn't cut off at its edge. */
.board-card:has(.work-pill.is-open)   { z-index: 30; }
.board-column:has(.work-pill.is-open) { overflow: visible; }
/* The board frame (.board-grid) scrolls horizontally, which also clips
   vertically — so a dropdown off a bottom card is cut at the frame edge.
   While a dropdown is open, reserve room below the columns so it fits.
   Scoped to the open state to avoid a permanent empty gap under the board. */
.board-grid:has(.work-pill.is-open) { padding-bottom: 500px; }

/* Board page reads cleaner without a trailing bottom bar — hide the drag hint
   and the global footer on this page only. (.board-grid is unique to the board
   page, so :has() scopes the footer rule to it.) */
.board-hint { display: none; }
.admin-main:has(.board-grid) .app-footer { display: none; }

/* Status palettes — color is by category, urgency comes from card border */
.work-pending          { background: var(--code-bg);          color: var(--ink-muted); border-color: var(--line-strong); }
.work-in_progress      { background: rgba(2,217,255,0.10);    color: var(--cyan);      border-color: rgba(2,217,255,0.30); }
.work-awaiting_content { background: rgba(255,181,71,0.14);   color: var(--amber);     border-color: rgba(255,181,71,0.32); }
.work-awaiting_feedback{ background: rgba(255,181,71,0.14);   color: var(--amber);     border-color: rgba(255,181,71,0.32); }
.work-awaiting_approval{ background: rgba(255,181,71,0.14);   color: var(--amber);     border-color: rgba(255,181,71,0.32); }
.work-blocked          { background: rgba(255,93,108,0.14);   color: var(--red);       border-color: rgba(255,93,108,0.32); }
.work-completed        { background: rgba(46,204,113,0.14);   color: var(--green);     border-color: rgba(46,204,113,0.30); }

/* ─── Status popover ──────────────────────────────────── */
.work-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 50;
    min-width: 220px;
    background: var(--surface-strong);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-md);
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 30px 60px -22px rgba(14,16,20,0.45),
        0 8px 22px -10px rgba(14,16,20,0.18);
    padding: 0.5rem;
    animation: wp-pop 180ms var(--ease-out);
}
[data-theme="dark"] .work-popover {
    box-shadow:
        0 1px 0 0 rgba(255,255,255,0.10) inset,
        0 30px 60px -22px rgba(0,0,0,0.65),
        0 8px 22px -10px rgba(0,0,0,0.45);
}
.work-popover::before {
    content: '';
    position: absolute;
    top: -6px; left: 18px;
    width: 12px; height: 12px;
    background: inherit;
    border-top: 1px solid var(--glass-border);
    border-left: 1px solid var(--glass-border);
    transform: rotate(45deg);
}
@keyframes wp-pop {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.wp-header {
    font-family: var(--font-display);
    font-size: 0.6rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.18em;
    color: var(--ink-faint);
    padding: 0.4rem 0.65rem 0.5rem;
}
.wp-list { display: flex; flex-direction: column; gap: 0.1rem; }
.wp-option {
    display: flex; align-items: center; gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: var(--r-sm);
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    transition: all var(--t-fast) var(--ease);
    border: 1px solid transparent;
    cursor: pointer;
}
.wp-option:hover { background: var(--code-bg); }
.wp-option:focus-visible { outline: none; background: var(--code-bg); border-color: var(--line-strong); }
.wp-option > i:first-child { font-size: 1.1rem; flex-shrink: 0; }
.wp-option > span { flex: 1; }
.wp-option .wp-check { font-size: 1rem; color: var(--accent); }
.wp-option.is-current { background: var(--accent-tint); }
.wp-option.is-current:hover { background: var(--accent-tint); }

/* Tint each option by status colour */
.wp-option.work-pending          > i:first-child { color: var(--ink-muted); }
.wp-option.work-in_progress      > i:first-child { color: var(--cyan); }
.wp-option.work-awaiting_content > i:first-child,
.wp-option.work-awaiting_feedback> i:first-child,
.wp-option.work-awaiting_approval> i:first-child { color: var(--amber); }
.wp-option.work-blocked          > i:first-child { color: var(--red); }
.wp-option.work-completed        > i:first-child { color: var(--green); }

/* ─── Follow-up indicators ────────────────────────────── */
.warn-line {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--amber);
    margin-top: 0.05rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255,181,71,0.10);
    border: 1px solid rgba(255,181,71,0.25);
    border-radius: var(--r-pill);
    align-self: flex-start;
}
.warn-line i { font-size: 0.95rem; }

.chase-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    align-self: flex-start;
    padding: 0.4rem 0.85rem;
    border-radius: var(--r-pill);
    background: rgba(255,93,108,0.12);
    color: var(--red);
    border: 1px solid rgba(255,93,108,0.40);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    box-shadow: 0 0 0 0 rgba(255,93,108,0.4);
    animation: chase-pulse 2.4s ease-in-out infinite;
}
.chase-btn:hover {
    background: var(--red);
    color: #fff;
    transform: translateY(-1px);
}
.chase-btn:disabled { opacity: 0.6; cursor: not-allowed; animation: none; }
.chase-btn i { font-size: 1.05rem; }
@keyframes chase-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,93,108,0.30); }
    50%      { box-shadow: 0 0 0 6px rgba(255,93,108,0); }
}

/* Card-level border treatment by follow-up level */
.board-card.card-follow-warn {
    border-color: rgba(255,181,71,0.45);
    box-shadow:
        0 0 0 1px rgba(255,181,71,0.18) inset,
        var(--shadow-card);
}
.board-card.card-follow-overdue {
    border-color: rgba(255,93,108,0.55);
    box-shadow:
        0 0 0 1px rgba(255,93,108,0.22) inset,
        0 22px 44px -22px rgba(255,93,108,0.28),
        var(--shadow-card);
}
.board-card.card-readonly { opacity: 0.92; cursor: not-allowed; }

/* ─── Drag-and-drop (SortableJS) ────────────────────────── */
/* Ghost: where the card will land. */
.board-card.card-drag-ghost {
    opacity: 0.4;
    background: var(--gradient-soft);
    border: 1px dashed var(--cyan);
    box-shadow: none;
}
.board-card.card-drag-ghost > * { visibility: hidden; }
/* Chosen: the original element that's being picked up. */
.board-card.card-drag-chosen {
    cursor: grabbing;
    box-shadow:
        0 24px 48px -16px rgba(2,217,255,0.35),
        0 0 0 1px rgba(2,217,255,0.45) inset,
        var(--shadow-card);
}
/* While dragging, dim the rest of the cards a touch so the target stands out. */
body.is-dragging-card .board-card:not(.card-drag-chosen):not(.card-drag-ghost) {
    opacity: 0.85;
}
body.is-dragging-card { cursor: grabbing; }

/* Card click affordance — hint when editable */
.board-card[data-can-edit="1"] .bc-name {
    transition: color var(--t-fast) var(--ease);
}
.board-card[data-can-edit="1"]:hover .bc-name {
    color: var(--accent);
}

/* ============================================================
   Progress page — earnings cards + tables
   ============================================================ */

.earnings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}
.earnings-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1100px) {
    .earnings-grid, .earnings-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .earnings-grid, .earnings-grid-4 {
        grid-template-columns: 1fr;
    }
}

.earn-card {
    padding: 1.3rem 1.4rem 1.2rem;
    display: flex; flex-direction: column; gap: 0.45rem;
    position: relative;
    overflow: hidden;
}
.earn-card::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--gradient);
    opacity: 0.6;
}
.earn-card.earn-card-mid::before { opacity: 0.35; }
.earn-card.earn-card-take.is-floor::before {
    background: linear-gradient(135deg, var(--amber), var(--cyan));
}
.earn-card.earn-card-take.is-commission::before {
    background: linear-gradient(135deg, var(--green), var(--cyan));
}
.earn-card.earn-card-net.is-positive::before {
    background: linear-gradient(135deg, var(--green), var(--cyan));
}
.earn-card.earn-card-net.is-negative::before {
    background: linear-gradient(135deg, var(--red), var(--amber));
}

.earn-eyebrow {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.earn-figure {
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.earn-meta {
    font-size: 0.78rem;
    color: var(--ink-muted);
    display: flex; align-items: center; gap: 0.45rem;
    flex-wrap: wrap;
}
.earn-meta i { font-size: 1rem; color: var(--accent); }
.earn-tag {
    font-size: 0.62rem;
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
    background: var(--accent-tint);
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Live vs In-Development MRR split (display only — money math unchanged) */
.mrr-split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 640px) {
    .mrr-split-grid { grid-template-columns: 1fr; }
}
.earn-card-live::before {
    background: linear-gradient(135deg, var(--green), var(--cyan));
    opacity: 0.75;
}
.earn-card-indev::before {
    background: linear-gradient(135deg, var(--amber), var(--cyan));
    opacity: 0.5;
}
/* In-Development is "almost money" — soften the figure so Live reads as the real number. */
.earn-card-indev .earn-figure { color: var(--ink-muted); }
.earn-tag-pipeline {
    background: transparent;
    border: 1px solid var(--amber);
    color: var(--amber);
    margin-left: 0.45rem;
    vertical-align: middle;
}

.progress-section-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 2rem 0 0.4rem;
    display: flex; align-items: center; gap: 0.55rem;
    color: var(--ink);
}
.progress-section-title i { font-size: 1.3rem; color: var(--accent); }
.progress-section-sub {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin: 0 0 0.9rem;
}

/* ─── Per-member breakdown cards ──────────────────── */
.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
    margin-top: 0.6rem;
}
.member-card {
    padding: 1.1rem 1.2rem 1rem;
    display: flex; flex-direction: column; gap: 0.7rem;
}
.member-card.is-mine {
    box-shadow: 0 0 0 1px var(--cyan) inset, var(--glass-shadow);
}
.member-head {
    display: flex; align-items: baseline; justify-content: space-between;
}
.member-head strong {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}
.member-head small { font-size: 0.7rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.12em; }
.member-rows {
    display: flex; flex-direction: column; gap: 0.3rem;
    border-top: 1px solid var(--line);
    padding-top: 0.65rem;
}
.member-rows > div {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 0.86rem;
}
.member-rows > div span { color: var(--ink-muted); }
.member-rows > div strong { font-family: var(--font-display); font-weight: 500; }
.member-row-take {
    border-top: 1px dashed var(--line);
    padding-top: 0.4rem;
    margin-top: 0.2rem;
}
.member-row-take strong { font-size: 1.05rem; color: var(--ink); }
.member-foot {
    display: flex; gap: 0.7rem; flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 0.55rem;
    font-size: 0.74rem;
    color: var(--ink-muted);
    align-items: center;
}
.member-foot .member-floor,
.member-foot .member-clear {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 99px;
    background: var(--accent-tint);
    color: var(--accent);
    font-weight: 600;
}
.member-foot .member-floor i,
.member-foot .member-clear i { font-size: 0.9rem; }

/* ─── Progress tables ─────────────────────────────── */
.progress-table-wrap {
    margin-top: 0.6rem;
    padding: 0;
    overflow: hidden;
}
.progress-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.progress-table th,
.progress-table td {
    padding: 0.7rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.progress-table thead th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: var(--bg-tint);
}
.progress-table tbody tr:last-child td { border-bottom: none; }
.progress-table tbody tr:hover { background: var(--accent-tint); }
.progress-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.progress-table .action-col { width: 1px; white-space: nowrap; text-align: right; }
.progress-table .row-completed td { opacity: 0.7; }
.progress-table .row-inactive td { opacity: 0.55; font-style: italic; }
.progress-table .owner-company {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.78rem;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    background: var(--accent-tint);
    color: var(--accent);
    font-weight: 600;
}

.btn-ghost.btn-sm {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: var(--r-sm, 0.55rem);
    display: inline-flex; align-items: center; gap: 0.35rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
}
.btn-ghost.btn-sm:hover {
    background: var(--accent-tint);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   Leads page
   ============================================================ */

.lead-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}
@media (max-width: 1100px) { .lead-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .lead-tiles { grid-template-columns: 1fr; } }

.lead-tile {
    padding: 1.1rem 1.2rem 1rem;
    display: flex; flex-direction: column; gap: 0.35rem;
    position: relative;
    overflow: hidden;
}
.lead-tile::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent-tint);
}
.lead-tile.is-overdue::before { background: linear-gradient(135deg, var(--red), var(--amber)); }
.lead-tile.is-won::before     { background: linear-gradient(135deg, var(--green), var(--cyan)); }
.lead-tile.is-lost::before    { background: linear-gradient(135deg, var(--ink-faint), var(--ink-muted)); }

.lt-eyebrow {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.lt-figure {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.lt-meta {
    font-size: 0.78rem;
    color: var(--ink-muted);
    display: flex; align-items: center; gap: 0.4rem;
}
.lead-tile.is-overdue .lt-meta { color: var(--red); }

/* ─── Filter bar ─────────────────────────────────────────── */
.lead-filters {
    margin: 1.5rem 0 0.4rem;
    padding: 0.9rem 1.1rem;
    display: flex; flex-wrap: wrap; gap: 1.2rem;
    align-items: flex-start;
}
.lead-filters .lf-group {
    display: flex; flex-direction: column; gap: 0.35rem;
}
.lead-filters .lf-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.lead-filters select {
    font-family: var(--font-body);
    background: var(--surface-flat);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm, 0.55rem);
    padding: 0.45rem 0.7rem;
    font-size: 0.86rem;
    color: var(--ink);
}
.lf-chips {
    display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.lf-chip {
    display: inline-flex; align-items: center;
    padding: 0.32rem 0.7rem;
    border-radius: 99px;
    background: var(--surface-flat);
    border: 1px solid var(--line-strong);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
    user-select: none;
}
.lf-chip input { display: none; }
.lf-chip.is-on {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.lf-chip:hover:not(.is-on) { border-color: var(--accent); color: var(--accent); }
.lf-clear {
    align-self: flex-end;
    margin-left: auto;
    color: var(--ink-muted);
    font-size: 0.82rem;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border-radius: var(--r-sm, 0.55rem);
}
.lf-clear:hover { color: var(--red); background: rgba(255,93,108,0.08); }

/* ─── Leads table ───────────────────────────────────────── */
.leads-table-wrap {
    margin-top: 0.9rem;
    padding: 0;
    overflow: visible;
}
.leads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.leads-table th, .leads-table td {
    padding: 0.7rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.leads-table thead th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    background: var(--bg-tint);
}
.leads-table tbody tr:last-child td { border-bottom: none; }
.leads-table .action-col { width: 1px; white-space: nowrap; text-align: right; }
.lead-row.is-closed td { opacity: 0.65; }
.lead-row.is-closed strong { color: var(--ink-muted); }

.lead-row strong {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    display: block;
}
.lead-contact {
    display: flex; flex-wrap: wrap; gap: 0.6rem;
    font-size: 0.74rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
}
.lead-contact a { color: var(--ink-muted); text-decoration: none; }
.lead-contact a:hover { color: var(--accent); }

.lead-source {
    font-size: 0.78rem;
    color: var(--ink-muted);
}
.lead-interest-none { color: var(--ink-faint); }

/* Follow-up pill (per row) */
.follow-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 600;
    background: rgba(46,204,113,0.12);
    color: #1d8e54;
}
.follow-pill i { font-size: 0.95rem; }
.follow-pill-due_soon {
    background: rgba(255,181,71,0.16);
    color: #b87a14;
}
.follow-pill-overdue {
    background: rgba(255,93,108,0.18);
    color: #d8364a;
    animation: follow-pulse 1.6s ease-in-out infinite;
}
@keyframes follow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,93,108,0.30); }
    50%      { box-shadow: 0 0 0 6px rgba(255,93,108,0.00); }
}

/* Status dropdown — colour band on the left, no native arrow weirdness */
.lead-status-select {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 1.7rem 0.35rem 0.8rem;
    border-radius: 99px;
    border: 1px solid var(--line-strong);
    background: var(--surface-flat);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%236b6e75' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}
.lead-status-select.lead-status-new         { background-color: rgba(123,97,255,0.10); color: #5a3fbd; border-color: rgba(123,97,255,0.30); }
.lead-status-select.lead-status-contacted   { background-color: rgba(2,217,255,0.12);  color: #0683a4; border-color: rgba(2,217,255,0.32); }
.lead-status-select.lead-status-quoted      { background-color: rgba(255,181,71,0.16); color: #b87a14; border-color: rgba(255,181,71,0.36); }
.lead-status-select.lead-status-negotiating { background-color: rgba(255,127,0,0.14);  color: #c75a00; border-color: rgba(255,127,0,0.32); }
.lead-status-select.lead-status-won         { background-color: rgba(46,204,113,0.16); color: #1d8e54; border-color: rgba(46,204,113,0.36); }
.lead-status-select.lead-status-lost        { background-color: rgba(107,110,117,0.14); color: var(--ink-muted); border-color: var(--line-strong); }

/* Action icons */
.lead-actions {
    display: inline-flex; gap: 0.25rem; align-items: center;
}
.icon-action {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid transparent;
    border-radius: var(--r-sm, 0.55rem);
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease);
}
.icon-action i { font-size: 1.1rem; }
.icon-action:hover {
    background: var(--accent-tint);
    color: var(--accent);
    border-color: var(--accent);
}
.icon-action:disabled {
    opacity: 0.5; cursor: wait;
}
.icon-action.is-primary {
    color: var(--cyan);
    border-color: rgba(2,217,255,0.32);
}
.icon-action.is-primary:hover {
    background: linear-gradient(135deg, rgba(2,217,255,0.10), rgba(123,97,255,0.10));
    color: var(--accent);
}

.lead-converted-pill {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.74rem;
    padding: 0.25rem 0.55rem;
    border-radius: 99px;
    background: rgba(46,204,113,0.14);
    color: #1d8e54;
    font-weight: 600;
}

.convert-summary {
    font-size: 0.92rem;
    color: var(--ink-muted);
    margin-bottom: 1.1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}
.convert-summary strong { color: var(--ink); }

.input-suffix {
    color: var(--ink-muted);
    font-size: 0.8rem;
    padding-right: 0.4rem;
}

/* ============================================================
   MCP token settings page
   ============================================================ */

.mcp-just-minted {
    margin-top: 1.4rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(255,181,71,0.45);
    background: linear-gradient(135deg, rgba(255,181,71,0.08), rgba(2,217,255,0.04));
    box-shadow:
        0 0 0 1px rgba(255,181,71,0.20) inset,
        var(--glass-shadow);
    display: flex; flex-direction: column; gap: 1.1rem;
}
.mcp-jm-head {
    display: flex; align-items: flex-start; gap: 0.8rem;
}
.mcp-jm-head > i {
    font-size: 1.6rem;
    color: var(--amber);
    flex-shrink: 0;
    margin-top: 0.15rem;
}
.mcp-jm-head strong {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
    display: block;
}
.mcp-jm-head small {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
    display: block;
}

.mcp-jm-token-row,
.mcp-cmd-row {
    display: flex; gap: 0.7rem; align-items: stretch;
}
.mcp-token {
    flex: 1;
    font-family: 'Courier New', ui-monospace, monospace;
    font-size: 0.86rem;
    background: var(--code-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm, 0.55rem);
    padding: 0.7rem 0.9rem;
    color: var(--ink);
    overflow-x: auto;
    white-space: nowrap;
    user-select: all;
    cursor: text;
}
.mcp-cmd { font-size: 0.78rem; }

.mcp-jm-cmd-row .field-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.mcp-jm-hint {
    font-size: 0.82rem;
    color: var(--red);
    display: flex; gap: 0.45rem; align-items: flex-start;
    margin: 0;
    padding-top: 0.7rem;
    border-top: 1px dashed rgba(255,93,108,0.30);
}
.mcp-jm-hint i { font-size: 1rem; flex-shrink: 0; margin-top: 0.1rem; }

/* ─── Status block ──────────────────────────────────────── */
.mcp-status {
    margin-top: 1.4rem;
    padding: 1.3rem 1.5rem;
    display: flex; flex-direction: column; gap: 1.1rem;
}
.mcp-status-head {
    display: flex; align-items: flex-start; gap: 0.7rem;
}
.mcp-status-head > i {
    font-size: 1.5rem;
    color: var(--accent);
    flex-shrink: 0;
}
.mcp-status-head strong {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    display: block;
}
.mcp-status-head small {
    font-size: 0.84rem;
    color: var(--ink-muted);
    margin-top: 0.15rem;
    display: block;
}
.mcp-status-head code {
    font-family: 'Courier New', ui-monospace, monospace;
    background: var(--code-bg);
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.86rem;
}
.mcp-actions {
    display: flex; gap: 0.6rem; flex-wrap: wrap;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

/* ─── Help block ────────────────────────────────────────── */
.mcp-help {
    margin-top: 1.4rem;
    padding: 1.3rem 1.5rem;
}
.mcp-help-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.6rem;
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--ink);
}
.mcp-help-title i { color: var(--accent); font-size: 1.2rem; }
.mcp-help-list {
    margin: 0;
    padding-left: 1.4rem;
    font-size: 0.88rem;
    color: var(--ink-2);
    line-height: 1.6;
}
.mcp-help-list li { margin-bottom: 0.35rem; }
.mcp-help-list strong { color: var(--ink); }
.mcp-help-list em { font-style: italic; color: var(--accent); }
.mcp-help-foot {
    margin: 1rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: var(--ink-muted);
    display: flex; align-items: flex-start; gap: 0.45rem;
}
.mcp-help-foot i { color: var(--amber); font-size: 1rem; margin-top: 0.1rem; flex-shrink: 0; }

/* ============================================================
   Dashboard "Today" panel
   ============================================================ */

.today-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.6rem;
}
.today-grid-admin { margin-top: 0.6rem; }
@media (max-width: 1100px) { .today-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .today-grid { grid-template-columns: 1fr; } }

.today-card {
    padding: 1.5rem 1.6rem 1.4rem;
    display: flex; flex-direction: column; gap: 0.55rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: all var(--t-fast) var(--ease);
}
.today-card::before {
    content: '';
    position: absolute; inset: 0 0 auto 0;
    height: 3px;
    background: var(--accent-tint);
}
.today-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 22px 44px -22px rgba(2,217,255,0.20),
        var(--glass-shadow);
}
.today-card.is-urgent::before  { background: linear-gradient(135deg, var(--red), var(--amber)); }
.today-card.is-waiting::before { background: linear-gradient(135deg, var(--amber), var(--cyan)); }
.today-card.td-take::before    { background: var(--gradient); }
.today-card.td-net.is-positive::before { background: linear-gradient(135deg, var(--green), var(--cyan)); }
.today-card.td-net.is-negative::before { background: linear-gradient(135deg, var(--red), var(--amber)); }

.td-eyebrow {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
}
.td-figure {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.td-meta {
    font-size: 0.78rem;
    color: var(--ink-muted);
    display: flex; align-items: center; gap: 0.4rem;
}
.td-meta i { font-size: 1rem; color: var(--accent); flex-shrink: 0; }
.today-card.is-urgent  .td-meta i { color: var(--red); }
.today-card.is-waiting .td-meta i { color: var(--amber); }

/* Quick-actions footer */
.today-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 2.4rem;
}
@media (max-width: 800px) { .today-quick { grid-template-columns: repeat(2, 1fr); } }

.today-q-btn {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-flat);
    color: var(--ink);
    text-decoration: none;
    transition: all var(--t-fast) var(--ease);
}
.today-q-btn:hover {
    border-color: var(--accent);
    background: var(--accent-tint);
    transform: translateY(-1px);
}
.today-q-btn i {
    font-size: 1.6rem;
    color: var(--accent);
    flex-shrink: 0;
}
.today-q-btn div { display: flex; flex-direction: column; line-height: 1.15; }
.today-q-btn strong {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.94rem;
}
.today-q-btn small {
    font-size: 0.74rem;
    color: var(--ink-muted);
    margin-top: 0.1rem;
}

/* ─── Reduced motion / transparency ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,*::before,*::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
    .glass, .sidebar, .searchbox, .icon-button, .btn-glass {
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
        background: var(--surface-flat) !important;
    }
}
