:root {
    --ms-bg: #f5f7fb;
    --ms-surface: #ffffff;
    --ms-surface-2: #f8fafc;
    --ms-surface-3: #eef2f7;
    --ms-text: #111827;
    --ms-text-2: #334155;
    --ms-muted: #64748b;
    --ms-muted-2: #94a3b8;
    --ms-border: #e2e8f0;
    --ms-border-strong: #cbd5e1;
    --ms-sidebar: #0f172a;
    --ms-sidebar-2: #111827;
    --ms-sidebar-text: #cbd5e1;
    --ms-primary: #2563eb;
    --ms-primary-2: #1d4ed8;
    --ms-primary-soft: #eff6ff;
    --ms-success: #059669;
    --ms-success-soft: #ecfdf5;
    --ms-warning: #b45309;
    --ms-warning-soft: #fffbeb;
    --ms-danger: #dc2626;
    --ms-danger-soft: #fef2f2;
    --ms-purple: #7c3aed;
    --ms-purple-soft: #f5f3ff;
    --ms-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --ms-shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --ms-shadow-md: 0 10px 28px rgba(15, 23, 42, .08);
    --ms-shadow-lg: 0 24px 64px rgba(15, 23, 42, .14);
    --ms-radius-sm: 8px;
    --ms-radius: 12px;
    --ms-radius-lg: 16px;
    --ms-sidebar-width: 248px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ms-bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ms-text);
    background: var(--ms-bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
img { max-width: 100%; }
/* Safety invariant: an SVG without an explicit component size must never expand to its 300x150 browser default. */
svg { display: inline-block; width: 1em; height: 1em; flex: 0 0 auto; vertical-align: -0.125em; }

/* ---------- Shared primitives ---------- */
.eyebrow {
    color: var(--ms-muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.muted { color: var(--ms-muted); line-height: 1.65; }
.text-link { color: var(--ms-primary); text-decoration: none; font-size: 13px; font-weight: 700; }
.text-link:hover { color: var(--ms-primary-2); }

.btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 14px;
    background: #fff;
    color: var(--ms-text-2);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .08s ease;
}
.btn:hover { border-color: var(--ms-border-strong); background: #f8fafc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary {
    color: #fff;
    border-color: #2563eb;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, .18);
}
.btn-primary:hover { color: #fff; border-color: #1d4ed8; background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%); }
.btn-secondary { border-color: var(--ms-border); background: #fff; }
.btn-ghost { color: inherit; border-color: rgba(148,163,184,.16); background: rgba(255,255,255,.035); }
.btn-ghost:hover { color: #fff; border-color: rgba(148,163,184,.24); background: rgba(255,255,255,.075); }
.btn-full { width: 100%; }

.badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ms-border);
    border-radius: 999px;
    padding: 3px 9px;
    background: #f8fafc;
    color: var(--ms-muted);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: #94a3b8; }
.badge.success { color: #047857; border-color: #a7f3d0; background: var(--ms-success-soft); }
.badge.success::before { background: #10b981; }
.badge.warning { color: #a16207; border-color: #fde68a; background: var(--ms-warning-soft); }
.badge.warning::before { background: #f59e0b; }
.badge.info { color: #1d4ed8; border-color: #bfdbfe; background: var(--ms-primary-soft); }
.badge.info::before { background: #3b82f6; }

.panel {
    background: var(--ms-surface);
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius-lg);
    box-shadow: var(--ms-shadow-xs);
}
.panel-pad { padding: 22px; }
.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.panel-head h3 { margin: 4px 0 0; color: var(--ms-text); font-size: 17px; line-height: 1.3; letter-spacing: -.02em; }
.panel-head p { margin: 6px 0 0; color: var(--ms-muted); font-size: 12px; line-height: 1.6; }

.alert { margin: 14px 0 0; padding: 11px 13px; border: 1px solid var(--ms-border); border-radius: 10px; font-size: 12px; line-height: 1.55; }
.alert-error { color: #b91c1c; border-color: #fecaca; background: var(--ms-danger-soft); }
.alert-warning { color: #a16207; border-color: #fde68a; background: var(--ms-warning-soft); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { color: var(--ms-text-2); font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    background: #fff;
    color: var(--ms-text);
    box-shadow: var(--ms-shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 108px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(59,130,246,.11); }
.field input::placeholder, .field textarea::placeholder { color: #a8b4c4; }
.field-error { margin-top: 5px; color: var(--ms-danger); font-size: 11px; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }

/* ---------- Admin application shell ---------- */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: var(--ms-sidebar-width) minmax(0,1fr); }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--ms-sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 16px;
    color: var(--ms-sidebar-text);
    background:
        radial-gradient(circle at 8% 2%, rgba(59,130,246,.16), transparent 28%),
        linear-gradient(180deg, #101827 0%, #0f172a 100%);
    border-right: 1px solid rgba(148,163,184,.08);
    overflow-y: auto;
}
.sidebar-brand-wrap { padding: 0 7px 17px; border-bottom: 1px solid rgba(148,163,184,.10); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg,#3b82f6,#1d4ed8);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -.04em;
    box-shadow: 0 8px 22px rgba(37,99,235,.24), inset 0 1px 0 rgba(255,255,255,.24);
}
.brand-copy { min-width: 0; display: flex; flex-direction: column; }
.brand-copy strong { font-size: 17px; line-height: 1.1; letter-spacing: -.025em; }
.brand-copy span { margin-top: 2px; color: #708198; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.nav-section { margin: 18px 4px 0; }
.nav-label { margin: 0 9px 8px; color: #5f7087; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    position: relative;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #91a1b7;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    transition: color .15s ease, background .15s ease;
}
.nav-item:hover { color: #f8fafc; background: rgba(148,163,184,.075); }
.nav-item.active { color: #fff; background: rgba(37,99,235,.18); }
.nav-item.active::before { content: ""; position: absolute; left: -4px; top: 11px; bottom: 11px; width: 3px; border-radius: 10px; background: #60a5fa; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-card { margin: 14px 4px; padding: 12px; border: 1px solid rgba(148,163,184,.10); border-radius: 11px; background: rgba(255,255,255,.03); }
.sidebar-card-row { display: flex; align-items: center; gap: 9px; }
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.09); }
.sidebar-card strong { display: block; color: #dce6f2; font-size: 11px; }
.sidebar-card small { display: block; margin-top: 2px; color: #68798f; font-size: 9px; }
.sidebar-footer { padding: 13px 4px 0; border-top: 1px solid rgba(148,163,184,.10); }
.user-mini { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(96,165,250,.16);
    border-radius: 10px;
    color: #dbeafe;
    background: #1e3a5f;
    font-size: 12px;
    font-weight: 800;
}
.user-mini-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.user-mini-copy strong, .user-mini-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini-copy strong { color: #e5edf7; font-size: 11.5px; }
.user-mini-copy span { margin-top: 2px; color: #65758b; font-size: 9.5px; }
.logout-form { margin-top: 9px; }

.main { grid-column: 2; min-width: 0; min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 26px;
    border-bottom: 1px solid rgba(226,232,240,.92);
    background: rgba(248,250,252,.92);
    backdrop-filter: blur(14px);
}
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.page-kicker { margin-bottom: 1px; color: var(--ms-muted-2); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar h1 { margin: 0; color: var(--ms-text); font-size: 19px; line-height: 1.25; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-link, .user-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--ms-border);
    border-radius: 10px;
    background: rgba(255,255,255,.92);
    color: var(--ms-text-2);
    text-decoration: none;
    box-shadow: var(--ms-shadow-xs);
}
.topbar-link { padding: 0 11px; font-size: 11.5px; font-weight: 700; }
.topbar-link svg { width: 14px; height: 14px; }
.user-chip { max-width: 240px; padding: 4px 9px 4px 5px; }
.user-chip-avatar {
    width: 27px;
    height: 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #1e40af;
    background: #dbeafe;
    font-size: 10px;
    font-weight: 850;
}
.user-chip-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.12; }
.user-chip-copy strong, .user-chip-copy span { max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-copy strong { font-size: 10.5px; }
.user-chip-copy span { margin-top: 2px; color: var(--ms-muted-2); font-size: 9px; }
.mobile-menu { width: 36px; height: 36px; display: none; align-items: center; justify-content: center; border: 1px solid var(--ms-border); border-radius: 9px; background: #fff; color: var(--ms-text-2); box-shadow: var(--ms-shadow-xs); cursor: pointer; }
.mobile-menu svg { width: 18px; height: 18px; }
.sidebar-overlay { display: none; }

.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px 26px 44px; }
.admin-footer { max-width: 1480px; margin: 0 auto; display: flex; justify-content: space-between; gap: 14px; padding: 0 26px 26px; color: var(--ms-muted-2); font-size: 10px; }

/* ---------- Dashboard ---------- */
.dashboard-hero {
    position: relative;
    min-height: 178px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 24px 26px;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 10%, rgba(147,197,253,.25), transparent 24%),
        linear-gradient(125deg, #172554 0%, #1e3a8a 48%, #1d4ed8 100%);
    box-shadow: 0 16px 38px rgba(30,64,175,.15);
}
.dashboard-hero::after { content: ""; position: absolute; right: -45px; top: -55px; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 28px rgba(255,255,255,.03), 0 0 0 56px rgba(255,255,255,.025); }
.hero-copy, .hero-side { position: relative; z-index: 1; }
.hero-copy { max-width: 720px; }
.dashboard-hero .eyebrow { color: #bfdbfe; }
.hero-copy h2 { margin: 7px 0 8px; font-size: clamp(23px,3vw,34px); line-height: 1.14; letter-spacing: -.04em; }
.hero-copy p { max-width: 680px; margin: 0; color: #dbeafe; font-size: 12.5px; line-height: 1.65; }
.hero-side { min-width: 180px; display: flex; align-items: flex-end; flex-direction: column; gap: 9px; }
.hero-version, .hero-online { border: 1px solid rgba(255,255,255,.13); border-radius: 999px; padding: 6px 9px; background: rgba(15,23,42,.18); backdrop-filter: blur(8px); font-size: 9.5px; font-weight: 700; }
.hero-online { display: flex; align-items: center; gap: 7px; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    min-height: 118px;
    padding: 17px;
    border: 1px solid var(--ms-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--ms-shadow-xs);
}
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--ms-muted); font-size: 10.5px; font-weight: 700; }
.stat-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbeafe;
    border-radius: 9px;
    color: #2563eb;
    background: #eff6ff;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.amber { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.stat-icon.purple { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.stat-icon.green { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.stat-value { display: block; margin-top: 11px; color: var(--ms-text); font-size: 20px; line-height: 1.15; letter-spacing: -.025em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-help { margin-top: 4px; color: var(--ms-muted-2); font-size: 9.5px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: 14px; }
.profile-block, .health-card { padding: 20px; }
.profile-head { display: flex; align-items: center; gap: 12px; margin: 2px 0 18px; }
.profile-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; color: #1d4ed8; background: #eff6ff; border: 1px solid #dbeafe; font-size: 15px; font-weight: 850; }
.profile-copy h3 { margin: 0; font-size: 14px; }
.profile-copy p { margin: 3px 0 0; color: var(--ms-muted); font-size: 10.5px; }
.detail-list { margin: 0; border-top: 1px solid var(--ms-border); }
.detail-list > div { display: grid; grid-template-columns: 132px minmax(0,1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ms-border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--ms-muted); font-size: 10.5px; }
.detail-list dd { margin: 0; color: var(--ms-text-2); font-size: 10.5px; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.health-list { border-top: 1px solid var(--ms-border); }
.health-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ms-border); }
.health-label { display: flex; align-items: center; gap: 9px; color: var(--ms-text-2); font-size: 10.5px; font-weight: 650; }
.health-label-icon { width: 28px; height: 28px; flex: 0 0 28px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ms-border); border-radius: 8px; background: #fff; color: #475569; }
.health-label-icon svg { width: 13px; height: 13px; }
.health-value { color: var(--ms-success); font-size: 10px; font-weight: 800; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.quick-link { padding: 10px 11px; border: 1px solid var(--ms-border); border-radius: 10px; background: #fff; color: var(--ms-text-2); text-decoration: none; font-size: 10.5px; font-weight: 700; }
.quick-link:hover { color: var(--ms-primary-2); border-color: #bfdbfe; background: #f8fbff; }
.request-meta { margin-top: 14px; color: var(--ms-muted-2); font-size: 9.5px; }
.request-meta code, .content code { padding: 2px 5px; border-radius: 6px; background: #f1f5f9; color: #475569; font-size: .92em; }

/* ---------- Page headers, module table ---------- */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-intro h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.2; letter-spacing: -.03em; }
.page-intro p { max-width: 740px; margin: 7px 0 0; color: var(--ms-muted); font-size: 12px; line-height: 1.6; }
.module-panel { overflow: hidden; }
.module-panel .panel-head { margin: 0; padding: 18px 20px 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 16px; border-top: 1px solid var(--ms-border); border-bottom: 1px solid var(--ms-border); background: #fbfcfe; color: var(--ms-muted-2); text-align: left; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.table td { padding: 13px 16px; border-bottom: 1px solid #edf2f7; color: var(--ms-text-2); font-size: 11px; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfdff; }
.module-cell { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.module-logo { width: 34px; height: 34px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; border: 1px solid #dbeafe; border-radius: 10px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 850; }
.module-copy strong { display: block; color: var(--ms-text); font-size: 11.5px; }
.table-sub { margin-top: 2px; color: var(--ms-muted-2); font-size: 9px; }
.dependencies { display: flex; flex-wrap: wrap; gap: 5px; }
.dependency-pill { padding: 3px 7px; border-radius: 7px; color: #475569; background: #f1f5f9; font-size: 9px; font-weight: 650; }
.page-note { margin-top: 12px; color: var(--ms-muted-2); font-size: 9.5px; }

/* Compatibility for current Settings V0.1 view */
.hero-card {
    min-height: 128px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(135deg,#f8fbff 0%,#eff6ff 100%);
    box-shadow: var(--ms-shadow-xs);
}
.hero-card h2 { margin: 5px 0 6px; font-size: 21px; letter-spacing: -.03em; }
.hero-card p { max-width: 720px; margin: 0; color: var(--ms-muted); font-size: 11.5px; line-height: 1.6; }
.hero-badge { border: 1px solid #bfdbfe; border-radius: 999px; padding: 5px 9px; color: #1d4ed8; background: #fff; font-size: 9.5px; font-weight: 800; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px !important; }
.settings-section { margin-bottom: 16px; }
.settings-section > .panel-head { margin: 0 0 9px !important; }
.settings-section .panel { padding: 16px; box-shadow: var(--ms-shadow-xs); }
.setting-help { color: var(--ms-muted) !important; font-size: 10.5px !important; }
.setting-meta { color: var(--ms-muted-2) !important; font-size: 9px !important; }
.settings-actions { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: flex-end; margin-top: 16px; padding: 9px; border: 1px solid rgba(226,232,240,.92); border-radius: 12px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: var(--ms-shadow-md); }

/* ---------- Authentication ---------- */
.auth-body {
    min-height: 100vh;
    background: #eef2f7;
}
.auth-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(520px, 1.1fr);
}
.auth-showcase {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 46px clamp(34px,5vw,72px);
    color: #fff;
    background:
        radial-gradient(circle at 12% 8%, rgba(96,165,250,.28), transparent 30%),
        radial-gradient(circle at 88% 86%, rgba(59,130,246,.16), transparent 28%),
        linear-gradient(145deg,#0f172a 0%,#172554 48%,#1e3a8a 100%);
}
.auth-showcase::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 56px rgba(255,255,255,.025), 0 0 0 112px rgba(255,255,255,.02); }
.auth-brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.auth-brand-copy { display: flex; flex-direction: column; }
.auth-brand-copy strong { font-size: 17px; line-height: 1.05; letter-spacing: -.03em; }
.auth-brand-copy span { margin-top: 2px; color: #8ea2bf; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-showcase-copy { position: relative; z-index: 1; max-width: 510px; margin-top: clamp(110px,18vh,180px); }
.auth-showcase-copy .eyebrow { color: #93c5fd; }
.auth-showcase-copy h2 { margin: 9px 0 14px; font-size: clamp(34px,4.2vw,58px); line-height: 1.02; letter-spacing: -.055em; }
.auth-showcase-copy p { max-width: 480px; margin: 0; color: #cbd5e1; font-size: 13px; line-height: 1.75; }
.auth-points { display: grid; gap: 10px; margin-top: 32px; }
.auth-point { display: flex; align-items: center; gap: 10px; color: #dbeafe; font-size: 11px; font-weight: 650; }
.auth-point-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(147,197,253,.17); border-radius: 8px; background: rgba(255,255,255,.045); color: #93c5fd; }
.auth-point-icon svg { width: 14px; height: 14px; }
.auth-showcase-footer { position: absolute; z-index: 1; left: clamp(34px,5vw,72px); right: clamp(34px,5vw,72px); bottom: 34px; display: flex; justify-content: space-between; gap: 12px; color: #64748b; font-size: 9px; }

.auth-workspace {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px clamp(28px,6vw,88px);
    background: #f8fafc;
}
.auth-panel { width: 100%; max-width: 440px; }
.auth-mobile-brand { display: none; margin-bottom: 28px; align-items: center; gap: 9px; color: var(--ms-text); text-decoration: none; font-weight: 850; }
.auth-kicker { margin-bottom: 8px; color: var(--ms-primary); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.auth-title { margin: 0; color: var(--ms-text); font-size: 31px; line-height: 1.12; letter-spacing: -.045em; }
.auth-subtitle { margin: 9px 0 0; color: var(--ms-muted); font-size: 12.5px; line-height: 1.65; }
.auth-card {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--ms-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15,23,42,.07);
}
.auth-card .form-stack { margin-top: 0; }
.auth-card .alert { margin: 0 0 14px; }
.auth-meta { margin-top: 18px; text-align: center; color: var(--ms-muted-2); font-size: 10px; }
.auth-meta a { color: var(--ms-primary); font-weight: 750; text-decoration: none; }
.auth-security { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ms-muted-2); font-size: 9.5px; }
.auth-security svg { width: 13px; height: 13px; }
.setup-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ms-border); color: var(--ms-muted); text-align: center; font-size: 10.5px; }
.setup-note a { color: var(--ms-primary); font-weight: 750; text-decoration: none; }
.auth-card code { padding: 2px 5px; border-radius: 5px; color: #475569; background: #f1f5f9; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .auth-page { grid-template-columns: minmax(320px,.78fr) minmax(480px,1.22fr); }
}
@media (max-width: 900px) {
    .admin-shell { display: block; }
    .main { min-height: 100vh; }
    .sidebar { transform: translateX(-102%); transition: transform .2s ease; box-shadow: 24px 0 60px rgba(15,23,42,.2); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 35; background: rgba(15,23,42,.42); backdrop-filter: blur(2px); }
    body.sidebar-open .sidebar-overlay { display: block; }
    .mobile-menu { display: inline-flex; }
    .topbar { padding: 0 17px; }
    .content { padding: 20px 17px 36px; }
    .admin-footer { padding: 0 17px 22px; }
    .auth-page { display: block; min-height: 100vh; }
    .auth-showcase { display: none; }
    .auth-workspace { min-height: 100vh; padding: 28px 20px; }
    .auth-mobile-brand { display: flex; }
}
@media (max-width: 620px) {
    .topbar { min-height: 60px; }
    .topbar h1 { font-size: 17px; }
    .page-kicker { display: none; }
    .topbar-link { display: none; }
    .user-chip-copy { display: none; }
    .user-chip { padding-right: 5px; }
    .dashboard-hero { min-height: 0; display: block; padding: 21px 18px; }
    .hero-side { min-width: 0; align-items: flex-start; margin-top: 17px; }
    .stats-grid { grid-template-columns: 1fr; gap: 9px; }
    .stat-card { min-height: 106px; }
    .quick-links { grid-template-columns: 1fr; }
    .detail-list > div { grid-template-columns: 100px minmax(0,1fr); gap: 9px; }
    .field-grid, .settings-grid { grid-template-columns: 1fr !important; }
    .page-intro { align-items: flex-start; flex-direction: column; }
    .hero-card { display: block; }
    .hero-badge { display: inline-flex; margin-top: 14px; }
    .auth-workspace { align-items: flex-start; padding-top: 34px; }
    .auth-card { padding: 20px; }
    .auth-title { font-size: 27px; }
    .table th, .table td { padding-left: 12px; padding-right: 12px; }
    .admin-footer { display: block; line-height: 1.7; }
}

/* ---------- V0.2.2 deployment-safe refinements ---------- */
svg[width], svg[height] { max-width: 100%; }
.auth-point-icon > svg,
.auth-security > svg,
.mobile-menu > svg,
.topbar-link > svg,
.health-label-icon > svg,
.stat-icon > svg,
.nav-icon > svg {
    display: block;
    width: 100%;
    height: 100%;
}
.auth-point-icon { width: 34px; height: 34px; flex: 0 0 34px; }
.auth-point-icon > svg { width: 17px; height: 17px; }
.auth-security > svg { width: 15px; height: 15px; }
.mobile-menu > svg { width: 20px; height: 20px; }
.topbar-link > svg { width: 14px; height: 14px; }
.health-label-icon > svg { width: 16px; height: 16px; }
.stat-icon > svg { width: 18px; height: 18px; }
