/* Awfar Dialer — Admin & Auth UI */

/* ── Admin design tokens ── */
.admin-shell,
.auth-page {
    --accent-soft: rgba(14, 122, 114, 0.12);
    --accent-glow: rgba(14, 122, 114, 0.24);
    --sidebar-w: var(--admin-sidebar-width, 260px);
    --topbar-h: 52px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --surface-elevated: var(--surface);
    --sidebar-bg: var(--surface);
    --sidebar-border: var(--border);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --stat-ok: #047857;
    --stat-warn: #b45309;
    --stat-off: #64748b;
}

[data-theme="dark"] .admin-shell,
[data-theme="dark"] .auth-page {
    --accent-soft: rgba(58, 184, 168, 0.12);
    --accent-glow: rgba(58, 184, 168, 0.18);
    --surface-elevated: var(--surface);
    --sidebar-bg: #161e2c;
    --sidebar-border: #2a3548;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.45);
    --stat-ok: #6fd4b8;
    --stat-warn: #e8c96a;
    --stat-off: #8899ad;
}

.admin-shell,
.auth-page {
    font-family: var(--font);
}

/* ── Admin app layout (sidebar) ── */
.admin-shell {
    background: var(--bg);
}

/* Admin SVG safety net — fallback if cache misses sizing rules */
.admin-shell [class*="-icon"] {
    overflow: hidden;
    flex-shrink: 0;
}

.admin-shell .admin-sidebar-brand-icon svg {
    width: 20px;
    height: 20px;
}

.admin-shell .admin-sidebar-nav a svg,
.admin-shell .admin-sidebar-footer a svg {
    width: 18px;
    height: 18px;
}

.admin-shell .admin-nav-menu-btn svg {
    width: 20px;
    height: 20px;
}

.admin-shell .admin-health-icon svg {
    width: 22px;
    height: 22px;
}

.admin-shell .admin-quick-action-icon svg,
.admin-shell .card-link-icon svg {
    width: 18px;
    height: 18px;
}

.admin-shell .admin-empty-icon,
.admin-shell .admin-empty-icon svg {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
}

.admin-shell .admin-schema-notice-icon {
    width: 20px;
    height: 20px;
}

.admin-shell .legacy-header,
.admin-shell > footer.legacy-footer {
    display: none;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

body.page-fit.admin-shell .admin-layout {
    min-height: 0;
}

.admin-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-inline-end: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--sidebar-border);
    text-decoration: none;
    color: var(--text);
}

.admin-sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-md);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.admin-sidebar-brand-icon svg {
    width: 20px;
    height: 20px;
}

.admin-sidebar-brand-text {
    font-weight: var(--fw-medium);
    font-size: var(--fs-md);
    line-height: 1.2;
}

.admin-sidebar-brand-text span {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--muted);
    margin-top: var(--sp-1);
}

.admin-sidebar-nav {
    flex: 1;
    padding: var(--sp-2) var(--sp-3);
    overflow-y: auto;
}

.admin-nav-group {
    margin-bottom: var(--sp-3);
}

.admin-nav-group-label {
    display: block;
    padding: var(--sp-2) var(--sp-3) var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-nav-group-color, var(--muted));
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    margin-bottom: var(--sp-1);
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar-nav a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
}

.admin-sidebar-nav a:hover {
    background: var(--nav-hover);
    color: var(--text);
}

.admin-sidebar-nav a:hover svg {
    opacity: 1;
}

.admin-sidebar-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: var(--fw-semibold);
}

.admin-sidebar-nav a.active svg {
    opacity: 1;
    color: var(--accent);
}

.admin-nav-badge {
    margin-inline-start: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--sp-1);
    border-radius: var(--r-full);
    background: var(--danger);
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variant-numeric: tabular-nums;
}

.admin-sidebar-footer {
    padding: var(--sp-3) var(--sp-3);
    border-top: 1px solid var(--sidebar-border);
}

.admin-sidebar-footer a {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--muted);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar-footer a:hover {
    background: rgba(212, 87, 58, 0.1);
    color: var(--danger);
}

.admin-sidebar-footer a svg {
    width: 18px;
    height: 18px;
}

.admin-main {
    flex: 1;
    margin-inline-start: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-fit.admin-shell .admin-main {
    min-height: 0;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) var(--sp-5);
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    gap: var(--sp-4);
}

.admin-topbar-start {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-width: 0;
}

.admin-nav-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-nav-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.admin-nav-menu-btn svg {
    width: 20px;
    height: 20px;
}

.admin-nav-menu-btn:hover {
    background: var(--nav-hover);
    border-color: var(--accent-glow);
}

.admin-nav-backdrop {
    display: none;
}

.admin-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    font-size: var(--fs-sm);
}

.admin-breadcrumb-root {
    color: var(--muted);
    white-space: nowrap;
}

.admin-breadcrumb-sep {
    color: var(--muted);
    opacity: 0.6;
}

.admin-breadcrumb-current {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
    margin: 0;
}

.admin-topbar .ui-prefs a {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    padding: var(--sp-1) var(--sp-2);
}

.admin-shell .admin-content {
    flex: 1;
    padding: var(--sp-4) var(--sp-5) var(--sp-6);
    max-width: 1280px;
    width: 100%;
}

.admin-schema-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-md);
    background: var(--alert-ok-bg);
    border: 1px solid var(--alert-ok-border);
    color: var(--alert-ok-text);
}

.admin-schema-notice-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--status-warn);
}

.admin-schema-notice-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    flex: 1;
    min-width: 0;
}

.admin-schema-notice-link {
    font-weight: var(--fw-semibold);
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.admin-schema-notice-link:hover {
    text-decoration: underline;
}

.admin-shell .admin-content footer,
.admin-shell footer.admin-footer {
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-sm);
    padding: var(--sp-4) 0 0;
    margin-top: auto;
}

/* ── Auth page layout ── */
.auth-page {
    --auth-hero-from: #085e58;
    --auth-hero-mid: #0d9488;
    --auth-hero-to: #053d32;
    --auth-glass: rgba(255, 255, 255, 0.09);
    --auth-glass-border: rgba(255, 255, 255, 0.2);
    --auth-flow1-accent: #5eead4;
    --auth-flow2-accent: #fbbf24;
    --auth-main-grad: radial-gradient(ellipse 80% 70% at 100% 15%, rgba(13, 148, 136, 0.1), transparent 58%);
    --auth-card-shadow: 0 16px 48px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(14, 122, 114, 0.08);
    background: var(--bg);
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.auth-page .legacy-header,
.auth-page > footer.legacy-footer,
.auth-page > main.legacy-main {
    display: none;
}

html:has(body.auth-page) {
    height: 100%;
    overflow: hidden;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-5) var(--sp-5);
    background: linear-gradient(145deg, var(--auth-hero-from) 0%, var(--auth-hero-mid) 42%, var(--auth-hero-to) 100%);
    color: #fff;
    overflow: hidden;
    min-height: 0;
    height: 100%;
}

[data-theme="dark"] .auth-brand {
    background: linear-gradient(145deg, #134e4a 0%, var(--auth-hero-mid) 42%, #042f2e 100%);
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.14) 0%, transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.35;
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    min-height: 0;
    justify-content: center;
}

.auth-brand-intro {
    flex-shrink: 0;
}

.auth-brand-lockup {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: 0;
}

.auth-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-brand-logo svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.auth-brand-product {
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    letter-spacing: 0.02em;
    opacity: 0.95;
}

.auth-brand-label {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.78;
}

[dir="rtl"] .auth-brand-label {
    letter-spacing: 0.06em;
    text-transform: none;
}

.auth-brand h1 {
    font-size: clamp(var(--fs-lg), 2vw, var(--fs-xl));
    font-weight: var(--fw-semibold);
    margin: 0;
    color: #fff;
    line-height: 1.15;
    text-wrap: balance;
}

.auth-brand-sub {
    margin: var(--sp-1) 0 0;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1.35;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.88);
}

.auth-brand-services,
.auth-brand-desc {
    margin: var(--sp-2) 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.auth-brand-desc-line {
    display: block;
}

.auth-service-chip {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-md);
    font-size: var(--fs-xs);
    line-height: 1.4;
    border: 1px solid transparent;
    background: var(--auth-glass);
    backdrop-filter: blur(8px);
}

.auth-service-chip-dot {
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-top: 0.2rem;
    border-radius: var(--r-full);
}

.auth-service-chip--ivr {
    border-color: rgba(94, 234, 212, 0.32);
    color: rgba(255, 255, 255, 0.94);
}

.auth-service-chip--ivr .auth-service-chip-dot {
    background: var(--auth-flow1-accent);
    box-shadow: 0 0 8px rgba(94, 234, 212, 0.55);
}

.auth-service-chip--tts {
    border-color: rgba(251, 191, 36, 0.32);
    color: rgba(255, 255, 255, 0.94);
}

.auth-service-chip--tts .auth-service-chip-dot {
    background: var(--auth-flow2-accent);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.auth-flows {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-top: 0;
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    min-height: 0;
    flex: 1 1 auto;
}

.auth-page .auth-flow-sub {
    display: none;
}

.auth-page .auth-flow-desc {
    display: none;
}

@media (min-width: 1024px) and (min-height: 700px) {
    .auth-page .auth-flow-desc {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        max-width: 100%;
        font-size: 0.625rem;
        line-height: 1.25;
        color: rgba(255, 255, 255, 0.7);
    }
}

.auth-page .auth-flow-heading {
    margin-bottom: var(--sp-2);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.auth-page .auth-flow-heading::before {
    content: "";
    flex-shrink: 0;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: var(--r-full);
    background: var(--auth-flow1-accent);
    box-shadow: 0 0 10px rgba(94, 234, 212, 0.5);
}

.auth-page .auth-flow--service2 .auth-flow-heading::before {
    background: var(--auth-flow2-accent);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.auth-flow {
    margin-top: 0;
    padding: var(--sp-3) var(--sp-3) var(--sp-2);
    border-radius: var(--r-lg);
    background: linear-gradient(155deg, rgba(6, 20, 36, 0.78), rgba(10, 30, 48, 0.58));
    border: 1px solid var(--auth-glass-border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px);
}

.auth-page .auth-flow--service1 {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 3px 0 rgba(94, 234, 212, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.18);
}

.auth-page .auth-flow--service2 {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 3px 0 rgba(251, 191, 36, 0.35),
        0 8px 24px rgba(0, 0, 0, 0.18);
}

.auth-flow-heading {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.92;
    color: #fff;
}

.auth-flow-sub {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-xs);
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.62);
}

[dir="rtl"] .auth-flow-heading {
    letter-spacing: 0.04em;
    text-transform: none;
}

.auth-flow-track {
    display: flex;
    align-items: stretch;
    gap: var(--sp-1);
    direction: ltr;
    overflow: hidden;
    position: relative;
}

.auth-flow--compact .auth-flow-step {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    scroll-snap-align: unset;
    padding: var(--sp-2) var(--sp-1) var(--sp-2);
    border-radius: var(--r-md);
}

.auth-flow--dense .auth-flow-step {
    padding: var(--sp-2) var(--sp-1) var(--sp-2);
}

.auth-flow--dense .auth-flow-icon {
    width: 1.55rem;
    height: 1.55rem;
    margin-bottom: var(--sp-1);
}

.auth-flow--dense .auth-flow-icon svg {
    width: 0.8rem;
    height: 0.8rem;
}

.auth-page .auth-flow--dense .auth-flow-title {
    font-size: 0.625rem;
    margin-bottom: 0;
    letter-spacing: 0.03em;
    max-width: 100%;
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
}

.auth-flow--dense .auth-flow-title {
    font-size: var(--fs-xs);
    margin-bottom: var(--sp-1);
    letter-spacing: 0.02em;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-flow--dense .auth-flow-desc {
    font-size: var(--fs-xs);
    line-height: 1.2;
}

.auth-flow--dense .auth-flow-bridge {
    flex: 0 0 0.55rem;
    min-width: 0.55rem;
}

.auth-flow--dense .auth-flow-bridge-arrow {
    width: 0.65rem;
    height: 0.65rem;
}

.auth-flow--dense .auth-flow-badge {
    margin: 0 0 var(--sp-1);
    padding: 1px var(--sp-1);
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
}

.auth-flow--dense .auth-flow-waves {
    height: 0.35rem;
    margin: -0.06rem 0 var(--sp-1);
    gap: var(--sp-1);
}

.auth-flow--dense .auth-flow-waves span {
    width: 2px;
}

.auth-flow--dense .auth-flow-ping {
    width: 0.32rem;
    height: 0.32rem;
    top: 0.25rem;
    inset-inline-end: 0.25rem;
}

[dir="rtl"] .auth-flow--dense .auth-flow-title {
    font-size: var(--fs-xs);
}

[dir="rtl"] .auth-flow--dense .auth-flow-desc {
    font-size: var(--fs-xs);
}

.auth-flow-step {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--sp-3) var(--sp-1) var(--sp-2);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-flow-step:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

@media (prefers-reduced-motion: reduce) {
    .auth-flow-step:hover {
        transform: none;
    }
}

.auth-flow-step--dial {
    border-color: rgba(45, 212, 191, 0.35);
    background: linear-gradient(180deg, rgba(45, 212, 191, 0.12), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--answer {
    border-color: rgba(244, 63, 94, 0.35);
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.12), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--ivr {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--upload {
    border-color: rgba(167, 139, 250, 0.4);
    background: linear-gradient(180deg, rgba(167, 139, 250, 0.14), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--tts {
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--recording {
    border-color: rgba(59, 130, 246, 0.45);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.16), rgba(255, 255, 255, 0.02));
}

.auth-flow-step--report {
    border-color: rgba(52, 211, 153, 0.4);
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.14), rgba(255, 255, 255, 0.02));
}

.auth-flow--compact .auth-flow-icon {
    width: 1.85rem;
    height: 1.85rem;
    margin-bottom: var(--sp-1);
}

.auth-flow--compact .auth-flow-icon svg {
    width: 0.95rem;
    height: 0.95rem;
}

.auth-flow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: var(--r-full);
    margin-bottom: var(--sp-2);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.auth-flow-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.auth-flow-step--dial .auth-flow-icon {
    color: #5eead4;
    background: rgba(45, 212, 191, 0.22);
}

.auth-flow-step--answer .auth-flow-icon {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.22);
}

.auth-flow-step--ivr .auth-flow-icon {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.25);
}

.auth-flow-step--upload .auth-flow-icon {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.25);
}

.auth-flow-step--tts .auth-flow-icon {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.25);
}

.auth-flow-step--recording .auth-flow-icon {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.28);
}

.auth-flow-step--report .auth-flow-icon {
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.25);
}

.auth-flow--compact .auth-flow-title {
    font-size: var(--fs-xs);
    margin-bottom: var(--sp-1);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-flow--compact .auth-flow-desc {
    font-size: var(--fs-xs);
    line-height: 1.3;
    max-width: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[dir="rtl"] .auth-flow--compact .auth-flow-title {
    font-size: var(--fs-xs);
}

[dir="rtl"] .auth-flow--compact .auth-flow-desc {
    font-size: var(--fs-xs);
    max-width: none;
}

.auth-flow-title {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.2;
    margin-bottom: var(--sp-1);
}

[dir="rtl"] .auth-flow-title {
    letter-spacing: 0;
    text-transform: none;
    font-size: var(--fs-sm);
}

.auth-flow-desc {
    display: block;
    font-size: var(--fs-xs);
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
    max-width: 7.5rem;
}

[dir="rtl"] .auth-flow-desc {
    font-size: var(--fs-xs);
    max-width: 8rem;
}

.auth-flow--compact .auth-flow-badge {
    margin: 0 0 var(--sp-1);
    padding: 1px var(--sp-1);
    font-size: var(--fs-xs);
    letter-spacing: 0.03em;
}

.auth-flow--compact .auth-flow-waves {
    height: 0.5rem;
    margin: -0.1rem 0 var(--sp-1);
}

.auth-flow--compact .auth-flow-bridge {
    flex: 0 0 0.5rem;
    min-width: 0.5rem;
}
.auth-flow-badge {
    position: static;
    display: inline-block;
    max-width: 100%;
    margin: 0 0 var(--sp-1);
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.35);
    border: 1px solid rgba(147, 197, 253, 0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-flow-waves {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: var(--sp-1);
    height: 0.65rem;
    margin: -0.15rem 0 var(--sp-1);
}

.auth-flow-waves span {
    display: block;
    width: 3px;
    border-radius: var(--r-sm);
    background: #60a5fa;
    animation: auth-flow-wave 1.1s ease-in-out infinite;
}

.auth-flow-waves span:nth-child(1) { height: 0.25rem; animation-delay: 0s; }
.auth-flow-waves span:nth-child(2) { height: 0.45rem; animation-delay: 0.15s; }
.auth-flow-waves span:nth-child(3) { height: 0.6rem; animation-delay: 0.3s; }
.auth-flow-waves span:nth-child(4) { height: 0.4rem; animation-delay: 0.45s; }
.auth-flow-waves span:nth-child(5) { height: 0.3rem; animation-delay: 0.6s; }

.auth-flow-ping {
    position: absolute;
    top: 0.5rem;
    inset-inline-end: 0.5rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: var(--r-full);
    background: #fb7185;
    box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.7);
    animation: auth-flow-ping 1.8s ease-out infinite;
}

.auth-flow-bridge {
    position: relative;
    flex: 0 0 1.4rem;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    opacity: 0.85;
}

.auth-flow-bridge-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.auth-flow-bridge-arrow {
    width: 0.85rem;
    height: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    position: relative;
    z-index: 1;
}

.auth-flow-bridge-dot {
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: var(--r-full);
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    animation: auth-flow-travel 2.4s ease-in-out infinite;
    animation-delay: var(--bridge-delay, 0s);
}

@keyframes auth-flow-wave {
0%, 100% { transform: scaleY(0.45); opacity: 0.55; }
50% { transform: scaleY(1); opacity: 1; }
}

@keyframes auth-flow-ping {
0% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.65); }
70% { box-shadow: 0 0 0 8px rgba(251, 113, 133, 0); }
100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0); }
}

@keyframes auth-flow-travel {
0% { left: 0; opacity: 0; }
15% { opacity: 1; }
85% { opacity: 1; }
100% { left: calc(100% - 5px); opacity: 0; }
}

/* Sequential runner: one arrow travels across all steps */
.auth-flow--sequential .auth-flow-bridge-dot {
    animation: none;
    opacity: 0;
}

.auth-flow-runner {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-top: -0.675rem;
    margin-left: -0.675rem;
    color: #fb7185;
    filter: drop-shadow(0 0 6px rgba(251, 113, 133, 0.85));
    pointer-events: none;
    will-change: transform;
}

.auth-flow--dense .auth-flow-runner {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: -0.525rem;
    margin-left: -0.525rem;
}

.auth-flow-runner svg {
    width: 100%;
    height: 100%;
}

[dir="rtl"] .auth-flow-runner svg {
    transform: scaleX(-1);
}

.auth-flow-step--lit {
    animation: auth-flow-step-flash 0.4s ease-out;
}

@keyframes auth-flow-step-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        border-color: rgba(255, 255, 255, 0.1);
    }
    35% {
        box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.55), 0 0 18px rgba(251, 113, 133, 0.45);
        border-color: rgba(251, 113, 133, 0.75);
        transform: translateY(-2px) scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        border-color: rgba(255, 255, 255, 0.1);
        transform: none;
    }
}

.auth-flow--panel .auth-flow-step--lit {
    animation-name: auth-flow-step-flash-panel;
}

@keyframes auth-flow-step-flash-panel {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 113, 133, 0);
        border-color: var(--border);
    }
    35% {
        box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.35), 0 0 14px rgba(251, 113, 133, 0.25);
        border-color: rgba(251, 113, 133, 0.65);
        transform: translateY(-2px) scale(1.02);
    }
    100% {
        box-shadow: none;
        border-color: var(--border);
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-flow-waves span,
    .auth-flow-ping,
    .auth-flow-bridge-dot {
        animation: none;
    }

    .auth-flow-runner {
        display: none;
    }

    .auth-flow-step--lit {
        animation: none;
    }
}

@media (max-width: 520px) {
    .auth-flow--compact .auth-flow-step {
        min-width: 4rem;
    }

    .auth-flow-desc {
        max-width: 4.5rem;
    }
}

.auth-flow--panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: none;
    margin-bottom: var(--sp-4);
    padding: var(--sp-3) var(--sp-3) var(--sp-3);
}

.auth-flow--panel .auth-flow-heading {
    color: var(--text);
    opacity: 1;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    letter-spacing: 0.05em;
}

.auth-flow--panel .auth-flow-sub {
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

.auth-flow--panel .auth-flow-step {
    background: var(--surface);
    border-color: var(--border);
    border-width: 1.5px;
}

.auth-flow--panel .auth-flow-step:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.auth-flow--panel .auth-flow-title {
    color: var(--text);
}

.auth-flow--panel .auth-flow-desc {
    color: var(--muted);
    font-weight: var(--fw-medium);
}

.auth-flow--panel.auth-flow--compact .auth-flow-title {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.04em;
}

.auth-flow--panel.auth-flow--compact .auth-flow-desc {
    font-size: var(--fs-sm);
    line-height: 1.3;
    font-weight: var(--fw-medium);
}

[dir="rtl"] .auth-flow--panel.auth-flow--compact .auth-flow-title {
    font-size: var(--fs-sm);
    letter-spacing: 0;
}

[dir="rtl"] .auth-flow--panel.auth-flow--compact .auth-flow-desc {
    font-size: var(--fs-sm);
}

.auth-flow--panel .auth-flow-icon {
    box-shadow: none;
}

.auth-flow--panel .auth-flow-step--upload {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.08);
}

.auth-flow--panel .auth-flow-step--upload .auth-flow-icon {
    color: #6d28d9;
    background: rgba(124, 58, 237, 0.16);
}

.auth-flow--panel .auth-flow-step--dial {
    border-color: var(--status-bar-border);
    background: rgba(15, 118, 110, 0.08);
}

.auth-flow--panel .auth-flow-step--dial .auth-flow-icon {
    color: var(--accent);
    background: rgba(15, 118, 110, 0.16);
}

.auth-flow--panel .auth-flow-step--answer {
    border-color: rgba(225, 29, 72, 0.4);
    background: rgba(225, 29, 72, 0.08);
}

.auth-flow--panel .auth-flow-step--answer .auth-flow-icon {
    color: #be123c;
    background: rgba(225, 29, 72, 0.14);
}

.auth-flow--panel .auth-flow-step--ivr {
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(37, 99, 235, 0.08);
}

.auth-flow--panel .auth-flow-step--ivr .auth-flow-icon {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.14);
}

.auth-flow--panel .auth-flow-step--report {
    border-color: rgba(5, 150, 105, 0.45);
    background: rgba(5, 150, 105, 0.08);
}

.auth-flow--panel .auth-flow-step--report .auth-flow-icon {
    color: var(--status-ok);
    background: rgba(5, 150, 105, 0.14);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step--upload .auth-flow-icon {
    color: #c4b5fd;
    background: rgba(124, 58, 237, 0.28);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step--dial .auth-flow-icon {
    color: #5eead4;
    background: rgba(45, 212, 191, 0.22);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step--answer .auth-flow-icon {
    color: #fda4af;
    background: rgba(225, 29, 72, 0.28);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step--ivr .auth-flow-icon {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.28);
}

[data-theme="dark"] .auth-flow--panel .auth-flow-step--report .auth-flow-icon {
    color: #6ee7b7;
    background: rgba(5, 150, 105, 0.28);
}

.auth-flow--panel .auth-flow-bridge-line {
    background: var(--border);
}

.auth-flow--panel .auth-flow-bridge-arrow {
    color: var(--muted);
}

.auth-flow--panel .auth-flow-bridge-dot {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

.auth-flow--coming-soon {
    margin-top: 0;
    padding: var(--sp-3) var(--sp-3);
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    opacity: 0.88;
}

.auth-flow--coming-soon .auth-flow-heading {
    margin-bottom: var(--sp-1);
}

.stat-disp-badge {
    display: inline-block;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-full);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    background: var(--badge-off-bg);
    color: var(--muted);
}

.stat-disp-badge--ivr {
    background: var(--badge-bg);
    color: var(--badge-text);
}

.stat-disp-row--ivr td {
    background: rgba(31, 138, 125, 0.06);
}

[data-theme="dark"] .stat-disp-row--ivr td {
    background: rgba(42, 157, 143, 0.1);
}

.auth-main {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--auth-main-grad), linear-gradient(180deg, #f6f9fc 0%, var(--bg) 100%);
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.auth-admin-topbar {
    display: flex;
    justify-content: flex-end;
    padding: var(--sp-3) var(--sp-5) 0;
    flex-shrink: 0;
}

.auth-admin-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}

.auth-admin-trigger svg {
    width: 1.6625rem;
    height: 1.6625rem;
    min-width: 1.6625rem;
    min-height: 1.6625rem;
    flex-shrink: 0;
}

.auth-admin-trigger:hover {
    border-color: rgba(31, 138, 125, 0.45);
    background: rgba(31, 138, 125, 0.08);
    transform: translateY(-1px);
}

.auth-admin-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--sp-10) var(--sp-4) var(--sp-4);
}

.auth-admin-modal[hidden] {
    display: none;
}

.auth-admin-modal-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.auth-admin-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-5) var(--sp-5) var(--sp-5);
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
}

.auth-admin-modal-dialog::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
}

.auth-admin-modal-close {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.auth-admin-modal-close svg {
    width: 1rem;
    height: 1rem;
}

.auth-admin-modal-close:hover {
    background: var(--nav-hover);
    color: var(--text);
}

.auth-admin-modal-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
}

.auth-admin-modal-header {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
    padding-inline-end: var(--sp-6);
}

.auth-admin-modal-kicker {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.auth-admin-modal-header h3 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
}

.auth-admin-modal-form .field {
    margin-bottom: var(--sp-3);
}

.auth-admin-modal-form .actions {
    margin-top: var(--sp-4);
}

.auth-admin-submit {
    width: 100%;
}

.auth-admin-modal-dialog .field {
    margin-bottom: var(--sp-3);
}

.auth-admin-modal-dialog .actions {
    margin-top: var(--sp-4);
}

.auth-admin-modal-dialog .actions button {
    width: 100%;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5) var(--sp-6);
    min-height: 0;
    overflow: auto;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--sp-6) var(--sp-6) var(--sp-5);
    box-shadow: var(--auth-card-shadow);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-secondary) 55%, rgba(14, 138, 154, 0.5) 100%);
}

.auth-card-head {
    margin-bottom: var(--sp-4);
}

.auth-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: var(--sp-3);
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(14, 122, 114, 0.12);
}

.auth-card h2 {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    color: var(--text);
    line-height: var(--lh-tight);
    text-wrap: balance;
}

.auth-card .subtitle {
    margin: 0;
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--muted);
}

.auth-card .field {
    margin-bottom: var(--sp-4);
}

.auth-card .field:last-of-type {
    margin-bottom: var(--sp-3);
}

.auth-card label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    margin-bottom: var(--sp-2);
    color: var(--text);
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
    width: 100%;
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius-sm);
    font-size: var(--fs-md);
    border: 1px solid var(--border);
    background: var(--input-bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card .secret-row {
    display: flex;
    gap: var(--sp-2);
    align-items: stretch;
}

.auth-card .secret-row input {
    flex: 1;
    min-width: 0;
}

.auth-password-toggle,
.auth-card .secret-row .btn-secondary {
    flex-shrink: 0;
    min-height: 2.75rem;
    padding-inline: var(--sp-3);
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="password"]:focus,
.auth-admin-modal-dialog input[type="text"]:focus,
.auth-admin-modal-dialog input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card .actions button,
.auth-admin-modal-dialog .actions button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
    border: none;
    cursor: pointer;
    font-weight: var(--fw-medium);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-card .actions button:hover,
.auth-admin-modal-dialog .actions button:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent-secondary-hover) 100%);
}

.auth-card .actions button:focus-visible,
.auth-admin-modal-dialog .actions button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card .actions {
    margin-top: var(--sp-4);
}

.auth-card .actions button {
    width: 100%;
    padding: var(--sp-3);
    font-size: var(--fs-md);
    border-radius: var(--radius-sm);
    min-height: 2.75rem;
}

.auth-card .auth-switch {
    margin-top: var(--sp-6);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: var(--fs-base);
    color: var(--muted);
}

.auth-card .auth-switch a {
    color: var(--accent);
    font-weight: var(--fw-medium);
    text-decoration: none;
}

.auth-card .auth-switch a:hover {
    text-decoration: underline;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--r-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    margin-bottom: var(--sp-3);
}

/* ── Viewport-fit layout (all non-auth pages) ── */
html:has(body.page-fit) {
    height: 100%;
    overflow: hidden;
}

body.page-fit {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Supervisor shell */
body.page-fit:not(.admin-shell) .legacy-header,
body.page-fit:not(.admin-shell) .main-tabs-bar {
    flex-shrink: 0;
}

body.page-fit:not(.admin-shell) .main-tabs-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-fit:not(.admin-shell) main.legacy-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-block: var(--sp-2) 0;
}

body.page-fit:not(.admin-shell) .legacy-footer {
    display: none;
}

body.page-fit:not(.admin-shell) main.legacy-main > .panel,
body.page-fit:not(.admin-shell) main.legacy-main > .groups-page,
body.page-fit:not(.admin-shell) main.legacy-main > .camp-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-fit:not(.admin-shell) main.legacy-main > .panel:has(.table-wrap),
body.page-fit:not(.admin-shell) main.legacy-main > .panel.dash-panel,
body.page-fit:not(.admin-shell) main.legacy-main > .panel.numbers-page,
body.page-fit:not(.admin-shell) main.legacy-main > .panel.dnc-page,
body.page-fit:not(.admin-shell) main.legacy-main > .panel.camp-page,
body.page-fit:not(.admin-shell) main.legacy-main > .groups-page {
    overflow: hidden;
}

body.page-fit:not(.admin-shell) .table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Admin shell */
body.page-fit.admin-shell .admin-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
}

body.page-fit.admin-shell .admin-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.page-fit.admin-shell .admin-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.page-fit.admin-shell .admin-content > .panel,
body.page-fit.admin-shell .admin-content > .page-card {
    min-height: 0;
}

/* Dashboard */
body.page-fit.dash-page main.legacy-main {
    max-width: 1416px;
    width: 100%;
    margin-inline: auto;
    padding: 0 var(--sp-4);
}

body.page-fit.dash-page .panel.dash-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit.dash-page .dash-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit.dash-page .dash-toolbar,
body.page-fit.dash-page .dash-filters,
body.page-fit.dash-page .dash-ai-panel,
body.page-fit.dash-page .dash-insights-wrap,
body.page-fit.dash-page .dash-alert,
body.page-fit.dash-page .dash-status-bar,
body.page-fit.dash-page .dash-footer-meta {
    flex-shrink: 0;
}

body.page-fit.dash-page .dash-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Numbers page */
body.page-fit.numbers-page-fit main.legacy-main {
    max-width: none;
    width: 100%;
    margin: var(--sp-1) 0 0;
    padding: 0 var(--sp-1);
}

body.page-fit .panel.numbers-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit .numbers-head,
body.page-fit .numbers-alert,
body.page-fit .numbers-filters,
body.page-fit .numbers-actions,
body.page-fit .numbers-select-all-note,
body.page-fit .numbers-footer,
body.page-fit .numbers-pagination {
    flex-shrink: 0;
}

body.page-fit .numbers-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit .numbers-table-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Campaigns editor */
body.page-fit.supervisor-campaigns-fit main.legacy-main {
    max-width: 1180px;
    width: 100%;
    margin: var(--sp-2) auto 0;
    padding: 0 var(--sp-4);
}

/* Groups page */
body.page-fit.supervisor-groups-fit main.legacy-main {
    max-width: none;
    width: 100%;
    margin: var(--sp-2) 0 0;
    padding: 0 var(--sp-2);
}

/* Do-not-call page */
body.page-fit.supervisor-dnc-fit main.legacy-main {
    max-width: none;
    width: 100%;
    margin: var(--sp-1) 0 0;
    padding: 0 var(--sp-2);
}

body.page-fit .panel.dnc-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit .dnc-head,
body.page-fit .dnc-alert,
body.page-fit .dnc-forms {
    flex-shrink: 0;
}

body.page-fit .dnc-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit .dnc-table-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Statistics page — viewport fit */
body.page-fit.stats-page main.legacy-main {
    max-width: none;
    width: 100%;
    margin: var(--sp-1) 0 0;
    padding: 0 var(--sp-2);
}

body.page-fit.stats-page .stats-page-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.page-fit.stats-page .stats-tab-panel {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Viewport-fit responsive */
@media (max-width: 900px) {
    body.page-fit:not(.admin-shell) main.legacy-main {
        padding-inline: var(--sp-3);
        margin-block-start: var(--sp-2);
    }

    body.page-fit.admin-shell .admin-content {
        padding: var(--sp-4);
    }

    body.page-fit.dash-page main.legacy-main {
        padding-inline: var(--sp-3);
    }
}

@media (max-height: 800px) {
    body.page-fit:not(.admin-shell) main.legacy-main {
        margin-block-start: var(--sp-1);
    }

    body.page-fit:not(.admin-shell) .legacy-header {
        padding-block: var(--sp-3);
    }

    body.page-fit .panel.numbers-page,
    body.page-fit .panel.dnc-page,
    body.page-fit .panel.dash-panel {
        padding-block: var(--sp-3);
    }
}

@media (max-width: 600px) {
    body.page-fit:not(.admin-shell) main.legacy-main {
        padding-inline: var(--sp-2);
    }
}

/* ── Unified app shell components ── */
.app-toolbar,
.dash-toolbar,
.camp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    padding: var(--sp-3) var(--sp-4);
    background: var(--toolbar-bg);
    color: var(--toolbar-fg);
    flex-shrink: 0;
}

.app-toolbar__start,
.dash-toolbar-start,
.camp-toolbar-start {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

.app-toolbar__title,
.dash-toolbar h1,
.camp-toolbar-start h1 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--toolbar-fg);
    white-space: nowrap;
}

.app-toolbar__icon,
.dash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: var(--toolbar-fg);
    flex-shrink: 0;
}

.app-toolbar__icon svg,
.dash-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.app-tabs-bar,
.main-tabs-bar {
    background: var(--tab-bar-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 var(--sp-5);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-tabs,
.main-tabs,
.camp-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    max-width: 1180px;
    margin: 0 auto;
    min-width: min-content;
}

.camp-tabs {
    max-width: none;
    padding: 0 var(--sp-3);
    border-bottom: 1px solid var(--border);
}

.app-tabs__link,
.main-tabs a,
.camp-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    color: var(--muted);
    text-decoration: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    border: none;
    border-top: 3px solid transparent;
    border-bottom: 1px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.camp-tab-btn {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.app-tabs__link svg,
.main-tabs a svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.75;
}

.app-tabs__link:hover,
.main-tabs a:hover,
.camp-tab-btn:hover:not(:disabled) {
    color: var(--text);
    background: var(--tab-hover-bg);
}

.app-tabs__link.is-active,
.main-tabs a.active,
.camp-tab-btn.is-active {
    color: var(--tab-active-color);
    background: var(--tab-active-bg);
    border-top-color: var(--tab-active-indicator);
    border-bottom-color: var(--tab-active-bg);
    font-weight: var(--fw-medium);
}

.camp-tab-btn.is-active {
    border-inline-color: var(--border);
}

.app-tabs__link.is-active svg,
.main-tabs a.active svg {
    opacity: 1;
    color: var(--accent);
}

.main-tabs a:focus-visible,
.camp-tab-btn:focus-visible,
.app-tabs__link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.camp-tab-btn.is-done .camp-tab-check {
    color: var(--ok);
}

.app-panel-head,
.fop-panel-head {
    padding: var(--sp-2) var(--sp-3);
    background: var(--panel-head-bg);
    color: var(--panel-head-fg);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .app-panel-head,
[data-theme="dark"] .fop-panel-head {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ── Admin panels & page headers ── */
.admin-shell .panel,
.admin-shell .page-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-5) var(--sp-5);
    box-shadow: var(--shadow-sm);
}

.admin-shell .page-header {
    margin-bottom: var(--sp-5);
}

.admin-shell .page-header h1 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--sp-1);
}

.admin-shell .page-header .subtitle {
    margin: 0;
    font-size: var(--fs-base);
}

/* ── Stat cards ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-4);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-glow);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card-icon.ok {
    background: rgba(5, 150, 105, 0.12);
    color: var(--stat-ok);
}

.stat-card-icon.warn {
    background: rgba(217, 119, 6, 0.12);
    color: var(--stat-warn);
}

.stat-card-icon.neutral {
    background: var(--accent-soft);
    color: var(--accent);
}

.stat-card-icon.off {
    background: rgba(100, 116, 139, 0.12);
    color: var(--stat-off);
}

.stat-card-body {
    flex: 1;
    min-width: 0;
}

.stat-card-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--muted);
    margin-bottom: var(--sp-1);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card-value {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--text);
    line-height: 1.3;
}

.stat-card-value.ok { color: var(--stat-ok); }
.stat-card-value.warn { color: var(--stat-warn); }
.stat-card-value.off { color: var(--stat-off); }

.stat-card-sub {
    font-size: var(--fs-sm);
    color: var(--muted);
    margin-top: var(--sp-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Admin v2 components ── */
.admin-page-header {
    display: block;
    margin-bottom: var(--sp-4);
    padding: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    gap: 0;
    flex-wrap: nowrap;
}

.admin-page-header h1 {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--sp-1);
    line-height: var(--lh-tight);
}

.admin-page-header .subtitle {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--muted);
    line-height: var(--lh-normal);
}

.admin-health-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.admin-health-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.admin-health-card.is-ok {
    border-color: rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(5, 150, 105, 0.06) 100%);
}

.admin-health-card.is-warn {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(217, 119, 6, 0.06) 100%);
}

.admin-health-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-health-card.is-ok .admin-health-icon {
    background: rgba(5, 150, 105, 0.14);
    color: var(--stat-ok);
}

.admin-health-card.is-warn .admin-health-icon {
    background: rgba(217, 119, 6, 0.14);
    color: var(--stat-warn);
}

.admin-health-icon svg {
    width: 22px;
    height: 22px;
}

.admin-health-body {
    min-width: 0;
    flex: 1;
}

.admin-health-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-1);
}

.admin-health-value {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
}

.admin-health-card.is-ok .admin-health-value { color: var(--stat-ok); }
.admin-health-card.is-warn .admin-health-value { color: var(--stat-warn); }

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.admin-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-3) var(--sp-4);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-kpi-card:hover {
    border-color: var(--accent-glow);
    box-shadow: var(--shadow-md);
}

.admin-kpi-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--muted);
}

.admin-kpi-value {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.admin-kpi-value.is-ok { color: var(--stat-ok); }
.admin-kpi-value.is-off { color: var(--stat-off); }

.admin-kpi-meta {
    font-size: var(--fs-xs);
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-section {
    margin-bottom: var(--sp-5);
}

.admin-section-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--sp-3);
    color: var(--text);
}

.admin-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-3);
}

.admin-quick-action {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.admin-quick-action:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    background: var(--accent-soft);
}

.admin-quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-quick-action-icon svg {
    width: 18px;
    height: 18px;
}

.admin-quick-action-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--sp-1);
}

.admin-quick-action-desc {
    font-size: var(--fs-xs);
    color: var(--muted);
    line-height: 1.35;
}

.admin-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-4);
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.admin-toolbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    margin-top: var(--sp-2);
}

.admin-toolbar-stat {
    font-size: var(--fs-sm);
    color: var(--muted);
}

.admin-toolbar-stat strong {
    color: var(--text);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
}

.admin-empty {
    text-align: center;
    padding: var(--sp-8) var(--sp-4);
    color: var(--muted);
    background: var(--card-bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
}

.admin-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--sp-3);
    color: var(--muted);
    opacity: 0.6;
}

.admin-empty-icon svg {
    display: block;
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
}

.admin-empty-title {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
    margin: 0 0 var(--sp-2);
}

.admin-empty-desc {
    margin: 0;
    font-size: var(--fs-sm);
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    white-space: nowrap;
}

.admin-status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-status-pill.is-ok {
    background: rgba(5, 150, 105, 0.12);
    color: var(--stat-ok);
}

.admin-status-pill.is-ok::before { background: var(--stat-ok); }

.admin-status-pill.is-off {
    background: var(--badge-off-bg);
    color: var(--muted);
}

.admin-status-pill.is-off::before { background: var(--muted); }

.admin-form-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: var(--sp-4);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-form-panel-head {
    padding: var(--sp-4) var(--sp-5);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.admin-form-panel-head h2 {
    margin: 0 0 var(--sp-1);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
}

.admin-form-panel-body {
    padding: var(--sp-4) var(--sp-5);
}

.admin-form-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    padding: var(--sp-3) var(--sp-5);
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.admin-shell .perm-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.admin-shell .perm-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.admin-shell .perm-chip:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--nav-active-color);
}

.admin-shell .perm-chip input {
    accent-color: var(--accent);
}

.admin-shell .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border);
}

.admin-shell .toggle-row:last-child {
    border-bottom: none;
}

.admin-shell .toggle-row-label {
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--text);
}

.admin-shell .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.admin-shell .toggle-switch input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

.admin-shell .toggle-switch-track {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--border);
    border-radius: var(--r-full);
    transition: background 0.15s;
}

.admin-shell .toggle-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--sh-sm);
    transition: transform 0.15s;
}

.admin-shell .toggle-switch input:checked + .toggle-switch-track {
    background: var(--accent);
}

.admin-shell .toggle-switch input:checked + .toggle-switch-track::after {
    transform: translateX(20px);
}

[dir="rtl"] .admin-shell .toggle-switch input:checked + .toggle-switch-track::after {
    transform: translateX(-20px);
}

.admin-toolbar form {
    display: inline-block;
    margin: 0;
}

.admin-form-panel-head .section-intro {
    margin: var(--sp-1) 0 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.admin-shell .admin-settings-form .admin-form-panel:last-child {
    margin-bottom: 0;
}

.admin-shell .admin-data-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-shell .migration-card {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-2);
    background: var(--card-bg);
}

.admin-shell .migration-card-kind {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    min-width: 72px;
}

@media (max-width: 1100px) {
    .admin-kpi-grid,
    .admin-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .admin-health-strip,
    .admin-kpi-grid,
    .admin-quick-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .admin-sidebar,
    .admin-quick-action,
    .admin-kpi-card,
    .admin-shell .toggle-switch-track,
    .admin-shell .toggle-switch-track::after {
        transition: none;
    }
}

/* ── Admin overview (compact, no page scroll) ── */
body.page-fit.admin-shell.admin-overview-page .admin-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: var(--sp-3) var(--sp-5) var(--sp-3);
}

.admin-overview {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.admin-overview .admin-page-header {
    margin-bottom: var(--sp-3);
    flex-shrink: 0;
}

.admin-overview .admin-health-strip,
.admin-overview .admin-kpi-grid {
    margin-bottom: var(--sp-3);
    flex-shrink: 0;
}

.admin-overview .admin-section {
    margin-bottom: var(--sp-3);
    flex-shrink: 0;
}

.admin-overview .settings-section--campaigns {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.admin-overview .settings-section--campaigns .admin-data-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.admin-overview .settings-section--campaigns .table-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-shell .admin-overview .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--sp-3);
    margin: var(--sp-2) 0;
}

.admin-shell .admin-overview .card-link > div:not(.card-link-icon) {
    min-width: 0;
    flex: 1;
}

.admin-shell .admin-overview .card-link .card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-shell .admin-overview .card-link .card-desc {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
}

@media (max-width: 900px) {
    .admin-shell .admin-overview .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Shortcut cards ── */
.admin-shell .cards {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--sp-3);
}

.admin-shell .card-link {
    padding: var(--sp-4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.admin-shell .card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--accent-soft);
}

.admin-shell .card-link-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-shell .card-link-icon svg {
    width: 18px;
    height: 18px;
}

.admin-shell .card-link .card-title {
    font-size: var(--fs-base);
    margin-bottom: var(--sp-1);
}

.admin-shell .card-link .card-desc {
    font-size: var(--fs-sm);
}

/* ── Tables ── */
.admin-shell .table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--sp-3);
}

.admin-shell table.data {
    margin: 0;
}

.admin-shell table.data thead {
    background: var(--card-bg);
    position: sticky;
    top: 0;
}

.admin-shell table.data th {
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--sp-3) var(--sp-3);
    border-bottom: 1px solid var(--border);
}

.admin-shell table.data td {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-base);
}

.admin-shell table.data tbody tr {
    transition: background 0.1s;
}

.admin-shell table.data tbody tr:hover {
    background: var(--nav-hover);
}

.admin-shell table.data tbody tr:last-child td {
    border-bottom: none;
}

/* ── Settings blocks ── */
.admin-shell .settings-block {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.admin-shell .settings-block-head h2 {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.admin-shell .settings-block-head h2::before {
    content: "";
    width: 4px;
    height: 1.1em;
    border-radius: var(--r-sm);
    background: var(--accent);
    flex-shrink: 0;
}

.admin-shell .btn-test {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.admin-shell .btn-test:hover {
    background: var(--accent-soft);
}

/* ── Toolbar ── */
.admin-shell .toolbar {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.admin-shell .toolbar h1 {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}

.admin-shell .toolbar .subtitle {
    margin-bottom: 0;
}

.admin-shell .toolbar form button {
    white-space: nowrap;
}

/* ── Section headings ── */
.admin-shell .settings-section h2 {
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .auth-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        overflow-y: auto;
    }

    .auth-page {
        height: auto;
        max-height: none;
        min-height: 100dvh;
        overflow: auto;
    }

    html:has(body.auth-page) {
        overflow: auto;
    }

    .auth-brand {
        padding: var(--sp-3) var(--sp-4) var(--sp-2);
        min-height: 0;
        height: auto;
        justify-content: flex-start;
    }

    .auth-brand-inner {
        height: auto;
        gap: var(--sp-2);
    }

    .auth-page .auth-flows {
        display: flex;
        gap: var(--sp-2);
        padding-top: var(--sp-2);
        margin-top: var(--sp-1);
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--sp-1);
    }

    .auth-page .auth-flow {
        flex: 0 0 min(88vw, 22rem);
        scroll-snap-align: start;
        padding: var(--sp-2);
    }

    .auth-page .auth-flow-track {
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--sp-1);
    }

    .auth-page .auth-brand-sub {
        display: block;
        font-size: var(--fs-sm);
    }

    .auth-page .auth-flow-desc {
        display: none;
    }

    .auth-brand h1 {
        font-size: var(--fs-lg);
    }

    .auth-brand-lockup {
        margin-bottom: 0;
    }

    .auth-brand-logo {
        width: 32px;
        height: 32px;
    }

    .auth-brand-services {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--sp-1);
    }

    .auth-service-chip {
        flex: 1 1 100%;
        padding: var(--sp-1) var(--sp-2);
        font-size: 0.6875rem;
    }

    .auth-form-wrap {
        padding: var(--sp-4);
        align-items: flex-start;
        overflow: visible;
    }

    .auth-card {
        padding: var(--sp-5);
        max-width: 100%;
    }

    .auth-flow-track {
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        padding-bottom: var(--sp-1);
    }

    .auth-flow--compact .auth-flow-step {
        scroll-snap-align: start;
        min-width: 3.75rem;
    }

    .admin-nav-menu-btn {
        display: flex;
    }

    .admin-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(15, 23, 42, 0.45);
        cursor: pointer;
    }

    .admin-nav-check:checked ~ .admin-nav-backdrop {
        display: block;
    }

    .admin-sidebar {
        width: var(--sidebar-w);
        transform: translateX(calc(-100% * var(--drawer-dir, 1)));
        transition: transform 0.2s ease;
        z-index: 100;
    }

    [dir="rtl"] .admin-sidebar {
        --drawer-dir: -1;
        transform: translateX(calc(100% * var(--drawer-dir, 1)));
    }

    .admin-nav-check:checked ~ .admin-sidebar {
        transform: translateX(0);
    }

    .admin-main {
        margin-inline-start: 0;
    }

    .admin-shell .admin-content {
        padding: var(--sp-3) var(--sp-4) var(--sp-5);
    }
}

@media (min-width: 1366px) and (min-height: 900px) {
    .auth-brand {
        padding: var(--sp-8) var(--sp-8);
    }
}

@media (max-height: 800px) {
    .auth-brand {
        padding: var(--sp-3) var(--sp-4);
    }

    .auth-brand-inner {
        gap: var(--sp-2);
    }

    .auth-brand-lockup {
        margin-bottom: 0;
    }

    .auth-brand-logo {
        width: 34px;
        height: 34px;
    }

    .auth-brand h1 {
        font-size: var(--fs-lg);
    }

    .auth-brand-sub {
        font-size: var(--fs-sm);
        margin-top: 0;
    }

    .auth-brand-services {
        margin-top: var(--sp-1);
        gap: var(--sp-1);
    }

    .auth-service-chip {
        padding: var(--sp-1) var(--sp-2);
        font-size: 0.6875rem;
    }

    .auth-flows {
        padding-top: var(--sp-2);
        gap: var(--sp-1);
    }

    .auth-page .auth-flow {
        padding: var(--sp-2);
    }

    .auth-card {
        padding: var(--sp-5);
    }

    .auth-form-wrap {
        padding: var(--sp-3) var(--sp-5);
    }

    .auth-page .auth-flow--compact .auth-flow-icon {
        width: 1.45rem;
        height: 1.45rem;
    }

    .auth-page .auth-flow--compact .auth-flow-icon svg {
        width: 0.75rem;
        height: 0.75rem;
    }
}

@media (max-height: 500px) {
    .auth-page .auth-brand {
        display: none;
    }

    .auth-page .auth-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
}

@media (max-width: 600px) {
    .auth-page .auth-brand-desc {
        display: none;
    }

    .auth-page .auth-brand h1 {
        font-size: var(--fs-md);
    }

    .auth-card h2 {
        font-size: var(--fs-lg);
    }

    .admin-shell .admin-content {
        padding: var(--sp-4);
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }

    .admin-topbar {
        padding: 0 var(--sp-4);
    }
}

/* ── Dashboard v2 ── */
.ltr {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

.dash-kpi-below {
    margin-top: var(--sp-5);
    margin-bottom: var(--sp-4);
}

.dash-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
}

.dash-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-6);
    align-items: center;
    padding: var(--sp-2) var(--sp-4);
    margin-bottom: var(--sp-3);
    border-radius: var(--r-sm);
    background: var(--status-bar-bg);
    border: 1px solid var(--status-bar-border);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--text);
}

.dash-status-strip .ok { color: var(--status-ok); font-weight: var(--fw-medium); }
.dash-status-strip .off { color: var(--status-warn); font-weight: var(--fw-medium); }

.dash-status-strip--footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-5);
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--muted);
}

.dash-foot-stat {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    white-space: nowrap;
}

.dash-foot-stat.ok { color: var(--status-ok); font-weight: var(--fw-medium); }
.dash-foot-stat.off { color: var(--status-warn); font-weight: var(--fw-medium); }

.dash-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}

.dash-filter-btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--r-full);
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dash-filter-btn:hover {
    background: var(--nav-hover);
}

.dash-filter-btn.is-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.dash-badge-running {
    background: rgba(5, 150, 105, 0.15);
    color: var(--stat-ok);
}

.dash-badge-paused {
    background: var(--badge-off-bg);
    color: var(--muted);
}

.dash-gauge-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.dash-gauge-pct {
    grid-area: 1 / 1;
    z-index: 1;
    font-size: 0.5625rem;
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    line-height: 1;
    direction: ltr;
    unicode-bidi: embed;
    pointer-events: none;
    transform: translateY(3px);
}

.dash-gauge {
    position: relative;
    width: 48px;
    height: 30px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.dash-gauge svg {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.dash-gauge-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 5;
    stroke-linecap: round;
}

.dash-gauge-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s;
}

.dash-gauge-val {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--text);
    line-height: 1;
}

.dash-stats-cell {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    min-width: 0;
    max-width: none;
}

.dash-stats-cell:has(.dash-stats-empty) {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2);
}

.dash-stats-stack {
    display: flex;
    height: 0.55rem;
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--border);
}

.dash-stats-seg {
    height: 100%;
    min-width: 2px;
    transition: width 0.3s;
}

.dash-gauge-val {
    display: none;
}

.dash-stats-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

.dash-stats-row .dash-stats-stack {
    flex: 1 1 auto;
    min-width: 0;
}

.dash-stats-top {
    flex-shrink: 0;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    white-space: nowrap;
    line-height: 1.2;
}

.dash-stats-legend {
    display: none;
}

.dash-stats-legend span {
    white-space: nowrap;
}

.dash-stats-view {
    display: inline-block;
    margin-top: 0;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

.dash-stats-cell:not(:has(.dash-stats-empty)) .dash-stats-view {
    margin-top: 2px;
    font-size: var(--fs-xs);
}

.dash-stats-empty {
    font-size: var(--fs-sm);
    color: var(--muted);
    font-weight: var(--fw-medium);
}

table.dash-table tbody tr.dash-row-running {
    background: var(--dash-row-running-bg);
}

table.dash-table tbody tr.dash-row-idle {
    background: var(--dash-row-idle-bg);
}

.dash-poll-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: var(--r-full);
    background: var(--muted);
    margin-inline-end: var(--sp-1);
    vertical-align: middle;
}

.dash-poll-dot.is-live {
    background: var(--stat-ok);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.25);
}

@media (max-width: 600px) {
    .dash-stats-cell {
        min-width: 6rem;
        max-width: 10rem;
    }
}

/* ── Dashboard page: Campaigns teal theme ── */
body.dash-page .panel.dash-panel {
    padding: 0;
    overflow: hidden;
    border-radius: var(--r-md);
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--border);
}

body.dash-page .dash-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-3) var(--sp-5);
    background: var(--surface-elevated);
    color: var(--text);
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--sh-sm);
}

body.dash-page .dash-ami-beacon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--r-sm);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    cursor: default;
}

body.dash-page .dash-ami-beacon__lens {
    display: block;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

body.dash-page .dash-ami-beacon.is-ami-ok {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18), 0 0 0 2px rgba(34, 197, 94, 0.25);
}

body.dash-page .dash-ami-beacon.is-ami-ok .dash-ami-beacon__lens,
body.dash-page .dash-ami-beacon__lens.is-ami-ok {
    background: #22c55e;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 8px rgba(34, 197, 94, 0.95),
        0 0 14px rgba(34, 197, 94, 0.55);
}

body.dash-page .dash-ami-beacon.is-ami-off {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18), 0 0 0 2px rgba(239, 68, 68, 0.28);
}

body.dash-page .dash-ami-beacon.is-ami-off .dash-ami-beacon__lens,
body.dash-page .dash-ami-beacon__lens.is-ami-off {
    background: #ef4444;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 8px rgba(239, 68, 68, 0.95),
        0 0 14px rgba(239, 68, 68, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
    body.dash-page .dash-ami-beacon.is-ami-ok .dash-ami-beacon__lens {
        animation: dash-ami-beacon-pulse 2.4s ease-in-out infinite;
    }
}

@keyframes dash-ami-beacon-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(255, 255, 255, 0.9),
            0 0 8px rgba(34, 197, 94, 0.95),
            0 0 14px rgba(34, 197, 94, 0.55);
    }
    50% {
        box-shadow:
            0 0 0 2px rgba(255, 255, 255, 0.9),
            0 0 12px rgba(34, 197, 94, 1),
            0 0 20px rgba(34, 197, 94, 0.7);
    }
}

[data-theme="dark"] body.dash-page .dash-ami-beacon {
    background: var(--surface);
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.dash-page .dash-toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

body.dash-page .dash-toolbar-cluster {
    display: inline-flex;
    align-items: stretch;
    gap: var(--sp-2);
    padding: var(--sp-1);
    border-radius: var(--r-md);
    background: var(--status-bar-bg);
    border: 1px solid var(--border);
}

body.dash-page .dash-toolbar-stats {
    display: flex;
    align-items: stretch;
    gap: var(--sp-2);
    min-width: 0;
}

body.dash-page .dash-toolbar-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 6.5rem;
    min-height: 3rem;
    padding: var(--sp-2);
    border-radius: var(--r-sm);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--sh-sm);
}

body.dash-page .dash-toolbar-stat-val {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: 0.01em;
}

body.dash-page .dash-toolbar-stat-sub {
    font-size: var(--fs-sm);
    font-weight: var(--fw-normal);
    color: var(--muted);
}

body.dash-page .dash-toolbar-stat-lbl {
    font-size: 0.625rem;
    font-weight: var(--fw-medium);
    color: var(--muted);
    white-space: nowrap;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
}

body.dash-page .dash-toolbar-stat--ami {
    width: auto;
    min-width: 5.5rem;
    padding-inline: var(--sp-3);
}

body.dash-page .dash-toolbar-stat--ami.ok .dash-toolbar-stat-val {
    color: var(--status-ok);
}

body.dash-page .dash-toolbar-stat--ami.off .dash-toolbar-stat-val {
    color: var(--status-warn);
}

body.dash-page .dash-toolbar-start {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}

body.dash-page .dash-toolbar h1 {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--text);
    white-space: nowrap;
}

body.dash-page .dash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--r-sm);
    background: var(--status-bar-bg);
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: var(--fs-md);
    box-shadow: none;
}

body.dash-page .dash-body {
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
}

body.dash-page .dash-clock-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--sp-2);
}

body.dash-page .dash-clock {
    display: flex;
    gap: var(--sp-1);
    direction: ltr;
    unicode-bidi: embed;
    padding: var(--sp-1) var(--sp-2);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

body.dash-page .dash-clock-seg {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-sm);
}

body.dash-page .dash-clock-seg--hrs {
    background: var(--dash-clock-hrs-bg);
    color: var(--dash-table-head-fg);
}

body.dash-page .dash-clock-seg--min {
    background: var(--dash-clock-min-bg);
    color: var(--accent);
}

body.dash-page .dash-clock-seg--sec {
    background: var(--dash-clock-sec-bg);
    color: var(--dash-clock-sec-color);
}

body.dash-page .dash-clock-val {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    font-family: var(--font);
}

body.dash-page .dash-clock-lbl {
    margin-top: var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
    letter-spacing: 0.07em;
    opacity: 0.88;
}

body.dash-page .dash-clock-meta {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    direction: ltr;
    unicode-bidi: embed;
}

body.dash-page .dash-clock-ampm {
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.04em;
    color: var(--muted);
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 0;
    line-height: 1.3;
}

body.dash-page .dash-clock-tz {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.05em;
    color: var(--muted);
    text-transform: uppercase;
}

body.dash-page .dash-clock-live-dot {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: var(--r-full);
    background: var(--status-ok);
    box-shadow: 0 0 5px rgba(111, 212, 184, 0.4);
    flex-shrink: 0;
}

[data-theme="dark"] body.dash-page .dash-clock {
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

body.dash-page .dash-filters {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
    padding: var(--sp-2) var(--sp-3);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    gap: var(--sp-2);
}

body.dash-page .dash-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-height: 2rem;
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.dash-page .dash-filter-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body.dash-page .dash-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0 var(--sp-1);
    border-radius: var(--r-full);
    background: var(--badge-off-bg);
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

body.dash-page .dash-filter-btn.is-active .dash-filter-count {
    background: var(--accent-soft);
    color: var(--accent);
}

body.dash-page .dash-filter-btn.is-active {
    background: var(--dash-filter-active-bg);
    border-color: var(--accent);
    color: var(--dash-table-head-fg);
    font-weight: var(--fw-semibold);
    box-shadow: var(--sh-sm);
}

body.dash-page table.dash-table thead tr {
    background: var(--dash-table-head-bg);
}

body.dash-page table.dash-table th {
    border-bottom: 2px solid var(--accent);
    color: var(--dash-table-head-fg);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
}

body.dash-page table.dash-table th:nth-child(3) {
    text-align: start;
}

body.dash-page table.dash-table td:nth-child(2) {
    text-align: center;
}

body.dash-page table.dash-table td:nth-child(2) .dash-campaign-cell {
    align-items: center;
}

body.dash-page table.dash-table td:nth-child(1),
body.dash-page table.dash-table td:nth-child(4),
body.dash-page table.dash-table td:nth-child(5),
body.dash-page table.dash-table td:nth-child(6),
body.dash-page table.dash-table td:nth-child(7),
body.dash-page table.dash-table td:nth-child(8),
body.dash-page table.dash-table td:nth-child(9) {
    text-align: center;
}

body.dash-page table.dash-table td:nth-child(4),
body.dash-page table.dash-table td:nth-child(5),
body.dash-page table.dash-table td:nth-child(7),
body.dash-page table.dash-table td:nth-child(9) {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-medium);
}

body.dash-page table.dash-table tbody tr {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

body.dash-page table.dash-table tbody tr.dash-row-running {
    background: var(--dash-row-running-bg);
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off {
    background: var(--dash-row-schedule-off-bg);
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off td {
    opacity: 0.42;
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off td:has(.dash-time-cell) {
    opacity: 1;
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-ended {
    background: var(--dash-row-schedule-ended-bg);
    opacity: 0.72;
}

body.dash-page table.dash-table tbody tr.dash-row-idle {
    background: var(--dash-row-idle-bg);
}

body.dash-page table.dash-table tbody tr:hover {
    filter: none;
    box-shadow: inset 3px 0 0 var(--accent);
}

[dir="rtl"] body.dash-page table.dash-table tbody tr:hover {
    box-shadow: inset -3px 0 0 var(--accent);
}

body.dash-page table.dash-table tbody tr.dash-row-running:hover {
    background: var(--dash-row-running-hover-bg);
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off:hover {
    background: var(--dash-row-schedule-off-hover-bg);
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off:hover td {
    opacity: 0.42;
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-off:hover td:has(.dash-time-cell) {
    opacity: 1;
}

body.dash-page table.dash-table tbody tr.dash-row-schedule-ended:hover {
    background: var(--dash-row-schedule-ended-hover-bg);
    opacity: 0.78;
}

body.dash-page table.dash-table tbody tr.dash-row-idle:hover {
    background: var(--dash-row-idle-hover-bg);
}

body.dash-page table.dash-table tbody tr:not(.dash-row-running):not(.dash-row-idle):hover {
    background: var(--nav-hover);
}

body.dash-page .dash-status-strip--footer .ok {
    color: var(--status-ok);
}

body.dash-page table.dash-table {
    min-width: 52rem;
}

body.dash-page table.dash-table td code {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

body.dash-page .dash-campaign-badges {
    max-width: 100%;
    gap: var(--sp-1);
}

body.dash-page .dash-poll-dot {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

body.dash-page main.legacy-main {
    max-width: 1416px;
    margin: var(--sp-4) auto var(--sp-2);
    padding: 0 var(--sp-4) var(--sp-2);
}

body.dash-page .main-tabs {
    max-width: 1416px;
}

body.dash-page table.dash-table th,
body.dash-page table.dash-table td {
    padding: var(--sp-2) var(--sp-3);
}

body.dash-page table.dash-table .dash-stats-cell {
    min-width: 0;
    max-width: none;
}

body.dash-page .legacy-footer {
    padding: var(--sp-2) var(--sp-4) var(--sp-3);
}

/* Dashboard polish: badges, controls, footer */
body.dash-page .dash-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 2px var(--sp-2);
    border-radius: var(--r-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: 1.2;
    border: 1px solid transparent;
    white-space: nowrap;
}

body.dash-page .dash-badge::before {
    content: '';
    width: 0.42rem;
    height: 0.42rem;
    border-radius: var(--r-full);
    flex-shrink: 0;
}

body.dash-page .dash-badge-running {
    background: rgba(15, 118, 110, 0.12);
    color: var(--preview-code);
    border-color: rgba(15, 118, 110, 0.22);
}

body.dash-page .dash-badge-running::before {
    background: var(--ok);
}

body.dash-page .dash-badge-paused {
    background: var(--badge-off-bg);
    color: var(--muted);
    border-color: var(--border);
}

body.dash-page .dash-badge-paused::before {
    background: var(--muted);
}

body.dash-page .dash-badge-schedule-ok {
    background: #e6f4f1;
    color: var(--preview-code);
    border-color: rgba(15, 118, 110, 0.2);
}

body.dash-page .dash-badge-schedule-ok::before {
    background: var(--accent);
}

body.dash-page .dash-badge-schedule-off {
    background: var(--badge-off-bg);
    color: var(--muted);
    border-color: var(--border);
}

body.dash-page .dash-badge-schedule-off::before {
    background: var(--muted);
    opacity: 0.55;
}

body.dash-page .dash-badge-finished {
    background: rgba(180, 83, 9, 0.1);
    color: var(--status-warn);
    border-color: rgba(180, 83, 9, 0.22);
}

body.dash-page .dash-badge-finished::before {
    background: var(--status-warn);
}

body.dash-page .dash-control-btn {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(15, 118, 110, 0.14);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

body.dash-page .dash-control-icon {
    display: block;
    flex-shrink: 0;
}

body.dash-page .dash-control-btn:hover:not(:disabled) {
    background: var(--accent-soft);
}

body.dash-page .dash-control-btn.is-pause {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

body.dash-page .dash-control-btn.is-pause:hover:not(:disabled) {
    background: var(--accent-hover);
    color: #fff;
}

body.dash-page .dash-filter-btn:hover {
    border-color: var(--accent);
    background: rgba(230, 244, 241, 0.65);
    color: var(--nav-active-color);
}

body.dash-page .dash-time-cell {
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-medium);
    white-space: nowrap;
    color: var(--preview-code);
}

body.dash-page .dash-time-cell.is-open {
    color: var(--ok);
}

body.dash-page .dash-time-cell.is-closed {
    color: var(--muted);
    font-weight: var(--fw-normal);
    font-size: var(--fs-xs);
}

body.dash-page .dash-time-cell.is-urgent {
    color: var(--danger);
}

body.dash-page .dash-time-cell.is-ended {
    color: var(--muted);
    font-size: var(--fs-xs);
}

body.dash-page .dash-time-cell.is-ended-today {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    color: var(--muted);
    font-size: var(--fs-xs);
    line-height: 1.25;
    white-space: normal;
}

body.dash-page .dash-time-cell.is-ended-today .dash-time-cell-primary {
    font-weight: var(--fw-medium);
    color: var(--muted);
    font-size: var(--fs-sm);
}

body.dash-page .dash-time-cell.is-ended-today .dash-time-cell-sub {
    font-size: var(--fs-xs);
    color: var(--muted);
    opacity: 0.85;
}

body.dash-page .dash-badge-schedule-ended {
    background: var(--badge-off-bg);
    color: var(--muted);
}

body.dash-page .dash-badge-schedule-ended::before {
    content: '';
    display: inline-block;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--muted);
    margin-inline-end: var(--sp-1);
    vertical-align: middle;
}

body.dash-page .dash-control-btn.is-schedule-ended {
    opacity: 0.45;
    cursor: not-allowed;
}

body.dash-page .dash-campaign-card--schedule-ended {
    opacity: 0.72;
    background: var(--dash-row-schedule-ended-bg);
}

body.dash-page .dash-campaign-card--schedule-off {
    background: var(--dash-row-schedule-off-bg);
}

body.dash-page .dash-campaign-card--schedule-off .dash-campaign-card-head,
body.dash-page .dash-campaign-card--schedule-off .dash-campaign-card-foot,
body.dash-page .dash-campaign-card--schedule-off .dash-campaign-card-metrics,
body.dash-page .dash-campaign-card--schedule-off .dash-campaign-card-row:not(.dash-campaign-card-row--time),
body.dash-page .dash-campaign-card--schedule-off .dash-campaign-card-stats {
    opacity: 0.42;
}

body.dash-page .dash-stats-view {
    color: var(--accent);
    font-weight: var(--fw-medium);
    text-decoration: none;
    font-size: var(--fs-xs);
}

body.dash-page .dash-stats-view:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

body.dash-page .dash-footer-meta {
    margin-top: var(--sp-3);
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(15, 118, 110, 0.14);
    gap: var(--sp-2);
}

body.dash-page .dash-footer-live-cluster {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-3) var(--sp-6);
    width: 100%;
}

body.dash-page .dash-poll-live {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    color: var(--text);
    font-weight: var(--fw-medium);
    font-size: var(--fs-base);
    flex-shrink: 0;
}

body.dash-page .dash-status-strip--footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-5);
    flex: 1;
    min-width: 12rem;
}

body.dash-page .dash-foot-stat {
    white-space: nowrap;
    font-size: var(--fs-base);
}

body.dash-page .dash-foot-stat.ok {
    color: var(--status-ok);
    font-weight: var(--fw-normal);
}

body.dash-page .dash-foot-stat.off {
    color: var(--status-warn);
    font-weight: var(--fw-normal);
}

body.dash-page #dashPollWrap {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-weight: var(--fw-normal);
}

body.dash-page .dash-poll-dot.is-live {
    background: var(--status-ok);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

[data-theme="dark"] body.dash-page .dash-badge-running {
    background: var(--badge-bg);
    color: var(--badge-text);
    border-color: var(--alert-ok-border);
}

[data-theme="dark"] body.dash-page .dash-badge-schedule-ok {
    background: var(--nav-active-bg);
    color: var(--badge-text);
    border-color: var(--badge-bg);
}

[data-theme="dark"] body.dash-page .dash-time-cell {
    color: var(--badge-text);
}

[data-theme="dark"] body.dash-page .dash-footer-meta {
    border-top-color: var(--status-bar-bg);
}

/* Dashboard dark mode polish */
[data-theme="dark"] body.dash-page .panel.dash-panel {
    border-color: var(--status-bar-bg);
}

[data-theme="dark"] body.dash-page .dash-toolbar {
    background: var(--surface-elevated);
    border-bottom-color: var(--accent);
    color: var(--text);
    box-shadow: var(--sh-sm);
}

[data-theme="dark"] body.dash-page .dash-toolbar-cluster {
    background: var(--status-bar-bg);
    border-color: var(--border);
}

[data-theme="dark"] body.dash-page .dash-toolbar-stat {
    background: var(--surface);
    border-color: var(--border);
}

[data-theme="dark"] body.dash-page .dash-toolbar-stat-val {
    color: var(--text);
}

[data-theme="dark"] body.dash-page .dash-toolbar-stat-lbl,
[data-theme="dark"] body.dash-page .dash-toolbar-stat-sub {
    color: var(--muted);
}

[data-theme="dark"] body.dash-page .dash-clock-ampm,
[data-theme="dark"] body.dash-page .dash-clock-tz {
    color: var(--muted);
}

[data-theme="dark"] body.dash-page .dash-alert {
    background: var(--dash-row-idle-bg);
    border-color: rgba(232, 201, 106, 0.28);
    color: var(--status-warn);
}

[data-theme="dark"] body.dash-page .dash-alert::before {
    box-shadow: 0 0 0 2px rgba(232, 201, 106, 0.2);
}

[data-theme="dark"] body.dash-page .dash-campaign-card {
    background: var(--surface-elevated);
}

[data-theme="dark"] body.dash-page .dash-campaign-card--running {
    background: var(--dash-row-running-bg);
    border-color: var(--status-bar-border);
}

[data-theme="dark"] body.dash-page .dash-campaign-card-metric,
[data-theme="dark"] body.dash-page .dash-campaign-card-row--time {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] body.dash-page .dash-filter-btn.is-active {
    background: var(--dash-filter-active-bg);
    border-color: var(--accent);
    color: var(--badge-text);
}

[data-theme="dark"] body.dash-page .dash-filter-btn:hover {
    background: var(--nav-active-bg);
    border-color: var(--accent);
    color: var(--badge-text);
}

[data-theme="dark"] body.dash-page .dash-badge-paused {
    border-color: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] body.dash-page .dash-badge-finished {
    background: var(--dash-row-idle-bg);
    color: var(--status-warn);
    border-color: rgba(232, 201, 106, 0.22);
}

[data-theme="dark"] body.dash-page .dash-badge-finished::before {
    background: var(--status-warn);
}

[data-theme="dark"] body.dash-page .dash-control-btn {
    background: rgba(45, 212, 191, 0.08);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] body.dash-page .dash-control-btn:hover:not(:disabled) {
    background: rgba(45, 212, 191, 0.18);
}

[data-theme="dark"] body.dash-page .dash-control-btn.is-pause {
    background: var(--accent);
    color: var(--text);
    border-color: var(--accent);
}

[data-theme="dark"] body.dash-page .dash-control-btn.is-pause:hover:not(:disabled) {
    background: var(--accent-hover);
    color: var(--text);
}

[data-theme="dark"] body.dash-page .dash-poll-dot.is-live {
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.28);
}

[data-theme="dark"] body.dash-page .dash-gauge-track {
    stroke: rgba(148, 163, 184, 0.35);
}

[data-theme="dark"] body.dash-page .dash-stats-stack {
    background: rgba(148, 163, 184, 0.25);
}

/* Dashboard RTL polish */
[dir="rtl"] body.dash-page .dash-toolbar {
    direction: rtl;
}

[dir="rtl"] body.dash-page .dash-toolbar-center {
    flex-direction: row;
}

[dir="rtl"] body.dash-page .dash-toolbar-cluster {
    flex-direction: row;
}

[dir="rtl"] body.dash-page .dash-toolbar-stats {
    flex-direction: row;
}

[dir="rtl"] body.dash-page .dash-filters {
    justify-content: flex-start;
}

[dir="rtl"] body.dash-page table.dash-table th {
    text-align: center;
}

[dir="rtl"] body.dash-page table.dash-table td {
    text-align: start;
}

[dir="rtl"] body.dash-page .dash-stats-legend {
    justify-content: flex-start;
}

[dir="rtl"] body.dash-page .dash-clock-tz {
    text-transform: none;
    letter-spacing: 0.02em;
}

/* Dashboard insights strip */
body.dash-page .dash-insights-wrap {
    margin-bottom: var(--sp-3);
}

body.dash-page .dash-insights-head {
    margin-bottom: var(--sp-2);
}

body.dash-page .dash-insights-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-normal);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nav-active-color);
}

body.dash-page .dash-insights {
    display: flex;
    gap: var(--sp-2);
    overflow-x: auto;
    padding-bottom: var(--sp-1);
    scroll-snap-type: x proximity;
}

body.dash-page .dash-insight {
    flex: 0 0 min(100%, 17rem);
    scroll-snap-align: start;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

body.dash-page .dash-insight--critical {
    border-color: var(--alert-err-border);
    background: rgba(194, 65, 12, 0.06);
}

body.dash-page .dash-insight--warn {
    border-color: rgba(180, 83, 9, 0.3);
    background: rgba(254, 243, 199, 0.45);
}

body.dash-page .dash-insight--info {
    border-color: rgba(15, 118, 110, 0.25);
    background: rgba(230, 244, 241, 0.65);
}

body.dash-page .dash-insight-icon {
    font-size: var(--fs-lg);
    line-height: 1;
    flex-shrink: 0;
}

body.dash-page .dash-insight-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    font-size: var(--fs-sm);
    color: var(--text);
}

body.dash-page .dash-insight-text strong {
    font-size: var(--fs-sm);
}

body.dash-page .dash-insight-actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    flex-shrink: 0;
}

body.dash-page .dash-insight-link,
body.dash-page .dash-insight-dismiss {
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
    text-decoration: none;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

body.dash-page .dash-insight-dismiss {
    color: var(--muted);
}

body.dash-page .dash-insight-link:hover {
    text-decoration: underline;
}

body.dash-page .dash-badge-eta {
    background: rgba(14, 138, 154, 0.1);
    color: var(--accent-secondary-hover);
    border-color: rgba(14, 138, 154, 0.22);
}

body.dash-page .dash-badge-eta::before {
    background: var(--accent-secondary);
}

/* Dashboard AI summary panel */
body.dash-page .dash-ai-panel {
    margin-bottom: var(--sp-3);
    padding: var(--sp-3) var(--sp-3);
    border-radius: var(--r-md);
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: linear-gradient(135deg, rgba(230, 244, 241, 0.8), rgba(255, 255, 255, 0.95));
}

body.dash-page .dash-ai-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

body.dash-page .dash-ai-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    color: var(--nav-active-color);
}

body.dash-page .dash-ai-refresh {
    appearance: none;
    border: 1px solid var(--accent);
    background: var(--surface);
    color: var(--accent);
    border-radius: var(--r-sm);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-normal);
    cursor: pointer;
    font-family: inherit;
}

body.dash-page .dash-ai-refresh:hover:not(:disabled) {
    background: var(--accent-soft);
}

body.dash-page .dash-ai-refresh:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.dash-page .dash-ai-summary {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-base);
    line-height: 1.45;
    color: var(--text);
}

body.dash-page .dash-ai-bullets {
    margin: 0 0 var(--sp-2);
    padding-inline-start: var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--muted);
}

body.dash-page .dash-ai-bullets li {
    margin-bottom: var(--sp-1);
}

body.dash-page .dash-ai-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-4);
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
    color: var(--muted);
}

body.dash-page .dash-ai-source {
    color: var(--accent);
    font-weight: var(--fw-normal);
}

body.dash-page .dash-ai-shimmer {
    font-size: var(--fs-sm);
    color: var(--muted);
    animation: dash-shimmer 1.2s ease-in-out infinite;
}

@keyframes dash-shimmer {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}

body.dash-page .dash-skeleton {
    height: 2.5rem;
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--border) 25%, var(--nav-hover) 50%, var(--border) 75%);
    background-size: 200% 100%;
    animation: dash-skel 1.2s ease-in-out infinite;
}

@keyframes dash-skel {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
    body.dash-page .dash-stats-legend {
        display: none;
    }

    body.dash-page table.dash-table th {
        font-size: var(--fs-sm);
    }
}

[data-theme="dark"] body.dash-page .dash-insights-title,
[data-theme="dark"] body.dash-page .dash-ai-title {
    color: var(--badge-text);
}

[data-theme="dark"] body.dash-page .dash-insight--info {
    background: var(--nav-active-bg);
}

[data-theme="dark"] body.dash-page .dash-insight--warn {
    background: var(--dash-row-idle-bg);
}

[data-theme="dark"] body.dash-page .dash-ai-panel {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.15), rgba(21, 31, 50, 0.9));
    border-color: rgba(45, 212, 191, 0.15);
}

/* Numbers page — compact dense layout */
body.numbers-page-fit .panel.numbers-page {
    padding: var(--sp-3) var(--sp-3);
    margin-bottom: 0;
}

.numbers-page .btn-sm {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    line-height: 1.35;
}

.numbers-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.numbers-title {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: 1.25;
}

.numbers-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-3);
    margin-top: var(--sp-1);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.numbers-stats strong {
    color: var(--text);
    font-weight: var(--fw-medium);
}

.numbers-alert {
    margin-bottom: var(--sp-2);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
}

.numbers-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1);
    margin-bottom: var(--sp-2);
    padding: var(--sp-1) var(--sp-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
    background: var(--card-bg, #fafafa);
}

.numbers-select {
    height: 28px;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    max-width: 11rem;
}

.numbers-search {
    height: 28px;
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    min-width: 10rem;
    max-width: 14rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
}

.numbers-hint-link {
    font-size: var(--fs-sm);
    color: var(--muted);
    margin-inline-start: auto;
}

.numbers-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1);
    margin-bottom: var(--sp-1);
}

.numbers-select-all-note {
    margin: 0 0 var(--sp-1);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-xs);
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
}

.numbers-empty {
    margin: var(--sp-2) 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.numbers-table-scroll {
    overflow: auto;
    margin-top: 0;
    border-radius: var(--radius-sm, 4px);
}

.numbers-dense-table {
    font-size: var(--fs-sm);
}

.numbers-dense-table thead th {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-xs);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card-bg);
}

.numbers-dense-table tbody td {
    padding: var(--sp-1) var(--sp-2);
    line-height: 1.25;
    vertical-align: middle;
}

.numbers-dense-table tbody tr:nth-child(even) {
    background: var(--nav-hover, #f7f7f7);
}

.numbers-dense-table .col-check {
    width: 26px;
    text-align: center;
}

.numbers-dense-table .col-campaign {
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.numbers-dense-table .col-cid {
    max-width: 5.5rem;
}

.numbers-dense-table .col-dest {
    min-width: 6.5rem;
}

.numbers-dense-table .col-name {
    max-width: 6rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.numbers-dense-table .col-result {
    max-width: 5.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.numbers-dense-table .col-status {
    width: 4.5rem;
}

.numbers-dense-table .col-retries {
    width: 2.2rem;
    text-align: center;
}

.numbers-dense-table .col-time {
    width: 8.5rem;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.numbers-num {
    font-family: Consolas, "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    font-weight: var(--fw-medium);
    font-size: var(--fs-sm);
}

.num-status {
    display: inline-block;
    padding: var(--sp-1) var(--sp-1);
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    line-height: 1.3;
    white-space: nowrap;
}

.num-status--pending { background: var(--num-pending-bg); color: var(--num-pending-fg); }
.num-status--dialing { background: var(--num-dialing-bg); color: var(--num-dialing-fg); }
.num-status--done { background: var(--num-done-bg); color: var(--num-done-fg); }
.num-status--failed { background: var(--num-failed-bg); color: var(--num-failed-fg); }
.num-status--skipped { background: var(--num-skipped-bg); color: var(--num-skipped-fg); }

.numbers-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-4);
    margin-top: var(--sp-1);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.numbers-pagination {
    display: flex;
    gap: var(--sp-1);
    margin-inline-start: auto;
}

/* Numbers expandable report */
.numbers-report-table .num-col-expand {
    width: 1.6rem;
    text-align: center;
    vertical-align: middle;
}

.num-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--bg, #fff);
    font-size: var(--fs-sm);
    line-height: 1;
    font-weight: var(--fw-medium);
    cursor: pointer;
}

.num-expand-btn:hover {
    background: var(--nav-hover);
}

.num-detail-row td {
    background: var(--panel-alt, #f4f6f8);
    padding: var(--sp-1) var(--sp-2);
}

.num-detail-panel {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: var(--sp-2) var(--sp-2);
    background: var(--bg, #fff);
}

.num-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-1) var(--sp-3);
    margin-bottom: var(--sp-1);
    font-size: var(--fs-sm);
}

.num-detail-meta {
    color: var(--muted);
    font-size: var(--fs-sm);
}

.num-attempts-table {
    margin-top: var(--sp-1);
    font-size: var(--fs-sm);
}

.num-attempts-table th,
.num-attempts-table td {
    padding: var(--sp-1) var(--sp-1);
}

.num-detail-note,
.num-detail-error,
.num-detail-loading {
    margin: 0;
    font-size: var(--fs-sm);
}

[data-theme="dark"] .num-detail-row td {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .num-detail-panel {
    background: var(--panel);
}

@media (max-width: 992px) {
    .numbers-filters {
        align-items: stretch;
    }

    .numbers-hint-link {
        margin-inline-start: 0;
    }
}

/* ============================================================
   Consolidated inline styles (Phase 2)
   ============================================================ */

/* --- templates/admin/layout.php --- */
* { box-sizing: border-box; }
        body {
            margin: 0;
            min-height: 100vh;
            font-family: var(--font);
            font-weight: var(--fw-normal);
            -webkit-font-smoothing: antialiased;
            background: var(--bg);
            color: var(--text);
        }
        header.legacy-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--sp-4) var(--sp-6);
            border-bottom: 1px solid var(--border);
            background: var(--header-bg);
            backdrop-filter: blur(8px);
            gap: var(--sp-4);
            flex-wrap: wrap;
        }
        header.legacy-header .brand {
            font-weight: var(--fw-medium);
            font-size: var(--fs-lg);
            letter-spacing: 0.02em;
        }
header.legacy-header .brand span { color: var(--accent); }
        header.legacy-header .header-end {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: var(--sp-3) var(--sp-4);
        }
        header.legacy-header nav {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: var(--sp-1) var(--sp-3);
        }
        header.legacy-header nav a {
            color: var(--muted);
            text-decoration: none;
            font-size: var(--fs-md);
            font-weight: var(--fw-medium);
            padding: var(--sp-1) var(--sp-2);
            border-radius: var(--r-sm);
        }
header.legacy-header nav a:hover { color: var(--text); background: var(--nav-hover); }
        header.legacy-header nav a.active {
            color: var(--nav-active-color);
            background: var(--nav-active-bg);
            font-weight: var(--fw-medium);
        }
        .ui-prefs {
            display: flex;
            align-items: center;
            gap: var(--sp-1);
        }
        .ui-prefs a {
            color: var(--text);
            text-decoration: none;
            font-size: var(--fs-sm);
            font-weight: var(--fw-medium);
            padding: var(--sp-1) var(--sp-2);
            border-radius: var(--r-sm);
            border: 1px solid var(--border);
            background: var(--surface);
        }
.ui-prefs a:hover { border-color: var(--accent); color: var(--accent); }
        .ui-prefs a.active {
            color: #fff;
            background: var(--accent);
            border-color: var(--accent);
        }
        main {
            max-width: 920px;
            margin: var(--sp-10) auto;
            padding: 0 var(--sp-5) var(--sp-10);
        }
        body.supervisor-wide main {
            max-width: 1180px;
            margin: var(--sp-6) auto;
            padding: 0 var(--sp-4) var(--sp-8);
        }
        .panel {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: var(--r-md);
            padding: var(--sp-6) var(--sp-6);
            box-shadow: var(--panel-shadow);
        }
        h1 {
            margin: 0 0 var(--sp-1);
            font-size: var(--fs-xl);
            font-weight: var(--fw-semibold);
        }
        h2 {
            margin: 0 0 var(--sp-3);
            font-size: var(--fs-lg);
            font-weight: var(--fw-medium);
            color: var(--text);
        }
        .settings-section {
            padding: var(--sp-5) 0 var(--sp-1);
            border-top: 1px solid var(--border);
            margin-top: var(--sp-5);
        }
        .settings-section:first-of-type {
            border-top: none;
            margin-top: 0;
            padding-top: 0;
        }
        .section-intro {
            margin: 0 0 var(--sp-4);
            color: var(--muted);
            font-size: var(--fs-base);
            line-height: 1.5;
        }
        .preview-box {
            margin-bottom: var(--sp-5);
            padding: var(--sp-4) var(--sp-4);
            border-radius: var(--r-sm);
            border: 1px solid rgba(42, 157, 143, 0.45);
            background: rgba(42, 157, 143, 0.1);
        }
        .preview-label {
            font-size: var(--fs-sm);
            color: var(--accent);
            margin-bottom: var(--sp-2);
            font-weight: var(--fw-normal);
        }
        .preview-box code {
            display: block;
            font-size: var(--fs-md);
            color: var(--preview-code);
            word-break: break-all;
            direction: ltr;
            text-align: left;
        }
        .subtitle {
            margin: 0 0 var(--sp-6);
            color: var(--muted);
            font-size: var(--fs-md);
            font-weight: var(--fw-normal);
            line-height: 1.5;
        }
        label {
            display: block;
            margin-bottom: var(--sp-1);
            font-size: var(--fs-base);
            font-weight: var(--fw-normal);
            color: var(--text);
        }
.field { margin-bottom: var(--sp-4); }
        input[type="text"],
        input[type="password"],
        input[type="number"],
        input[type="file"],
        select {
            width: 100%;
            padding: var(--sp-3) var(--sp-3);
            border: 1px solid var(--border);
            border-radius: var(--r-sm);
            background: var(--input-bg);
            color: var(--text);
            font-size: var(--fs-md);
            font-family: inherit;
        }
        select[multiple] {
            min-height: 8rem;
        }
        input:focus, select:focus {
            outline: 2px solid rgba(42, 157, 143, 0.45);
            border-color: var(--accent);
        }
        .hint {
            margin-top: var(--sp-1);
            font-size: var(--fs-sm);
            color: var(--muted);
        }
        .actions {
            display: flex;
            gap: var(--sp-3);
            align-items: center;
            margin-top: var(--sp-6);
            flex-wrap: wrap;
        }
        button, .btn {
            appearance: none;
            border: none;
            border-radius: var(--r-sm);
            padding: var(--sp-3) var(--sp-5);
            font-size: var(--fs-md);
            font-family: inherit;
            cursor: pointer;
            background: var(--accent);
            color: #fff;
            font-weight: var(--fw-medium);
            text-decoration: none;
            display: inline-block;
        }
button:hover, .btn:hover { background: var(--accent-hover); }
        button:disabled, .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .btn-secondary {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text);
        }
.btn-secondary:hover { border-color: var(--muted); background: var(--nav-hover); }
        .btn-danger {
            background: transparent;
            border: 1px solid rgba(231, 111, 81, 0.55);
            color: var(--btn-danger-color);
        }
.btn-danger:hover { background: rgba(231, 111, 81, 0.12); }
        .alert {
            padding: var(--sp-3) var(--sp-4);
            border-radius: var(--r-sm);
            margin-bottom: var(--sp-5);
            font-size: var(--fs-md);
            line-height: 1.45;
        }
        .alert-ok {
            background: var(--alert-ok-bg);
            border: 1px solid var(--alert-ok-border);
            color: var(--alert-ok-text);
        }
        .alert-err {
            background: var(--alert-err-bg);
            border: 1px solid var(--alert-err-border);
            color: var(--alert-err-text);
        }
        .secret-row {
            display: flex;
            gap: var(--sp-2);
            align-items: stretch;
        }
.secret-row input { flex: 1; }
        .secret-row .btn-secondary {
            white-space: nowrap;
            padding: var(--sp-3) var(--sp-4);
        }
        .check {
            display: flex;
            align-items: center;
            gap: var(--sp-2);
            margin-top: var(--sp-2);
            color: var(--muted);
            font-size: var(--fs-base);
        }
.check input { width: auto; }
        .checks-grid {
            display: grid;
            gap: var(--sp-1);
        }
.table-wrap { overflow-x: auto; margin-top: var(--sp-4); }
        table.data {
            width: 100%;
            border-collapse: collapse;
            font-size: var(--fs-base);
        }
        table.data th, table.data td {
            text-align: start;
            padding: var(--sp-3) var(--sp-2);
            border-bottom: 1px solid var(--border);
            vertical-align: top;
        }
        table.data th {
            color: var(--text);
            font-weight: var(--fw-medium);
            font-size: var(--fs-base);
        }
        .badge {
            display: inline-block;
            padding: var(--sp-1) var(--sp-2);
            border-radius: var(--r-full);
            font-size: var(--fs-sm);
            background: var(--badge-bg);
            color: var(--badge-text);
            margin: var(--sp-1);
        }
        .badge-off {
            background: var(--badge-off-bg);
            color: var(--muted);
        }
        .row-actions {
            display: flex;
            gap: var(--sp-2);
            flex-wrap: wrap;
        }
.row-actions form { display: inline; }
        .toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: var(--sp-3);
            flex-wrap: wrap;
            margin-bottom: var(--sp-4);
        }
        .settings-block {
            margin-top: var(--sp-5);
            padding: var(--sp-5) var(--sp-4);
            border: 1px solid var(--border);
            border-radius: var(--r-md);
            background: var(--card-bg);
        }
.settings-block:first-of-type { margin-top: var(--sp-2); }
        .settings-block-head {
            margin-bottom: var(--sp-4);
            padding-bottom: var(--sp-3);
            border-bottom: 1px solid var(--border);
        }
.settings-block-head h2 { margin: 0 0 var(--sp-2); }
        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: var(--sp-3) var(--sp-4);
            margin-bottom: var(--sp-2);
        }
        footer {
            text-align: center;
            color: var(--muted);
            font-size: var(--fs-sm);
            padding-bottom: var(--sp-8);
        }
        code.ltr {
            direction: ltr;
            unicode-bidi: embed;
        }
        .cards {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: var(--sp-3);
            margin: var(--sp-4) 0 var(--sp-2);
        }
        .card-link {
            display: block;
            padding: var(--sp-4);
            border-radius: var(--r-md);
            border: 1px solid var(--border);
            background: var(--card-bg);
            color: var(--text);
            text-decoration: none;
            transition: border-color 0.15s, background 0.15s;
        }
        .card-link:hover {
            border-color: var(--accent);
            background: rgba(42, 157, 143, 0.12);
        }
        .card-link .card-title {
            font-weight: var(--fw-medium);
            margin-bottom: var(--sp-1);
        }
        .card-link .card-desc {
            font-size: var(--fs-base);
            color: var(--muted);
            line-height: 1.4;
        }
        .status-bar {
            display: flex;
            flex-wrap: wrap;
            gap: var(--sp-2) var(--sp-4);
            padding: var(--sp-3) var(--sp-4);
            border-radius: var(--r-sm);
            border: 1px solid var(--border);
            background: var(--status-bg);
            margin-bottom: var(--sp-5);
            font-size: var(--fs-base);
            font-weight: var(--fw-medium);
        }
.status-bar .ok { color: var(--status-ok); font-weight: var(--fw-medium); }
.status-bar .warn { color: var(--status-warn); font-weight: var(--fw-medium); }
.status-bar .off { color: var(--muted); }
a { color: var(--accent); }

        /* Supervisor main tabs — see unified .app-tabs / .main-tabs above */

        .header-logout {
            color: var(--text);
            text-decoration: none;
            font-size: var(--fs-base);
            font-weight: var(--fw-medium);
            padding: var(--sp-1) var(--sp-2);
            border-radius: var(--r-sm);
        }
        .header-logout:hover {
            color: var(--text);
            background: var(--nav-hover);
        }

        /* Compact admin-only layout (supervisor pages unchanged) */
        .admin-shell {
            --ui-pad: 0.65rem;
            --ui-gap: 0.5rem;
            --ui-font: 0.875rem;
        }
        .admin-shell header.legacy-header {
            padding: var(--sp-2) var(--sp-4);
            gap: var(--sp-2);
        }
.admin-shell header.legacy-header .brand { font-size: var(--fs-md); }
        .admin-shell header.legacy-header nav a {
            font-size: var(--fs-base);
            padding: var(--sp-1) var(--sp-2);
        }
        .admin-shell .ui-prefs a {
            font-size: var(--fs-sm);
            padding: var(--sp-1) var(--sp-2);
            font-weight: var(--fw-medium);
        }
        .admin-shell main {
            max-width: 1180px;
            margin: var(--sp-4) auto;
            padding: 0 var(--sp-4) var(--sp-5);
        }
        .admin-shell .panel {
            padding: var(--sp-4) var(--sp-4);
            border-radius: var(--r-md);
        }
        .admin-shell h1 {
            font-size: var(--fs-lg);
            margin-bottom: var(--sp-1);
            font-weight: var(--fw-semibold);
        }
        .admin-shell h2 {
            font-size: var(--fs-md);
            margin-bottom: var(--sp-2);
        }
        .admin-shell .subtitle {
            margin-bottom: var(--sp-3);
            font-size: var(--fs-base);
            line-height: 1.35;
        }
        .admin-shell .section-intro {
            margin-bottom: var(--sp-2);
            font-size: var(--fs-sm);
            line-height: 1.35;
        }
        .admin-shell .settings-section {
            padding: var(--sp-3) 0 var(--sp-1);
            margin-top: var(--sp-3);
        }
.admin-shell label { font-size: var(--fs-sm); margin-bottom: var(--sp-1); }
.admin-shell .field { margin-bottom: var(--sp-2); }
        .admin-shell input[type="text"],
        .admin-shell input[type="password"],
        .admin-shell input[type="number"],
        .admin-shell input[type="file"],
        .admin-shell select {
            padding: var(--sp-2) var(--sp-2);
            font-size: var(--fs-base);
            border-radius: var(--r-sm);
        }
.admin-shell select[multiple] { min-height: 5rem; }
        .admin-shell .hint {
            font-size: var(--fs-sm);
            margin-top: var(--sp-1);
            line-height: 1.3;
        }
        .admin-shell .actions {
            gap: var(--sp-2);
            margin-top: var(--sp-3);
        }
        .admin-shell button,
        .admin-shell .btn {
            padding: var(--sp-2) var(--sp-3);
            font-size: var(--fs-base);
            border-radius: var(--r-sm);
        }
.admin-shell .secret-row .btn-secondary { padding: var(--sp-2) var(--sp-3); }
        .admin-shell .alert {
            padding: var(--sp-2) var(--sp-3);
            margin-bottom: var(--sp-3);
            font-size: var(--fs-base);
            line-height: 1.35;
        }
        .admin-schema-notice {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: var(--sp-2);
            background: rgba(184, 138, 26, 0.12);
            border: 1px solid rgba(184, 138, 26, 0.35);
            color: var(--text);
        }
        .admin-schema-notice-link {
            font-weight: 600;
            color: var(--accent);
            text-decoration: none;
        }
        .admin-schema-notice-link:hover {
            text-decoration: underline;
        }
        .admin-nav-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 1.25rem;
            height: 1.25rem;
            padding: 0 0.35rem;
            margin-inline-start: auto;
            border-radius: 999px;
            font-size: 0.7rem;
            font-weight: 700;
            line-height: 1;
            background: rgba(184, 138, 26, 0.2);
            color: #9a6b14;
        }
        .admin-sidebar-nav a {
            position: relative;
        }
.admin-shell .check { font-size: var(--fs-sm); margin-top: var(--sp-1); gap: var(--sp-1); }
.admin-shell .checks-grid { gap: var(--sp-1); }
.admin-shell .table-wrap { margin-top: var(--sp-2); }
        .admin-shell table.data {
            font-size: var(--fs-base);
        }
        .admin-shell table.data th,
        .admin-shell table.data td {
            padding: var(--sp-2) var(--sp-2);
        }
.admin-shell table.data th { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
        .admin-shell table.data.table-compact th,
        .admin-shell table.data.table-compact td {
            padding: var(--sp-1) var(--sp-1);
            font-size: var(--fs-sm);
        }
        .admin-shell table.data.table-compact .badge {
            font-size: var(--fs-sm);
            padding: var(--sp-1) var(--sp-1);
            margin: var(--sp-1);
        }
        .admin-shell .badge {
            font-size: var(--fs-sm);
            font-weight: var(--fw-medium);
            padding: var(--sp-1) var(--sp-1);
        }
.admin-shell .row-actions { gap: var(--sp-1); }
.admin-shell .row-actions .btn { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); }
.admin-shell .toolbar { margin-bottom: var(--sp-2); gap: var(--sp-2); }
        .admin-shell .settings-block {
            margin-top: var(--sp-3);
            padding: var(--sp-3) var(--sp-3);
            border-radius: var(--r-sm);
        }
        .admin-shell .settings-block-head {
            margin-bottom: var(--sp-2);
            padding-bottom: var(--sp-2);
        }
.admin-shell .settings-block-head h2 { margin-bottom: var(--sp-1); }
        .admin-shell .settings-grid {
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: var(--sp-2) var(--sp-3);
        }
        .admin-shell .preview-box {
            margin-bottom: var(--sp-3);
            padding: var(--sp-2) var(--sp-3);
        }
.admin-shell .preview-label { font-size: var(--fs-sm); margin-bottom: var(--sp-1); }
.admin-shell .preview-box code { font-size: var(--fs-sm); }
        .admin-shell .cards {
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: var(--sp-2);
            margin: var(--sp-2) 0 var(--sp-1);
        }
        .admin-shell .card-link {
            padding: var(--sp-3);
            border-radius: var(--r-sm);
        }
.admin-shell .card-link .card-title { margin-bottom: var(--sp-1); font-size: var(--fs-base); }
.admin-shell .card-link .card-desc { font-size: var(--fs-sm); line-height: 1.3; }
        .admin-shell .status-bar {
            gap: var(--sp-1) var(--sp-3);
            padding: var(--sp-2) var(--sp-3);
            margin-bottom: var(--sp-3);
            font-size: var(--fs-sm);
            border-radius: var(--r-sm);
        }
        .admin-shell .checkbox-scroll {
            max-height: 9rem;
            overflow: auto;
            padding: var(--sp-1) var(--sp-2);
            border: 1px solid var(--border);
            border-radius: var(--r-sm);
            background: var(--input-bg);
        }
        .admin-shell footer {
            font-size: var(--fs-sm);
            padding-bottom: var(--sp-4);
        }

/* --- templates/supervisor/dashboard.php --- */
.dash-status-bar {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-2) var(--sp-5);
        padding: var(--sp-3) var(--sp-4);
        border-radius: var(--r-sm);
        border: 1px solid var(--status-bar-border);
        background: var(--status-bar-bg);
        margin-bottom: var(--sp-4);
        font-size: var(--fs-base);
        font-weight: var(--fw-medium);
    }
.dash-status-bar .ok { color: var(--status-ok); font-weight: var(--fw-medium); }
.dash-status-bar .off { color: var(--muted); font-weight: var(--fw-normal); }
    .dash-alert {
        padding: var(--sp-2) var(--sp-3);
        border-radius: var(--r-md);
        margin-bottom: var(--sp-3);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        background: rgba(154, 107, 20, 0.1);
        border: 1px solid rgba(154, 107, 20, 0.28);
        color: var(--status-warn);
        display: none;
        align-items: center;
        gap: var(--sp-2);
        line-height: 1.4;
    }

    .dash-alert::before {
        content: '';
        width: 0.5rem;
        height: 0.5rem;
        border-radius: var(--r-full);
        background: var(--status-warn);
        flex-shrink: 0;
        box-shadow: 0 0 0 2px rgba(161, 98, 7, 0.2);
    }

.dash-alert.visible { display: flex; }
.dash-table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
body.dash-page .dash-body > .dash-table-wrap {
    margin-bottom: var(--sp-3);
}
    table.dash-table {
        width: 100%;
        min-width: 52rem;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: var(--fs-base);
    }
    table.dash-table th,
    table.dash-table td {
        padding: var(--sp-3) var(--sp-2);
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        text-align: start;
    }
    table.dash-table th {
        color: var(--text);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }
    .dash-control-btn {
        appearance: none;
        width: 2.25rem;
        height: 2.25rem;
        border-radius: var(--r-full);
        border: 2px solid var(--text);
        background: var(--surface);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: var(--fs-sm);
        padding: 0;
        color: var(--text);
        transition: background 0.15s, opacity 0.15s;
    }
.dash-control-btn:hover:not(:disabled) { background: var(--nav-hover); }
.dash-control-btn:disabled { opacity: 0.45; cursor: not-allowed; }
    .dash-campaign-name {
        font-weight: var(--fw-medium);
        color: var(--accent);
        text-decoration: none;
    }
.dash-campaign-name:hover { text-decoration: underline; }
    .dash-campaign-cell {
        display: flex;
        flex-direction: column;
        align-items: start;
        gap: var(--sp-1);
    }
    .dash-campaign-badges {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-2);
    }
.dash-campaign-badges .dash-badge { margin-inline-start: 0; }
    .dash-badge {
        display: inline-block;
        padding: var(--sp-1) var(--sp-2);
        border-radius: var(--r-full);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        background: var(--badge-off-bg);
        color: var(--muted);
        vertical-align: middle;
    }
.dash-badge-schedule-ok { background: var(--badge-bg); color: var(--badge-text); }
.dash-badge-schedule-off { background: var(--badge-off-bg); color: var(--muted); }
.dash-badge-finished { background: rgba(154, 107, 20, 0.15); color: var(--status-warn); }
    .dash-time-cell {
        direction: ltr;
        unicode-bidi: embed;
        font-variant-numeric: tabular-nums;
        font-family: "Courier New", monospace;
        font-size: var(--fs-base);
        font-weight: var(--fw-medium);
    }
    .progress-ring {
        width: 2.5rem;
        height: 2.5rem;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle.track { fill: none; stroke: var(--border); stroke-width: 3; }
    .progress-ring circle.fill {
        fill: none;
        stroke: var(--accent);
        stroke-width: 3;
        stroke-linecap: round;
        transition: stroke-dashoffset 0.3s;
    }
    .progress-ring .pct {
        position: absolute;
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        color: var(--text);
    }
    .dash-footer-meta {
        margin-top: var(--sp-4);
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-3) var(--sp-5);
        align-items: flex-start;
        font-size: var(--fs-base);
        font-weight: var(--fw-medium);
        color: var(--muted);
    }
    .dash-footer-live-cluster {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--sp-3) var(--sp-5);
        width: 100%;
    }
    .dash-poll-live {
        display: inline-flex;
        align-items: center;
        gap: var(--sp-2);
        color: var(--text);
        font-weight: var(--fw-medium);
        font-size: var(--fs-base);
        flex-shrink: 0;
    }
    .dash-foot-stat {
        display: inline-flex;
        align-items: center;
        gap: var(--sp-1);
        white-space: nowrap;
        font-size: var(--fs-base);
    }
    .dash-empty {
        text-align: center;
        padding: var(--sp-8) var(--sp-4);
        color: var(--muted);
        font-size: var(--fs-md);
        font-weight: var(--fw-normal);
    }
    .dash-toast {
        position: fixed;
        bottom: 1.25rem;
        inset-inline-end: 1.25rem;
        max-width: 22rem;
        padding: var(--sp-3) var(--sp-4);
        border-radius: var(--r-sm);
        font-size: var(--fs-base);
        z-index: 100;
        box-shadow: var(--panel-shadow);
        display: none;
    }
.dash-toast.visible { display: block; }
.dash-toast.ok { background: var(--alert-ok-bg); border: 1px solid var(--alert-ok-border); color: var(--alert-ok-text); }
.dash-toast.err { background: var(--alert-err-bg); border: 1px solid var(--alert-err-border); color: var(--alert-err-text); }

/* --- dashboard layout v3 (command center) --- */
.dash-layout-v3 .dash-kpi-grid {
    display: none;
}

@media (max-width: 899px) {
    body.dash-page .dash-toolbar {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: var(--sp-2) var(--sp-3);
    }

    body.dash-page .dash-ami-beacon {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    body.dash-page .dash-toolbar-center {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
    }

    body.dash-page .dash-clock-wrap {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: center;
    }

    body.dash-page .dash-toolbar-cluster {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    body.dash-page .dash-toolbar-stats {
        flex-wrap: wrap;
        justify-content: center;
    }

    body.dash-page .dash-toolbar-stat {
        width: 6rem;
        flex: 1 1 6rem;
        max-width: 8rem;
    }
}

@media (max-width: 480px) {
    body.dash-page .dash-toolbar-cluster {
        padding: var(--sp-1);
        gap: var(--sp-1);
    }

    body.dash-page .dash-toolbar-stats {
        gap: var(--sp-1);
    }

    body.dash-page .dash-toolbar-stat {
        width: 5.25rem;
        min-height: 2.75rem;
        padding: var(--sp-1);
    }

    body.dash-page .dash-toolbar-stat-val {
        font-size: var(--fs-md);
    }

    body.dash-page .dash-toolbar-stat-lbl {
        font-size: 0.5625rem;
    }
}

.dash-kpi-card {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    box-shadow: var(--sh-sm);
    min-width: 0;
}
.dash-kpi-card.ok .dash-kpi-value { color: var(--status-ok); }
.dash-kpi-card.off .dash-kpi-value { color: var(--status-warn); }
.dash-kpi-value {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    font-variant-numeric: tabular-nums;
    line-height: var(--lh-tight);
    color: var(--text);
}
.dash-kpi-sub {
    font-size: var(--fs-sm);
    font-weight: var(--fw-normal);
    color: var(--muted);
}
.dash-kpi-label {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: var(--fw-medium);
}
.dash-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}
.dash-campaign-card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-elevated);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    box-shadow: var(--sh-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dash-campaign-card--running {
    border-color: var(--status-bar-border);
    background: var(--dash-row-running-bg);
    box-shadow: var(--sh-md);
}
.dash-campaign-card--idle {
    border-color: var(--border);
    background: var(--surface-elevated);
}
.dash-campaign-card-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
}
.dash-campaign-card-title-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
    width: 100%;
}
.dash-campaign-card-title-row .dash-campaign-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--fs-md);
}
.dash-campaign-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    font-size: var(--fs-sm);
}
.dash-campaign-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-2);
}
.dash-campaign-card-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--sp-2);
    border-radius: var(--r-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
    min-width: 0;
}
.dash-campaign-card-metric .dash-campaign-card-value {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text);
}
.dash-campaign-card-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-1) var(--sp-2);
}
.dash-campaign-card-row--time {
    padding: var(--sp-2);
    border-radius: var(--r-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.dash-campaign-card-row--progress {
    align-items: center;
}
.dash-campaign-card-stats {
    min-width: 0;
}
.dash-campaign-card-stats .dash-stats-view {
    margin-top: var(--sp-1);
}
.dash-campaign-card-label {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.dash-campaign-card-value {
    font-variant-numeric: tabular-nums;
}
.dash-campaign-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border);
}
.dash-campaign-card-foot:empty {
    display: none;
    padding: 0;
    border: none;
}
.dash-progress-bar {
    position: relative;
    height: 0.45rem;
    border-radius: var(--r-full);
    background: var(--card-bg);
    overflow: hidden;
}
.dash-progress-bar-fill {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: var(--r-full);
    transition: width 0.2s ease;
}
.dash-progress-bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: var(--fw-semibold);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.dash-empty--filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    text-align: center;
}

.dash-filter-empty-hint {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.dash-filter-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--sp-2);
    margin-top: var(--sp-1);
}

.dash-filter-empty-btn {
    cursor: pointer;
}

.dash-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
    justify-content: center;
}

.dash-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}
.dash-btn-primary {
    background: var(--accent);
    color: #fff;
}
.dash-btn-primary:hover { background: var(--accent-hover); }
.dash-btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.dash-btn-ghost:hover { background: var(--nav-hover); }
.dash-layout-v3 .dash-filter-btn {
    border-radius: var(--r-full);
    padding: var(--sp-1) var(--sp-3);
}
.dash-layout-v3 .dash-filter-btn.is-active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
    border: 1px solid var(--status-bar-border);
}
.dash-footer-live-cluster--poll-only {
    justify-content: flex-end;
}
.dash-layout-v3 .dash-table-wrap--hybrid {
    display: none;
}
.dash-layout-v3 .dash-card-grid {
    display: grid;
}
@media (min-width: 900px) {
    .dash-layout-v3 .dash-table-wrap--hybrid {
        display: block;
    }
    .dash-layout-v3 .dash-card-grid {
        display: none;
    }
}
@media (min-width: 600px) and (max-width: 899px) {
    .dash-layout-v3 .dash-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 899px) {
    .dash-layout-v3 .dash-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .dash-layout-v3 .dash-kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* --- templates/supervisor/campaign_mode_picker.php --- */
.camp-mode-picker { max-width: 520px; margin: var(--sp-5) auto 0; padding: var(--sp-2) 0 var(--sp-4); }
.camp-mode-picker-head { text-align: center; margin-bottom: var(--sp-4); }
.camp-mode-picker-head h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-lg); }
.camp-mode-picker-cards { gap: var(--sp-3); }
.camp-call-mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
    .camp-call-mode-card {
        display: flex; flex-direction: column; gap: 0.2rem;
        padding: var(--sp-2) 0.6rem; border: var(--sp-1) solid var(--border);
        border-radius: var(--r-sm); background: var(--surface);
        transition: border-color 0.15s, background 0.15s;
    }
.camp-call-mode-card-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); }
.camp-call-mode-card-desc { font-size: var(--fs-sm); line-height: 1.3; color: var(--muted); }
.camp-call-mode-card--disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.camp-call-mode-card--link { text-decoration: none; color: inherit; cursor: pointer; }
    .camp-call-mode-card--link:hover {
        border-color: rgba(31, 138, 125, 0.45);
        background: rgba(31, 138, 125, 0.06);
    }

/* --- templates/supervisor/campaign_wizard.php --- */
.wizard-steps {
        display: flex;
        gap: var(--sp-1);
        margin: 0 0 var(--sp-6);
        flex-wrap: wrap;
    }
    .wizard-step-tab {
        flex: 1;
        min-width: 6.5rem;
        text-align: center;
        padding: var(--sp-2) var(--sp-2);
        border-radius: var(--r-sm);
        border: 1px solid var(--border);
        background: var(--card-bg);
        color: var(--muted);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
    }
    .wizard-step-tab.active {
        color: var(--tab-active-color);
        background: var(--tab-active-bg);
        border-color: transparent;
        border-top: 3px solid var(--tab-active-indicator);
    }
    .wizard-step-tab.done {
        color: var(--status-ok);
        border-color: rgba(31, 138, 125, 0.35);
    }
.wizard-pane { display: none; }
.wizard-pane.active { display: block; }
    .wizard-limits {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-3) var(--sp-5);
        margin: 0 0 var(--sp-4);
        padding: var(--sp-3) var(--sp-4);
        border-radius: var(--r-sm);
        background: var(--status-bg);
        font-size: var(--fs-base);
        color: var(--muted);
    }
.wizard-limits strong { color: var(--text); }
.camp-call-mode { margin-bottom: var(--sp-3); }
    .camp-call-mode-label {
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-base);
        color: var(--muted);
        font-weight: var(--fw-normal);
    }
    .camp-call-mode-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-2);
    }
    .camp-call-mode-card {
        display: flex;
        flex-direction: column;
        gap: var(--sp-1);
        padding: var(--sp-3) var(--sp-3);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--surface);
        cursor: pointer;
    }
.camp-call-mode-card input { position: absolute; opacity: 0; pointer-events: none; }
    .camp-call-mode-card.is-selected {
        border-color: rgba(31, 138, 125, 0.55);
        background: rgba(31, 138, 125, 0.08);
    }
.camp-call-mode-card-title { font-size: var(--fs-base); font-weight: var(--fw-medium); }
.camp-call-mode-card-desc { font-size: var(--fs-sm); line-height: 1.35; color: var(--muted); }
    .camp-mode-coming-soon {
        padding: var(--sp-3);
        border: 1px dashed var(--border);
        border-radius: var(--r-sm);
        background: var(--status-bg);
        color: var(--muted);
        font-size: var(--fs-base);
    }
.camp-mode-coming-soon p { margin: 0; }
.camp-wizard-flows { margin: 0 0 var(--sp-4); }
    .weekday-presets {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-2);
        margin: 0 0 var(--sp-3);
    }
    .weekday-presets button {
        padding: var(--sp-1) var(--sp-3);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        background: transparent;
        border: 1px solid var(--border);
        color: var(--text);
    }
    .weekday-presets button:hover {
        border-color: var(--muted);
        background: var(--nav-hover);
    }
    .manual-list {
        margin: var(--sp-3) 0 0;
        padding: 0;
        list-style: none;
    }
    .manual-list li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-3);
        padding: var(--sp-2) var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        margin-bottom: var(--sp-1);
        font-size: var(--fs-base);
    }
.manual-list li .ltr { direction: ltr; unicode-bidi: embed; }
    .manual-list .btn-remove {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-sm);
        background: transparent;
        border: 1px solid rgba(231, 111, 81, 0.55);
        color: var(--btn-danger-color);
    }
    .review-grid {
        display: grid;
        gap: var(--sp-2);
        margin: 0 0 var(--sp-4);
    }
    .review-row {
        display: grid;
        grid-template-columns: minmax(7rem, 32%) 1fr;
        gap: var(--sp-2);
        padding: var(--sp-2) 0;
        border-bottom: 1px solid var(--border);
        font-size: var(--fs-md);
    }
.review-row .k { color: var(--muted); }
.review-row .v { font-weight: var(--fw-medium); word-break: break-word; }
    input[type="date"],
    input[type="time"],
    input.time-input-24h {
        width: 100%;
        padding: var(--sp-3) var(--sp-3);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--input-bg);
        color: var(--text);
        font-size: var(--fs-md);
        font-family: inherit;
    }
    .time-picker-24h {
        display: flex;
        align-items: center;
        gap: var(--sp-1);
        width: 100%;
    }
    .time-picker-24h__hour,
    .time-picker-24h__minute {
        flex: 1 1 0;
        min-width: 0;
        height: 36px;
        min-height: 36px;
        padding-inline: var(--sp-2);
        padding-block: 0;
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--input-bg);
        color: var(--text);
        font-size: var(--fs-base);
        font-family: inherit;
        font-variant-numeric: tabular-nums;
        direction: ltr;
        box-sizing: border-box;
        cursor: pointer;
    }
    .time-picker-24h__sep {
        flex: 0 0 auto;
        font-weight: var(--fw-medium);
        color: var(--muted);
        font-variant-numeric: tabular-nums;
        user-select: none;
    }
    input.time-input-24h {
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.02em;
        direction: ltr;
        text-align: start;
    }
.wizard-step-tab { cursor: pointer; }
.wizard-step-tab:hover { background: var(--nav-hover); }
.wizard-error[hidden] { display: none !important; }
#wizardForm { padding-bottom: var(--sp-2); }
    #wizardNav {
        position: sticky;
        top: 0;
        z-index: 40;
        margin: 0 0 var(--sp-3);
        padding: var(--sp-2) 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        justify-content: flex-start;
    }

/* --- templates/supervisor/campaigns_editor.php --- */
    .camp-page {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
        border-radius: var(--r-md);
    }

    .camp-toolbar {
        border-radius: var(--r-md) var(--r-md) 0 0;
    }
    .camp-toolbar-sub {
        font-size: var(--fs-sm);
        color: rgba(255, 255, 255, 0.82);
        white-space: nowrap;
    }
    .camp-status-badge {
        display: inline-flex;
        align-items: center;
        gap: var(--sp-1);
        padding: var(--sp-1) var(--sp-2);
        border-radius: var(--r-full);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
        white-space: nowrap;
    }
.camp-status-badge .camp-dot { width: 0.42rem; height: 0.42rem; }
    .camp-toolbar-msg {
        flex: 1;
        min-width: 8rem;
        font-size: var(--fs-sm);
        padding: var(--sp-1) var(--sp-2);
        border-radius: var(--r-sm);
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .camp-toolbar-msg.is-ok {
        background: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
    .camp-toolbar-msg.is-err {
        background: rgba(212, 87, 58, 0.35);
        color: #fff;
    }
    .camp-toolbar-actions {
        display: flex;
        align-items: center;
        gap: var(--sp-2);
        flex-shrink: 0;
        flex-wrap: wrap;
    }
    .camp-btn {
        appearance: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--sp-1);
        padding: var(--sp-2) var(--sp-3);
        border-radius: var(--r-sm);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        font-family: inherit;
        text-decoration: none;
        cursor: pointer;
        border: none;
        white-space: nowrap;
        transition: background 0.15s, opacity 0.15s;
    }
    .camp-btn-primary {
        background: #fff;
        color: var(--accent);
    }
.camp-btn-primary:hover { background: rgba(255, 255, 255, 0.92); }
    .camp-btn-ghost {
        background: rgba(255, 255, 255, 0.14);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.28);
    }
.camp-btn-ghost:hover { background: rgba(255, 255, 255, 0.22); }
    .camp-btn-save {
        background: #fff;
        color: var(--accent);
    }
.camp-btn-save:hover { background: rgba(255, 255, 255, 0.92); }
.camp-btn-save:disabled { opacity: 0.55; cursor: not-allowed; }

    .camp-layout {
        display: grid;
        grid-template-columns: minmax(190px, 220px) 1fr;
        flex: 1;
        min-height: 0;
        border: 1px solid var(--border);
        border-top: none;
        background: var(--surface);
    }
    .camp-sidebar {
        border-inline-end: 1px solid var(--border);
        padding: var(--sp-2);
        display: flex;
        flex-direction: column;
        gap: var(--sp-2);
        background: var(--card-bg);
        min-height: 0;
    }
    .camp-search {
        width: 100%;
        padding: var(--sp-2) var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--input-bg);
        color: var(--text);
        font-size: var(--fs-base);
        font-family: inherit;
        flex-shrink: 0;
    }
    .camp-list {
        list-style: none;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    .camp-list-item {
        display: flex;
        align-items: center;
        gap: var(--sp-1);
        margin-bottom: var(--sp-1);
    }
    .camp-list-link {
        flex: 1;
        display: flex;
        align-items: center;
        gap: var(--sp-2);
        padding: var(--sp-2) var(--sp-2);
        border-radius: var(--r-sm);
        text-decoration: none;
        color: var(--text);
        font-size: var(--fs-base);
        min-width: 0;
    }
.camp-list-link:hover { background: var(--nav-hover); }
    .camp-list-link.active {
        background: var(--nav-active-bg);
        color: var(--nav-active-color);
        font-weight: var(--fw-medium);
    }
    .camp-list-link .name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .camp-schedule-badge {
        font-size: var(--fs-xs);
        font-variant-numeric: tabular-nums;
        flex-shrink: 0;
        color: var(--muted);
        min-width: 2.75rem;
        text-align: center;
    }
    .camp-list-item--schedule-off .camp-list-link {
        background: rgba(254, 243, 199, 0.35);
    }
    .camp-list-item--schedule-off .camp-list-link.active {
        background: rgba(253, 230, 138, 0.55);
    }
    .camp-launch-countdown {
        font-variant-numeric: tabular-nums;
        font-weight: var(--fw-medium);
    }
    .camp-launch-countdown.is-open { color: var(--ok); }
    .camp-launch-countdown.is-closed { color: var(--status-warn); }
    .camp-dot {
        width: 0.45rem;
        height: 0.45rem;
        border-radius: var(--r-full);
        flex-shrink: 0;
    }
.camp-dot-running { background: var(--ok); }
.camp-dot-paused { background: var(--muted); }
.camp-dot-draft { background: #4a90d9; }
.camp-dot-finished { background: var(--status-warn); }
    .camp-delete-btn {
        appearance: none;
        border: none;
        background: transparent;
        color: var(--danger);
        cursor: pointer;
        padding: var(--sp-1) var(--sp-1);
        font-size: var(--fs-base);
        line-height: 1;
        border-radius: var(--r-sm);
        opacity: 0.7;
    }
.camp-delete-btn:hover { opacity: 1; background: rgba(212, 87, 58, 0.1); }
    .camp-empty-sidebar {
        font-size: var(--fs-sm);
        color: var(--muted);
        padding: var(--sp-2) var(--sp-1);
        line-height: 1.4;
    }

    .camp-main {
        padding: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    .camp-running-banner {
        flex-shrink: 0;
        padding: var(--sp-1) var(--sp-3);
        font-size: var(--fs-sm);
        background: rgba(212, 87, 58, 0.1);
        border-bottom: 1px solid rgba(212, 87, 58, 0.25);
        color: var(--alert-err-text);
    }
    .camp-live-field {
        box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
        background: var(--surface);
    }
    .camp-form-body {
        flex: 1;
        min-height: 0;
        padding: var(--sp-2) var(--sp-2) var(--sp-1);
        overflow-x: hidden;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
    .camp-form-body:has(input[name="call_mode"][value="ai_tts"]:checked),
    .camp-form-body:has(input[type="hidden"][name="call_mode"][value="ai_tts"]) {
        overflow-y: auto;
        overflow-x: hidden;
    }
    .camp-form-grid {
        display: grid;
        grid-template-columns: 1fr 1.35fr 1fr;
        grid-template-rows: minmax(0, 1fr);
        gap: var(--sp-2);
        flex: 1;
        min-height: 0;
        align-content: stretch;
        overflow: hidden;
    }
    .camp-form-grid:has(input[name="call_mode"][value="ai_tts"]:checked),
    .camp-form-grid:has(input[type="hidden"][name="call_mode"][value="ai_tts"]) {
        grid-template-columns: 1.15fr 1.15fr 0.8fr;
        align-items: start;
        align-content: start;
        overflow: visible;
        min-height: min-content;
    }
    .camp-section {
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        padding: var(--sp-2) var(--sp-2);
        background: var(--card-bg);
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .camp-form-grid:has(input[name="call_mode"][value="ai_tts"]:checked) > .camp-section:first-child,
    .camp-form-grid:has(input[type="hidden"][name="call_mode"][value="ai_tts"]) > .camp-section:first-child {
        overflow: visible;
        max-height: none;
    }
    .camp-section h3 {
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        color: var(--accent);
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
.camp-section .field { margin-bottom: var(--sp-1); }
.camp-section .field:last-child { margin-bottom: 0; }
    .camp-section label {
        font-size: var(--fs-sm);
        margin-bottom: var(--sp-1);
    }
    .camp-section input,
    .camp-section select {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-sm);
    }
    .camp-page .camp-call-mode-label,
    .camp-page .camp-call-mode-label + .hint {
        display: none;
    }
    .camp-page .camp-section .field > .hint {
        font-size: var(--fs-xs);
        margin: var(--sp-1) 0 0;
        line-height: 1.25;
    }
.camp-call-mode { margin-bottom: var(--sp-1); }
    .camp-call-mode-label {
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-sm);
        color: var(--muted);
        font-weight: var(--fw-normal);
    }
    .camp-call-mode-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-2);
    }
    .camp-call-mode-card {
        display: flex;
        flex-direction: column;
        gap: var(--sp-1);
        padding: var(--sp-2) var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--surface);
        cursor: pointer;
        transition: border-color 0.15s, background 0.15s;
    }
.camp-call-mode-card input { position: absolute; opacity: 0; pointer-events: none; }
    .camp-call-mode-card.is-selected {
        border-color: rgba(31, 138, 125, 0.55);
        background: rgba(31, 138, 125, 0.08);
    }
    .camp-call-mode-card-title {
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--text);
    }
    .camp-call-mode-card-desc {
        font-size: var(--fs-sm);
        line-height: 1.3;
        color: var(--muted);
    }
.camp-call-mode-card--soon { opacity: 0.92; }
    .camp-call-mode-card--disabled {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
    }
    .camp-call-mode-card--link {
        text-decoration: none;
        color: inherit;
    }
    .camp-call-mode-card--link:hover {
        border-color: rgba(31, 138, 125, 0.45);
        background: rgba(31, 138, 125, 0.06);
    }
    .camp-mode-picker {
        max-width: 520px;
        margin: var(--sp-5) auto 0;
        padding: var(--sp-2) 0 var(--sp-4);
    }
    .camp-mode-picker-head {
        text-align: center;
        margin-bottom: var(--sp-4);
    }
    .camp-mode-picker-head h2 {
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-lg);
    }
    .camp-mode-picker-cards {
        gap: var(--sp-3);
    }
    .camp-mode-badge {
        display: inline-block;
        margin: 0 0 var(--sp-2);
        padding: var(--sp-1) var(--sp-2);
        border-radius: var(--r-full);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--primary, #1f8a7d);
        background: rgba(31, 138, 125, 0.12);
        border: 1px solid rgba(31, 138, 125, 0.25);
    }
.camp-mode-type { margin: 0 0 var(--sp-2); }
    .camp-mode-type-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-2);
        margin-bottom: var(--sp-1);
    }
    .camp-mode-type-label {
        font-size: var(--fs-sm);
        font-weight: var(--fw-normal);
        color: var(--muted);
    }
    .camp-mode-type-change {
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        color: var(--primary, #1f8a7d);
        text-decoration: none;
    }
.camp-mode-type-change:hover { text-decoration: underline; }
    .camp-mode-type-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-1);
    }
    .camp-mode-type-opt {
        display: block;
        padding: var(--sp-2) var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--surface);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        text-align: center;
        text-decoration: none;
        color: var(--muted);
        transition: border-color 0.15s, background 0.15s, color 0.15s;
    }
    .camp-mode-type-opt.is-active {
        border-color: rgba(31, 138, 125, 0.55);
        background: rgba(31, 138, 125, 0.1);
        color: var(--primary, #1f8a7d);
    }
    .camp-mode-type-opt.is-muted,
    .camp-mode-type-opt.is-disabled {
        opacity: 0.42;
        pointer-events: none;
    }
    .camp-mode-type-desc {
        margin: var(--sp-1) 0 0;
        font-size: var(--fs-xs);
        line-height: 1.3;
    }
    .camp-toolbar-mode {
        display: inline-flex;
        align-items: center;
        padding: var(--sp-1) var(--sp-2);
        margin-inline-start: var(--sp-2);
        border-radius: var(--r-full);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        color: var(--primary, #1f8a7d);
        background: rgba(31, 138, 125, 0.12);
        border: 1px solid rgba(31, 138, 125, 0.22);
        vertical-align: middle;
    }
    .camp-toolbar-mode--tts {
        color: #7c5cbf;
        background: rgba(124, 92, 191, 0.1);
        border-color: rgba(124, 92, 191, 0.25);
    }
    .camp-list-mode {
        display: inline-block;
        flex-shrink: 0;
        padding: var(--sp-1) var(--sp-1);
        border-radius: var(--r-sm);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--primary, #1f8a7d);
        background: rgba(31, 138, 125, 0.1);
    }
    .camp-list-mode--tts {
        color: #7c5cbf;
        background: rgba(124, 92, 191, 0.1);
    }
.camp-list-link .name { min-width: 0; }
.camp-mode-panel { margin-top: var(--sp-1); }
    .camp-section .ivr-message-block.settings-block {
        margin-top: var(--sp-1) !important;
        padding: var(--sp-1) var(--sp-2);
        box-shadow: none;
    }
    .camp-section .ivr-message-block .settings-block-head {
        margin-bottom: var(--sp-1);
        padding-bottom: var(--sp-1);
    }
    .camp-section .ivr-message-block .settings-block-head h2 {
        font-size: var(--fs-sm);
        margin: 0 0 0.15rem;
    }
    .camp-section .ivr-message-block .section-intro {
        font-size: var(--fs-xs);
        line-height: 1.25;
        margin: 0;
    }
    .camp-section .camp-tts-account-card {
        margin: var(--sp-1) 0;
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-xs);
        gap: var(--sp-1);
    }
    .camp-section #ivr_message_text {
        min-height: 3.5rem;
        height: 3.5rem;
        resize: vertical;
        font-size: var(--fs-sm);
    }
    .camp-tts-text-source {
        margin: 0 0 var(--sp-2);
        padding: var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--surface);
    }
    .camp-tts-text-source-label {
        display: block;
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--text);
    }
    .camp-tts-text-source-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-1);
    }
    .camp-tts-text-source-opt {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        margin: 0;
        padding: var(--sp-1) var(--sp-2);
        border: 1px solid var(--border);
        border-radius: var(--r-sm);
        background: var(--card-bg);
        font-size: var(--fs-sm);
        cursor: pointer;
        line-height: 1.25;
    }
    .camp-tts-text-source-opt:has(input:checked) {
        border-color: var(--accent);
        background: rgba(31, 138, 125, 0.1);
        color: var(--accent);
        font-weight: var(--fw-medium);
    }
    .camp-tts-text-source-hint {
        margin: var(--sp-1) 0 0;
        font-size: var(--fs-xs);
        line-height: 1.3;
    }
    .camp-mode-coming-soon {
        padding: var(--sp-3);
        border: 1px dashed var(--border);
        border-radius: var(--r-sm);
        background: var(--status-bg);
        font-size: var(--fs-sm);
        color: var(--muted);
        line-height: 1.4;
    }
.camp-mode-coming-soon p { margin: 0; }
    .camp-field-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-2);
    }
    .camp-readonly {
        padding: var(--sp-2) var(--sp-2);
        border-radius: var(--r-sm);
        background: var(--status-bg);
        font-size: var(--fs-sm);
        color: var(--muted);
        line-height: 1.35;
    }
.camp-readonly strong { color: var(--text); }

    .camp-wd-toolbar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--sp-1);
        margin-bottom: var(--sp-2);
    }
    .camp-wd-toolbar:empty { display: none; }
    .camp-wd-field {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.3rem 0.4rem;
        margin-top: 0.4rem;
        flex-shrink: 0;
        min-width: 0;
    }
    .camp-wd-field > label {
        margin: 0;
        flex-shrink: 0;
        white-space: nowrap;
    }
    .camp-wd-presets {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-1);
    }
    .camp-wd-presets button {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-xs);
        background: transparent;
        border: 1px solid var(--border);
        color: var(--muted);
        border-radius: var(--r-full);
        cursor: pointer;
        font-family: inherit;
    }
.camp-wd-presets button:hover { background: var(--nav-hover); color: var(--text); }
    .camp-wd-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        flex: 1 1 12rem;
        min-width: 0;
    }
    .camp-wd-pill {
        position: relative;
        cursor: pointer;
        flex: 0 0 auto;
    }
    .camp-wd-pill input {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }
    .camp-wd-pill span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 2.15rem;
        padding: 0.2rem 0.4rem;
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        line-height: 1.2;
        border-radius: var(--r-full);
        border: 1px solid var(--border);
        background: var(--input-bg);
        color: var(--text);
        transition: background 0.12s, color 0.12s, border-color 0.12s;
        user-select: none;
        white-space: nowrap;
    }
    .camp-wd-pill input:checked + span {
        background: var(--nav-active-bg);
        color: var(--nav-active-color);
        border-color: transparent;
    }
.camp-wd-pill input:disabled + span { opacity: 0.82; cursor: not-allowed; }
    .camp-section--datetime {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }
    .camp-section--datetime .camp-wd-field {
        margin-top: auto;
        padding-top: 0.35rem;
    }
    .camp-wd-pill input:focus-visible + span {
        outline: 2px solid var(--accent);
        outline-offset: 1px;
    }

    .camp-action-bar {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: var(--sp-2);
        padding: var(--sp-1) var(--sp-2);
        border-top: 1px solid var(--border);
        background: var(--status-bg);
        font-size: var(--fs-sm);
    }
    .camp-action-links {
        display: flex;
        flex-wrap: wrap;
        gap: var(--sp-1) var(--sp-3);
    }
    .camp-action-links a {
        color: var(--muted);
        text-decoration: none;
    }
.camp-action-links a:hover { color: var(--accent); }
.camp-form-footer { display: none; }

    .camp-editor-flow-strip {
        flex-shrink: 0;
        padding: var(--sp-1) var(--sp-2) var(--sp-1);
        border-top: 1px solid var(--border);
        background: var(--card-bg);
    }
    .camp-editor-flow-strip .auth-flow {
        margin: 0;
        padding: var(--sp-1) var(--sp-1) var(--sp-1);
    }
.camp-editor-flow-strip .auth-flow-sub { display: none; }
    .camp-editor-flow-strip .auth-flow-heading {
        margin: 0 0 var(--sp-1);
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: center;
    }
    .camp-editor-flow-strip .auth-flow-track {
        position: relative;
        justify-content: center;
        gap: var(--sp-1);
        min-height: 5.4rem;
        padding: var(--sp-1) 0;
    }
    .camp-editor-flow-strip .auth-flow-step {
        min-width: 0;
        flex: 1 1 0;
        max-width: none;
        min-height: 5.4rem;
        padding: 0.35rem 0.25rem 2.15rem;
        gap: 0;
        justify-content: center;
        overflow: hidden;
    }
    .camp-editor-flow-strip .auth-flow-badge,
    .camp-editor-flow-strip .auth-flow-waves {
        display: none;
    }
    .camp-editor-flow-strip .auth-flow--dense .auth-flow-title {
        margin-bottom: 0;
    }
    .camp-editor-flow-strip .auth-flow-icon {
        width: 1.35rem;
        height: 1.35rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .camp-editor-flow-strip .auth-flow-icon svg {
        width: 0.75rem;
        height: 0.75rem;
    }
    .camp-editor-flow-strip .auth-flow-title {
        position: absolute;
        inset-inline: 0.15rem;
        bottom: 0.2rem;
        margin: 0;
        font-size: var(--fs-xs);
        line-height: 1.15;
        letter-spacing: 0.01em;
        text-align: center;
        white-space: normal;
        overflow: hidden;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: normal;
        overflow-wrap: normal;
        max-width: none;
    }
    .camp-editor-flow-strip .auth-flow-bridge {
        flex: 0 0 auto;
        min-width: 0.55rem;
    }
    .camp-editor-flow-strip .auth-flow-bridge-arrow {
        width: 0.55rem;
        height: 0.55rem;
        opacity: 0.45;
    }
    .camp-editor-flow-strip .auth-flow-runner {
        width: 1rem;
        height: 1rem;
        margin-top: -0.5rem;
        margin-left: -0.5rem;
    }
    .camp-editor-flow-strip .auth-flow-ping {
        width: 0.3rem;
        height: 0.3rem;
        top: 0.1rem;
        inset-inline-end: 0.1rem;
    }

    @media (max-width: 1024px) {
.camp-form-grid { grid-template-columns: 1fr; }
.camp-form-body { overflow-y: auto; }
    }
    @media (max-width: 768px) {
.camp-layout { grid-template-columns: 1fr; }
        .camp-sidebar {
            border-inline-end: none;
            border-bottom: 1px solid var(--border);
            max-height: 10rem;
        }
.camp-toolbar { border-radius: var(--r-md) var(--r-md) 0 0; }
.camp-toolbar-msg { display: none; }
    }

/* ============================================================
   Phase 4 — Component unification
   ============================================================ */

/* Tables — header cells */
table.data th,
table.dash-table th,
.numbers-dense-table thead th,
.num-attempts-table th,
.admin-shell table.data th {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.dash-page table.dash-table thead tr,
[data-theme="dark"] body.dash-page table.dash-table thead tr {
    background: var(--dash-table-head-bg);
}

body.dash-page table.dash-table th,
[data-theme="dark"] body.dash-page table.dash-table th {
    color: var(--dash-table-head-fg);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

/* Tables — rows: bottom border only, no vertical lines */
table.data th,
table.data td,
table.dash-table th,
table.dash-table td,
.numbers-dense-table th,
.numbers-dense-table td,
.num-attempts-table th,
.num-attempts-table td {
    border-bottom: 1px solid var(--border);
    border-inline-width: 0;
    border-inline-style: none;
}

/* Cards */
.panel:not(.camp-page):not(.dash-panel):not(.numbers-page):not(.dnc-page),
.stat-card,
.card-link,
.settings-block {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

.panel:not(.camp-page):not(.dash-panel):not(.numbers-page):not(.dnc-page),
.stat-card,
.card-link,
.settings-block {
    padding: var(--sp-5);
}

body.dash-page .panel.dash-panel {
    box-shadow: var(--sh-sm);
}

.admin-shell .stat-card {
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

/* Buttons — standard height (exclude specialty controls) */
button:not(.dash-control-btn):not(.camp-flow-nav-btn):not(.camp-wd-pill):not(.btn-remove),
.btn:not(.dash-control-btn):not(.btn-remove):not(.btn-sm),
.weekday-presets button,
.camp-btn {
    height: 36px;
    min-height: 36px;
    padding-block: 0;
    padding-inline: var(--sp-4);
    border-radius: var(--r-sm);
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
}

/* Inputs — match button height */
input[type="text"]:not(.camp-search),
input[type="password"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input.time-input-24h,
.time-picker-24h__hour,
.time-picker-24h__minute,
select:not([multiple]) {
    height: 36px;
    min-height: 36px;
    padding-block: 0;
    padding-inline: var(--sp-3);
    border-radius: var(--r-sm);
    box-sizing: border-box;
    font-size: var(--fs-base);
}

.admin-shell input[type="text"],
.admin-shell input[type="password"],
.admin-shell input[type="number"],
.admin-shell select:not([multiple]) {
    height: 36px;
    min-height: 36px;
    padding-block: 0;
    padding-inline: var(--sp-3);
    font-size: var(--fs-base);
    border-radius: var(--r-sm);
}

.admin-shell button,
.admin-shell .btn:not(.btn-sm),
.camp-btn {
    height: 36px;
    min-height: 36px;
    padding-block: 0;
    padding-inline: var(--sp-4);
    font-size: var(--fs-base);
    border-radius: var(--r-sm);
}

/* Do-not-call page — compact wide layout */
body.supervisor-dnc-fit main.legacy-main,
body.supervisor-dnc-fit main {
    max-width: none;
    width: 100%;
    margin: var(--sp-1) 0 0;
    padding: 0 var(--sp-2);
}

.panel.dnc-page {
    padding: var(--sp-3) var(--sp-4);
    margin-bottom: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-sm);
}

.dnc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

.dnc-title {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    line-height: 1.25;
}

.dnc-summary {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--muted);
    line-height: 1.35;
    white-space: nowrap;
}

.dnc-alert {
    margin-bottom: var(--sp-2);
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
}

.dnc-forms {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--sp-3);
    margin-bottom: var(--sp-3);
}

.dnc-card {
    padding: var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--card-bg);
}

.dnc-card h2,
.dnc-list h2 {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
}

.dnc-intro {
    margin: 0 0 var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--muted);
    line-height: 1.35;
}

.dnc-page .field {
    margin-bottom: 0;
    min-width: 0;
}

.dnc-page .field label {
    margin-bottom: var(--sp-1);
    font-size: var(--fs-sm);
}

.dnc-add-form {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) minmax(10rem, 1.4fr) auto;
    gap: var(--sp-2);
    align-items: end;
}

.dnc-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--sp-2);
    align-items: end;
}

.dnc-form-actions {
    display: flex;
    align-items: flex-end;
}

.dnc-page input[type="file"] {
    padding-block: var(--sp-1);
    padding-inline: var(--sp-2);
    min-height: 36px;
}

.dnc-list {
    min-height: 0;
}

.dnc-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: var(--sp-3);
    font-size: var(--fs-sm);
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    background: var(--card-bg);
}

.dnc-table-scroll {
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.dnc-page table.data thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--card-bg);
    font-size: var(--fs-xs);
    white-space: nowrap;
}

.dnc-page table.data th:last-child,
.dnc-page table.data td:last-child {
    width: 1%;
    white-space: nowrap;
    text-align: end;
}

@media (max-width: 900px) {
    .dnc-forms {
        grid-template-columns: 1fr;
    }

    .dnc-add-form,
    .dnc-import-form {
        grid-template-columns: 1fr;
    }

    .dnc-form-actions {
        justify-content: flex-start;
    }
}

/* ── Inline hover tooltips (ui_tip) — content shown via ui-tip.js float ── */
.ui-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    outline: none;
}

.ui-tip--hover {
    cursor: help;
}

.ui-tip__label {
    border-bottom: 1px dotted color-mix(in srgb, var(--muted) 70%, transparent);
}

.ui-tip__bubble {
    display: none !important;
}

.ui-tip-float {
    position: fixed;
    z-index: 10000;
    width: max-content;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    background: var(--text);
    color: var(--bg);
    font-size: var(--fs-sm);
    font-weight: var(--fw-normal);
    line-height: 1.45;
    text-align: start;
    white-space: normal;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.ui-tip-float::after {
    content: '';
    position: absolute;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
}

.ui-tip-float--above::after {
    top: 100%;
    border-top-color: var(--text);
}

.ui-tip-float--below::after {
    bottom: 100%;
    border-bottom-color: var(--text);
}

.ui-tip--icon .ui-tip__label {
    border-bottom: none;
    cursor: default;
}

.ui-tip__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    padding: 0;
    border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: var(--fw-bold);
    font-family: var(--font);
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

.ui-tip__trigger:hover,
.ui-tip__trigger:focus-visible {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: var(--accent-soft);
    outline: none;
}

.admin-sidebar-nav .ui-tip,
.main-tabs .ui-tip,
.fop-panel-head .ui-tip {
    font: inherit;
    font-weight: inherit;
    color: inherit;
}

.admin-sidebar-nav .ui-tip__label,
.main-tabs .ui-tip__label,
.fop-panel-head .ui-tip__label {
    border-bottom: none;
}

h1 .ui-tip,
h2 .ui-tip,
h3 .ui-tip,
th .ui-tip,
label .ui-tip {
    font: inherit;
    font-weight: inherit;
    color: inherit;
}

h1 .ui-tip__label,
h2 .ui-tip__label,
h3 .ui-tip__label {
    border-bottom-color: color-mix(in srgb, currentColor 35%, transparent);
}

.fop-panel-head .ui-tip--hover .ui-tip__label {
    border-bottom-color: color-mix(in srgb, currentColor 40%, transparent);
}

@media (max-width: 640px) {
    .ui-tip-float {
        max-width: min(18rem, calc(100vw - 1rem));
    }
}

.camp-schedule-badge .ui-tip__label {
    border-bottom: none;
}

.camp-schedule-badge .ui-tip--hover {
    cursor: help;
}

.camp-schedule-badge .ui-tip--hover .ui-tip__label {
    border-bottom: 1px dotted color-mix(in srgb, currentColor 35%, transparent);
}

.fop-icon-btn .ui-tip__label,
.camp-delete-btn .ui-tip__label {
    border-bottom: none;
}

/* ============================================================
   Supervisor UI v2 — unified shell, tabs, panels (feature flag)
   ============================================================ */

body.supervisor-ui-v2:not(.admin-shell) {
    background: linear-gradient(165deg, var(--body-grad-1) 0%, var(--bg) 38%, var(--body-grad-2) 100%);
}

body.supervisor-ui-v2:not(.admin-shell) header.legacy-header {
    padding: var(--sp-3) var(--sp-5);
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.supervisor-ui-v2:not(.admin-shell) header .brand {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.01em;
}

body.supervisor-ui-v2:not(.admin-shell) .ui-prefs a {
    font-size: var(--fs-xs);
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--r-sm);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

body.supervisor-ui-v2:not(.admin-shell) .ui-prefs a.active {
    color: var(--accent-contrast);
    background: var(--accent);
    border-color: var(--accent);
}

body.supervisor-ui-v2:not(.admin-shell) .main-tabs-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--tab-bar-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-sm);
}

body.supervisor-ui-v2:not(.admin-shell) .main-tabs,
body.supervisor-ui-v2:not(.admin-shell) .camp-tabs {
    max-width: 1416px;
}

body.supervisor-ui-v2:not(.admin-shell) .main-tabs a:focus-visible,
body.supervisor-ui-v2:not(.admin-shell) .camp-tab-btn:focus-visible,
body.supervisor-ui-v2:not(.admin-shell) .app-tabs__link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

body.supervisor-ui-v2:not(.admin-shell) .main-tabs a.active {
    box-shadow: inset 0 3px 0 var(--tab-active-indicator);
}

body.supervisor-ui-v2:not(.admin-shell) main.legacy-main {
    max-width: 1416px;
    width: 100%;
    margin-inline: auto;
    padding: var(--sp-3) var(--sp-5) var(--sp-4);
}

body.supervisor-ui-v2:not(.admin-shell) main.legacy-main > .panel,
body.supervisor-ui-v2:not(.admin-shell) main.legacy-main > .groups-page,
body.supervisor-ui-v2:not(.admin-shell) main.legacy-main > .camp-page {
    border-radius: var(--r-md);
    border: 1px solid var(--border);
    box-shadow: var(--sh-md);
    background: var(--surface);
}

body.supervisor-ui-v2:not(.admin-shell) .panel {
    border-radius: var(--r-md);
    box-shadow: var(--sh-md);
    padding: var(--sp-4) var(--sp-5);
}

body.supervisor-ui-v2:not(.admin-shell) .panel-head,
body.supervisor-ui-v2:not(.admin-shell) .fop-panel-head,
body.supervisor-ui-v2:not(.admin-shell) .app-panel-head,
body.supervisor-ui-v2:not(.admin-shell) .dash-toolbar,
body.supervisor-ui-v2:not(.admin-shell) .camp-toolbar {
    border-radius: var(--r-md) var(--r-md) 0 0;
}

body.supervisor-ui-v2:not(.admin-shell) .dash-toolbar,
body.supervisor-ui-v2:not(.admin-shell) .camp-toolbar {
    background: linear-gradient(
        135deg,
        var(--dash-toolbar-grad-from) 0%,
        var(--dash-toolbar-grad-mid) 50%,
        var(--dash-toolbar-grad-to) 100%
    );
    color: var(--toolbar-fg);
}

body.supervisor-ui-v2:not(.admin-shell) .dash-clock-ampm,
body.supervisor-ui-v2:not(.admin-shell) .dash-clock-tz {
    color: var(--clock-text);
}

body.supervisor-ui-v2:not(.admin-shell) .dash-kpi-card,
body.supervisor-ui-v2:not(.admin-shell) .camp-kpi-card,
body.supervisor-ui-v2:not(.admin-shell) .stats-funnel {
    background: var(--surface-elevated);
    border-color: var(--border);
    box-shadow: var(--sh-sm);
}

body.supervisor-ui-v2:not(.admin-shell) .dash-kpi-value,
body.supervisor-ui-v2:not(.admin-shell) .camp-kpi-value,
body.supervisor-ui-v2:not(.admin-shell) .stats-funnel-step strong {
    font-variant-numeric: tabular-nums;
}

body.supervisor-ui-v2:not(.admin-shell) table.data thead th,
body.supervisor-ui-v2:not(.admin-shell) table.dash-table thead th {
    background: var(--dash-table-head-bg);
    color: var(--dash-table-head-fg);
}

body.supervisor-ui-v2:not(.admin-shell) .fop-panel,
body.supervisor-ui-v2:not(.admin-shell) .dnc-card,
body.supervisor-ui-v2:not(.admin-shell) .camp-section {
    background: var(--surface);
    border-color: var(--border);
    box-shadow: var(--sh-sm);
}

body.supervisor-ui-v2:not(.admin-shell) .camp-flow-nav {
    background: var(--card-bg);
    border-color: var(--border);
}

body.supervisor-ui-v2:not(.admin-shell) .camp-flow-nav-step.is-active {
    background: var(--nav-active-bg);
    color: var(--nav-active-color);
}

body.supervisor-ui-v2:not(.admin-shell) input:focus-visible,
body.supervisor-ui-v2:not(.admin-shell) select:focus-visible,
body.supervisor-ui-v2:not(.admin-shell) textarea:focus-visible,
body.supervisor-ui-v2:not(.admin-shell) button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

body.supervisor-ui-v2:not(.admin-shell) .dash-filter-btn.is-active,
body.supervisor-ui-v2:not(.admin-shell) .camp-wd-pill input:checked + span {
    background: var(--dash-filter-active-bg);
    color: var(--nav-active-color);
}

body.supervisor-ui-v2:not(.admin-shell) .dash-empty,
body.supervisor-ui-v2:not(.admin-shell) .fop-empty,
body.supervisor-ui-v2:not(.admin-shell) .dnc-empty {
    color: var(--muted);
    border-color: var(--border);
    background: var(--card-bg);
}

[data-theme="dark"] body.supervisor-ui-v2:not(.admin-shell) .main-tabs a.active svg {
    color: var(--accent);
    filter: drop-shadow(0 0 4px var(--tab-indicator-glow));
}

[data-theme="dark"] body.supervisor-ui-v2:not(.admin-shell) .panel,
[data-theme="dark"] body.supervisor-ui-v2:not(.admin-shell) main.legacy-main > .panel {
    background: var(--surface);
}

@media (max-width: 768px) {
    body.supervisor-ui-v2:not(.admin-shell) header.legacy-header {
        padding: var(--sp-2) var(--sp-3);
    }

    body.supervisor-ui-v2:not(.admin-shell) main.legacy-main {
        padding: var(--sp-2) var(--sp-3) var(--sp-3);
    }

    body.supervisor-ui-v2:not(.admin-shell) .panel {
        padding: var(--sp-3);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.supervisor-ui-v2:not(.admin-shell) .main-tabs a,
    body.supervisor-ui-v2:not(.admin-shell) .camp-tab-btn,
    body.supervisor-ui-v2:not(.admin-shell) .stats-tab {
        transition: none;
    }

    [data-theme="dark"] body.supervisor-ui-v2:not(.admin-shell) .main-tabs a.active svg {
        filter: none;
    }
}

/* ============================================================
   Supervisor compact density — unified smaller scale
   ============================================================ */

body.supervisor-compact:not(.admin-shell):not(.auth-page) header.legacy-header {
    padding: var(--sp-2) var(--sp-4);
    gap: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) header .brand {
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .ui-prefs a {
    font-size: var(--fs-xs);
    padding: 2px var(--sp-2);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .main-tabs a,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .camp-tab-btn,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .stats-tab {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
    border-top-width: 2px;
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .main-tabs a svg,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .camp-tab-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) main.legacy-main {
    padding: var(--sp-2) var(--sp-4) var(--sp-3);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .panel,
body.supervisor-compact:not(.admin-shell):not(.auth-page) main.legacy-main > .panel,
body.supervisor-compact:not(.admin-shell):not(.auth-page) main.legacy-main > .groups-page,
body.supervisor-compact:not(.admin-shell):not(.auth-page) main.legacy-main > .camp-page {
    border-radius: var(--r-sm);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .panel-head,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .fop-panel-head,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .app-panel-head {
    padding: var(--sp-2) var(--sp-3);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .dash-toolbar,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .camp-toolbar {
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .dash-toolbar h1,
body.supervisor-compact:not(.admin-shell):not(.auth-page) .camp-toolbar-start h1 {
    font-size: var(--fs-md);
}

body.supervisor-compact:not(.admin-shell):not(.auth-page) .dash-icon {
    width: 1.5rem;
    height: 1.5rem;
    font-size: var(--fs-sm);
}

body.supervisor-compact.dash-page .dash-body {
    padding: var(--sp-3) var(--sp-4) var(--sp-3);
}

body.supervisor-compact.dash-page .dash-clock {
    padding: var(--sp-1) var(--sp-1);
    gap: 2px;
}

body.supervisor-compact.dash-page .dash-clock-seg {
    min-width: 2.7rem;
    padding: 2px var(--sp-1);
}

body.supervisor-compact.dash-page .dash-clock-val {
    font-size: var(--fs-lg);
}

body.supervisor-compact.dash-page .dash-clock-lbl {
    margin-top: 1px;
    font-size: 0.625rem;
}

body.supervisor-compact.dash-page .dash-clock-ampm,
body.supervisor-compact.dash-page .dash-clock-tz {
    font-size: 0.625rem;
    padding: 1px var(--sp-1);
}

body.supervisor-compact:not(.admin-shell) .dash-kpi-grid,
body.supervisor-compact:not(.admin-shell) .dash-layout-v3 .dash-kpi-grid {
    gap: var(--sp-2);
    margin-bottom: var(--sp-2);
}

body.supervisor-compact.dash-page .dash-toolbar-cluster {
    gap: var(--sp-1);
    padding: 2px;
}

body.supervisor-compact.dash-page .dash-toolbar-stats {
    gap: var(--sp-1);
}

body.supervisor-compact.dash-page .dash-toolbar-stat {
    width: 5.75rem;
    min-height: 2.85rem;
    padding: var(--sp-1) var(--sp-2);
}

body.supervisor-compact.dash-page .dash-toolbar-stat-val {
    font-size: var(--fs-md);
}

body.supervisor-compact.dash-page .dash-toolbar-stat-lbl {
    font-size: 0.5625rem;
}

body.supervisor-compact.dash-page .dash-ami-beacon {
    width: 1.5rem;
    height: 1.5rem;
}

body.supervisor-compact.dash-page .dash-ami-beacon__lens {
    width: 0.5rem;
    height: 0.5rem;
}

body.supervisor-compact:not(.admin-shell) .dash-kpi-card,
body.supervisor-compact:not(.admin-shell) .camp-kpi-card {
    padding: var(--sp-2);
    gap: 2px;
    border-radius: var(--r-sm);
}

body.supervisor-compact:not(.admin-shell) .dash-kpi-value,
body.supervisor-compact:not(.admin-shell) .camp-kpi-value {
    font-size: var(--fs-md);
}

body.supervisor-compact:not(.admin-shell) .dash-kpi-label,
body.supervisor-compact:not(.admin-shell) .camp-kpi-label {
    font-size: 0.6875rem;
}

body.supervisor-compact:not(.admin-shell) .dash-kpi-sub,
body.supervisor-compact:not(.admin-shell) .camp-kpi-sub {
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .dash-filters {
    gap: var(--sp-1);
    margin-bottom: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .dash-filter-btn {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .dash-status-bar {
    padding: var(--sp-2) var(--sp-3);
    margin-bottom: var(--sp-2);
    font-size: var(--fs-sm);
    gap: var(--sp-1) var(--sp-3);
}

body.supervisor-compact:not(.admin-shell) .dash-alert {
    padding: var(--sp-2);
    margin-bottom: var(--sp-2);
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell) table.dash-table {
    font-size: var(--fs-sm);
    min-width: 46rem;
}

body.supervisor-compact:not(.admin-shell) table.dash-table th,
body.supervisor-compact:not(.admin-shell) table.dash-table td {
    padding: var(--sp-2) var(--sp-1);
}

body.supervisor-compact.dash-page table.dash-table th {
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .dash-control-btn {
    width: 1.75rem;
    height: 1.75rem;
    font-size: var(--fs-xs);
    border-width: 1.5px;
}

body.supervisor-compact:not(.admin-shell) .dash-badge {
    padding: 1px var(--sp-2);
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .dash-campaign-name {
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell) .dash-footer-meta {
    padding: var(--sp-1) 0 0;
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .dash-campaign-card {
    padding: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .camp-section {
    padding: var(--sp-3);
    margin-bottom: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .camp-section h3 {
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .camp-flow-nav-step {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .numbers-head,
body.supervisor-compact:not(.admin-shell) .dnc-head {
    padding: var(--sp-2) var(--sp-3);
    gap: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .numbers-head h1,
body.supervisor-compact:not(.admin-shell) .dnc-head h1 {
    font-size: var(--fs-md);
}

body.supervisor-compact:not(.admin-shell) .numbers-filters,
body.supervisor-compact:not(.admin-shell) .dnc-forms {
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
}

body.supervisor-compact:not(.admin-shell) table.data th,
body.supervisor-compact:not(.admin-shell) table.data td {
    padding: var(--sp-2) var(--sp-2);
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell) table.data thead th {
    font-size: var(--fs-xs);
}

body.supervisor-compact:not(.admin-shell) .fop-table th,
body.supervisor-compact:not(.admin-shell) .fop-table td {
    padding: var(--sp-2);
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell) .fop-table thead th {
    font-size: var(--fs-xs);
    padding: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .fop-btn,
body.supervisor-compact:not(.admin-shell) .fop-btn-primary,
body.supervisor-compact:not(.admin-shell) .fop-btn-secondary {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-sm);
    min-height: 1.75rem;
}

body.supervisor-compact:not(.admin-shell) .dnc-card {
    padding: var(--sp-3);
}

body.supervisor-compact:not(.admin-shell) .field {
    margin-bottom: var(--sp-2);
}

body.supervisor-compact:not(.admin-shell) .field label {
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-1);
}

body.supervisor-compact:not(.admin-shell) input[type="text"],
body.supervisor-compact:not(.admin-shell) input[type="password"],
body.supervisor-compact:not(.admin-shell) input[type="number"],
body.supervisor-compact:not(.admin-shell) input[type="email"],
body.supervisor-compact:not(.admin-shell) input[type="date"],
body.supervisor-compact:not(.admin-shell) select,
body.supervisor-compact:not(.admin-shell) textarea {
    padding: var(--sp-1) var(--sp-2);
    font-size: var(--fs-sm);
}

body.supervisor-compact:not(.admin-shell) button,
body.supervisor-compact:not(.admin-shell) .btn-primary,
body.supervisor-compact:not(.admin-shell) .btn-secondary {
    padding: var(--sp-1) var(--sp-3);
    font-size: var(--fs-sm);
    min-height: 1.75rem;
}

body.page-fit.supervisor-compact:not(.admin-shell) .dash-filters,
body.page-fit.supervisor-compact:not(.admin-shell) .dash-ai-panel,
body.page-fit.supervisor-compact:not(.admin-shell) .dash-insights-wrap,
body.page-fit.supervisor-compact:not(.admin-shell) .dash-alert,
body.page-fit.supervisor-compact:not(.admin-shell) .dash-status-bar,
body.page-fit.supervisor-compact:not(.admin-shell) .dash-footer-meta {
    flex-shrink: 0;
}

@media (max-width: 900px) {
    body.supervisor-compact:not(.admin-shell):not(.auth-page) main.legacy-main {
        padding: var(--sp-2) var(--sp-3);
    }

    body.supervisor-compact:not(.admin-shell) .main-tabs a,
    body.supervisor-compact:not(.admin-shell) .camp-tab-btn {
        padding: var(--sp-1) var(--sp-2);
        font-size: var(--fs-xs);
    }
}

/* Admin shell UI hardening — page headers + empty-state icons */
.admin-shell .admin-topbar {
    flex-shrink: 0;
    isolation: isolate;
}

.admin-shell .admin-content {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.admin-shell .admin-page-header {
    display: block;
    position: static;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    min-height: 0;
}

.admin-shell .admin-empty {
    flex: 0 0 auto;
    min-height: 0;
    overflow: hidden;
}

.admin-shell .admin-empty-icon {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    margin-inline: auto;
    overflow: hidden;
}

.admin-shell .admin-empty-icon svg {
    display: block;
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
}

.tts-sync-results {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
}

.tts-api-status {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tts-api-status--ok {
    color: var(--accent, #1f8a7d);
}

.tts-sync-results--simple .tts-sync-summary {
    margin-bottom: 0.5rem;
}

.tts-sync-summary {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.tts-sync-progress {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.tts-sync-progress-bar {
    height: 100%;
    background: var(--accent, #22c55e);
}

.tts-sync-voices-wrap {
    max-height: 220px;
    overflow: auto;
}

.camp-tts-account-card {
    margin: 0.75rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    display: grid;
    gap: 0.35rem;
}

.camp-tts-alert {
    color: var(--warning, #f59e0b);
}

.camp-tts-setup-row {
    display: block;
    margin-bottom: 0.75rem;
}

.camp-tts-setup-main {
    min-width: 0;
}

.camp-tts-test-mount {
    margin-top: 0.85rem;
    margin-bottom: 0;
}

.camp-tts-test-mount .camp-tts-test-panel[hidden] {
    display: none !important;
}

.camp-tts-test-mount .camp-tts-test-panel {
    margin: 0;
}

.camp-tts-test-panel {
    border: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.1));
    border-radius: 10px;
    padding: 0.85rem 1rem;
    background: var(--surface-2, rgba(0, 0, 0, 0.03));
}

.camp-tts-test-title {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.camp-tts-test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}
