/* =====================================================================
   Warmup — Warm Editorial theme (Phase 1).
   Loads AFTER shell.css/auth.css/app.css to override design tokens.
   Aesthetic: cream paper background, ember-orange accent, deep navy ink,
   serif display (Fraunces) + grotesque body (Bricolage Grotesque),
   donut gauges as the signature visual element.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,300..900,0..100&family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');

:root {
    /* Override shell design tokens — same names so existing rules pick them up. */
    --shell-bg: #faf6ef;
    --shell-surface: #ffffff;
    --shell-surface-soft: #f4ecdd;
    --shell-border: #eae2d4;
    --shell-border-strong: #d9cfb7;
    --shell-text: #1a2d3d;
    --shell-body: #3d4d5c;
    --shell-muted: #8a95a1;
    --shell-primary: #e96846;
    --shell-primary-soft: rgba(233, 104, 70, 0.10);
    --shell-primary-hover: #d4583a;
    --shell-success: #2d8c5f;
    --shell-success-soft: #e5f3eb;
    --shell-warning: #e5a93c;
    --shell-warning-soft: #fbf1d9;
    --shell-danger: #c84b3b;
    --shell-danger-soft: #fae6e2;
    --shell-table-head: #f8f1e3;
    --shell-divider: #ece3d2;
    /* Fonts */
    --font-display: "Fraunces", "Times New Roman", ui-serif, Georgia, serif;
    --font-body: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    /* Shadows — warm paper feel */
    --shadow-paper-sm: 0 1px 0 rgba(26, 45, 61, 0.03), 0 2px 8px rgba(26, 45, 61, 0.04);
    --shadow-paper-md: 0 1px 0 rgba(26, 45, 61, 0.04), 0 8px 24px rgba(26, 45, 61, 0.07);
    --shadow-paper-lg: 0 1px 0 rgba(26, 45, 61, 0.05), 0 16px 48px rgba(26, 45, 61, 0.10);
    --shadow-ember: 0 6px 20px rgba(233, 104, 70, 0.28);
    /* Radii */
    --radius-pill: 999px;
    --radius-card: 16px;
    --radius-button: 10px;
    --radius-input: 10px;
    /* Tracking */
    --tracking-tight: -0.022em;
    --tracking-display: -0.030em;
}

[data-warmup-theme="dark"] {
    --shell-bg: #1a1612;
    --shell-surface: #25201c;
    --shell-surface-soft: #2f2924;
    --shell-border: #3a342e;
    --shell-border-strong: #4a4239;
    --shell-text: #f5ede0;
    --shell-body: #cdc4b6;
    --shell-muted: #8a807a;
    --shell-primary: #ff8a5c;
    --shell-primary-soft: rgba(255, 138, 92, 0.16);
    --shell-primary-hover: #ffa07c;
    --shell-success: #5fbd87;
    --shell-success-soft: rgba(95, 189, 135, 0.14);
    --shell-warning: #f0c071;
    --shell-warning-soft: rgba(240, 192, 113, 0.14);
    --shell-danger: #ec7060;
    --shell-danger-soft: rgba(236, 112, 96, 0.14);
    --shell-divider: #322c27;
    --shell-table-head: #2f2924;
    --shadow-paper-sm: 0 1px 0 rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-paper-md: 0 1px 0 rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-paper-lg: 0 1px 0 rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.45);
    --shadow-ember: 0 6px 24px rgba(255, 138, 92, 0.32);
}

[data-warmup-theme="dark"] .app-nav {
    background: linear-gradient(180deg, #221d18 0%, var(--shell-surface) 100%);
}

[data-warmup-theme="dark"] .app-bar {
    background: rgba(37, 32, 28, 0.78);
}

[data-warmup-theme="dark"] .donut-gauge[data-band="excellent"] { --gauge-fill: #5fbd87; }
[data-warmup-theme="dark"] .donut-gauge[data-band="good"]      { --gauge-fill: #7fc99c; }
[data-warmup-theme="dark"] .donut-gauge[data-band="warn"]      { --gauge-fill: #f0c071; }
[data-warmup-theme="dark"] .donut-gauge[data-band="poor"]      { --gauge-fill: #ec7060; }

[data-warmup-theme="dark"] .esp-badge.esp-google     { background: rgba(95,189,135,0.16); color: #7fcd9d; border-color: rgba(95,189,135,0.30); }
[data-warmup-theme="dark"] .esp-badge.esp-microsoft  { background: rgba(120,160,230,0.16); color: #8fb1f0; border-color: rgba(120,160,230,0.30); }
[data-warmup-theme="dark"] .esp-badge.esp-yahoo      { background: rgba(190,130,200,0.16); color: #d29ce0; border-color: rgba(190,130,200,0.30); }
[data-warmup-theme="dark"] .esp-badge.esp-apple      { background: rgba(180,170,150,0.14); color: #c8c0a8; border-color: rgba(180,170,150,0.28); }
[data-warmup-theme="dark"] .esp-badge.esp-other      { background: rgba(240,192,113,0.14); color: #f0c071; border-color: rgba(240,192,113,0.30); }

[data-warmup-theme="dark"] body::before {
    /* Re-tint the paper grain for dark mode — warmer, lighter blend so it reads
       as toasted-paper rather than dust on slate. */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95 0 0 0 0 0.85 0 0 0 0 0.65 0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.30;
    mix-blend-mode: screen;
}

/* =====================================================================
   Body + typography
   ===================================================================== */

body, body.warmup-app-body {
    background: var(--shell-bg);
    color: var(--shell-body);
    font-family: var(--font-body);
    font-feature-settings: "ss01", "ss02", "cv11";
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle paper grain overlay — fixed so it stays put while content scrolls. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0 0.30 0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.45;
    mix-blend-mode: multiply;
}

[data-warmup-theme="dark"] body::before {
    opacity: 0.22;
    mix-blend-mode: screen;
}

h1, h2, h3, .auth-brand-headline, .page-title {
    font-family: var(--font-display);
    color: var(--shell-text);
    letter-spacing: var(--tracking-display);
    font-feature-settings: "ss01";
    font-optical-sizing: auto;
}

h1, .page-title { font-weight: 580; }
h2 { font-weight: 560; }
h3 { font-weight: 540; }

.page-subtitle {
    font-family: var(--font-body);
    color: var(--shell-muted);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0.005em;
}

/* =====================================================================
   App shell (sidebar + topbar)
   ===================================================================== */

.app-shell {
    background: var(--shell-bg);
}

.app-nav {
    grid-area: nav;
    background: linear-gradient(180deg, #fdfaf3 0%, var(--shell-surface) 100%);
    border-right: 1px solid var(--shell-border);
    padding: 22px 16px 18px 16px;
    overflow-y: auto;
    box-shadow: inset -1px 0 0 var(--shell-border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px 8px;
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--shell-border);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: var(--tracking-display);
    color: var(--shell-text);
}

.nav-brand .mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(140deg, #ff8a4a 0%, #e96846 60%, #c84b3b 100%);
    color: #fff;
    font-size: 16px;
    box-shadow: var(--shadow-ember);
}

.warmup-nav .nav-section-label {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--shell-muted);
    padding: 12px 10px 6px 10px;
    margin-top: 4px;
}

.warmup-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--shell-body);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.005em;
    transition: background 0.14s ease, color 0.14s ease, transform 0.14s ease;
    position: relative;
}

.warmup-nav .nav-link:hover {
    background: var(--shell-surface-soft);
    color: var(--shell-text);
}

.warmup-nav .nav-link.active {
    background: linear-gradient(95deg, var(--shell-primary-soft), transparent 80%);
    color: var(--shell-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--shell-primary);
}

.warmup-nav .nav-link .material-icons {
    font-size: 18px;
    color: currentColor;
    opacity: 0.85;
}

.warmup-nav .nav-link.disabled {
    color: var(--shell-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.warmup-nav .nav-badge {
    margin-left: auto;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--shell-warning-soft);
    color: #8a6a1a;
    font-weight: 600;
}

.app-bar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: saturate(150%) blur(10px);
    -webkit-backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid var(--shell-border);
}

.app-bar .breadcrumb strong {
    font-family: var(--font-display);
    font-weight: 540;
    letter-spacing: var(--tracking-tight);
    font-size: 16px;
    color: var(--shell-text);
}

.app-bar .icon-btn:hover,
.app-bar .menu-toggle:hover {
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
}

.app-bar .user-pill {
    border: 1px solid var(--shell-border);
    background: var(--shell-surface);
    border-radius: var(--radius-pill);
    transition: border-color 0.14s, background 0.14s;
}

.app-bar .user-pill:hover {
    border-color: var(--shell-primary);
    background: var(--shell-primary-soft);
}

.app-bar .user-pill .avatar {
    background: linear-gradient(140deg, #ff8a4a, #e96846 60%, #c84b3b);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
}

.app-main {
    grid-area: main;
    padding: 32px 36px 64px 36px;
    max-width: 1480px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* =====================================================================
   Page header + cards + buttons
   ===================================================================== */

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--shell-border);
}

.page-title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.06;
    margin: 0 0 6px 0;
    font-weight: 540;
}

.page-card {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 24px 26px;
    box-shadow: var(--shadow-paper-sm);
    position: relative;
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.page-card:hover {
    box-shadow: var(--shadow-paper-md);
}

.page-card h2 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 540;
    letter-spacing: var(--tracking-tight);
    color: var(--shell-text);
    margin: 0 0 4px 0;
}

.page-empty {
    text-align: center;
    padding: 72px 24px;
    background: var(--shell-surface);
    border: 1px dashed var(--shell-border-strong);
    border-radius: var(--radius-card);
    color: var(--shell-muted);
}

.page-empty .empty-icon {
    font-size: 48px;
    color: var(--shell-primary);
    opacity: 0.6;
    margin-bottom: 12px;
}

.page-empty h2 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--shell-text);
    margin: 0 0 8px 0;
    font-weight: 520;
}

/* Generic stat tile (Dashboard). */
.stat-tile {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 20px 22px;
    box-shadow: var(--shadow-paper-sm);
    position: relative;
    overflow: hidden;
}

.stat-tile::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--shell-primary), #ff8a4a);
    transition: width 0.4s ease;
    border-radius: 0 0 3px 0;
}

.stat-tile:hover::before { width: 100%; }

.stat-tile .stat-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--shell-muted);
    margin: 0 0 10px 0;
}

.stat-tile .stat-value {
    font-family: var(--font-display);
    font-size: 38px;
    line-height: 1;
    font-weight: 440;
    color: var(--shell-text);
    letter-spacing: var(--tracking-display);
    font-feature-settings: "ss01", "tnum";
    margin: 0 0 10px 0;
}

.stat-tile .stat-hint {
    font-size: 12px;
    color: var(--shell-muted);
    margin: 0;
}

/* Buttons — Radzen + native. */
.rz-button.rz-primary,
button.btn-primary,
.auth-form .auth-submit,
.auth-submit {
    background: linear-gradient(135deg, #ff8a4a 0%, #e96846 100%) !important;
    border: none !important;
    color: #fff !important;
    border-radius: var(--radius-button);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.005em;
    padding: 10px 18px;
    box-shadow: var(--shadow-ember);
    transition: transform 0.14s ease, box-shadow 0.18s ease, filter 0.14s;
}

.rz-button.rz-primary:hover,
button.btn-primary:hover,
.auth-form .auth-submit:hover,
.auth-submit:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(233, 104, 70, 0.36);
}

.rz-button.rz-button-outlined {
    background: transparent;
    border: 1px solid var(--shell-border-strong);
    color: var(--shell-text);
    border-radius: var(--radius-button);
}

.rz-button.rz-button-outlined:hover {
    border-color: var(--shell-primary);
    color: var(--shell-primary);
    background: var(--shell-primary-soft);
}

.card-action-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--shell-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: -0.005em;
    transition: gap 0.14s ease;
}

.card-action-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* =====================================================================
   Pills / badges / status
   ===================================================================== */

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-body);
    background: var(--shell-surface-soft);
    color: var(--shell-body);
    border: 1px solid var(--shell-border);
}

.status-pill.status-active     { background: var(--shell-success-soft); color: var(--shell-success); border-color: #c5e2cf; }
.status-pill.status-paused     { background: var(--shell-warning-soft); color: #8a6a1a; border-color: #e8d3a1; }
.status-pill.status-quarantined,
.status-pill.status-disconnected,
.status-pill.status-suspended  { background: var(--shell-danger-soft); color: var(--shell-danger); border-color: #f0c9c2; }
.status-pill.status-pendingverification,
.status-pill.status-cancelling { background: var(--shell-warning-soft); color: #8a6a1a; border-color: #e8d3a1; }

/* =====================================================================
   Donut gauge — used on Dashboard hero + Reports tiles.
   ===================================================================== */

.donut-gauge {
    --gauge-size: 200px;
    --gauge-track: var(--shell-border);
    --gauge-fill: var(--shell-primary);
    width: var(--gauge-size);
    height: var(--gauge-size);
    position: relative;
    flex-shrink: 0;
}

.donut-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-gauge .gauge-track {
    fill: none;
    stroke: var(--gauge-track);
    stroke-width: 14;
    stroke-linecap: round;
}

.donut-gauge .gauge-fill {
    fill: none;
    stroke: var(--gauge-fill);
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.donut-gauge .gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    color: var(--shell-text);
}

.donut-gauge .gauge-value {
    font-size: calc(var(--gauge-size) / 4.2);
    font-weight: 480;
    line-height: 1;
    letter-spacing: var(--tracking-display);
    font-feature-settings: "tnum";
}

.donut-gauge .gauge-label {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--shell-muted);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    margin-top: 4px;
}

.donut-gauge .gauge-suffix {
    font-size: calc(var(--gauge-size) / 9);
    color: var(--shell-muted);
    font-weight: 400;
}

/* Score colour bands — gauge picks the band via attribute. */
.donut-gauge[data-band="excellent"] { --gauge-fill: #2d8c5f; }
.donut-gauge[data-band="good"]      { --gauge-fill: #4ea374; }
.donut-gauge[data-band="warn"]      { --gauge-fill: #e5a93c; }
.donut-gauge[data-band="poor"]      { --gauge-fill: #c84b3b; }
.donut-gauge[data-band="empty"]     { --gauge-fill: var(--shell-border-strong); }

/* =====================================================================
   Auth split-screen — restyle for warm editorial.
   Force the warm-light palette regardless of the user's app theme so
   marketing/login pages always match the brand identity.
   ===================================================================== */

.auth-shell,
[data-warmup-theme="dark"] .auth-shell {
    --shell-bg: #faf6ef;
    --shell-surface: #ffffff;
    --shell-surface-soft: #f4ecdd;
    --shell-border: #eae2d4;
    --shell-border-strong: #d9cfb7;
    --shell-text: #1a2d3d;
    --shell-body: #3d4d5c;
    --shell-muted: #8a95a1;
    --shell-primary: #e96846;
    --shell-primary-soft: rgba(233, 104, 70, 0.10);
    --shell-divider: #ece3d2;
    background: var(--shell-bg);
    color: var(--shell-body);
}

.auth-brand {
    /* Replace the existing dark navy-blue gradient with warm cream + ember glow. */
    background:
        radial-gradient(ellipse at 18% 22%, rgba(233, 104, 70, 0.20) 0%, transparent 56%),
        radial-gradient(ellipse at 92% 88%, rgba(255, 196, 132, 0.28) 0%, transparent 58%),
        linear-gradient(160deg, #f8eedb 0%, #fdfaf3 50%, #f4ecdd 100%);
    color: var(--shell-text);
    overflow: hidden;
    position: relative;
}

/* Defeat the original ::before / ::after radial blobs (they were navy-blue glows). */
.auth-brand::before { display: none; }
.auth-brand::after { display: none; }

/* Decorative serif "W" watermark — bottom-right, low contrast, large. */
.auth-brand-inner::after {
    content: "W";
    position: absolute;
    bottom: -90px;
    right: -40px;
    font-family: var(--font-display);
    font-size: 480px;
    font-weight: 200;
    line-height: 1;
    color: var(--shell-text);
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.auth-brand-logo {
    color: var(--shell-text);
    font-family: var(--font-display);
    font-weight: 580;
    letter-spacing: var(--tracking-display);
}

.auth-brand-logo .brand-mark {
    background: linear-gradient(140deg, #ff8a4a 0%, #e96846 60%, #c84b3b 100%);
    color: #fff;
    box-shadow: var(--shadow-ember);
    backdrop-filter: none;
}

.auth-brand-headline {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.4vw, 52px);
    font-weight: 480;
    line-height: 1.04;
    letter-spacing: var(--tracking-display);
    color: var(--shell-text);
    margin-bottom: 28px;
}

.auth-brand-headline em,
.auth-brand-headline .accent {
    font-style: italic;
    color: var(--shell-primary);
    font-weight: 460;
}

.auth-brand-subhead {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.62;
    color: var(--shell-body);
}

.auth-brand-features li {
    color: var(--shell-body);
    font-size: 15px;
}

.auth-brand-features .dot {
    background: linear-gradient(135deg, #ff8a4a, #e96846);
    box-shadow: 0 0 0 4px rgba(233, 104, 70, 0.10);
}

.auth-brand-footer {
    color: var(--shell-muted);
}

.auth-brand-footer a {
    color: var(--shell-text);
    text-decoration: none;
    border-bottom: 1px dotted var(--shell-border-strong);
}

/* Form panel (right). */
.auth-form {
    background: var(--shell-surface);
    border-left: 1px solid var(--shell-border);
}

.auth-form-inner {
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 80px 40px;
}

.auth-form h1 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 520;
    letter-spacing: var(--tracking-display);
    margin: 0 0 8px 0;
    color: var(--shell-text);
}

.auth-form .auth-lede {
    color: var(--shell-muted);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0 0 28px 0;
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--shell-text);
    margin-bottom: 6px;
}

.auth-field input,
.auth-field .rz-textbox,
input.form-control {
    width: 100%;
    box-sizing: border-box;
    background: var(--shell-bg);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-input);
    padding: 11px 14px;
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--shell-text);
    transition: border-color 0.14s, box-shadow 0.14s, background 0.14s;
}

.auth-field input:focus,
input.form-control:focus {
    outline: none;
    border-color: var(--shell-primary);
    background: var(--shell-surface);
    box-shadow: 0 0 0 4px var(--shell-primary-soft);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 22px 0;
    font-size: 13px;
}

.auth-row .remember {
    color: var(--shell-body);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-row a {
    color: var(--shell-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-row a:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-submit {
    width: 100%;
    padding: 13px 18px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 4px;
}

.auth-divider {
    text-align: center;
    margin: 22px 0;
    color: var(--shell-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    position: relative;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 80px);
    height: 1px;
    background: var(--shell-border);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--shell-muted);
}

.auth-footer a {
    color: var(--shell-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

/* =====================================================================
   Dashboard hero — donut + side stack composition
   ===================================================================== */

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
    gap: 28px;
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 32px 36px;
    box-shadow: var(--shadow-paper-md);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    /* Tiny ember spark in top-right corner. */
    content: "";
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(233, 104, 70, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-hero-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-right: 28px;
    border-right: 1px dashed var(--shell-border);
    position: relative;
}

.dashboard-hero-gauge .gauge-domain {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--shell-muted);
    letter-spacing: 0.04em;
}

.dashboard-hero-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
    align-content: center;
}

.dashboard-hero-stack .stat-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--shell-bg);
    border: 1px solid var(--shell-border);
}

.dashboard-hero-stack .stat-row-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shell-muted);
}

.dashboard-hero-stack .stat-row-value {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 460;
    color: var(--shell-text);
    letter-spacing: var(--tracking-display);
    font-feature-settings: "tnum";
}

.dashboard-hero-stack .stat-row-trend {
    font-size: 12px;
    font-weight: 500;
}

.dashboard-hero-stack .stat-row-trend.up { color: var(--shell-success); }
.dashboard-hero-stack .stat-row-trend.down { color: var(--shell-danger); }
.dashboard-hero-stack .stat-row-trend.flat { color: var(--shell-muted); }

@media (max-width: 900px) {
    .dashboard-hero { grid-template-columns: 1fr; }
    .dashboard-hero-gauge { border-right: none; border-bottom: 1px dashed var(--shell-border); padding-right: 0; padding-bottom: 24px; }
}

/* Status breakdown + activity list polish (Dashboard). */
.status-breakdown,
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.status-breakdown li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--shell-divider);
}

.status-breakdown li:last-child { border-bottom: none; }

.status-breakdown .status-count {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 480;
    font-feature-settings: "tnum";
}

.activity-list li {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--shell-divider);
    font-size: 13px;
}

.activity-list li:last-child { border-bottom: none; }

.activity-list .activity-action {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--shell-text);
}

.activity-list .activity-resource {
    color: var(--shell-muted);
    font-size: 12px;
}

.activity-list .activity-time {
    font-size: 11.5px;
    color: var(--shell-muted);
    font-variant-numeric: tabular-nums;
}

/* =====================================================================
   Workspace banner / page error
   ===================================================================== */

.workspace-banner {
    border-radius: var(--radius-card);
    padding: 14px 20px;
    margin-bottom: 18px;
    border: 1px solid var(--shell-warning);
    background: var(--shell-warning-soft);
    color: #8a6a1a;
}

.workspace-banner-suspended,
.workspace-banner-cancelled {
    background: var(--shell-danger-soft);
    border-color: var(--shell-danger);
    color: var(--shell-danger);
}

.workspace-banner-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.workspace-banner a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* =====================================================================
   Tables (used on /app/seed-lists, /app/templates/performance, etc.)
   ===================================================================== */

.page-card table {
    border-collapse: collapse;
    width: 100%;
}

.page-card table thead th {
    background: var(--shell-table-head);
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--shell-muted);
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--shell-border);
}

.page-card table tbody td {
    padding: 12px 16px !important;
    border-top: 1px solid var(--shell-divider);
    color: var(--shell-body);
    font-size: 13.5px;
}

.page-card table tbody tr:hover td {
    background: var(--shell-bg);
}

/* ESP badges on /app/seed-lists. */
.esp-badge {
    font-family: var(--font-body);
    border-radius: var(--radius-pill);
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.esp-badge.esp-google     { background: #e6f4ea; color: #1e7a3a; border-color: #c5e2cf; }
.esp-badge.esp-microsoft  { background: #e6ecf6; color: #1f3f8a; border-color: #c1cee7; }
.esp-badge.esp-yahoo      { background: #f6e6f6; color: #6a1f6a; border-color: #e3c1e3; }
.esp-badge.esp-apple      { background: #ece8e1; color: #3d3a35; border-color: #cdc6b9; }
.esp-badge.esp-other      { background: var(--shell-warning-soft); color: #8a6a1a; border-color: #e8d3a1; }

/* =====================================================================
   Reset Bootstrap surprises that bleed in.
   ===================================================================== */

.btn-primary {
    background: linear-gradient(135deg, #ff8a4a 0%, var(--shell-primary) 100%) !important;
    border-color: transparent !important;
    color: #fff !important;
    border-radius: var(--radius-button) !important;
    font-weight: 600;
}

.btn-primary:hover { filter: brightness(0.96); }

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--shell-primary) !important;
    box-shadow: 0 0 0 4px var(--shell-primary-soft) !important;
}

/* Anchor link hover everywhere (subtle). */
a {
    color: var(--shell-primary);
    transition: color 0.14s ease;
}

a:hover { color: var(--shell-primary-hover); }

/* =====================================================================
   Motion — initial page-load reveal. CSS-only, no JS coordination.
   Animations run once on mount; respects prefers-reduced-motion.
   ===================================================================== */

@keyframes warmup-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes warmup-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes warmup-gauge-grow {
    from { stroke-dashoffset: 276.46; }
}

.app-main .page-header {
    animation: warmup-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.app-main .dashboard-hero,
.app-main > .page-card,
.app-main > div > .page-card,
.app-main .reports-grid,
.app-main .severity-grid,
.app-main .academy-meta,
.app-main .academy-track {
    animation: warmup-fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.08s;
}

.app-main .reports-grid > .report-tile {
    animation: warmup-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.app-main .reports-grid > .report-tile:nth-child(1) { animation-delay: 0.10s; }
.app-main .reports-grid > .report-tile:nth-child(2) { animation-delay: 0.16s; }
.app-main .reports-grid > .report-tile:nth-child(3) { animation-delay: 0.22s; }
.app-main .reports-grid > .report-tile:nth-child(4) { animation-delay: 0.28s; }
.app-main .reports-grid > .report-tile:nth-child(5) { animation-delay: 0.34s; }

.app-main .lesson-grid > .lesson-card {
    animation: warmup-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.app-main .lesson-grid > .lesson-card:nth-child(4n+1) { animation-delay: 0.06s; }
.app-main .lesson-grid > .lesson-card:nth-child(4n+2) { animation-delay: 0.11s; }
.app-main .lesson-grid > .lesson-card:nth-child(4n+3) { animation-delay: 0.16s; }
.app-main .lesson-grid > .lesson-card:nth-child(4n+4) { animation-delay: 0.21s; }

.app-main .severity-grid > .severity-tile:nth-child(1) { animation-delay: 0.08s; }
.app-main .severity-grid > .severity-tile:nth-child(2) { animation-delay: 0.14s; }
.app-main .severity-grid > .severity-tile:nth-child(3) { animation-delay: 0.20s; }

.donut-gauge .gauge-fill {
    animation: warmup-gauge-grow 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.30s;
}

.auth-brand-inner {
    animation: warmup-fade-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand-headline { animation: warmup-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }
.auth-brand-subhead   { animation: warmup-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.20s both; }
.auth-brand-features  { animation: warmup-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both; }

.auth-form-inner {
    animation: warmup-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.10s both;
}

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

/* =====================================================================
   Focus rings — keyboard navigation accessibility.
   :focus-visible only fires on keyboard focus, not pointer clicks.
   ===================================================================== */

*:focus { outline: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.rz-button:focus-visible,
.rz-textbox:focus-visible,
.rz-dropdown:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--shell-primary);
    outline-offset: 2px;
    border-radius: 6px;
}

.warmup-nav .nav-link:focus-visible {
    outline-offset: 0;
    outline-width: 2px;
}

.donut-gauge:focus-visible,
.lesson-card:focus-visible,
.report-tile:focus-visible,
.severity-tile:focus-visible,
.notif-item:focus-visible {
    outline: 2px solid var(--shell-primary);
    outline-offset: 3px;
}

/* =====================================================================
   Mobile responsiveness — 480 / 720 / 1024 breakpoints.
   ===================================================================== */

/* Tablet: collapse sidebar to icon-rail. */
@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 64px 1fr;
    }
    .app-shell .nav-brand .brand-word,
    .app-shell .warmup-nav .nav-section-label,
    .app-shell .warmup-nav .nav-link span:not(.material-icons):not(.nav-badge),
    .app-shell .warmup-nav .nav-badge {
        display: none;
    }
    .app-shell .warmup-nav .nav-link {
        justify-content: center;
        padding: 10px;
    }
    .app-main {
        padding: 24px 24px 48px 24px;
    }
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    .dashboard-hero-gauge {
        border-right: none;
        border-bottom: 1px dashed var(--shell-border);
        padding-right: 0;
        padding-bottom: 22px;
    }
}

/* Phone: stack everything, hide sidebar entirely (would need a hamburger).
   For now we keep the icon-rail visible to preserve nav reachability. */
@media (max-width: 720px) {
    .app-main {
        padding: 18px 16px 36px 16px;
    }
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .page-title {
        font-size: clamp(24px, 7vw, 32px);
    }
    .reports-grid,
    .severity-grid,
    .lesson-grid {
        grid-template-columns: 1fr !important;
    }
    .dashboard-hero-stack {
        grid-template-columns: 1fr !important;
    }
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-brand {
        padding: 32px 24px;
    }
    .auth-form-inner {
        padding: 48px 24px;
    }
    .stat-tile .stat-value,
    .severity-tile-count {
        font-size: 28px;
    }
    .academy-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Small phone tweaks. */
@media (max-width: 480px) {
    .page-card {
        padding: 18px 16px;
    }
    .page-empty {
        padding: 48px 18px;
    }
    .auth-brand-headline {
        font-size: clamp(28px, 8vw, 38px);
    }
}

/* =====================================================================
   Marketing landing — applies on `/`.
   ===================================================================== */

.landing-shell {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 18% 22%, rgba(233, 104, 70, 0.18) 0%, transparent 56%),
        radial-gradient(ellipse at 92% 88%, rgba(255, 196, 132, 0.22) 0%, transparent 58%),
        linear-gradient(160deg, #f8eedb 0%, #fdfaf3 50%, #f4ecdd 100%);
    color: var(--shell-text);
    position: relative;
    overflow-x: hidden;
}

.landing-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0 0.30 0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.45;
    mix-blend-mode: multiply;
    z-index: 0;
}

.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 48px;
    max-width: 1240px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.landing-nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--shell-text);
    font-family: var(--font-display);
    font-weight: 580;
    font-size: 22px;
    letter-spacing: var(--tracking-display);
}

.landing-nav-logo .mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(140deg, #ff8a4a 0%, #e96846 60%, #c84b3b 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-ember);
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 14.5px;
}

.landing-nav-links a {
    color: var(--shell-body);
    text-decoration: none;
    font-weight: 500;
}

.landing-nav-links a:hover { color: var(--shell-primary); }

.landing-nav-cta {
    background: linear-gradient(135deg, #ff8a4a 0%, var(--shell-primary) 100%);
    color: #fff !important;
    padding: 9px 18px;
    border-radius: var(--radius-button);
    font-weight: 600;
    box-shadow: var(--shadow-ember);
    transition: transform 0.14s, filter 0.14s;
}

.landing-nav-cta:hover { transform: translateY(-1px); filter: brightness(0.96); }

.landing-hero {
    max-width: 980px;
    margin: 80px auto 60px auto;
    padding: 0 48px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.landing-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    color: var(--shell-primary);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 28px;
    box-shadow: var(--shadow-paper-sm);
}

.landing-hero-headline {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 460;
    line-height: 1.04;
    letter-spacing: var(--tracking-display);
    color: var(--shell-text);
    margin: 0 0 22px 0;
}

.landing-hero-headline em,
.landing-hero-headline .accent {
    font-style: italic;
    color: var(--shell-primary);
    font-weight: 460;
}

.landing-hero-sub {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.56;
    color: var(--shell-body);
    max-width: 680px;
    margin: 0 auto 32px auto;
}

.landing-hero-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.landing-btn-primary,
.landing-btn-secondary {
    padding: 14px 26px;
    border-radius: var(--radius-button);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    text-decoration: none;
    transition: transform 0.14s, filter 0.14s, box-shadow 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.landing-btn-primary {
    background: linear-gradient(135deg, #ff8a4a 0%, var(--shell-primary) 100%);
    color: #fff !important;
    box-shadow: var(--shadow-ember);
}

.landing-btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(0.96);
    box-shadow: 0 12px 32px rgba(233, 104, 70, 0.36);
}

.landing-btn-secondary {
    background: transparent;
    color: var(--shell-text) !important;
    border: 1px solid var(--shell-border-strong);
}

.landing-btn-secondary:hover {
    border-color: var(--shell-primary);
    color: var(--shell-primary) !important;
}

.landing-hero-foot {
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--shell-muted);
}

.landing-features {
    max-width: 1180px;
    margin: 80px auto 0 auto;
    padding: 0 48px;
    position: relative;
    z-index: 2;
}

.landing-features-head {
    text-align: center;
    margin-bottom: 48px;
}

.landing-features-head h2 {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 480;
    color: var(--shell-text);
    margin: 0 0 12px 0;
    letter-spacing: var(--tracking-display);
}

.landing-features-head p {
    color: var(--shell-body);
    font-size: 16px;
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.55;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.landing-feature {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 26px 24px;
    box-shadow: var(--shadow-paper-sm);
    transition: box-shadow 0.18s, transform 0.18s;
}

.landing-feature:hover {
    box-shadow: var(--shadow-paper-md);
    transform: translateY(-2px);
}

.landing-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.landing-feature-icon .material-icons { font-size: 22px; }

.landing-feature h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 540;
    color: var(--shell-text);
    margin: 0 0 8px 0;
    letter-spacing: var(--tracking-tight);
}

.landing-feature p {
    color: var(--shell-body);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

.landing-stats {
    max-width: 1180px;
    margin: 80px auto 0 auto;
    padding: 36px 48px;
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-paper-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 28px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.landing-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.landing-stat-value {
    font-family: var(--font-display);
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 460;
    color: var(--shell-text);
    letter-spacing: var(--tracking-display);
    line-height: 1;
    font-feature-settings: "tnum";
}

.landing-stat-value em {
    font-style: italic;
    color: var(--shell-primary);
    font-weight: 460;
}

.landing-stat-label {
    color: var(--shell-muted);
    font-size: 13px;
    font-weight: 500;
}

.landing-cta {
    max-width: 980px;
    margin: 80px auto 60px auto;
    padding: 56px 48px;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(233, 104, 70, 0.14) 0%, transparent 70%),
        var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-paper-md);
    position: relative;
    z-index: 2;
}

.landing-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 480;
    color: var(--shell-text);
    margin: 0 0 12px 0;
    letter-spacing: var(--tracking-display);
}

.landing-cta p {
    color: var(--shell-body);
    font-size: 16px;
    margin: 0 0 26px 0;
    line-height: 1.55;
}

.landing-foot {
    text-align: center;
    color: var(--shell-muted);
    padding: 28px 48px 36px 48px;
    font-size: 13px;
    position: relative;
    z-index: 2;
}

.landing-foot a {
    color: var(--shell-body);
    text-decoration: none;
    border-bottom: 1px dotted var(--shell-border-strong);
    margin: 0 8px;
}

.landing-foot a:hover { color: var(--shell-primary); border-bottom-color: var(--shell-primary); }

@media (max-width: 720px) {
    .landing-nav { padding: 18px 24px; flex-wrap: wrap; gap: 14px; }
    .landing-nav-links { gap: 16px; font-size: 13.5px; }
    .landing-hero { margin: 48px auto 36px auto; padding: 0 24px; }
    .landing-features { margin-top: 56px; padding: 0 24px; }
    .landing-stats { padding: 24px 18px; margin: 56px 18px 0 18px; }
    .landing-cta { padding: 38px 22px; margin: 56px 18px 36px 18px; }
}

/* =====================================================================
   Onboarding 3-step checklist on Dashboard empty state.
   ===================================================================== */

.onboarding-card {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 32px 36px;
    box-shadow: var(--shadow-paper-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    position: relative;
    overflow: hidden;
}

.onboarding-card::before {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(233, 104, 70, 0.16) 0%, transparent 70%);
    pointer-events: none;
}

.onboarding-card-pitch h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 520;
    color: var(--shell-text);
    margin: 0 0 10px 0;
    letter-spacing: var(--tracking-display);
}

.onboarding-card-pitch p {
    color: var(--shell-body);
    font-size: 14.5px;
    line-height: 1.6;
    margin: 0 0 22px 0;
}

.onboarding-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.onboarding-step {
    counter-increment: step;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--shell-bg);
    border: 1px solid var(--shell-border);
    border-radius: 12px;
    transition: border-color 0.18s, background 0.18s;
}

.onboarding-step::before {
    content: counter(step, decimal-leading-zero);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 540;
    font-feature-settings: "tnum";
}

.onboarding-step.active { border-color: var(--shell-primary); background: var(--shell-primary-soft); }
.onboarding-step.active::before { background: linear-gradient(135deg, #ff8a4a, #e96846); color: #fff; }

.onboarding-step.done { opacity: 0.55; }
.onboarding-step.done::before {
    content: "✓";
    background: var(--shell-success-soft);
    color: var(--shell-success);
}

.onboarding-step-body {
    flex: 1;
}

.onboarding-step-title {
    font-family: var(--font-display);
    font-size: 15.5px;
    font-weight: 540;
    color: var(--shell-text);
    margin: 0 0 4px 0;
}

.onboarding-step-desc {
    color: var(--shell-muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.onboarding-step-action {
    display: inline-block;
    margin-top: 8px;
    color: var(--shell-primary);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.onboarding-step-action:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
    .onboarding-card { grid-template-columns: 1fr; padding: 24px; gap: 22px; }
}

/* =====================================================================
   Reports — mini donut tile grid.
   ===================================================================== */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.report-tile {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 22px 22px 18px 22px;
    box-shadow: var(--shadow-paper-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.report-tile:hover {
    box-shadow: var(--shadow-paper-md);
    transform: translateY(-1px);
}

.report-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.report-tile-label {
    font-family: var(--font-body);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shell-muted);
}

.report-tile-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.report-tile-icon .material-icons { font-size: 18px; }

.report-tile-body {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-tile-body .donut-gauge {
    --gauge-size: 90px;
    flex-shrink: 0;
}

.report-tile-body .donut-gauge .gauge-value { font-size: 22px; }
.report-tile-body .donut-gauge .gauge-label { font-size: 9px; margin-top: 2px; }

.report-tile-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.report-tile-headline {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 460;
    color: var(--shell-text);
    letter-spacing: var(--tracking-display);
    line-height: 1;
    font-feature-settings: "tnum";
}

.report-tile-headline.is-empty {
    font-size: 22px;
    color: var(--shell-muted);
    font-style: italic;
}

.report-tile-explain {
    font-size: 12px;
    color: var(--shell-muted);
    line-height: 1.45;
    margin: 0;
}

.report-tile-explain code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: var(--shell-bg);
    border-radius: 4px;
    padding: 1px 5px;
}

/* =====================================================================
   Notifications — severity summary tiles + timeline list.
   ===================================================================== */

.severity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

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

.severity-tile {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 18px 22px;
    box-shadow: var(--shadow-paper-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.severity-tile::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--severity-color, var(--shell-primary));
}

.severity-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--severity-color, var(--shell-primary)) 14%, transparent);
    color: var(--severity-color, var(--shell-primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.severity-tile-icon .material-icons { font-size: 22px; }

.severity-tile-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.severity-tile-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shell-muted);
}

.severity-tile-count {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 460;
    line-height: 1;
    color: var(--severity-color, var(--shell-text));
    letter-spacing: var(--tracking-display);
    font-feature-settings: "tnum";
}

.severity-tile.severity-critical { --severity-color: var(--shell-danger); }
.severity-tile.severity-warning  { --severity-color: var(--shell-warning); }
.severity-tile.severity-info     { --severity-color: #5b8a9b; }

.notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notif-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px dashed var(--shell-divider);
    align-items: flex-start;
    transition: background 0.14s ease;
}

.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--shell-bg); }

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--notif-color, var(--shell-muted)) 14%, transparent);
    color: var(--notif-color, var(--shell-muted));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.notif-icon .material-icons { font-size: 20px; }

.notif-item.severity-critical { --notif-color: var(--shell-danger); }
.notif-item.severity-warning  { --notif-color: var(--shell-warning); }
.notif-item.severity-info     { --notif-color: #5b8a9b; }

.notif-content { min-width: 0; }

.notif-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
}

.notif-title {
    font-family: var(--font-display);
    font-size: 15.5px;
    font-weight: 520;
    color: var(--shell-text);
    letter-spacing: var(--tracking-tight);
    margin: 0;
}

.notif-time {
    font-size: 11.5px;
    color: var(--shell-muted);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.notif-message {
    margin: 4px 0 0 0;
    color: var(--shell-body);
    font-size: 13.5px;
    line-height: 1.5;
}

.notif-cta {
    display: inline-block;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--shell-primary);
    text-decoration: none;
}

.notif-cta:hover { text-decoration: underline; text-underline-offset: 3px; }

.notif-side {
    flex-shrink: 0;
    align-self: flex-start;
}

/* =====================================================================
   Radzen DataGrid — warm table treatment.
   Targets .rz-grid-table inside our .page-card containers so we don't
   accidentally restyle Radzen tables outside the app pages.
   ===================================================================== */

.page-card .rz-data-grid,
.page-card .rz-grid-table {
    background: transparent;
    border: none;
    font-family: var(--font-body);
}

.page-card .rz-grid-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.page-card .rz-grid-table thead th {
    background: var(--shell-table-head) !important;
    color: var(--shell-muted) !important;
    font-family: var(--font-body) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px !important;
    border-top: 1px solid var(--shell-border) !important;
    border-bottom: 1px solid var(--shell-border) !important;
}

.page-card .rz-grid-table thead th:first-child { border-left: none; }
.page-card .rz-grid-table thead th:last-child { border-right: none; }

.page-card .rz-grid-table tbody td {
    background: var(--shell-surface) !important;
    color: var(--shell-body) !important;
    font-size: 13.5px !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--shell-divider) !important;
    border-top: none !important;
}

.page-card .rz-grid-table tbody tr:hover td,
.page-card .rz-grid-table tbody tr.rz-state-hover td {
    background: var(--shell-bg) !important;
}

.page-card .rz-grid-table tbody tr.rz-data-row:nth-child(even) td {
    background: color-mix(in srgb, var(--shell-bg) 50%, var(--shell-surface)) !important;
}

.page-card .rz-grid-table tbody tr.rz-state-highlight td,
.page-card .rz-grid-table tbody tr.rz-selected td {
    background: var(--shell-primary-soft) !important;
}

.page-card .rz-paginator {
    background: var(--shell-bg) !important;
    border-top: 1px solid var(--shell-border) !important;
    padding: 10px 14px !important;
}

.page-card .rz-paginator .rz-paginator-element {
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--shell-body) !important;
    font-family: var(--font-body) !important;
    transition: background 0.14s, color 0.14s;
}

.page-card .rz-paginator .rz-paginator-element:hover {
    background: var(--shell-primary-soft) !important;
    color: var(--shell-primary) !important;
}

.page-card .rz-paginator .rz-paginator-element.rz-state-active {
    background: var(--shell-primary) !important;
    color: #fff !important;
}

.page-card .rz-grid-table .rz-cell-filter,
.page-card .rz-data-grid .rz-cell-filter input {
    background: var(--shell-surface) !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: 8px !important;
    font-family: var(--font-body) !important;
    color: var(--shell-text) !important;
}

.page-card .rz-grid-table .rz-cell-filter input:focus,
.page-card .rz-data-grid .rz-cell-filter input:focus {
    outline: none;
    border-color: var(--shell-primary) !important;
    box-shadow: 0 0 0 3px var(--shell-primary-soft) !important;
}

.rz-badge {
    font-family: var(--font-body) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill) !important;
    padding: 3px 10px !important;
}

.rz-badge.rz-badge-light {
    background: var(--shell-surface-soft) !important;
    color: var(--shell-body) !important;
    border: 1px solid var(--shell-border);
}

.rz-badge.rz-badge-success {
    background: var(--shell-success-soft) !important;
    color: var(--shell-success) !important;
    border: 1px solid #c5e2cf;
}

.rz-badge.rz-badge-warning {
    background: var(--shell-warning-soft) !important;
    color: #8a6a1a !important;
    border: 1px solid #e8d3a1;
}

.rz-badge.rz-badge-danger {
    background: var(--shell-danger-soft) !important;
    color: var(--shell-danger) !important;
    border: 1px solid #f0c9c2;
}

.rz-button-text {
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
}

.rz-button.rz-button-text {
    background: transparent !important;
    color: var(--shell-body) !important;
    border-radius: var(--radius-pill) !important;
    padding: 6px 12px !important;
    box-shadow: none !important;
    transition: background 0.14s, color 0.14s;
}

.rz-button.rz-button-text:hover {
    background: var(--shell-primary-soft) !important;
    color: var(--shell-primary) !important;
}

.rz-button.rz-button-text.rz-danger {
    color: var(--shell-danger) !important;
}

.rz-button.rz-button-text.rz-danger:hover {
    background: var(--shell-danger-soft) !important;
}

.rz-dropdown,
.rz-textbox,
.rz-input {
    background: var(--shell-surface) !important;
    border: 1px solid var(--shell-border) !important;
    border-radius: var(--radius-input) !important;
    font-family: var(--font-body) !important;
    color: var(--shell-text) !important;
    transition: border-color 0.14s, box-shadow 0.14s;
}

.rz-dropdown:focus,
.rz-dropdown.rz-state-focused,
.rz-textbox:focus,
.rz-input:focus {
    border-color: var(--shell-primary) !important;
    box-shadow: 0 0 0 3px var(--shell-primary-soft) !important;
    outline: none;
}

.rz-switch.rz-switch-checked .rz-switch-circle {
    background: var(--shell-primary) !important;
}

.rz-switch.rz-switch-checked {
    background: color-mix(in srgb, var(--shell-primary) 28%, transparent) !important;
}

/* =====================================================================
   Radzen Tabs (used on Settings → Workspace, Mailbox detail).
   ===================================================================== */

.rz-tabview,
.rz-tabview-panels {
    background: transparent !important;
    border: none !important;
}

.rz-tabview-nav {
    background: transparent !important;
    border-bottom: 1px solid var(--shell-border) !important;
    padding: 0 !important;
    margin-bottom: 22px !important;
    gap: 4px;
}

.rz-tabview-nav li {
    background: transparent !important;
    border: none !important;
    margin-bottom: -1px;
}

.rz-tabview-nav li > a,
.rz-tabview-nav .rz-tabview-title {
    color: var(--shell-muted) !important;
    background: transparent !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 10px 16px !important;
    border-radius: 0 !important;
    border-bottom: 2px solid transparent !important;
    transition: color 0.14s, border-color 0.14s !important;
}

.rz-tabview-nav li:hover > a,
.rz-tabview-nav li:hover .rz-tabview-title {
    color: var(--shell-text) !important;
    border-bottom-color: var(--shell-border-strong) !important;
}

.rz-tabview-nav li.rz-state-active > a,
.rz-tabview-nav li.rz-state-active .rz-tabview-title {
    color: var(--shell-primary) !important;
    border-bottom-color: var(--shell-primary) !important;
}

.rz-tabview-panel {
    padding: 0 !important;
    background: transparent !important;
}

/* =====================================================================
   Public free-tools pages — page-header consistency.
   The free-tool pages render outside MainLayout so they don't get the
   warm app shell, but they still benefit from the theme tokens.
   ===================================================================== */

body:not(.warmup-app-body) .page-header {
    max-width: 960px;
    margin: 32px auto 28px auto;
    padding: 0 24px 18px 24px;
}

body:not(.warmup-app-body) .page-card,
body:not(.warmup-app-body) .page-empty {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

/* =====================================================================
   Inbox academy — track sections + lesson cards.
   ===================================================================== */

.academy-track {
    margin-bottom: 28px;
}

.academy-track-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--shell-border);
}

.academy-track-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 540;
    color: var(--shell-text);
    margin: 0;
    letter-spacing: var(--tracking-display);
}

.academy-track-blurb {
    color: var(--shell-muted);
    font-size: 13.5px;
    margin: 0;
}

.academy-track-count {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--shell-muted);
    font-family: var(--font-mono);
    font-feature-settings: "tnum";
}

.lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}

.lesson-card {
    background: var(--shell-surface);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    padding: 18px 20px;
    box-shadow: var(--shadow-paper-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.lesson-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--shell-primary), #ff8a4a);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.lesson-card:hover {
    box-shadow: var(--shadow-paper-md);
    border-color: var(--shell-border-strong);
    transform: translateY(-1px);
}

.lesson-card:hover::before { transform: scaleX(1); }

.lesson-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--shell-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lesson-card-duration {
    margin-left: auto;
    background: var(--shell-primary-soft);
    color: var(--shell-primary);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: none;
}

.lesson-card h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 540;
    color: var(--shell-text);
    margin: 4px 0 0 0;
    letter-spacing: var(--tracking-tight);
    line-height: 1.25;
}

.lesson-card-summary {
    font-size: 13.5px;
    color: var(--shell-body);
    line-height: 1.5;
    margin: 0;
}

.academy-meta {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    margin-top: 4px;
    background: var(--shell-surface-soft);
    border: 1px solid var(--shell-border);
    border-radius: var(--radius-card);
    color: var(--shell-body);
    font-size: 13px;
}

.academy-meta strong {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--shell-text);
    margin-right: 6px;
    font-feature-settings: "tnum";
}

/* =====================================================================
   Auth — secondary link cleanup.
   ===================================================================== */

.auth-form a,
.auth-footer a,
.auth-row a {
    color: var(--shell-primary);
}

.auth-form a:hover,
.auth-footer a:hover { color: var(--shell-primary-hover); text-decoration: underline; text-underline-offset: 3px; }

/* The framework's "There are no external authentication services configured"
   notice gets a danger underline by default — soften it. */
.auth-sso a { color: var(--shell-muted) !important; text-decoration: underline; text-underline-offset: 2px; }
.auth-sso a:hover { color: var(--shell-primary) !important; }
.auth-sso { color: var(--shell-muted); font-size: 13px; line-height: 1.5; }

/* =====================================================================
   Icon font fix — body rule cascaded onto Radzen's `.rzi` and Material
   `.material-icons` `<i>` elements, which made the icon ligature names
   render as raw text ("add", "keyboard_arrow_down"). Pin them back.
   ===================================================================== */

i.material-icons,
.material-icons,
.material-symbols-outlined,
.material-symbols-rounded {
    font-family: 'Material Icons', 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    letter-spacing: normal;
    text-transform: none;
}

i.rzi,
.rzi,
.rz-button-icon-left,
.rz-button-icon-right,
.rz-button-icon-only,
.rz-navigation-item-icon-children,
.rz-icon,
.rz-button-icon-start,
.rz-button-icon-end {
    font-family: 'Material Icons', 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    letter-spacing: normal;
    text-transform: none;
}
