/* ==========================================================================
   Modern Simple Dashboard — LIGHT theme, SSI red accent
   - Font: Inter
   - Radius: 8px standard, 6px small
   - No borders, use bg layering for elevation
   - Compact density (16-20px padding)
   - Buttons: rounded rectangle (no pills)
   ========================================================================== */

:root {
    /* Light layered backgrounds — neutral on-brand (red/black/white) */
    --bg-0: #f7f7f8;          /* outer page bg (cool off-white) */
    --bg-1: #ffffff;          /* card */
    --bg-2: #f4f4f5;          /* card hover / input */
    --bg-3: #ebebed;          /* sub-row / divider */

    --text: #1a1a1a;
    --text-2: #404040;
    --muted: #737373;
    --text-dim: #a3a3a3;

    --border-subtle: rgba(0, 0, 0, 0.04);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);

    --primary: #ef1b4b;
    --primary-hover: #d31340;
    --primary-soft: rgba(239, 27, 75, 0.10);
    --primary-soft-2: rgba(239, 27, 75, 0.05);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.10);
    --warning: #f59e0b;
    /* Danger uses SSI primary red — single brand red across UI */
    --danger: var(--primary);
    --danger-hover: var(--primary-hover);
    --danger-soft: var(--primary-soft);

    /* Geometry */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 999px;

    /* Sidebar */
    --sidebar-w: 240px;
    --sidebar-w-collapsed: 64px;
    --topbar-h: 56px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Override style.css base — apply Inter font + light bg globally */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
    background: var(--bg-0) !important;
    color: var(--text) !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }

/* Override pill buttons from style.css */
.btn {
    border-radius: var(--radius);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    border: 1px solid transparent;
}
.btn:hover { transform: none; box-shadow: none; }
.btn:active { transform: none; }
.btn-pill { border-radius: var(--radius); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
    background: var(--bg-1);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-2); border-color: var(--border-strong); }

.btn-dark { background: var(--text); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-google {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}
.btn-google:hover { background: var(--bg-2); border-color: var(--border-strong); }

/* ===== Auth shell ===== */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background: var(--bg-0);
}
.auth-card {
    width: 100%;
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--bg-1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.auth-card.compact { max-width: 440px; grid-template-columns: 1fr; padding: 32px; }
@media (max-width: 820px) {
    .auth-card { grid-template-columns: 1fr; }
    .auth-hero { border-bottom: 1px solid var(--border); }
}
.auth-hero {
    padding: 40px;
    background: #0a0a0a;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
    min-height: 460px;
}
.auth-hero-logo img { height: 28px; }
.auth-hero h1 {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
    font-weight: 700;
    color: #fff;
}
.auth-hero h1 .accent { color: var(--primary); }
.auth-hero p {
    color: #a3a3a3;
    margin: 12px 0 0;
    max-width: 40ch;
    font-size: 14px;
    line-height: 1.5;
}
.auth-hero .auth-badge {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border-color: rgba(255,255,255,0.16);
}
.auth-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.auth-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
}
.auth-form { padding: 40px; display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.auth-form h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.auth-form .sub { color: var(--muted); margin: -6px 0 6px; font-size: 13px; }

/* ===== Sidebar ===== */
html.sidebar-collapsed { --sidebar-w: var(--sidebar-w-collapsed); }
body.app-shell { padding-left: var(--sidebar-w); transition: padding-left .2s ease; }
@media (max-width: 900px) { body.app-shell { padding-left: 0; } }

.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg-1);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: width .2s ease, transform .25s ease;
    overflow: hidden;
}
.app-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    min-height: var(--topbar-h);
    flex-shrink: 0;
    background: #0a0a0a;
    color: #fff;
}
.app-sidebar-head .sidebar-toggle { color: #d4d4d4; }
.app-sidebar-head .sidebar-toggle:hover { background: rgba(255,255,255,0.08); color: #fff; }
.app-sidebar-brand { display: inline-flex; align-items: center; gap: 10px; overflow: hidden; }
.app-sidebar-brand img { height: 22px; flex-shrink: 0; }
.app-sidebar-brand img.brand-expanded { display: block; }
.app-sidebar-brand img.brand-collapsed { display: none; height: 26px; }
html.sidebar-collapsed .app-sidebar-brand img.brand-expanded { display: none; }
html.sidebar-collapsed .app-sidebar-brand img.brand-collapsed { display: block; }
html.sidebar-collapsed .app-sidebar-head { justify-content: center; padding: 14px 8px; }
html.sidebar-collapsed .sidebar-toggle { display: none; }
html.sidebar-collapsed .app-sidebar-brand { gap: 0; }

.app-sidebar-brand .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}
html.sidebar-collapsed .app-sidebar-brand .label { display: none; }

.sidebar-toggle {
    width: 28px; height: 28px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.sidebar-toggle:hover { background: var(--bg-2); color: var(--text); }
.sidebar-toggle svg { transition: transform .2s ease; }
html.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.app-sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sidebar-section {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    padding: 14px 12px 6px;
    white-space: nowrap;
}
html.sidebar-collapsed .sidebar-section { display: none; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background .12s, color .12s;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-link:hover { background: var(--bg-2); color: var(--text); }
.sidebar-link.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-link.active:hover { background: var(--primary-hover); color: #fff; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
html.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 8px 0;
    position: relative;
}
html.sidebar-collapsed .sidebar-link .label { display: none; }
html.sidebar-collapsed .sidebar-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: calc(100% + 8px);
    background: var(--text);
    color: #fff;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    z-index: 70;
}

.app-sidebar-foot {
    padding: 12px;
    flex-shrink: 0;
    border-top: 1px solid var(--border-subtle);
}

/* ===== Topbar ===== */
.app-topbar {
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
}
.app-topbar-actions { display: flex; align-items: center; gap: 12px; }
.app-topbar-actions .user-email { color: var(--muted); font-size: 13px; }
.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.topbar-logout:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== Mobile drawer ===== */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 55;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility 0s .25s;
}
@media (max-width: 900px) {
    .app-sidebar { transform: translateX(-100%); width: 260px !important; }
    html.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
    html.sidebar-mobile-open .sidebar-backdrop { opacity: 1; visibility: visible; transition: opacity .25s; }
    html.sidebar-collapsed .app-sidebar { width: 260px !important; }
    html.sidebar-collapsed .sidebar-link { justify-content: flex-start; padding: 8px 12px; }
    html.sidebar-collapsed .sidebar-link .label { display: inline; }
    html.sidebar-collapsed .sidebar-section { display: block; }
    html.sidebar-collapsed .app-sidebar-brand .label { display: inline; }
}
.mobile-menu-btn {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
@media (max-width: 900px) { .mobile-menu-btn { display: inline-flex; } }

/* ===== Cards ===== */
.card {
    background: var(--bg-1);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.card-accent {
    background: var(--bg-1);
    border-left: 3px solid var(--primary);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.card-subtitle { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; color: var(--text); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ===== Form fields ===== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: none;
    letter-spacing: 0;
}
.field-label .req { color: var(--primary); margin-left: 2px; }
.input, .textarea, .select {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-1);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
    border-color: var(--primary);
}
.input.with-icon { padding-left: 40px; }
.input-wrap { position: relative; }
.input-wrap .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}
.textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.checkbox-label, .radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}
.checkbox-label input, .radio-label input { accent-color: var(--primary); }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.table th, .table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}
.table thead th {
    background: var(--bg-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-2); }

/* ===== Status / alerts ===== */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    background: var(--bg-3);
}
.badge-success { color: var(--success); background: var(--success-soft); }
.badge-muted { color: var(--muted); background: var(--bg-3); }
.badge-primary { color: var(--primary); background: var(--primary-soft); }

/* ===== Signature pad ===== */
.signature-pad {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}
.signature-pad canvas {
    display: block;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
    background: repeating-linear-gradient(-45deg, #fafafa, #fafafa 8px, #fff 8px, #fff 16px);
}
.signature-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-2);
}
.signature-hint { color: var(--muted); font-size: 12px; }
.signature-clear {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.signature-clear:hover { color: var(--danger); border-color: var(--danger); }

/* ===== Wizard preview tabs (card / browser-style tabs) ===== */
.preview-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    padding: 0 0 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    position: relative;
    z-index: 1;
    scrollbar-width: none;
}
.preview-tabs::-webkit-scrollbar { display: none; }
.preview-tab {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-bottom: 0;
    padding: 10px 20px 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: background .15s ease, color .15s ease;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    margin-bottom: -1px;
}
.preview-tab:hover {
    background: var(--bg-3);
    color: var(--text);
}
.preview-tab.active {
    background: var(--bg-1);
    color: var(--primary);
    border-color: var(--border);
    border-top: 3px solid var(--primary);
    padding-top: 8px;
    z-index: 2;
}
.preview-tab.active:hover { background: var(--bg-1); color: var(--primary); }
.preview-panel.active {
    display: block;
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.preview-panel { display: none; }

/* =========================================================
   Google Places Autocomplete (place field)
   ========================================================= */
.place-picker { display: flex; flex-direction: column; gap: 10px; }
.place-mount { display: block; }
gmp-place-autocomplete,
.ssi-place-autocomplete {
    /* Force light theme (element auto-detects prefers-color-scheme by default) */
    color-scheme: light only;

    /* Modern core Maps Web Components variables */
    --gmp-color-surface: #ffffff;
    --gmp-color-on-surface: #1a1a1a;
    --gmp-color-on-surface-variant: #737373;
    --gmp-color-primary: #ef1b4b;
    --gmp-color-on-primary: #ffffff;
    --gmp-color-outline: rgba(0, 0, 0, 0.10);
    --gmp-color-outline-variant: rgba(0, 0, 0, 0.06);
    --gmp-color-surface-container-low: #ffffff;
    --gmp-color-surface-container: #f7f7f8;
    --gmp-color-surface-container-high: #f4f4f5;
    --gmp-color-secondary-container: #fce4eb;
    --gmp-color-on-secondary-container: #ef1b4b;
    --gmp-color-error: #d31340;
    --gmp-font-family-base: 'Inter', system-ui, sans-serif;
    --gmp-font-family-headings: 'Inter', system-ui, sans-serif;
    --gmp-font-size-base: 14px;

    /* Older Extended Components naming (defensive fallback) */
    --gmpx-color-surface: #ffffff;
    --gmpx-color-on-surface: #1a1a1a;
    --gmpx-color-on-surface-variant: #737373;
    --gmpx-color-primary: #ef1b4b;
    --gmpx-color-on-primary: #ffffff;
    --gmpx-color-outline: rgba(0, 0, 0, 0.10);
    --gmpx-font-family-base: 'Inter', system-ui, sans-serif;
    --gmpx-font-family-headings: 'Inter', system-ui, sans-serif;
    --gmpx-font-size-base: 14px;

    /* Host-level styling */
    display: block;
    width: 100%;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
gmp-place-autocomplete:focus-within,
.ssi-place-autocomplete:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.place-preview {
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.place-preview-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.place-preview-addr {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}
/* Google's Autocomplete dropdown styling */
.pac-container {
    font-family: 'Inter', system-ui, sans-serif;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    margin-top: 4px;
    z-index: 9999;
}
.pac-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-top: 1px solid var(--border-subtle);
}
.pac-item:first-child { border-top: 0; }
.pac-item:hover, .pac-item-selected { background: var(--bg-2); }
.pac-item-query { font-weight: 600; color: var(--text); }
.pac-matched { color: var(--primary); }

/* Hide native number input spinners (up/down arrows) */
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.preview-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.preview-panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.preview-edit {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}
.preview-edit:hover { text-decoration: underline; }

/* ===== Inline edit ===== */
.ie-row {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .12s;
    margin-bottom: 4px;
}
.ie-row:hover { background: var(--bg-2); }
.ie-row.editing { background: var(--bg-2); border-color: var(--border); cursor: auto; }
.ie-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 3px;
}
.ie-display { font-size: 13px; font-weight: 500; word-break: break-word; color: var(--text); }
.ie-status {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    height: 14px;
}
.ie-status.ok { color: var(--success); }
.ie-status.err { color: var(--danger); }

/* ===== Layout helpers ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.dash-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.dash-sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); }
@media (max-width: 900px) {
    .dash-layout { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; }
    .grid-2 { grid-template-columns: 1fr; }
}

/* ===== Section divider (form builder) ===== */
.section-divider {
    margin: 16px 0 8px;
    padding: 8px 12px;
    background: var(--primary-soft);
    border-left: 2px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Repeater ===== */
.repeater-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-2);
}
.repeater-add {
    background: transparent;
    border: 1px dashed var(--border-strong);
    color: var(--text-2);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.repeater-add:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.repeater-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: var(--radius-sm);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.repeater-remove:hover { color: var(--danger); border-color: var(--danger); }

/* ===== Page header ===== */
.page-header { margin-bottom: 20px; }
.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}
.page-header p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }

/* ===== Errors list ===== */
.errors-list { list-style: none; margin: 0; padding: 0; }
.errors-list li { font-size: 13px; }
.errors-list li::before { content: '• '; color: var(--danger); }

/* ===== Stepper ===== */
.stepper {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 24px;
    background: var(--bg-1);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    overflow-x: auto;
}
.stepper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 90px;
    padding: 8px 6px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}
.stepper-item.is-clickable {
    cursor: pointer;
}
.stepper-item.is-clickable:hover {
    background: var(--bg-2);
}
.stepper-item.is-locked {
    cursor: not-allowed;
    opacity: 0.55;
}
.stepper-bullet {
    width: 28px; height: 28px;
    border-radius: 999px;
    background: var(--bg-3);
    border: 2px solid var(--bg-3);
    flex-shrink: 0;
    text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.stepper-item.is-clickable:hover .stepper-bullet {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}
.stepper-lock { color: var(--muted); }
.stepper-item.completed .stepper-bullet {
    background: var(--success);
    border-color: var(--success);
    position: relative;
}
.stepper-item.completed .stepper-bullet::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
}
.stepper-item.active .stepper-bullet {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
    position: relative;
}
.stepper-item.active .stepper-bullet::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 8px; height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 999px;
    background: var(--primary);
}
.stepper-info {
    text-align: center;
    margin-top: 10px;
}
.stepper-num {
    font-size: 10px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.stepper-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-top: 2px;
    max-width: 120px;
}
.stepper-status {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.stepper-item.completed .stepper-status { color: var(--success); }
.stepper-item.active .stepper-status { color: var(--primary); }
.stepper-line {
    flex: 1;
    min-width: 32px;
    height: 2px;
    background: var(--bg-3);
    margin-top: 19px;
    align-self: flex-start;
}
.stepper-line.completed { background: var(--success); }
.stepper-item.is-locked .stepper-status { color: var(--text-dim); }
@media (max-width: 720px) {
    .stepper { padding: 16px; }
    .stepper-item { min-width: 70px; }
    .stepper-label { font-size: 12px; }
}

/* =========================================================
   SweetAlert2 theme override (SSI)
   ========================================================= */
.swal2-container.swal2-backdrop-show { background: rgba(20, 20, 25, 0.45); }

.ssi-swal-popup.swal2-popup {
    font-family: 'Inter', system-ui, sans-serif;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 24px 24px 20px;
    max-width: 440px;
    background: var(--bg-1);
    color: var(--text);
}
.ssi-swal-title.swal2-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    padding: 0 0 6px;
    letter-spacing: -0.01em;
}
.ssi-swal-body.swal2-html-container {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-2);
    margin: 8px 0 0;
    padding: 0 4px;
}
.ssi-swal-popup .swal2-icon {
    width: 56px;
    height: 56px;
    border-width: 3px;
    margin: 4px auto 14px;
}
.ssi-swal-popup .swal2-icon.swal2-warning {
    border-color: var(--primary);
    color: var(--primary);
}
.ssi-swal-popup .swal2-icon.swal2-question {
    border-color: var(--border-strong);
    color: var(--text);
}
.ssi-swal-popup .swal2-icon.swal2-info {
    border-color: var(--info, #2563eb);
    color: var(--info, #2563eb);
}
.ssi-swal-actions.swal2-actions {
    margin: 18px 0 4px;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 4px;
}
.ssi-swal-confirm,
.ssi-swal-cancel {
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--radius) !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
    min-width: 96px;
}
.ssi-swal-confirm:focus,
.ssi-swal-cancel:focus {
    outline: 2px solid var(--primary-soft) !important;
    outline-offset: 2px !important;
}
.swal2-container .swal2-close {
    color: var(--muted);
    font-size: 24px;
    transition: color .15s ease;
}
.swal2-container .swal2-close:hover { color: var(--primary); }

/* =========================================================
   Repeater display (key-value cards)
   Used in admin participant-detail, wizard-preview, wizard-review
   ========================================================= */
.kv-stack { display: flex; flex-direction: column; gap: 8px; }
.kv-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-1);
    overflow: hidden;
}
.kv-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.kv-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}
.kv-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kv-card-body { padding: 4px 12px 8px; }
.kv-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    border-top: 1px solid var(--border-subtle);
    line-height: 1.45;
}
.kv-row:first-child { border-top: 0; }
.kv-key { color: var(--muted); font-weight: 500; }
.kv-val { color: var(--text); word-break: break-word; }
.kv-val--empty { color: var(--text-dim); }
@media (max-width: 560px) {
    .kv-row { grid-template-columns: 1fr; gap: 2px; padding: 6px 0; }
}

/* Autosave indicator */
.autosave-indicator { font-size: 12px; font-weight: 600; letter-spacing: .2px; transition: color .2s ease; display: inline-flex; align-items: center; gap: 4px; min-height: 18px; }
.autosave-indicator.text-success { color: var(--success); }
.autosave-indicator.text-warning { color: var(--warning); }
.autosave-indicator.text-muted { color: var(--text-dim); }
.autosave-indicator.text-danger { color: var(--danger); }
