/* ==========================================================================
   JenAir AI Marketing & Sales — design system
   Dark purple (JenAir family) with a gold "growth" accent.
   Tokens → base → app shell → components → pages.
   Screen-size rules live in sales-responsive.css.
   ========================================================================== */

:root {
    --bg: #110920;
    --bg-2: #180e2c;
    --surface: #1d1335;
    --surface-2: #251944;
    --surface-3: #2f2154;
    --raise: rgba(255, 255, 255, 0.035);
    --border: rgba(196, 167, 255, 0.11);
    --border-2: rgba(196, 167, 255, 0.22);

    --text: #f3eefc;
    --text-2: #cfc5e6;
    --muted: #a092c2;
    --faint: #6f6292;

    --primary: #8b5cf6;
    --primary-2: #a78bfa;
    --primary-3: #c4b5fd;
    --primary-ink: #ffffff;
    --gold: #f5b941;
    --gold-2: #ffd77a;

    --ok: #34d399;
    --warn: #fbbf24;
    --bad: #f87171;
    --info: #60a5fa;

    --r-lg: 18px;
    --r: 14px;
    --r-sm: 10px;
    --r-xs: 7px;
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 6px 16px -10px rgba(0, 0, 0, 0.6);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;

    --sidebar-w: 248px;
    --topbar-h: 64px;

    /* Prospect status colours */
    --st-new: #94a3b8;
    --st-contacted: #a78bfa;
    --st-engaged: #22d3ee;
    --st-opportunity: #f5b941;
    --st-customer: #34d399;
    --st-lost: #f87171;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; background: var(--bg-2); }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(1100px 560px at 92% -12%, rgba(139, 92, 246, 0.20), transparent 60%),
        radial-gradient(800px 480px at -8% 112%, rgba(245, 185, 65, 0.06), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
}

a { color: var(--primary-2); text-decoration: none; }
a:hover { color: var(--gold-2); }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; font-weight: 720; }
h2 { font-size: 1.02rem; font-weight: 650; }
h3 { font-size: 0.95rem; font-weight: 650; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.88em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

.ico { flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.83rem; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.gold { color: var(--gold); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: grid; gap: 1.1rem; }
.row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 1rem; }
.mt-s { margin-top: 0.5rem; }

/* ==========================================================================
   App shell
   ========================================================================== */

.app { display: flex; min-height: 100vh; }

.sidebar {
    position: sticky;
    top: 0;
    flex: none;
    width: var(--sidebar-w);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 0.85rem;
    background: linear-gradient(180deg, rgba(25, 14, 46, 0.96), rgba(17, 9, 32, 0.98));
    border-right: 1px solid var(--border);
    z-index: 40;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.35rem 0.5rem 1.1rem;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand img { display: block; border-radius: 11px; box-shadow: 0 8px 20px -8px rgba(139, 92, 246, 0.8); }
.brand-name { display: block; font-size: 1.02rem; font-weight: 760; letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.02em; }
.brand-sub b { color: var(--gold); font-weight: 700; }

.nav { display: grid; gap: 2px; }
.nav-label {
    margin: 1rem 0.65rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.58rem 0.7rem;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-weight: 520;
    position: relative;
}
.nav-link .ico { color: var(--muted); }
.nav-link:hover { background: var(--raise); color: var(--text); }
.nav-link:hover .ico { color: var(--primary-3); }
.nav-link.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.24), rgba(139, 92, 246, 0.06));
    color: #fff;
}
.nav-link.active .ico { color: var(--gold); }
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -0.85rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
}
.nav-count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.nav-foot { margin-top: auto; padding-top: 1rem; }
.next-card {
    padding: 0.9rem;
    border-radius: var(--r);
    background: linear-gradient(140deg, rgba(139, 92, 246, 0.22), rgba(245, 185, 65, 0.08));
    border: 1px solid var(--border-2);
}
.next-card strong { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--gold-2); }
.next-card p { margin-top: 0.3rem; font-size: 0.78rem; color: var(--text-2); }

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.75rem;
    background: rgba(17, 9, 32, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.search {
    flex: 1;
    min-width: 0;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 40px;
    padding: 0 0.85rem;
    border-radius: 999px;
    background: var(--raise);
    border: 1px solid var(--border);
    color: var(--muted);
    transition: border-color 0.15s, background 0.15s;
}
.search:focus-within { border-color: var(--primary); background: rgba(139, 92, 246, 0.08); }
.search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
}
.search input::placeholder { color: var(--faint); }

.topbar-end { flex: none; margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

.content {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.6rem 1.75rem 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-content: start;
}
.content > *, .stack > *, .split > *, .split-wide > *, .grid-2 > *, .grid-3 > * { min-width: 0; }

.scrim { display: none; }

/* ---------- Menus (details/summary, no JS needed) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 230px;
    padding: 0.4rem;
    border-radius: var(--r);
    background: #221642;
    border: 1px solid var(--border-2);
    box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.8);
    z-index: 50;
}
.menu-pop a, .menu-pop button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 0;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--text-2);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: rgba(139, 92, 246, 0.16); color: #fff; }
.menu-pop .menu-head { padding: 0.55rem 0.7rem 0.6rem; border-bottom: 1px solid var(--border); margin-bottom: 0.3rem; }
.menu-pop .menu-head strong { display: block; }
.menu-pop .menu-head span { font-size: 0.8rem; color: var(--muted); }
.menu-pop form { margin: 0; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.6rem 0.25rem 0.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--raise);
}
.user-chip:hover { border-color: var(--border-2); }
.user-chip-name { font-weight: 600; font-size: 0.9rem; color: var(--text-2); }

/* ==========================================================================
   Components
   ========================================================================== */

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 38px;
    padding: 0 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-2);
    background: var(--raise);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.15s, background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:hover { color: #fff; border-color: var(--primary-2); background: rgba(139, 92, 246, 0.12); }
.btn:active { transform: translateY(1px); }
.btn-primary {
    border-color: transparent;
    background: linear-gradient(135deg, #8b5cf6, #6d3fe0);
    color: #fff;
    box-shadow: 0 8px 20px -10px rgba(139, 92, 246, 0.9);
}
.btn-primary:hover { filter: brightness(1.1); background: linear-gradient(135deg, #8b5cf6, #6d3fe0); border-color: transparent; }
.btn-gold {
    border-color: transparent;
    background: linear-gradient(135deg, var(--gold-2), var(--gold));
    color: #2a1a00;
}
.btn-gold:hover { color: #2a1a00; filter: brightness(1.05); background: linear-gradient(135deg, var(--gold-2), var(--gold)); border-color: transparent; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--raise); border-color: var(--border); }
.btn-danger { border-color: rgba(248, 113, 113, 0.35); color: #fecaca; background: rgba(248, 113, 113, 0.08); }
.btn-danger:hover { border-color: var(--bad); background: rgba(248, 113, 113, 0.16); color: #fff; }
.btn-sm { height: 32px; padding: 0 0.8rem; font-size: 0.83rem; }
.btn-xs { height: 27px; padding: 0 0.6rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--raise);
    color: var(--text-2);
    cursor: pointer;
}
.icon-btn:hover { color: #fff; border-color: var(--border-2); }
.icon-btn.sm { width: 30px; height: 30px; }
.inline-form { display: inline; margin: 0; }

/* ---------- Page heading ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}
.page-head .sub { margin-top: 0.3rem; color: var(--muted); }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.eyebrow {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.eyebrow a { color: var(--muted); }
.eyebrow a:hover { color: var(--gold-2); }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; }

/* ---------- Cards ---------- */
.card {
    background: linear-gradient(180deg, rgba(40, 26, 72, 0.6), rgba(29, 19, 53, 0.82));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-pad { padding: 1.25rem 1.35rem; }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    border-bottom: 1px solid var(--border);
}
.card-head h2 { display: flex; align-items: center; gap: 0.5rem; }
.card-head h2 .ico { color: var(--primary-2); }
.card-body { padding: 1.1rem 1.35rem 1.25rem; }
.card-foot { padding: 0.8rem 1.35rem; border-top: 1px solid var(--border); }
.card-link { font-size: 0.85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.3rem; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.split-wide { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kpi {
    position: relative;
    overflow: hidden;
    padding: 1.1rem 1.2rem 1.15rem;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(47, 33, 84, 0.85), rgba(29, 19, 53, 0.9));
    box-shadow: var(--shadow-sm);
}
.kpi::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--kc, rgba(139, 92, 246, 0.3)), transparent 70%);
    opacity: 0.6;
}
.kpi-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; }
.kpi-label .ico { color: var(--kc-solid, var(--primary-2)); }
.kpi-value { margin-top: 0.45rem; font-size: 1.75rem; font-weight: 760; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: 0.15rem; font-size: 0.82rem; color: var(--muted); }
.kpi-sub b { color: var(--text-2); font-weight: 650; }
.kpi.k-gold { --kc: rgba(245, 185, 65, 0.35); --kc-solid: var(--gold); }
.kpi.k-green { --kc: rgba(52, 211, 153, 0.3); --kc-solid: var(--ok); }
.kpi.k-red { --kc: rgba(248, 113, 113, 0.3); --kc-solid: var(--bad); }
.kpi.k-gold .kpi-value { color: var(--gold-2); }

/* ---------- Pills, chips, avatars ---------- */
.pill {
    --c: var(--st-new);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 23px;
    padding: 0 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
    color: color-mix(in srgb, var(--c) 78%, white);
    background: color-mix(in srgb, var(--c) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.st-new { --c: var(--st-new); }
.st-contacted { --c: var(--st-contacted); }
.st-engaged { --c: var(--st-engaged); }
.st-opportunity { --c: var(--st-opportunity); }
.st-customer { --c: var(--st-customer); }
.st-lost { --c: var(--st-lost); }
.stg-open { --c: var(--primary-2); }
.stg-won { --c: var(--ok); }
.stg-lost { --c: var(--bad); }

.chip {
    --c: #a78bfa;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 0.55rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    color: color-mix(in srgb, var(--c) 70%, white);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.pri { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: 5px; }
.pri-high { color: #fecaca; background: rgba(248, 113, 113, 0.16); }
.pri-med { color: var(--muted); background: var(--raise); }
.pri-low { color: var(--faint); background: transparent; }

.avatar {
    --h: 265;
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 750;
    color: #fff;
    background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 30) 65% 40%));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.avatar.sm { width: 24px; height: 24px; font-size: 0.62rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.05rem; border-radius: 16px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--primary)); }

/* ---------- Flash ---------- */
.flash {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: var(--r);
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.1);
    color: #d1fae5;
}
.flash .ico { color: var(--ok); margin-top: 1px; }
.flash.err { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.1); color: #fee2e2; }
.flash.err .ico { color: var(--bad); }
.flash .grow { display: grid; gap: 0.5rem; }
.flash-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: 0.6; cursor: pointer; padding: 0; }
.flash-close:hover { opacity: 1; }
.secret {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.secret code {
    padding: 0.4rem 0.75rem;
    border-radius: var(--r-xs);
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(255, 255, 255, 0.25);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: #fff;
    user-select: all;
}

.notice {
    display: flex;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: var(--r);
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(251, 191, 36, 0.08);
    color: #fef3c7;
}
.notice .ico { color: var(--warn); margin-top: 2px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.field { display: grid; gap: 0.35rem; min-width: 0; align-content: start; }
.field > label, .label { font-size: 0.82rem; font-weight: 620; color: var(--text-2); }
.field .hint { font-size: 0.78rem; color: var(--faint); }
.req { color: var(--gold); margin-left: 2px; }

.input, .select, .textarea {
    width: 100%;
    min-height: 42px;
    padding: 0.55rem 0.8rem;
    border-radius: var(--r-sm);
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--border-2);
    background: rgba(10, 5, 22, 0.45);
    color: var(--text);
    font: inherit;
    font-size: 0.93rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--primary-2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
    background: rgba(10, 5, 22, 0.6);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select {
    appearance: none;
    padding-right: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a092c2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
}
.select option { background: #1d1335; color: var(--text); }
input[type="date"].input, input[type="datetime-local"].input { color-scheme: dark; }
.input-validation-error { border-color: rgba(248, 113, 113, 0.7) !important; }
.field-validation-error, .text-danger { font-size: 0.8rem; color: #fca5a5; }
.validation-summary-errors {
    padding: 0.8rem 1rem;
    border-radius: var(--r);
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(248, 113, 113, 0.08);
    color: #fee2e2;
    font-size: 0.88rem;
}
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.validation-summary-valid { display: none; }

.check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-2);
}
.check input { width: 17px; height: 17px; accent-color: var(--primary); }

.tag-pick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag-pick label { cursor: pointer; }
.tag-pick input { position: absolute; opacity: 0; pointer-events: none; }
.tag-pick .chip { height: 30px; padding: 0 0.75rem; opacity: 0.55; transition: opacity 0.15s, transform 0.1s; }
.tag-pick input:checked + .chip { opacity: 1; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent); }
.tag-pick input:focus-visible + .chip { outline: 2px solid var(--primary-2); outline-offset: 2px; }

.swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; pointer-events: none; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 8px; background: var(--c); border: 2px solid transparent; }
.swatches input:checked + span { border-color: #fff; box-shadow: 0 0 0 2px var(--c); }

.form-section { padding: 1.25rem 1.35rem; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: 0; }
.form-section h2 { margin-bottom: 0.9rem; }
.form-section h2 + .muted { margin-top: -0.6rem; }
.form-section > .muted { margin-bottom: 1rem; font-size: 0.86rem; }
.form-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--border);
    background: rgba(10, 5, 22, 0.2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.toolbar .select, .toolbar .input { width: auto; min-width: 150px; min-height: 38px; padding-top: 0.4rem; padding-bottom: 0.4rem; font-size: 0.88rem; }
.toolbar .input.search-input { min-width: 220px; }

.seg {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(10, 5, 22, 0.4);
    border: 1px solid var(--border);
}
.seg a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.85rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.seg a:hover { color: var(--text); background: var(--raise); }
.seg a.on { background: var(--surface-3); color: #fff; box-shadow: var(--shadow-sm); }
.seg .count { font-size: 0.74rem; padding: 0 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--text-2); }
.seg a.on .count { background: rgba(245, 185, 65, 0.2); color: var(--gold-2); }
.seg .count.alert { background: rgba(248, 113, 113, 0.2); color: #fecaca; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(139, 92, 246, 0.06); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-main { font-weight: 650; color: var(--text); }
.table .t-main:hover { color: var(--gold-2); }
.table .t-sub { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 1px; }
.table td.actions { text-align: right; white-space: nowrap; }
.table tr.is-muted td { opacity: 0.55; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .row { gap: 0.4rem; }

/* ---------- Empty states ---------- */
.empty {
    display: grid;
    justify-items: center;
    gap: 0.6rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
}
.empty-ico {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(140deg, rgba(139, 92, 246, 0.25), rgba(245, 185, 65, 0.12));
    border: 1px solid var(--border-2);
    color: var(--gold-2);
}
.empty h3 { color: var(--text); font-size: 1.05rem; }
.empty p { max-width: 46ch; }
.empty.compact { padding: 1.4rem 1rem; }

/* ---------- Lists inside cards ---------- */
.list { display: grid; }
.list-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.35rem;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}
.list-item:last-child { border-bottom: 0; }
.list-item .grow > a, .list-item .grow > strong { font-weight: 620; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .grow > a:hover { color: var(--gold-2); }
.list-item .meta { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.due { font-size: 0.78rem; font-weight: 650; white-space: nowrap; color: var(--muted); }
.due.today { color: var(--gold-2); }
.due.late { color: #fca5a5; }

.check-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 8px;
    border: 1.5px solid var(--border-2);
    background: transparent;
    color: transparent;
    cursor: pointer;
    transition: all 0.15s;
}
.check-btn:hover { border-color: var(--ok); color: var(--ok); background: rgba(52, 211, 153, 0.1); }
.check-btn.done { border-color: var(--ok); background: var(--ok); color: #052e1c; }

/* ---------- Bars (funnel, interest) ---------- */
.bars { display: grid; gap: 0.7rem; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 40px; align-items: center; gap: 0.75rem; font-size: 0.86rem; }
.bar-row > span:first-child { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--c, var(--primary)); min-width: 3px; }
.bar-row .num { text-align: right; font-weight: 650; }
.bar-row a { color: inherit; }
.bar-row a:hover { color: var(--gold-2); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0.4rem 0; }
.tl-item { position: relative; display: flex; gap: 0.9rem; padding: 0.85rem 1.35rem; }
.tl-item::before {
    content: "";
    position: absolute;
    left: calc(1.35rem + 16px);
    top: 46px;
    bottom: -6px;
    width: 1px;
    background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-ico {
    --c: var(--primary-2);
    flex: none;
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border-radius: 11px;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
    position: relative;
    z-index: 1;
}
.tl-item.ch-system .tl-ico { --c: var(--faint); }
.tl-item.ch-whatsapp .tl-ico { --c: #25d366; }
.tl-item.ch-call .tl-ico { --c: var(--info); }
.tl-item.ch-email .tl-ico { --c: #f472b6; }
.tl-item.ch-meeting .tl-ico, .tl-item.ch-demo .tl-ico { --c: var(--gold); }
.tl-item.ch-visit .tl-ico { --c: var(--ok); }
.tl-body { flex: 1; min-width: 0; }
.tl-top { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }
.tl-top strong { color: var(--text); font-size: 0.88rem; }
.tl-text { margin-top: 0.25rem; white-space: pre-line; word-break: break-word; color: var(--text-2); }
.tl-item.ch-system .tl-text { color: var(--muted); font-size: 0.88rem; margin-top: 0.1rem; }
.tl-del { margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.tl-item:hover .tl-del { opacity: 1; }
.dir { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.05rem 0.4rem; border-radius: 4px; background: var(--raise); color: var(--muted); }
.dir.in { background: rgba(34, 211, 238, 0.14); color: #a5f3fc; }

/* ---------- Detail header ---------- */
.profile-head {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    padding: 1.4rem 1.5rem;
    border-radius: calc(var(--r-lg) + 2px);
    border: 1px solid var(--border-2);
    background:
        radial-gradient(520px 200px at 0% 0%, rgba(139, 92, 246, 0.32), transparent 70%),
        linear-gradient(135deg, #2a1850 0%, #1d1236 100%);
    box-shadow: var(--shadow);
}
.profile-head h1 { font-size: 1.5rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.45rem; color: var(--muted); font-size: 0.88rem; }
.profile-meta span { display: inline-flex; align-items: center; gap: 0.35rem; }
.profile-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }

.contact-btns { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.9rem; }
.contact-btns a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.8rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
}
.contact-btns a:hover { color: #fff; border-color: var(--border-2); }
.contact-btns a.wa:hover { border-color: #25d366; color: #bbf7d0; }

.status-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.status-steps form { margin: 0; }
.status-steps button {
    --c: var(--st-new);
    height: 30px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 620;
    cursor: pointer;
}
.status-steps button:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); color: var(--text); }
.status-steps button.on {
    color: #fff;
    background: color-mix(in srgb, var(--c) 30%, transparent);
    border-color: color-mix(in srgb, var(--c) 70%, transparent);
}

.facts { display: grid; gap: 0.85rem; }
.fact dt { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.fact dd { margin: 0.15rem 0 0; color: var(--text-2); word-break: break-word; }
.facts dl { margin: 0; display: grid; gap: 0.85rem; }

.tabs { display: flex; gap: 0.25rem; padding: 0 1rem; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 44px;
    padding: 0 0.85rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 620;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: #fff; border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.on { display: block; }

/* ---------- Kanban ---------- */
.board {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(252px, 1fr);
    gap: 0.9rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    align-items: start;
    scroll-snap-type: x proximity;
}
.col {
    --c: var(--st-new);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    max-height: calc(100vh - 230px);
    border-radius: var(--r-lg);
    background: rgba(17, 9, 32, 0.55);
    border: 1px solid var(--border);
    scroll-snap-align: start;
    transition: border-color 0.15s, background 0.15s;
}
.col.drag-over { border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 8%, rgba(17, 9, 32, 0.6)); }
.col-head {
    padding: 0.85rem 0.95rem 0.7rem;
    border-bottom: 1px solid var(--border);
    border-top: 3px solid var(--c);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.col-head .row-between { gap: 0.4rem; }
.col-title { display: flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.9rem; }
.col-title .dot { background: var(--c); }
.col-count { font-size: 0.78rem; font-weight: 700; color: var(--muted); padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--raise); }
.col-sum { margin-top: 0.2rem; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-body { flex: 1; overflow-y: auto; padding: 0.6rem; display: grid; gap: 0.55rem; align-content: start; }
.col-more { text-align: center; font-size: 0.8rem; padding: 0.35rem; }

.kcard {
    position: relative;
    display: block;
    padding: 0.75rem 0.8rem 0.7rem;
    border-radius: var(--r);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border);
    color: var(--text);
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, transform 0.1s, opacity 0.15s;
    touch-action: manipulation;
}
.kcard:hover { border-color: var(--border-2); color: var(--text); }
.kcard.dragging { opacity: 0.45; transform: rotate(1.5deg); }
.kcard.saving { opacity: 0.6; pointer-events: none; }
.kcard-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; font-weight: 650; font-size: 0.9rem; line-height: 1.3; }
.kcard-title a { color: var(--text); }
.kcard-title a:hover { color: var(--gold-2); }
.kcard-sub { margin-top: 0.2rem; font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard .chips { margin-top: 0.5rem; }
.kcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid var(--border); font-size: 0.76rem; color: var(--muted); }
.kcard-foot .val { font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.kcard-move { display: none; }
.kcard-move select { width: 100%; min-height: 32px; padding: 0.2rem 0.6rem; font-size: 0.8rem; margin-top: 0.55rem; }

.col.c-new { --c: var(--st-new); }
.col.c-contacted { --c: var(--st-contacted); }
.col.c-engaged { --c: var(--st-engaged); }
.col.c-opportunity { --c: var(--st-opportunity); }
.col.c-customer { --c: var(--st-customer); }
.col.c-lost { --c: var(--st-lost); }
.col.c-open { --c: var(--primary-2); }
.col.c-won { --c: var(--ok); }

.prob { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 0.55rem; }
.prob span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); }

/* ---------- Auth pages ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-art {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    background:
        radial-gradient(700px 420px at 10% 0%, rgba(139, 92, 246, 0.45), transparent 65%),
        radial-gradient(600px 400px at 100% 100%, rgba(245, 185, 65, 0.16), transparent 60%),
        linear-gradient(160deg, #24124a 0%, #120a24 100%);
    border-right: 1px solid var(--border);
}
.auth-art h1 { font-size: 2.3rem; line-height: 1.15; max-width: 15ch; letter-spacing: -0.02em; }
.auth-art h1 em { font-style: normal; color: var(--gold-2); }
.auth-art .lede { margin-top: 1rem; max-width: 46ch; color: var(--text-2); font-size: 1rem; }
.flow { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.8rem; }
.flow span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-2);
    color: var(--text-2);
}
.flow span:last-child { color: var(--gold-2); border-color: rgba(245, 185, 65, 0.4); }
.auth-foot { font-size: 0.8rem; color: var(--faint); }
.auth-panel { display: grid; place-items: center; padding: 2rem 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 1.45rem; }
.auth-card .sub { margin-top: 0.35rem; color: var(--muted); }
.auth-card form { margin-top: 1.6rem; display: grid; gap: 1rem; }
.auth-card .btn { height: 46px; font-size: 0.98rem; }
.auth-wide { max-width: 520px; }

/* ---------- Status page ---------- */
.status-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.5rem 1.75rem;
    border-radius: calc(var(--r-lg) + 2px);
    border: 1px solid var(--border-2);
    background:
        radial-gradient(500px 220px at 0% 0%, rgba(52, 211, 153, 0.2), transparent 70%),
        linear-gradient(135deg, #2b1852 0%, #1d1236 100%);
    box-shadow: var(--shadow);
}
.status-hero.is-attention { background: radial-gradient(500px 220px at 0% 0%, rgba(248, 113, 113, 0.26), transparent 70%), linear-gradient(135deg, #2b1852 0%, #1d1236 100%); }
.status-hero-main { display: flex; align-items: center; gap: 1.1rem; }
.pulse { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok); animation: pulse 2.2s infinite; }
.is-attention .pulse { background: var(--bad); animation-name: pulse-bad; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); } 70% { box-shadow: 0 0 0 16px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
@keyframes pulse-bad { 0% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.55); } 70% { box-shadow: 0 0 0 16px rgba(248, 113, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); } }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 0.4rem 1.8rem; margin: 0; }
.hero-stats dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-stats dd { margin: 0.15rem 0 0; font-size: 1.3rem; font-weight: 720; font-variant-numeric: tabular-nums; }

.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
.check-card {
    --tone: var(--info);
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem 1.05rem 1.3rem;
    border-radius: var(--r);
    background: var(--surface);
    border: 1px solid var(--border);
}
.check-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tone); }
.check-card header { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.4rem; }
.check-card p { color: var(--muted); font-size: 0.88rem; word-break: break-word; }
.t-pass { --tone: var(--ok); }
.t-warn { --tone: var(--warn); }
.t-fail { --tone: var(--bad); }
.t-info { --tone: var(--info); }
.badge {
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tone);
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
}

.hours {
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 5px;
    align-items: end;
    height: 140px;
    padding: 0.7rem 0.7rem 0;
    border-radius: var(--r-sm);
    background: rgba(10, 5, 20, 0.35);
    border: 1px solid var(--border);
}
.hour { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.hour-fill { display: block; width: 100%; border-radius: 5px 5px 2px 2px; }
.hour-label { text-align: center; font-size: 0.64rem; color: var(--faint); padding: 0.3rem 0 0.4rem; font-variant-numeric: tabular-nums; }
.hour.is-current .hour-label { color: var(--gold-2); font-weight: 700; }
.h-full { background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.h-part { background: linear-gradient(180deg, var(--primary-2), var(--primary)); }
.h-low { background: var(--warn); opacity: 0.85; }
.h-none { background: rgba(165, 151, 196, 0.18); }
.awake-num { font-size: 2rem; font-weight: 760; color: var(--gold); line-height: 1; font-variant-numeric: tabular-nums; }

.facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem 1.5rem; margin: 0; }
.facts-grid dt { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.facts-grid dd { margin: 0.15rem 0 0; font-weight: 620; word-break: break-word; font-variant-numeric: tabular-nums; }

/* ---------- Error page (no shell) ---------- */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.solo .card { max-width: 480px; width: 100%; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
