/* ==========================================================================
   Meditly / MedicRoster — Design System
   One stylesheet for marketing, auth and both dashboards.
   Sections:
     1. Tokens (light / dark)      6. App shell (sidebar, topbar)
     2. Base                        7. Page patterns (stats, plans, roster)
     3. Buttons                     8. Auth layout
     4. Forms                       9. Marketing layout
     5. Data display                10. Third-party widget overrides + print
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root,
[data-theme="light"] {
    --font-sans: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Neutrals */
    --bg: #F6F7F9;
    --surface: #FFFFFF;
    --surface-2: #F9FAFB;
    --surface-3: #F2F4F7;
    --border: #E4E7EC;
    --border-strong: #D0D5DD;
    --text: #101828;
    --text-2: #344054;
    --text-muted: #667085;
    --text-subtle: #98A2B3;

    /* Brand — clinical teal */
    --brand-50: #EEF7F5;
    --brand-100: #D4ECE7;
    --brand-200: #A8D8CE;
    --brand-500: #179383;
    --brand-600: #0E7C6D;
    --brand-700: #0B6559;
    --brand-800: #0A5048;
    --brand-900: #0A3B35;
    --brand-fg: #0B6E61;            /* brand-coloured text / links */
    --brand-soft: var(--brand-50);  /* tinted backgrounds */

    /* Status */
    --success-600: #079455; --success-700: #067647; --success-bg: #ECFDF3; --success-border: #ABEFC6;
    --warning-600: #DC6803; --warning-700: #B54708; --warning-bg: #FFFAEB; --warning-border: #FEDF89;
    --danger-600:  #D92D20; --danger-700:  #B42318; --danger-bg:  #FEF3F2; --danger-border:  #FECDCA;
    --info-600:    #1570EF; --info-700:    #175CD3; --info-bg:    #EFF8FF; --info-border:    #B2DDFF;

    /* Shape & depth */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 14px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
    --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
    --shadow-xl: 0 20px 24px -4px rgba(16, 24, 40, 0.10), 0 8px 8px -4px rgba(16, 24, 40, 0.04);
    --ring: 0 0 0 3px rgba(14, 124, 109, 0.18);
    --ring-danger: 0 0 0 3px rgba(217, 45, 32, 0.15);

    /* Layout */
    --sidebar-width: 248px;
    --sidebar-collapsed: 68px;
    --topbar-height: 56px;

    /* Legacy aliases — referenced by existing inline styles & JS templates */
    --color-bg: var(--bg);
    --color-background: var(--surface-2);
    --color-surface: var(--surface);
    --color-text: var(--text);
    --color-text-muted: var(--text-muted);
    --color-border: var(--border);
    --color-primary: var(--text);
    --color-secondary: var(--brand-600);
    --color-accent: var(--success-600);
    --color-danger: var(--danger-600);
    --color-warning: var(--warning-600);

    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0B0E12;
    --surface: #12161C;
    --surface-2: #161B22;
    --surface-3: #1C222B;
    --border: #252C36;
    --border-strong: #333C48;
    --text: #EEF1F4;
    --text-2: #C9CFD6;
    --text-muted: #8D97A3;
    --text-subtle: #66707C;

    --brand-50: rgba(46, 186, 162, 0.12);
    --brand-100: rgba(46, 186, 162, 0.20);
    --brand-fg: #4CCBB4;
    --brand-soft: rgba(46, 186, 162, 0.12);

    --success-bg: rgba(23, 178, 106, 0.12); --success-border: rgba(23, 178, 106, 0.30); --success-700: #47CD89;
    --warning-bg: rgba(247, 144, 9, 0.12);  --warning-border: rgba(247, 144, 9, 0.30);  --warning-700: #FDB022;
    --danger-bg:  rgba(240, 68, 56, 0.12);  --danger-border:  rgba(240, 68, 56, 0.30);  --danger-700:  #F97066;
    --info-bg:    rgba(46, 144, 250, 0.12); --info-border:    rgba(46, 144, 250, 0.30); --info-700:    #53B1FD;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 24px -4px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(76, 203, 180, 0.25);

    color-scheme: dark;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { color: var(--text); font-weight: 600; letter-spacing: -0.011em; line-height: 1.3; }
a { color: var(--brand-fg); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img, svg { display: inline-block; vertical-align: middle; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
::selection { background: var(--brand-100); }

.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

.brand-mark { width: 28px; height: 28px; flex-shrink: 0; color: var(--brand-600); }

/* 3. Buttons --------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }

.btn-secondary,
.btn-outline { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--danger-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn-danger:hover:not(:disabled) { background: var(--danger-700); }

.btn-dark { background: var(--text); color: var(--surface); }
.btn-dark:hover:not(:disabled) { opacity: 0.9; }

.btn-muted, .btn-muted:disabled { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); cursor: default; opacity: 1; }

.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius); gap: 6px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

.btn-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--brand-fg); font-weight: 500; font-size: 13.5px;
    background: none; border: 0; padding: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.bordered { border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); }
.icon-btn-danger:hover { background: var(--danger-bg); color: var(--danger-600); }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--brand-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    flex-shrink: 0;
}
.btn-primary .spinner, .btn-danger .spinner { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 4. Forms ----------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.assign-view > .form-group:last-child, .form-row > .form-group { margin-bottom: 16px; }
.form-label,
.form-group > label:not(.check) {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    margin-bottom: 6px;
}
.form-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.form-label-row .form-label { margin-bottom: 0; }
.form-label .optional { color: var(--text-subtle); font-weight: 400; }

.form-control {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    appearance: none;
    -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:hover:not(:disabled):not([readonly]) { border-color: var(--text-subtle); }
.form-control:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--ring); }
.form-control:disabled,
.form-control[readonly] { background: var(--surface-2); color: var(--text-muted); box-shadow: none; cursor: default; }
textarea.form-control { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.form-control,
select.form-select {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}
input[type="date"].form-control,
input[type="time"].form-control { padding-right: 8px; }
input[type="color"].form-control { width: 72px; height: 38px; padding: 4px; cursor: pointer; }
.form-control-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: var(--radius); }
select.form-control-sm { padding-right: 28px; background-position: right 6px center; background-size: 14px; }

.form-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.form-section-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--surface-3); color: var(--text-2);
    font-size: 11.5px; font-weight: 600; font-family: var(--font-mono);
}

input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand-600); cursor: pointer; flex-shrink: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }

.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; height: 30px; padding: 0 10px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    font-size: 13px; font-weight: 500; color: var(--text-2); background: var(--surface);
    cursor: pointer; transition: all 0.12s ease;
}
.chip-check input:checked + span { background: var(--brand-soft); border-color: var(--brand-600); color: var(--brand-fg); }
.chip-check input:focus-visible + span { box-shadow: var(--ring); }

.input-group {
    display: flex;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input-group:focus-within { border-color: var(--brand-600); box-shadow: var(--ring); }
.input-group .form-control { border: 0; box-shadow: none; border-radius: 0; min-width: 0; }
.input-group .form-control:focus { box-shadow: none; }
.input-addon {
    display: flex; align-items: center; padding: 0 12px;
    background: var(--surface-2); border-left: 1px solid var(--border);
    color: var(--text-muted); font-size: 13.5px; white-space: nowrap;
}

.status-msg { min-height: 18px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.status-error { color: var(--danger-600); }
.status-success { color: var(--success-700); }

.form-alert {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 12px; margin-bottom: 16px;
    background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--radius-md);
    color: var(--danger-700); font-size: 13.5px;
}
.form-alert:empty { display: none; }

/* 5. Data display ---------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    min-width: 0;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.no-dot::before, .badge-plain::before { display: none; }
.badge-active, .badge-success, .badge-used { background: var(--success-bg); color: var(--success-700); border-color: var(--success-border); }
.badge-pending, .badge-warning, .badge-past_due, .badge-grace { background: var(--warning-bg); color: var(--warning-700); border-color: var(--warning-border); }
.badge-inactive, .badge-danger, .badge-suspended, .badge-expired { background: var(--danger-bg); color: var(--danger-700); border-color: var(--danger-border); }
.badge-upcoming, .badge-info, .badge-trialing { background: var(--info-bg); color: var(--info-700); border-color: var(--info-border); }
.badge-neutral, .badge-canceled, .badge-offline { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
.badge-brand { background: var(--brand-soft); color: var(--brand-fg); border-color: var(--brand-100); }
[class*="badge-"] { text-transform: none; }
.badge-trialing, .badge-past_due, .badge-grace, .badge-suspended, .badge-expired, .badge-canceled, .badge-active { text-transform: capitalize; }

.tag {
    display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
    border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text-2);
    font-size: 11.5px; font-weight: 500; font-family: var(--font-mono); white-space: nowrap;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll { max-height: 520px; overflow-y: auto; }

.roster-table,
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}
.roster-table th,
.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.roster-table td,
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-2);
    vertical-align: middle;
}
.roster-table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: 0; }
.roster-table tbody tr:hover td,
.data-table tbody tr:hover td { background: var(--surface-2); }
.roster-table td.cell-strong, .cell-strong { color: var(--text); font-weight: 500; }
.table-responsive .roster-table { min-width: 680px; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions .icon-btn + .icon-btn { margin-left: 2px; }
.table-empty td, td.table-empty { text-align: center; padding: 48px 16px !important; color: var(--text-muted); }

.entity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity-avatar {
    width: 30px; height: 30px; border-radius: var(--radius-md); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border);
    font-size: 12px; font-weight: 600;
}
.entity-name { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-meta { color: var(--text-muted); font-size: 12.5px; }
.staff-info { display: flex; align-items: center; gap: 10px; }

.avatar {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-100); color: var(--brand-800);
    font-size: 12.5px; font-weight: 600;
}
[data-theme="dark"] .avatar { color: var(--brand-fg); }

.tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    position: relative;
    padding: 10px 0 12px;
    background: none;
    border: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.12s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-600); border-radius: 2px 2px 0 0; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.pagination-container {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-info span { color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.pagination-controls { display: flex; align-items: center; gap: 8px; }
.page-btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 10px;
    border-radius: var(--radius); border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-xs);
    font-size: 13px; font-weight: 500; cursor: pointer;
}
.page-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.segmented, .interval-toggle {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.segmented button, .interval-toggle button {
    height: 28px; padding: 0 12px; border: 0; border-radius: var(--radius);
    background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.12s ease;
}
.segmented button:hover, .interval-toggle button:hover { color: var(--text); }
.segmented button.active, .interval-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.segmented .save-hint { color: var(--success-700); font-size: 12px; margin-left: 4px; }

.notice {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 16px;
    border-radius: var(--radius-md); border: 1px solid;
    font-size: 13.5px; line-height: 1.5;
}
.notice svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.notice strong { font-weight: 600; }
.notice-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-700); }
.notice-danger  { background: var(--danger-bg);  border-color: var(--danger-border);  color: var(--danger-700); }
.notice-info    { background: var(--info-bg);    border-color: var(--info-border);    color: var(--info-700); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 13.5px; }
.empty-state-icon {
    width: 40px; height: 40px; margin: 0 auto 12px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.empty-state-icon svg { width: 18px; height: 18px; }
.empty-state-title { color: var(--text); font-weight: 500; font-size: 14px; margin-bottom: 4px; }

.loading-block { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13.5px; padding: 8px 0; }

.list-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.list-row + .list-row { margin-top: 8px; }
.list-row-title { font-weight: 500; color: var(--text); }
.list-row-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.color-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.color-swatch { width: 10px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }

.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); background: var(--surface); }

/* Native-dialog style modal (landlord subscription / tenant overview) */
.modal-backdrop,
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
    padding: 24px; background: rgba(16, 24, 40, 0.45);
}
.modal-backdrop.show, .modal-overlay.show { display: flex; animation: fadeIn 0.15s ease-out; }
.modal {
    width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    padding: 24px;
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal h3, .modal-title { font-size: 16px; font-weight: 600; }
.modal p { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.close-modal { width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--radius); color: var(--text-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.close-modal:hover { background: var(--surface-3); color: var(--text); }

.hospital-option {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin-top: 8px;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    cursor: pointer; transition: border-color 0.12s, background-color 0.12s;
}
.hospital-option:hover { border-color: var(--border-strong); background: var(--surface-2); }
.hospital-option:has(input:checked) { border-color: var(--brand-600); background: var(--brand-soft); }
.hospital-option .name { font-weight: 500; font-size: 14px; color: var(--text); }
.hospital-option .slug { font-size: 12.5px; color: var(--text-muted); font-family: var(--font-mono); }

.chip-input-container {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    min-height: 42px; padding: 6px 8px; margin-bottom: 16px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface);
    cursor: text; box-shadow: var(--shadow-xs);
}
.chip-input-container:focus-within { border-color: var(--brand-600); box-shadow: var(--ring); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: var(--radius); background: var(--surface-3); border: 1px solid var(--border); font-size: 13px; }
.remove-chip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; color: var(--text-muted); cursor: pointer; }
.remove-chip:hover { background: var(--border); color: var(--text); }
.chip-input { flex: 1; min-width: 160px; height: 28px; border: 0; outline: none; background: transparent; font-size: 14px; }

/* 6. App shell ------------------------------------------------------------- */
body.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transition: width 0.2s ease, transform 0.2s ease;
}
.sidebar-header {
    display: flex;
    align-items: center;
    height: var(--topbar-height);
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.015em;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-text { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-tag {
    display: inline-flex; align-items: center; height: 18px; padding: 0 6px;
    border-radius: 4px; border: 1px solid var(--border);
    font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--text-muted); background: var(--surface-2);
}

.workspace {
    display: flex; align-items: center; gap: 10px;
    margin: 12px 12px 4px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2);
    min-width: 0;
}
.workspace-avatar {
    width: 26px; height: 26px; border-radius: var(--radius); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-600); color: #fff; font-size: 12px; font-weight: 600;
}
.workspace-meta { min-width: 0; line-height: 1.25; }
.workspace-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-sub { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-body { flex: 1; display: flex; flex-direction: column; padding: 8px 12px 12px; overflow-y: auto; overflow-x: hidden; }
.nav-section-label {
    padding: 14px 10px 6px;
    font-size: 11.5px; font-weight: 500; color: var(--text-subtle);
    white-space: nowrap;
}
.nav-menu { list-style: none; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-spacer { flex: 1; min-height: 16px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius);
    border: 0;
    background: transparent;
    width: 100%;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); stroke-width: 1.8; transition: color 0.12s ease, transform 0.2s ease; }
.nav-item:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-item:hover svg { color: var(--text-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-fg); }
.nav-item.active svg { color: var(--brand-fg); }
.nav-item-hq { color: var(--brand-fg); }
.nav-item-hq svg { color: var(--brand-fg); }
.nav-divider { height: 1px; background: var(--border); margin: 8px 0; }

.sidebar-toggle-btn { color: var(--text-muted); }
.sidebar-toggle-btn .chevron-icon { transition: transform 0.2s ease; }

/* Collapsed (desktop) */
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-header { padding: 0; justify-content: center; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .workspace-meta { display: none; }
.sidebar.collapsed .workspace { justify-content: center; margin: 12px 10px 4px; padding: 6px; }
.sidebar.collapsed .sidebar-body { padding: 8px 10px 12px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .chevron-icon { transform: rotate(180deg); }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

.main-content {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.2s ease;
}

/* Topbar */
.header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--topbar-height);
    padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--text-muted); }
.breadcrumbs .sep { color: var(--text-subtle); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); text-decoration: none; }
.page-title { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.user-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 10px 4px 4px; border-radius: var(--radius-md);
    border: 1px solid transparent; cursor: default;
}
.user-info { line-height: 1.25; min-width: 0; }
.user-info h4 { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.user-info span { display: block; font-size: 12px; color: var(--text-muted); text-transform: capitalize; }

.mobile-menu-btn { display: none; }

.dashboard-container {
    flex: 1;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 28px 32px 56px;
    min-width: 0;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-header p { margin-top: 4px; color: var(--text-muted); font-size: 14px; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 32px 0 16px; }
.section-head h3 { font-size: 16px; font-weight: 600; }
.section-head p { margin-top: 4px; font-size: 13.5px; color: var(--text-muted); }

.mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(16, 24, 40, 0.45);
}
.mobile-backdrop.show { display: block; animation: fadeIn 0.15s ease-out; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 20px; }

/* 7. Page patterns --------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.stat-icon {
    width: 28px; height: 28px; border-radius: var(--radius);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 12.5px; color: var(--text-muted); }

.action-list { display: flex; flex-direction: column; }
.action-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 20px; border: 0; border-bottom: 1px solid var(--border);
    background: transparent; color: var(--text); text-align: left; font-size: 13.5px; text-decoration: none; cursor: pointer;
    transition: background-color 0.12s ease;
}
.action-item:last-child { border-bottom: 0; }
.action-item:hover { background: var(--surface-2); text-decoration: none; }
.action-item .action-icon {
    width: 32px; height: 32px; border-radius: var(--radius-md); flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--brand-soft); color: var(--brand-fg);
}
.action-item .action-icon svg { width: 16px; height: 16px; }
.action-item .action-title { font-weight: 500; }
.action-item .action-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.action-item .action-chevron { margin-left: auto; color: var(--text-subtle); width: 16px; height: 16px; }

/* Subscription */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; }
.summary-item { padding: 4px 20px 4px 0; }
.summary-item .label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-bottom: 6px; }
.summary-item .value { font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-transform: capitalize; }
.card > #current-plan > .summary-grid { margin: 0 -1px -1px 0; }
.summary-grid .summary-item { padding: 16px 20px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; background: var(--brand-600); transition: width 0.4s ease; }
.meter-fill.over { background: var(--danger-600); }

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.plan-card {
    position: relative;
    display: flex; flex-direction: column; gap: 14px;
    padding: 20px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
}
.plan-card.current, .plan-card.featured { border-color: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600), var(--shadow-sm); }
.plan-flag {
    position: absolute; top: 18px; right: 18px;
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 999px; background: var(--brand-soft); color: var(--brand-fg);
    font-size: 12px; font-weight: 500;
}
.plan-name { font-size: 15px; font-weight: 600; color: var(--text); }
.plan-price { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 13px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; }
.plan-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; min-height: 39px; }
.plan-features { list-style: none; display: flex; flex-direction: column; gap: 9px; flex: 1; font-size: 13px; color: var(--text-2); padding-top: 14px; border-top: 1px solid var(--border); }
.plan-features li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.45; }
.plan-features li.off { color: var(--text-subtle); }
.plan-features li.lead { color: var(--text-muted); font-weight: 500; }
.plan-features svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.plan-features .yes { color: var(--brand-fg); }
.plan-features .no { color: var(--text-subtle); }
.plan-features strong { font-weight: 600; color: var(--text); }
.plan-card .btn { width: 100%; }
.plan-note { font-size: 12.5px; color: var(--text-muted); }

/* Permission groups (roles + staff overrides) */
.perm-groups { display: flex; flex-direction: column; gap: 8px; }
.perm-group { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.perm-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.perm-group-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.perm-group-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.perm-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.perm-actions .check span { text-transform: capitalize; }
.perm-all span { font-weight: 600; color: var(--text); }
.perm-scroll { max-height: 380px; overflow-y: auto; padding-right: 4px; margin-right: -4px; }

/* Invite list */
.invite-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.invite-row-email { font-size: 13.5px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bulk-bar {
    align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 8px 8px 12px; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2);
    font-size: 13px; color: var(--text-2);
}

/* Roster */
.check-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius);
    cursor: pointer; transition: background-color 0.12s ease;
}
.check-row:hover { background: var(--surface-2); }
.check-row-title { font-weight: 500; color: var(--text); font-size: 13.5px; }
.check-row-meta { font-size: 12px; color: var(--text-muted); }
.check-box-list { max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }

.shift-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
}
.shift-item + .shift-item { margin-top: 8px; }
.shift-item .shift-swatch { width: 4px; height: 32px; border-radius: 2px; flex-shrink: 0; }
.shift-item .shift-name { font-weight: 500; color: var(--text); }
.shift-item .shift-hours { font-size: 12.5px; color: var(--text-muted); font-family: var(--font-mono); }
.shift-item .shift-actions { margin-left: auto; display: flex; gap: 2px; }

.day-entry {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
    border-left-width: 3px;
}
.day-entry + .day-entry { margin-top: 8px; }
.day-entry-title { font-weight: 500; color: var(--text); }
.day-entry-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.day-entry-note { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.day-head h3 { font-size: 15px; font-weight: 600; }
.time-pill { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: var(--radius); background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

/* Weekly board */
.week-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.week-range { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.btn-group { display: inline-flex; }
.btn-group .page-btn { border-radius: 0; margin-left: -1px; box-shadow: none; }
.btn-group .page-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); margin-left: 0; }
.btn-group .page-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.week-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 900px; }
.week-table th, .week-table td { padding: 10px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); }
.week-table th:last-child, .week-table td:last-child { border-right: 0; }
.week-table tbody tr:last-child td { border-bottom: 0; }
.week-table th { background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.35; }
.week-table th .day-num { display: block; color: var(--text); font-size: 13px; font-weight: 600; }
.week-table th.today-col .day-num { color: var(--brand-fg); }
.week-table th.today-col, .week-table td.today-col { background: var(--brand-soft); }
.week-table td.staff-cell { text-align: left; min-width: 180px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.week-table th:first-child { text-align: left; position: sticky; left: 0; z-index: 2; }
.week-table td.empty-cell { color: var(--text-subtle); }
.shift-pill { display: inline-block; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.shift-time { display: block; margin-top: 4px; font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.off-pill { display: inline-block; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: var(--danger-bg); color: var(--danger-700); }

/* 8. Auth layout ----------------------------------------------------------- */
body.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--surface);
    font-size: 14px;
}
.auth-main { display: flex; flex-direction: column; min-height: 100vh; padding: 24px 40px; }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.auth-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 0; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; }
.auth-sub { margin: 8px 0 28px; font-size: 14.5px; color: var(--text-muted); }
.auth-form .btn-primary.btn-block { margin-top: 8px; height: 40px; }
.auth-footer { margin-top: 24px; font-size: 13.5px; color: var(--text-muted); }
.auth-footer a { font-weight: 500; }
.auth-legal { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-subtle); }
.auth-legal a { color: var(--text-subtle); }
.workspace-pill {
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 100%; height: 30px; padding: 0 12px 0 4px; margin-bottom: 20px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
    font-size: 13px; color: var(--text-2);
}
.workspace-pill .workspace-avatar { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; }
.workspace-pill strong { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth-aside {
    position: relative;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 40px 48px;
    background: #0B1A18;
    color: #E6EEEC;
    overflow: hidden;
    border-left: 1px solid var(--border);
}
.auth-aside::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 85%);
    pointer-events: none;
}
.auth-aside > * { position: relative; }
.auth-aside h2 { color: #fff; font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; max-width: 420px; }
.auth-aside p { color: #9FB3AF; font-size: 14.5px; margin-top: 12px; max-width: 420px; }
.auth-aside-points { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 28px; font-size: 14px; color: #C9D6D3; }
.auth-aside-points li { display: flex; align-items: center; gap: 10px; }
.auth-aside-points svg { width: 16px; height: 16px; color: #4CCBB4; flex-shrink: 0; }
.auth-aside-foot { font-size: 12.5px; color: #6F8783; }

/* Preview card used on auth aside + landing hero */
.preview {
    background: #fff;
    color: #101828;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 12px;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-size: 12px;
}
.preview-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #EAECF0; }
.preview-bar-title { font-weight: 600; font-size: 12.5px; }
.preview-bar-meta { color: #667085; font-size: 11.5px; font-family: var(--font-mono); }
.preview-dots { display: flex; gap: 6px; }
.preview-dots i { width: 10px; height: 10px; border-radius: 50%; background: #EAECF0; display: block; }
.preview-grid { display: grid; grid-template-columns: 120px repeat(5, minmax(0, 1fr)); }
.preview-grid > div { padding: 8px; border-bottom: 1px solid #F2F4F7; border-right: 1px solid #F2F4F7; display: flex; align-items: center; min-height: 38px; }
.preview-grid > div:nth-child(6n) { border-right: 0; }
.preview-grid .ph { background: #F9FAFB; color: #667085; font-weight: 500; font-size: 11px; justify-content: center; min-height: 30px; }
.preview-grid .ph:first-child { justify-content: flex-start; }
.preview-grid .ph.today { color: #0B6E61; background: #EEF7F5; }
.preview-grid .pn { gap: 8px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.preview-grid .pn i { width: 20px; height: 20px; border-radius: 50%; background: #F2F4F7; color: #475467; font-style: normal; font-size: 9.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.preview-grid .pc { justify-content: center; }
.preview-grid .pc.today { background: #F6FBFA; }
.sp { display: inline-block; padding: 3px 7px; border-radius: 4px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.sp-am { background: #E0F2EF; color: #0B6559; }
.sp-pm { background: #EEF4FF; color: #3538CD; }
.sp-nt { background: #F4F3FF; color: #5925DC; }
.sp-off { background: #FEF3F2; color: #B42318; }
.sp-oc { background: #FFFAEB; color: #B54708; }

/* 9. Marketing ------------------------------------------------------------- */
body.marketing { background: var(--surface); font-size: 16px; overflow-x: hidden; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.site-header .brand { font-size: 16px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; }
.site-nav a.nav-link { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: var(--radius); color: var(--text-2); font-size: 14.5px; font-weight: 500; }
.site-nav a.nav-link:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.site-nav .nav-ctas { display: flex; align-items: center; gap: 8px; margin-left: 12px; }
.site-header-right { display: flex; align-items: center; gap: 8px; }
.mobile-menu-toggle { display: none; }
.mobile-menu-backdrop { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45); z-index: 98; }
.mobile-menu-backdrop.active { display: block; }

.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: inline-block; }

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    height: 28px; padding: 0 12px 0 6px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
    font-size: 13px; font-weight: 500; color: var(--text-2);
    box-shadow: var(--shadow-xs);
}
.eyebrow .eyebrow-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-fg); font-size: 11.5px; font-weight: 600; }
.section-kicker { font-size: 13px; font-weight: 600; color: var(--brand-fg); margin-bottom: 12px; font-family: var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; }

.hero { padding: 80px 0 72px; border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, var(--surface-2), var(--surface) 70%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.hero h1 { margin-top: 20px; font-size: 52px; font-weight: 600; line-height: 1.06; letter-spacing: -0.035em; color: var(--text); }
.hero h1 .muted-line { color: var(--text-muted); }
.hero-lead { margin-top: 20px; font-size: 18px; line-height: 1.6; color: var(--text-muted); max-width: 520px; }
.hero-ctas { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-note { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 24px; font-size: 13.5px; color: var(--text-muted); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 15px; height: 15px; color: var(--brand-fg); }
.hero-visual { position: relative; margin-bottom: 40px; }
.hero-visual .preview { box-shadow: var(--shadow-xl); border-color: var(--border); }
.hero-float {
    position: absolute; right: -20px; bottom: -64px; width: 240px;
    background: #fff; color: #101828; border: 1px solid #EAECF0; border-radius: 10px; box-shadow: var(--shadow-lg);
    padding: 12px 14px; font-size: 12px;
}
.hero-float-title { font-weight: 600; font-size: 12.5px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.hero-float-title span { color: #667085; font-weight: 500; font-family: var(--font-mono); font-size: 11.5px; }
.cov-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: #475467; }
.cov-row b { width: 64px; font-weight: 500; color: #344054; }
.cov-bar { flex: 1; height: 6px; border-radius: 99px; background: #F2F4F7; overflow: hidden; }
.cov-bar i { display: block; height: 100%; background: #0E7C6D; border-radius: 99px; }
.cov-bar i.warn { background: #DC6803; }
.cov-row em { font-style: normal; font-family: var(--font-mono); font-size: 11px; width: 34px; text-align: right; }

.strip { border-bottom: 1px solid var(--border); }
.strip-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.strip-item { padding: 28px 24px; border-right: 1px solid var(--border); }
.strip-item:last-child { border-right: 0; }
.strip-item b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.strip-item span { display: block; font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.m-section { padding: 96px 0; border-bottom: 1px solid var(--border); }
.m-section-head { max-width: 640px; margin-bottom: 48px; }
.m-section-head h2 { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.m-section-head p { margin-top: 14px; font-size: 17px; color: var(--text-muted); line-height: 1.6; }
.m-section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.feature-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border); border-radius: var(--radius-xl); overflow: hidden; background: var(--surface);
}
.feature { padding: 28px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.feature:nth-child(3n) { border-right: 0; }
.feature:nth-last-child(-n+3) { border-bottom: 0; }
.feature-icon {
    width: 36px; height: 36px; border-radius: var(--radius-md);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--brand-fg);
    margin-bottom: 18px;
}
.feature-icon svg { width: 18px; height: 18px; }
.feature h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.feature p { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; counter-reset: step; }
.step { padding-top: 20px; border-top: 1px solid var(--border-strong); }
.step-index { font-family: var(--font-mono); font-size: 13px; color: var(--brand-fg); font-weight: 500; }
.step h3 { font-size: 17px; font-weight: 600; margin: 10px 0 6px; }
.step p { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.check-list-lg { list-style: none; display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.check-list-lg li { display: flex; gap: 12px; font-size: 15px; color: var(--text-2); line-height: 1.55; }
.check-list-lg li b { color: var(--text); font-weight: 600; }
.check-list-lg svg { width: 18px; height: 18px; color: var(--brand-fg); flex-shrink: 0; margin-top: 2px; }
.arch {
    border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface-2); padding: 28px;
    font-size: 13px;
}
.arch-node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; box-shadow: var(--shadow-xs); }
.arch-node b { display: block; font-size: 13.5px; color: var(--text); }
.arch-node span { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.arch-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.arch-link { height: 28px; margin: 0 auto; width: 1px; background: var(--border-strong); }
.arch-db { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.arch-db svg { width: 14px; height: 14px; color: var(--brand-fg); }

.pricing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.pricing-head .m-section-head { margin-bottom: 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pricing-grid .plan-card { padding: 24px; }
.pricing-grid .plan-price { font-size: 32px; }
.pricing-foot { margin-top: 20px; font-size: 13.5px; color: var(--text-muted); }

.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; }
.faq-list { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 0; cursor: pointer; list-style: none;
    font-size: 16px; font-weight: 500; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { width: 18px; height: 18px; color: var(--text-muted); transition: transform 0.2s ease; flex-shrink: 0; }
.faq-item[open] summary svg { transform: rotate(45deg); }
.faq-item p { padding: 0 32px 20px 0; font-size: 15px; color: var(--text-muted); line-height: 1.65; }

.cta-band { padding: 96px 0; }
.cta-box {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
    padding: 48px; border-radius: 16px; background: #0B1A18; color: #E6EEEC;
}
.cta-box::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: linear-gradient(to left, rgba(0,0,0,0.9), transparent 70%);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.9), transparent 70%);
}
.cta-box > * { position: relative; }
.cta-box h2 { color: #fff; font-size: 30px; font-weight: 600; letter-spacing: -0.025em; }
.cta-box p { margin-top: 10px; color: #9FB3AF; font-size: 16px; max-width: 520px; }
.cta-box .btn-light { background: #fff; color: #0B1A18; }
.cta-box .btn-light:hover { background: #E6EEEC; }
.cta-box .btn-ghost-light { color: #E6EEEC; border-color: rgba(255,255,255,0.18); background: transparent; }
.cta-box .btn-ghost-light:hover { background: rgba(255,255,255,0.06); }

.site-footer { padding: 56px 0 32px; border-top: 1px solid var(--border); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.footer-grid p { margin-top: 12px; font-size: 14px; color: var(--text-muted); max-width: 300px; line-height: 1.6; }
.footer-col h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 14px; color: var(--text-muted); }
.footer-col a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-subtle); }

/* Error page */
body.error-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.error-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.error-card { max-width: 440px; text-align: left; }
.error-code { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--brand-fg); }
.error-card h1 { margin-top: 12px; font-size: 30px; letter-spacing: -0.025em; }
.error-card p { margin-top: 10px; font-size: 15px; color: var(--text-muted); line-height: 1.6; }
.error-card .row { margin-top: 28px; }

/* 10. Third-party widget overrides ---------------------------------------- */
/* CustomModal.js */
body .custom-modal-overlay { background: rgba(16, 24, 40, 0.45); backdrop-filter: none; -webkit-backdrop-filter: none; }
body .custom-modal-container {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    transform: translateY(8px); transition: transform 0.18s ease-out;
}
body .custom-modal-overlay.cm-show .custom-modal-container { transform: translateY(0); }
body .custom-modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
body .custom-modal-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
body .custom-modal-close { width: 32px; height: 32px; border-radius: var(--radius); font-size: 20px; color: var(--text-muted); }
body .custom-modal-close:hover { background: var(--surface-3); color: var(--text); }
body .custom-modal-body { padding: 20px; }
body .custom-modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }
.modal-intro { font-size: 13.5px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.55; }
.modal-intro strong { color: var(--text); font-weight: 600; }

/* ConfirmModal.js */
body .sv-confirm-overlay { background: rgba(16, 24, 40, 0.45); backdrop-filter: none; -webkit-backdrop-filter: none; }
body .sv-confirm-modal {
    max-width: 420px; padding: 24px; text-align: left;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl);
    transform: translateY(8px); transition: transform 0.18s ease-out;
}
body .sv-confirm-overlay.active .sv-confirm-modal { transform: translateY(0); }
body .sv-confirm-icon { width: 40px; height: 40px; border-radius: 50%; margin: 0 0 16px; }
body .sv-confirm-icon i { display: none; }
body .sv-confirm-icon::before {
    content: ""; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .sv-confirm-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: -0.01em; }
body .sv-confirm-message { font-size: 14px; font-weight: 400; color: var(--text-muted); margin-bottom: 24px; line-height: 1.55; }
body .sv-confirm-actions { justify-content: flex-end; gap: 8px; }
body .sv-confirm-btn {
    flex: none; height: 36px; padding: 0 14px; border-radius: var(--radius-md);
    font-size: 13.5px; font-weight: 500; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-xs);
}
body .sv-confirm-btn-cancel { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); }
body .sv-confirm-btn-cancel:hover { background: var(--surface-2); color: var(--text); }
body .sv-confirm-danger .sv-confirm-icon { background: var(--danger-bg); color: var(--danger-600); }
body .sv-confirm-danger .sv-confirm-btn-confirm { background: var(--danger-600); box-shadow: var(--shadow-xs); }
body .sv-confirm-warning .sv-confirm-icon { background: var(--warning-bg); color: var(--warning-600); }
body .sv-confirm-warning .sv-confirm-btn-confirm { box-shadow: var(--shadow-xs); }
body .sv-confirm-info .sv-confirm-icon { background: var(--brand-soft); color: var(--brand-fg); }
body .sv-confirm-info .sv-confirm-btn-confirm { background: var(--brand-600); box-shadow: var(--shadow-xs); }
body .sv-confirm-success .sv-confirm-icon { background: var(--success-bg); color: var(--success-600); }

/* toast.js */
body .toast {
    font-family: var(--font-sans);
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 12px 14px; gap: 10px; min-width: 300px;
}
body .toast.toast-success, body .toast.toast-error, body .toast.toast-warning, body .toast.toast-info { border-left: 1px solid var(--border); }
body .toast-title { font-weight: 600; font-size: 13.5px; }
body .toast-message { color: var(--text-muted); font-weight: 400; font-size: 13px; }
body .toast-progress { height: 2px; }

/* CalendarUI.js */
body .cui-header-bar { margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
body .cui-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
body .cui-nav { gap: 6px; }
body .cui-btn {
    height: 32px; padding: 0 12px; border-radius: var(--radius);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
    font-size: 13px; font-weight: 500; box-shadow: var(--shadow-xs);
}
body .cui-btn:hover { background: var(--surface-2); color: var(--text); }
body .cui-grid-wrapper { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
body .cui-days-header { background: var(--border); }
body .cui-day-name { background: var(--surface-2); padding: 8px; font-size: 11.5px; font-weight: 500; letter-spacing: 0.04em; color: var(--text-muted); }
body .cui-grid { background: var(--border); }
body .cui-cell { min-height: 112px; padding: 6px 6px 8px; background: var(--surface); transition: background-color 0.12s ease; }
body .cui-cell.empty { background: var(--surface-2); }
body .cui-cell:not(.empty):hover { filter: none; background: var(--surface-2); }
body .cui-date-num {
    align-self: flex-end;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 4px; margin-bottom: 4px;
    border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
body .cui-cell.has-events .cui-date-num { color: var(--text); }
body .cui-cell.is-today .cui-date-num {
    background: var(--brand-600); color: #fff;
    -webkit-background-clip: border-box; background-clip: border-box; -webkit-text-fill-color: #fff;
}
body .cui-events { gap: 2px; }
body .cui-event-badge { font-size: 11.5px; font-weight: 500; padding: 2px 6px; border-radius: var(--radius-sm); color: var(--text-2) !important; border-left-width: 3px !important; }
body .cui-nav .btn { margin-left: 6px; }

/* Responsive --------------------------------------------------------------- */
@media (max-width: 1100px) {
    .content-grid { grid-template-columns: minmax(0, 1fr); }
    .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
    .hero-float { right: 16px; }
}

@media (max-width: 960px) {
    body.auth-page { grid-template-columns: minmax(0, 1fr); }
    .auth-aside { display: none; }
    .auth-main { padding: 20px 24px; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .feature:nth-child(3n) { border-right: 1px solid var(--border); }
    .feature:nth-child(2n) { border-right: 0; }
    .feature:nth-last-child(-n+3) { border-bottom: 1px solid var(--border); }
    .feature:nth-last-child(-n+2) { border-bottom: 0; }
    .split, .faq-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .strip-inner { grid-template-columns: repeat(2, 1fr); }
    .strip-item:nth-child(2) { border-right: 0; }
    .strip-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); box-shadow: var(--shadow-xl); }
    .sidebar.show { transform: translateX(0); }
    .sidebar.collapsed { width: var(--sidebar-width); }
    .sidebar.collapsed .brand-text, .sidebar.collapsed .nav-text, .sidebar.collapsed .workspace-meta { display: revert; }
    .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 0 10px; }
    .sidebar-toggle-btn { display: none !important; }
    .main-content, .sidebar.collapsed ~ .main-content { margin-left: 0; }
    .mobile-menu-btn { display: inline-flex; }
    .header { padding: 0 16px; }
    .dashboard-container { padding: 20px 16px 40px; }
    .user-info { display: none; }
    .user-profile { padding: 2px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .page-header { align-items: flex-start; }
}

@media (max-width: 768px) {
    body.marketing { font-size: 15px; }
    .mobile-menu-toggle { display: inline-flex; }
    .site-nav {
        position: fixed; top: 0; right: 0; bottom: 0; z-index: 99;
        width: 300px; max-width: 86vw;
        flex-direction: column; align-items: stretch; gap: 0;
        padding: 72px 16px 24px;
        background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-xl);
        transform: translateX(100%); transition: transform 0.2s ease;
    }
    .site-nav.active { transform: translateX(0); }
    .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
    .site-nav a.nav-link { height: 42px; font-size: 15px; }
    .site-nav .nav-ctas { flex-direction: column; align-items: stretch; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
    .site-header-right .header-signin { display: none; }
    .hero { padding: 56px 0 64px; }
    .hero h1 { font-size: 38px; }
    .hero-lead { font-size: 16.5px; }
    .hero-float { display: none; }
    .preview-grid { grid-template-columns: 96px repeat(5, minmax(0, 1fr)); }
    .m-section, .cta-band { padding: 64px 0; }
    .m-section-head h2 { font-size: 28px; }
    .feature-grid, .steps, .pricing-grid { grid-template-columns: minmax(0, 1fr); }
    .feature { border-right: 0 !important; border-bottom: 1px solid var(--border) !important; }
    .feature:last-child { border-bottom: 0 !important; }
    .cta-box { padding: 32px 24px; }
    .cta-box h2 { font-size: 24px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid > :first-child { grid-column: 1 / -1; }
    body .cui-cell { min-height: 72px; padding: 4px; }
    body .cui-date-num { min-width: 20px; height: 20px; font-size: 11px; }
    body .cui-event-badge { font-size: 10px; padding: 1px 3px; }
    body .cui-nav .btn { margin-left: 0; }
}

@media (max-width: 480px) {
    .strip-inner { grid-template-columns: 1fr; }
    .strip-item { border-right: 0 !important; border-bottom: 1px solid var(--border); }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
}

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