/*
 * Copyright (c) 2026 Stolen Youth Organization (Pty) Ltd
 * All rights reserved. Unauthorised copying or distribution of this file,
 * via any medium, is strictly prohibited.
 *
 * SY Console: the shared look for Stolen Youth admin consoles (SY-IAM first, then SY Auto SEO and Pulseflow).
 * Dark navy sidebar, light content with an automatic dark mode, teal/green/gold brand accents, dense data
 * tables, KPI tiles and status pills, in the spirit of IBM Security Verify, JumpCloud and NordLayer.
 * Product-neutral: products set only --sy-brand (and their logo). Plain element styles (h1, table, .card,
 * .btn, .badge, .field, .notice) are covered too, so existing markup upgrades without rewrites.
 */
:root {
    color-scheme: light;
    --sy-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sy-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    /* Brand */
    --sy-navy: #0b1f2a;
    --sy-navy-2: #0f2e40;
    --sy-teal: #1f6f6a;
    --sy-green: #3e9a73;
    --sy-gold: #e8a43a;
    --sy-brand: var(--sy-teal);
    --sy-brand-strong: #17574f;
    --sy-brand-soft: rgba(31, 111, 106, 0.12);

    /* Surfaces & text (light) */
    --sy-bg: #f3f5f7;
    --sy-surface: #ffffff;
    --sy-surface-2: #f8fafb;
    --sy-border: #e1e6ea;
    --sy-border-strong: #c9d1d8;
    --sy-text: #13232e;
    --sy-muted: #5b6b76;
    --sy-faint: #8796a0;

    /* Sidebar (dark in both themes) */
    --sy-side-bg: var(--sy-navy);
    --sy-side-text: #c9d6dc;
    --sy-side-muted: #7f97a3;
    --sy-side-hover: rgba(255, 255, 255, 0.06);
    --sy-side-active: rgba(232, 164, 58, 0.14);

    /* Status */
    --sy-ok: #1e8e5a;      --sy-ok-soft: rgba(30, 142, 90, 0.12);
    --sy-warn: #b7791f;    --sy-warn-soft: rgba(232, 164, 58, 0.16);
    --sy-bad: #c53030;     --sy-bad-soft: rgba(197, 48, 48, 0.1);
    --sy-info: #2563eb;    --sy-info-soft: rgba(37, 99, 235, 0.1);

    --sy-radius: 10px;
    --sy-radius-sm: 6px;
    --sy-shadow: 0 1px 2px rgba(16, 32, 44, 0.06), 0 1px 3px rgba(16, 32, 44, 0.05);
    --sy-shadow-lg: 0 12px 32px rgba(16, 32, 44, 0.16);
    --sy-side-w: 248px;
    --sy-top-h: 56px;
}

/* Dark mode: follows the device unless the person picked one (data-theme). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --sy-bg: #070c13; --sy-surface: #101a24; --sy-surface-2: #0c141e; --sy-border: #1f2e3c; --sy-border-strong: #2c3f50;
        --sy-text: #e9f2f7; --sy-muted: #90a3b5; --sy-faint: #6c8090;
        --sy-side-bg: #060b11; --sy-brand: #45c2ab; --sy-brand-strong: #6fe3c7; --sy-brand-soft: rgba(69, 194, 171, 0.14);
        --sy-ok: #4fd18e; --sy-ok-soft: rgba(79, 209, 142, 0.12); --sy-warn: #f0b85a; --sy-bad: #f07272; --sy-bad-soft: rgba(240, 114, 114, 0.12);
        --sy-info: #7aa7ff; --sy-info-soft: rgba(122, 167, 255, 0.12);
        --sy-shadow: none; --sy-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --sy-bg: #070c13; --sy-surface: #101a24; --sy-surface-2: #0c141e; --sy-border: #1f2e3c; --sy-border-strong: #2c3f50;
    --sy-text: #e9f2f7; --sy-muted: #90a3b5; --sy-faint: #6c8090;
    --sy-side-bg: #060b11; --sy-brand: #45c2ab; --sy-brand-strong: #6fe3c7; --sy-brand-soft: rgba(69, 194, 171, 0.14);
    --sy-ok: #4fd18e; --sy-ok-soft: rgba(79, 209, 142, 0.12); --sy-warn: #f0b85a; --sy-bad: #f07272; --sy-bad-soft: rgba(240, 114, 114, 0.12);
    --sy-info: #7aa7ff; --sy-info-soft: rgba(122, 167, 255, 0.12);
    --sy-shadow: none; --sy-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--sy-font); background: var(--sy-bg); color: var(--sy-text); }
:where(a) { color: var(--sy-brand); text-decoration: none; }
:where(a:hover) { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--sy-gold); outline-offset: 2px; }
code, .sy-mono { font-family: var(--sy-mono); font-size: 12.5px; background: var(--sy-surface-2); border: 1px solid var(--sy-border); border-radius: 4px; padding: 1px 6px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--sy-border); margin: 16px 0; }
.sy-muted, .muted { color: var(--sy-muted); }
.sy-faint { color: var(--sy-faint); font-size: 12px; }
.sy-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.sy-shell { display: grid; grid-template-columns: var(--sy-side-w) 1fr; min-height: 100vh; }
.sy-sidebar {
    background: var(--sy-side-bg); color: var(--sy-side-text); position: sticky; top: 0; height: 100vh; overflow-y: auto;
    display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; border-right: 1px solid rgba(255, 255, 255, 0.04);
}
.sy-brand { display: flex; align-items: center; padding: 4px 8px 18px; }
.sy-brand img { height: 34px; width: auto; display: block; }
.sy-nav-section { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--sy-side-muted); padding: 14px 10px 6px; font-weight: 650; }
.sy-nav-link {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--sy-side-text);
    font-size: 13.5px; text-decoration: none; position: relative;
}
.sy-nav-link:hover { background: var(--sy-side-hover); color: #fff; text-decoration: none; }
.sy-nav-link.active { background: var(--sy-side-active); color: #fff; }
.sy-nav-link.active::before { content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sy-gold); }
.sy-nav-link svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.sy-nav-count { margin-left: auto; background: var(--sy-bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.sy-sidebar-foot { margin-top: auto; padding: 16px 10px 12px; font-size: 11.5px; color: var(--sy-side-muted); border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sy-sidebar-foot a { color: var(--sy-side-muted); }

.sy-main { min-width: 0; display: flex; flex-direction: column; }
.sy-topbar {
    height: var(--sy-top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--sy-surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--sy-border);
}
.sy-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--sy-surface-2); border: 1px solid var(--sy-border); border-radius: 8px; padding: 0 10px; height: 36px; }
.sy-search svg { width: 16px; height: 16px; color: var(--sy-faint); flex: none; }
.sy-search input { border: 0; background: transparent; outline: none; color: var(--sy-text); font: inherit; width: 100%; height: 100%; }
.sy-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sy-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent;
    background: transparent; color: var(--sy-muted); cursor: pointer; position: relative; text-decoration: none;
}
.sy-icon-btn:hover { background: var(--sy-surface-2); border-color: var(--sy-border); color: var(--sy-text); text-decoration: none; }
.sy-icon-btn svg { width: 18px; height: 18px; }
.sy-dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--sy-bad); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.sy-menu-toggle { display: none; }
.sy-user-menu { position: relative; }
.sy-user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; }
.sy-user-menu summary::-webkit-details-marker { display: none; }
.sy-user-menu summary:hover, .sy-user-menu[open] summary { background: var(--sy-surface-2); border-color: var(--sy-border); }
.sy-user-menu .sy-name { font-size: 13px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--sy-surface); border: 1px solid var(--sy-border);
    border-radius: 10px; box-shadow: var(--sy-shadow-lg); padding: 6px; z-index: 30;
}
.sy-menu-panel a, .sy-menu-panel button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--sy-text); font: inherit; background: none; border: 0; cursor: pointer; text-decoration: none; }
.sy-menu-panel a:hover, .sy-menu-panel button:hover { background: var(--sy-surface-2); text-decoration: none; }
.sy-menu-panel .sy-menu-head { padding: 8px 10px; border-bottom: 1px solid var(--sy-border); margin-bottom: 4px; }
.sy-avatar { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--sy-teal), var(--sy-green)); flex: none; }
.sy-avatar.lg { width: 44px; height: 44px; font-size: 15px; }

.sy-content, .content { padding: 24px 28px 48px; width: 100%; max-width: 1240px; }

/* ---------- Page header ---------- */
.sy-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.sy-page-head p { margin: 4px 0 0; color: var(--sy-muted); max-width: 720px; }
.sy-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sy-brand); font-weight: 700; margin-bottom: 4px; }
.sy-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, grids, KPIs ---------- */
.sy-card, .card { background: var(--sy-surface); border: 1px solid var(--sy-border); border-radius: var(--sy-radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--sy-shadow); }
.sy-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sy-card-head h2 { margin: 0; }
.sy-card.flush, .card.flush { padding: 0; overflow: hidden; }
.sy-card.flush .sy-card-head { padding: 14px 18px 0; }
.sy-grid { display: grid; gap: 16px; }
.sy-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sy-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sy-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sy-grid.main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.sy-kpi { background: var(--sy-surface); border: 1px solid var(--sy-border); border-radius: var(--sy-radius); padding: 14px 16px; box-shadow: var(--sy-shadow); }
.sy-kpi .label { font-size: 12px; color: var(--sy-muted); display: flex; align-items: center; gap: 6px; }
.sy-kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.sy-kpi .sub { font-size: 12px; color: var(--sy-faint); }
.sy-kpi a { color: inherit; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sy-border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sy-muted); font-weight: 650; background: var(--sy-surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: color-mix(in srgb, var(--sy-brand) 4%, transparent); }
.sy-table-wrap { overflow-x: auto; border: 1px solid var(--sy-border); border-radius: var(--sy-radius); background: var(--sy-surface); }
.card > table, .sy-card > table { margin: -4px 0; }
.sy-cell-main { font-weight: 600; }
.sy-cell-sub { font-size: 12px; color: var(--sy-faint); }
.sy-right { text-align: right; }
.sy-nowrap { white-space: nowrap; }

/* ---------- Pills / badges ---------- */
.badge, .sy-pill {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px;
    background: var(--sy-surface-2); color: var(--sy-muted); border: 1px solid var(--sy-border); white-space: nowrap;
}
.badge::before, .sy-pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.9; }
.badge.ok, .sy-pill.ok { background: var(--sy-ok-soft); color: var(--sy-ok); border-color: transparent; }
.badge.warn, .sy-pill.warn { background: var(--sy-warn-soft); color: var(--sy-warn); border-color: transparent; }
.badge.bad, .sy-pill.bad { background: var(--sy-bad-soft); color: var(--sy-bad); border-color: transparent; }
.badge.info, .sy-pill.info { background: var(--sy-info-soft); color: var(--sy-info); border-color: transparent; }
.sy-pill.plain::before { display: none; }

/* ---------- Buttons ---------- */
.btn, .sy-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--sy-radius-sm);
    border: 1px solid var(--sy-brand); background: var(--sy-brand); color: #fff; font: 600 13.5px/1.2 var(--sy-font); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover, .sy-btn:hover { background: var(--sy-brand-strong); border-color: var(--sy-brand-strong); text-decoration: none; color: #fff; }
:root[data-theme="dark"] .btn:not(.secondary):not(.ghost):not(.danger), :root[data-theme="dark"] .sy-btn:not(.secondary):not(.ghost):not(.danger) { color: #04120f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.secondary):not(.ghost):not(.danger), :root:not([data-theme="light"]) .sy-btn:not(.secondary):not(.ghost):not(.danger) { color: #04120f; } }
.btn.secondary, .sy-btn.secondary { background: var(--sy-surface); color: var(--sy-text); border-color: var(--sy-border-strong); }
.btn.secondary:hover, .sy-btn.secondary:hover { background: var(--sy-surface-2); color: var(--sy-text); }
.btn.ghost, .sy-btn.ghost { background: transparent; border-color: transparent; color: var(--sy-brand); }
.btn.ghost:hover, .sy-btn.ghost:hover { background: var(--sy-brand-soft); color: var(--sy-brand); }
.btn.danger, .sy-btn.danger { background: var(--sy-bad); border-color: var(--sy-bad); color: #fff; }
.btn.danger:hover, .sy-btn.danger:hover { filter: brightness(0.92); background: var(--sy-bad); }
.btn.sm, .sy-btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn[disabled], .sy-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field, .sy-field { margin-bottom: 14px; }
.field label, .sy-field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--sy-text); margin-bottom: 5px; }
.field .hint, .sy-field .hint { font-size: 12px; color: var(--sy-faint); margin-top: 4px; }
input, select, textarea { font: inherit; color: var(--sy-text); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea,
.sy-field input:not([type=checkbox]):not([type=radio]), .sy-field select, .sy-field textarea, .sy-input {
    width: 100%; padding: 8px 10px; background: var(--sy-surface); border: 1px solid var(--sy-border-strong); border-radius: var(--sy-radius-sm); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .sy-field input:focus, .sy-field select:focus, .sy-input:focus { border-color: var(--sy-brand); box-shadow: 0 0 0 3px var(--sy-brand-soft); }
.field label input[type=checkbox], .sy-check input { margin-right: 6px; accent-color: var(--sy-brand); }
.sy-check { display: flex; align-items: flex-start; gap: 4px; font-size: 13.5px; }
.sy-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.sy-toolbar .field { margin: 0; }
.sy-code-input { font: 600 22px/1 var(--sy-mono) !important; letter-spacing: 0.3em; text-align: center; }

/* ---------- Notices ---------- */
.notice, .sy-notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid var(--sy-border); background: var(--sy-surface-2); }
.notice.error, .sy-notice.error { background: var(--sy-bad-soft); color: var(--sy-bad); border-color: transparent; }
.notice.success, .sy-notice.success { background: var(--sy-ok-soft); color: var(--sy-ok); border-color: transparent; }
.notice.warn, .sy-notice.warn { background: var(--sy-warn-soft); color: var(--sy-warn); border-color: transparent; }
.notice.info, .sy-notice.info { background: var(--sy-info-soft); color: var(--sy-info); border-color: transparent; }
.secret-box, .sy-secret { font-family: var(--sy-mono); background: var(--sy-surface-2); border: 1px dashed var(--sy-border-strong); padding: 12px; border-radius: 8px; word-break: break-all; color: var(--sy-text); margin-top: 6px; }

/* ---------- Tabs ---------- */
.sy-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--sy-border); margin-bottom: 16px; }
.sy-tabs a { padding: 9px 14px; color: var(--sy-muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.sy-tabs a.active { color: var(--sy-text); border-bottom-color: var(--sy-gold); }

/* ---------- Lists & misc ---------- */
.sy-list { list-style: none; margin: 0; padding: 0; }
.sy-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--sy-border); }
.sy-list li:last-child { border-bottom: 0; }
.sy-alert-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.sy-alert-icon svg { width: 16px; height: 16px; }
.sy-alert-icon.high { background: var(--sy-bad-soft); color: var(--sy-bad); }
.sy-alert-icon.medium { background: var(--sy-warn-soft); color: var(--sy-warn); }
.sy-alert-icon.info { background: var(--sy-info-soft); color: var(--sy-info); }
.sy-empty { text-align: center; padding: 36px 16px; color: var(--sy-muted); }
.sy-empty svg { width: 36px; height: 36px; color: var(--sy-faint); margin-bottom: 8px; }
.sy-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sy-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.sy-dl dt { color: var(--sy-muted); }
.sy-dl dd { margin: 0; }
.sy-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; font: 600 15px/1.8 var(--sy-mono); background: var(--sy-surface-2); border: 1px dashed var(--sy-border-strong); border-radius: 8px; padding: 12px 16px; }
.sy-qr { background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--sy-border); display: inline-block; line-height: 0; }

/* Bar chart (pure CSS/SVG, no library) */
.sy-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.sy-chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; height: 100%; position: relative; }
.sy-chart .ok { background: var(--sy-green); border-radius: 3px 3px 0 0; min-height: 1px; }
.sy-chart .fail { background: var(--sy-bad); opacity: 0.8; border-radius: 3px 3px 0 0; }
.sy-chart .bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--sy-text); color: var(--sy-surface); font-size: 11px; padding: 3px 7px; border-radius: 4px; z-index: 2; }
.sy-chart-x { display: flex; gap: 6px; font-size: 10.5px; color: var(--sy-faint); margin-top: 4px; }
.sy-chart-x span { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.sy-legend { display: flex; gap: 14px; font-size: 12px; color: var(--sy-muted); }
.sy-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Sign-in / public pages ---------- */
.sy-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sy-auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.sy-auth-box { width: 100%; max-width: 380px; }
.sy-auth-box .logo { height: 40px; margin-bottom: 28px; }
.sy-auth-hero { background: radial-gradient(circle at 30% 20%, rgba(31, 111, 106, 0.55), transparent 55%), radial-gradient(circle at 80% 90%, rgba(232, 164, 58, 0.22), transparent 50%), var(--sy-navy); color: #dbe7ec; display: flex; align-items: center; justify-content: center; padding: 48px; }
.sy-auth-hero h2 { color: #fff; font-size: 26px; line-height: 1.25; margin: 18px 0 12px; max-width: 420px; }
.sy-auth-hero li { margin-bottom: 8px; color: #b9cad2; }
.sy-auth-foot { margin-top: 28px; font-size: 12px; color: var(--sy-faint); }
.sy-public { max-width: 760px; margin: 0 auto; padding: 40px 24px 64px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .sy-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sy-grid.main-side { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
    .sy-shell { grid-template-columns: 1fr; }
    .sy-sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; }
    .sy-shell.nav-open .sy-sidebar { transform: none; box-shadow: var(--sy-shadow-lg); }
    .sy-shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 40; }
    .sy-menu-toggle { display: inline-flex; }
    .sy-topbar { padding: 0 12px; }
    .sy-content, .content { padding: 18px 16px 40px; }
    .sy-grid.c2, .sy-grid.c3 { grid-template-columns: 1fr; }
    .sy-user-menu .sy-name { display: none; }
    .sy-auth { grid-template-columns: 1fr; }
    .sy-auth-hero { display: none; }
}
@media (max-width: 520px) { .sy-grid.c4 { grid-template-columns: 1fr 1fr; } .sy-codes { grid-template-columns: 1fr; } }

/* Shortcut links (content area) */
.sy-shortcuts { display: flex; flex-direction: column; gap: 2px; }
.sy-shortcut { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--sy-text); text-decoration: none; }
.sy-shortcut:hover { background: var(--sy-surface-2); text-decoration: none; }
.sy-shortcut svg { width: 18px; height: 18px; color: var(--sy-brand); }

/* Icon sizing inside content components */
.btn svg, .sy-btn svg { width: 16px; height: 16px; flex: none; }
.sy-kpi .label svg { width: 14px; height: 14px; }
.sy-menu-panel svg { width: 16px; height: 16px; color: var(--sy-muted); }
.sy-content svg:not([width]):not([class]) { max-width: 20px; max-height: 20px; }
.sy-brand img { height: 40px; }
.sy-auth-box .logo { height: 48px; }

/* Icon chip (vault folders): calm tinted square in the SY Console palette. */
.sy-chip { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--sy-brand-soft); color: var(--sy-brand); }
.sy-chip svg { width: 15px; height: 15px; }

/* ---------- Password safe ---------- */
.grow { flex: 1; min-width: 0; }
.sy-safe { grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
.sy-safe-nav { padding: 10px; position: sticky; top: calc(var(--sy-top-h) + 16px); }
.sy-safe-nav .sy-nav-section { color: var(--sy-muted); }
.sy-safe-link { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: var(--sy-text); text-decoration: none; font-weight: 500; }
.sy-safe-link:hover { background: var(--sy-surface-2); text-decoration: none; }
.sy-safe-link.active { background: var(--sy-brand-soft); box-shadow: inset 3px 0 0 var(--sy-gold); font-weight: 650; }
.sy-count { font-size: 12px; color: var(--sy-muted); background: var(--sy-surface-2); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.sy-avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.sy-safe-lock { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--sy-radius); margin-bottom: 16px; background: color-mix(in srgb, var(--sy-gold) 14%, var(--sy-surface)); border: 1px solid color-mix(in srgb, var(--sy-gold) 40%, transparent); flex-wrap: wrap; }
.sy-safe-lock.open { background: color-mix(in srgb, var(--sy-green) 12%, var(--sy-surface)); border-color: color-mix(in srgb, var(--sy-green) 40%, transparent); }
.sy-safe-lock-ico { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--sy-gold); color: #fff; flex: none; }
.sy-safe-lock.open .sy-safe-lock-ico { background: var(--sy-green); }
.sy-safe-lock-ico svg { width: 18px; height: 18px; }
.sy-safe-lock.shake { animation: sy-shake 0.5s; }
@keyframes sy-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.sy-safe-unlock { display: flex; gap: 8px; }
.sy-safe-unlock .sy-input { width: 170px; }
.sy-safe-search .sy-input { width: 240px; padding: 6px 10px; }
.sy-secret-mask { font-family: var(--sy-mono); letter-spacing: 0.06em; vertical-align: middle; }
.sy-secret-mask.shown { background: var(--sy-surface-2); border: 1px dashed var(--sy-border-strong); border-radius: 4px; padding: 1px 6px; letter-spacing: 0; user-select: all; }
.sy-secret-mask.copied { color: var(--sy-ok); font-family: var(--sy-font); font-weight: 600; }
.sy-icon-btn.sm { width: 28px; height: 28px; vertical-align: middle; }
.sy-icon-btn.sm svg { width: 15px; height: 15px; }
.sy-notes { white-space: pre-wrap; margin-top: 6px; max-width: 360px; }
.sy-edit-row td { background: var(--sy-surface-2); }
.sy-safe-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.sy-safe-form .wide { grid-column: 1 / -1; }
.sy-safe-form textarea { width: 100%; padding: 8px 10px; background: var(--sy-surface); border: 1px solid var(--sy-border-strong); border-radius: var(--sy-radius-sm); }
.sy-pw { display: flex; gap: 6px; }
.sy-pw input { flex: 1; }
.sy-modal { position: fixed; inset: 0; z-index: 60; background: rgba(41, 47, 76, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto; }
.sy-modal[hidden] { display: none; }
.sy-modal-box { width: 100%; max-width: 640px; box-shadow: var(--sy-shadow-lg); }
@media (max-width: 860px) {
    .sy-safe { grid-template-columns: 1fr; }
    .sy-safe-nav { position: static; }
    .sy-safe-form { grid-template-columns: 1fr; }
    .sy-safe-search .sy-input { width: 150px; }
}

.sy-card > .sy-card-head:first-child .sy-legend { color: #fff; }
.sy-card > .sy-card-head:first-child .sy-legend i { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85); }

/* ---------- Onboarding wizard (v4) ---------- */
.sy-step { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--sy-brand); color: #fff; font-size: 12.5px; font-weight: 700; margin-right: 8px; vertical-align: 1px; }
.sy-system-pick { border: 1px solid var(--sy-border); border-radius: var(--sy-radius); padding: 12px 14px; margin-bottom: 10px; }
.sy-system-pick.on { border-color: var(--sy-brand); background: var(--sy-brand-soft); }
.sy-system-pick .sy-system-opts { display: none; margin-top: 12px; }
.sy-system-pick.on .sy-system-opts { display: grid; }
.sy-system-pick .sy-check { align-items: flex-start; gap: 8px; }
.sy-checklist { list-style: none; margin: 0; padding: 0; }
.sy-checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--sy-border); }
.sy-checklist li:last-child { border-bottom: 0; }
.sy-checklist .tick { width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; flex: none; border: 2px solid var(--sy-border-strong); }
.sy-checklist .done .tick { background: var(--sy-green); border-color: var(--sy-green); color: #fff; }
.sy-checklist .tick svg { width: 13px; height: 13px; }
.sy-guide h2 { margin-top: 28px; }
.sy-guide table { margin: 8px 0 16px; }

/* The hidden attribute always wins over layout classes (e.g. .sy-toolbar is display:flex). */
[hidden] { display: none !important; }
