/* Bizix Cloud — dense control-plane styling. Bizix brand: deep navy/teal
   canvas, isometric-cube cyan accents echoing the Bizix logo. */

:root {
    /* Surfaces — dark, layered */
    --bg: #0a1320;
    --bg-alt: #0e1a2a;
    --bg-card: #101e30;
    --bg-side: #0c1726;
    --bg-head: #07101c;
    --bg-tab: #0e1a2a;

    /* Foreground / type */
    --fg: #e8edf2;
    --fg-mute: #8597ad;
    --fg-accent: #00b4e0;
    --fg-on-dark: #f3f4f6;

    /* Borders */
    --bd: #1a2a3c;
    --bd-soft: #142133;

    /* Bizix brand */
    --brand: #0073a8;
    --brand-2: #005075;
    --brand-cyan: #00f0ff;
    --brand-cyan-dim: rgba(0, 240, 255, 0.18);
    --brand-cyan-glow: rgba(0, 240, 255, 0.55);
    --brand-warm: #a0b4ff;

    /* Status */
    --ok: #00d084;
    --warn: #ff9500;
    --err: #ef4444;
    --info: #00b4e0;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.25);
    --shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45);
    --glow-cyan: 0 0 0 1px rgba(0, 240, 255, 0.18), 0 0 14px rgba(0, 240, 255, 0.12);

    --radius: 4px;
    --radius-lg: 6px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--fg);
    background: var(--bg);
    height: 100vh;
}
a { color: var(--fg-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

/* ---------- App shell ---------- */
.app {
    display: grid;
    grid-template-rows: 44px 1fr 24px;
    height: 100vh;
}

.topbar {
    background: var(--bg-head);
    color: var(--fg-on-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    box-shadow: var(--shadow-1);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { display: inline-flex; align-items: center; }
.brand .logo img { height: 26px; width: auto; display: block; filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.18)); }
.brand .name {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}
.brand .name .accent { color: var(--brand-cyan); font-weight: 600; }
.brand .org {
    color: #9bb1c7;
    font-size: 12px;
    border-left: 1px solid rgba(0, 240, 255, 0.18);
    padding-left: 10px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.cluster-picker { margin-left: 6px; }
.cluster-picker select {
    background: rgba(0, 240, 255, 0.06);
    color: var(--fg-on-dark);
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: var(--radius);
    font-size: 11px;
    padding: 3px 8px;
    font-family: inherit;
    cursor: pointer;
}
.cluster-picker select:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--brand-cyan);
}
.topnav { display: flex; align-items: center; gap: 10px; }
.topnav .separator {
    width: 1px; height: 22px; background: rgba(255,255,255,0.2);
}
.topnav .user { color: #cbd5e1; font-size: 12px; }

.statusbar {
    background: var(--bg-alt);
    border-top: 1px solid var(--bd);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 12px;
    color: var(--fg-mute);
    font-size: 11px;
    gap: 16px;
}
.statusbar .right { text-align: right; }
.statusbar .middle { display: flex; justify-content: center; }

/* ---------- Tasks tray ---------- */
.tray {
    display: flex; align-items: center; gap: 12px;
    font-size: 11px;
}
.tray-count {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}
.tray-count-running { background: rgba(0, 240, 255, 0.14); color: var(--brand-cyan); }
.tray-count-idle { background: rgba(0, 208, 132, 0.14); color: var(--ok); }
.tray-details { position: relative; }
.tray-details summary {
    cursor: pointer; list-style: none;
    padding: 2px 8px; border-radius: 10px;
    background: var(--bg-card); border: 1px solid var(--bd);
}
.tray-details summary::-webkit-details-marker { display: none; }
.tray-details[open] .tray-list {
    display: block;
}
.tray-list {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0;
    width: 480px;
    max-height: 320px; overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    z-index: 50;
    padding: 6px 0;
}
.tray-item {
    display: grid;
    grid-template-columns: 18px 1fr 2fr 1fr 1.5fr;
    gap: 8px;
    align-items: center;
    padding: 4px 12px;
    font-size: 11.5px;
}
.tray-item:hover { background: var(--bg-alt); }
.tray-empty { padding: 12px; text-align: center; }

.spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(0, 240, 255, 0.3);
    border-top-color: var(--fg-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.spinner.small { width: 10px; height: 10px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    overflow: hidden;
}

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--bg-side);
    border-right: 1px solid var(--bd);
    overflow-y: auto;
    user-select: none;
}
.sidebar-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--fg-mute);
    border-bottom: 1px solid var(--bd-soft);
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 1;
}
.icon-btn {
    background: none; border: none; cursor: pointer; color: var(--fg-mute);
    font-size: 14px; padding: 2px 6px; border-radius: var(--radius);
}
.icon-btn:hover { background: var(--bd-soft); color: var(--fg); }

.tree, .tree-children {
    list-style: none; margin: 0; padding: 0;
}
.tree-children { padding-left: 20px; }
.tree-item {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    cursor: pointer;
    border-left: 2px solid transparent;
    line-height: 1.4;
}
.tree-item:hover { background: rgba(0, 240, 255, 0.06); }
.tree-item.selected {
    background: rgba(0, 240, 255, 0.14);
    border-left-color: var(--fg-accent);
    font-weight: 500;
}
.tree-toggle, .tree-spacer { color: var(--fg-mute); width: 12px; font-size: 10px; }
.tree-spacer { display: inline-block; }
.tree-icon { color: var(--fg-mute); width: 14px; }
.tree-cluster .tree-icon { color: var(--fg-accent); }
.tree-label { flex: 1; }
.tree-vmid { color: var(--fg-mute); font-family: var(--font-mono); font-size: 11px; }
.tree-empty { padding: 4px 24px; color: var(--fg-mute); font-style: italic; font-size: 12px; }
.tree-vm.is-template { color: var(--fg-mute); font-style: italic; }
.tree-item[draggable] { cursor: grab; }
.tree-item[draggable]:active { cursor: grabbing; }
.tree-node.drag-over {
    background: var(--brand-cyan-dim) !important;
    box-shadow: inset 0 0 0 2px var(--brand-cyan);
}

/* ---------- Status dots ---------- */
.dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.dot-running { background: var(--ok); }
.dot-stopped { background: #94a3b8; }
.dot-paused { background: var(--warn); }
.dot-unknown { background: transparent; box-shadow: 0 0 0 1px var(--bd); }

/* ---------- Main panel ---------- */
.main {
    overflow: auto;
    background: var(--bg);
}
.panel {
    background: var(--bg-card);
    margin: 12px;
    border: 1px solid var(--bd);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-1);
}
.panel-head {
    border-bottom: 1px solid var(--bd-soft);
    padding: 12px 18px 0 18px;
}
.panel-head h2 {
    margin: 0; font-size: 16px; font-weight: 600;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.title-icon { color: var(--fg-accent); }
.panel-tabs {
    display: flex; gap: 0; margin-top: 10px;
    border-bottom: 1px solid var(--bd-soft);
    margin-left: -18px; margin-right: -18px;
    padding-left: 18px;
    align-items: stretch;
}
.panel-tabs .tab,
button.tab {
    -webkit-appearance: none;
    appearance: none;
    background: none !important;
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 6px 14px;
    font: inherit;
    font-size: 12px;
    color: var(--fg-mute);
    cursor: pointer;
    margin-bottom: -1px;
    outline: none;
    line-height: 1.4;
}
.panel-tabs .tab:hover {
    color: var(--fg);
    background: rgba(0, 240, 255, 0.05) !important;
}
.panel-tabs .tab.active {
    color: var(--fg);
    border-bottom-color: var(--fg-accent) !important;
    font-weight: 500;
}
.panel-tabs .tab:focus-visible {
    outline: 2px solid rgba(0, 240, 255, 0.4);
    outline-offset: -2px;
}
.panel-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
    margin: 10px 0 0 0;
    padding: 8px 0;
    border-top: 1px solid var(--bd-soft);
    margin-top: 10px;
}
.panel-section {
    padding: 14px 18px;
    border-bottom: 1px solid var(--bd-soft);
}
.panel-section:last-child { border-bottom: none; }
.panel-section h3 {
    margin: 0 0 10px 0;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--fg-mute); font-weight: 600;
}

/* ---------- Tables ---------- */
.table {
    width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.table th, .table td {
    text-align: left; padding: 6px 10px;
    border-bottom: 1px solid var(--bd-soft);
}
.table th {
    background: var(--bg-tab); font-weight: 600; color: var(--fg);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px;
}
.table tbody tr:hover { background: rgba(0, 240, 255, 0.04); }

/* ---------- KV grid ---------- */
.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 4px 28px;
}
.kv-grid > div {
    display: grid; grid-template-columns: 96px 1fr; gap: 8px;
    padding: 4px 0;
    align-items: baseline;
}
.kv-grid .k {
    color: var(--fg-mute); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.3px;
    font-weight: 500;
}
.kv-grid .v { font-weight: 500; word-break: break-word; min-width: 0; }
.kv-grid .v code { word-break: break-all; }

/* ---------- Bars ---------- */
.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 180px;
    gap: 10px;
    align-items: center;
    margin: 4px 0;
}
.bar-label { color: var(--fg-mute); font-size: 12px; }
.bar {
    height: 10px; background: var(--bd-soft); border-radius: 3px;
    overflow: hidden; min-width: 100px;
}
.bar.mini { display: inline-block; width: 80px; vertical-align: middle; margin-right: 6px; }
.bar-fill {
    height: 100%; background: var(--fg-accent);
    transition: width 200ms ease;
}
.bar-pct { font-family: var(--font-mono); font-size: 11px; color: var(--fg-mute); }

/* ---------- Buttons ---------- */
.btn, .btn-primary, .btn-success, .btn-warn, .btn-danger, .btn-ghost {
    border: 1px solid var(--bd);
    background: var(--bg-card);
    color: var(--fg);
    padding: 5px 11px;
    border-radius: var(--radius);
    font-size: 12px;
    cursor: pointer;
    line-height: 1.3;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn:hover { background: var(--bg-alt); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    border-color: var(--brand);
    color: #fff;
    box-shadow: var(--glow-cyan);
}
.btn-primary:hover { filter: brightness(1.12); }
.btn-success { background: var(--ok); border-color: var(--ok); color: #07101c; }
.btn-success:hover:not(:disabled) { filter: brightness(1.08); }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #1a1208; }
.btn-warn:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--fg-on-dark); }
.btn-ghost:hover { background: rgba(255,255,255,0.06); }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 1px 7px;
    font-size: 11px;
    background: var(--bg-tab);
    border-radius: 999px;
    color: var(--fg);
}
.badge-ok { background: rgba(0, 208, 132, 0.18); color: var(--ok); }
.badge-warn { background: rgba(255, 149, 0, 0.18); color: var(--warn); }
.badge-err { background: rgba(239, 68, 68, 0.18); color: #ff8585; }
.badge-muted { background: var(--bd-soft); color: var(--fg-mute); }
.muted { color: var(--fg-mute); }
.muted.small { font-size: 11px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.form-wide { max-width: none; }
.form label {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 12px; color: var(--fg-mute);
}
.form input, .form select, .form textarea {
    padding: 7px 10px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--fg);
    background: var(--bg-card);
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none;
    border-color: var(--fg-accent);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.18);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.form-actions {
    padding: 14px 18px;
    display: flex; gap: 8px;
    border-top: 1px solid var(--bd-soft);
}

/* ---------- Auth pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 240, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 115, 168, 0.12) 0%, transparent 50%),
        linear-gradient(135deg, #050b14 0%, #0a1320 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute; inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}
.auth-card {
    background: var(--bg-card);
    padding: 30px 32px;
    border-radius: 8px;
    border: 1px solid var(--bd);
    box-shadow: var(--shadow-2), var(--glow-cyan);
    width: 360px;
    max-width: 100%;
    position: relative;
    z-index: 1;
}
.auth-card-wide { width: 540px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand .logo img { height: 36px; width: auto; filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.35)); }
.auth-brand .name { font-weight: 700; font-size: 20px; letter-spacing: 0.5px; }
.auth-brand .name .accent { color: var(--brand-cyan); }
.auth-card h1 { font-size: 18px; margin: 0 0 16px 0; }

.totp-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 18px;
    align-items: center;
    margin: 16px 0 8px 0;
}
.totp-qr {
    width: 200px; height: 200px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    background: var(--bg-card);
}
.totp-secret {
    display: block;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-alt);
    padding: 8px 10px;
    border-radius: var(--radius);
    word-break: break-all;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 13px;
}
.alert-error { background: rgba(239, 68, 68, 0.12); color: #ff8585; border: 1px solid rgba(239, 68, 68, 0.4); }
.alert-info { background: rgba(0, 180, 224, 0.12); color: var(--brand-cyan); border: 1px solid rgba(0, 240, 255, 0.3); }

.loading { padding: 20px; color: var(--fg-mute); font-style: italic; }

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 100;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
    min-width: 380px;
    max-width: 500px;
    overflow: hidden;
}
.modal-wide { min-width: 520px; max-width: 640px; }
label.inline {
    display: flex; flex-direction: row; align-items: center; gap: 8px;
    margin: 6px 0;
    color: var(--fg);
}
label.inline input[type=checkbox] {
    width: auto; margin: 0;
}
.section-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.section-head h3 { margin: 0; }
.section-actions { display: flex; gap: 6px; }

/* Mode-toggle radio block in VM wizard */
.mode-toggle {
    display: grid; gap: 8px;
}
.mode-option {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-card);
}
.mode-option:has(input:checked) {
    border-color: var(--fg-accent);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.14);
}
.mode-option input[type=radio] { margin-top: 3px; }
.mode-option span { flex: 1; line-height: 1.4; }

.row-locked { background: rgba(245, 158, 11, 0.06); }
.row-locked code { color: var(--fg-mute); }

/* Snapshot tree */
.snap-table .snap-current { background: rgba(0, 240, 255, 0.06); }
.snap-table .snap-branch { color: var(--fg-mute); margin-right: 4px; font-family: var(--font-mono); }
.snap-table code { font-size: 12.5px; }

/* Sparklines */
.spark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.spark-card {
    background: var(--bg-alt);
    border: 1px solid var(--bd-soft);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}
.spark { display: flex; flex-direction: column; }
.spark-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 10px 4px 10px;
    gap: 12px;
    border-bottom: 1px solid var(--bd-soft);
    background: var(--bg-card);
}
.spark-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--fg-mute);
    font-weight: 600;
}
.spark-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    white-space: nowrap;
}
.spark-svg {
    display: block;
    width: 100%;
    height: 64px;
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--bd-soft);
    background: var(--bg-alt);
}
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.modal-body { padding: 16px 18px; }
.modal-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 12px 18px;
    border-top: 1px solid var(--bd-soft);
    background: var(--bg-alt);
}
.modal label { display: block; margin-bottom: 12px; }
.modal label > select, .modal label > input {
    display: block; margin-top: 4px;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
}

/* ---------- Right-click context menu ---------- */
.ctxmenu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    min-width: 220px;
    z-index: 200;
    padding: 4px 0;
    user-select: none;
    font-size: 12.5px;
}
.ctxmenu-head {
    padding: 6px 14px;
    color: var(--fg-mute);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--bd-soft);
    margin-bottom: 4px;
}
.ctxmenu-item {
    display: block; width: 100%;
    text-align: left;
    background: none; border: none;
    padding: 6px 14px;
    cursor: pointer;
    color: var(--fg);
    font-family: inherit;
    font-size: 12.5px;
    text-decoration: none;
    box-sizing: border-box;
}
a.ctxmenu-item { display: block; }
.ctxmenu-item:hover { background: rgba(0, 240, 255, 0.12); text-decoration: none; }
.ctxmenu-item:disabled { color: var(--fg-mute); cursor: not-allowed; }
.ctxmenu-warn { color: var(--warn); }
.ctxmenu-danger { color: #ff8585; }

/* ---------- ISO catalog grid ---------- */
.iso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
    margin-bottom: 6px;
}
.iso-card {
    background: var(--bg-alt);
    border: 1px solid var(--bd-soft);
    border-radius: var(--radius);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.iso-card:hover {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.18);
}
.iso-card-head { font-size: 13px; }
.iso-card-note {
    font-size: 11.5px;
    color: var(--fg-mute);
    line-height: 1.4;
}
.iso-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}
.iso-card-filename {
    font-size: 10.5px;
    color: var(--fg-mute);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

/* ---------- OSD replace wizard ---------- */
.osd-steps { list-style: none; padding: 0; margin: 8px 0; }
.osd-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--bd-soft);
}
.osd-step:last-child { border-bottom: none; }
.osd-step.done { opacity: 0.7; }
.osd-step.active { background: rgba(0, 240, 255, 0.04); }
.osd-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-alt);
    color: var(--fg-mute);
    font-weight: 600;
    font-size: 12px;
    border: 1px solid var(--bd);
}
.osd-step.active .osd-step-num {
    background: var(--brand-cyan-dim);
    color: var(--brand-cyan);
    border-color: var(--brand-cyan);
    box-shadow: 0 0 8px var(--brand-cyan-dim);
}
.osd-step.done .osd-step-num {
    background: rgba(0, 208, 132, 0.18);
    color: var(--ok);
    border-color: var(--ok);
}
.osd-step-body { min-width: 0; }
.osd-step-body strong { display: block; margin-bottom: 4px; }

/* OSD create picker */
.osd-create-picker { position: relative; display: inline-block; }
.osd-create-picker > summary { list-style: none; cursor: pointer; }
.osd-create-picker > summary::-webkit-details-marker { display: none; }
.osd-create-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--bg-card);
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow-2);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
    min-width: 160px;
}

/* ---------- Sidebar search header ---------- */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--bd-soft);
    background: var(--bg-side);
}
.sidebar-search input[type=search] {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--fg);
    font-size: 12px;
    font-family: inherit;
    outline: none;
}
.sidebar-search input[type=search]:focus {
    border-color: var(--brand-cyan);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.18);
}
.sidebar-search select {
    padding: 4px 6px;
    border: 1px solid var(--bd);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--fg);
    font-size: 11px;
    max-width: 100px;
}

/* ---------- Sidebar notifications widget ---------- */
.sidebar { display: flex; flex-direction: column; }
.sidebar > #tree { flex: 1; overflow-y: auto; min-height: 0; }
.sidebar-notif {
    border-top: 1px solid var(--bd);
    background: var(--bg-side);
    max-height: 240px;
    overflow-y: auto;
    flex-shrink: 0;
}
.notif-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--fg-mute);
    background: var(--bg-card);
    border-bottom: 1px solid var(--bd-soft);
    position: sticky;
    top: 0;
}
.notif-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 16px; padding: 0 6px;
    font-size: 10px;
    border-radius: 999px;
    background: var(--bd-soft);
    color: var(--fg-mute);
}
.notif-count.has-active {
    background: rgba(239, 68, 68, 0.25);
    color: #ff8585;
}
.notif-list { list-style: none; margin: 0; padding: 4px 0; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--bd-soft);
    font-size: 12px;
    line-height: 1.35;
}
.notif-item:last-child { border-bottom: none; }
.notif-dot {
    width: 8px; height: 8px; border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}
.notif-dot-err { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.notif-dot-warn { background: var(--warn); box-shadow: 0 0 6px rgba(255, 149, 0, 0.5); }
.notif-dot-info { background: var(--brand-cyan); box-shadow: 0 0 6px var(--brand-cyan-glow); }
.notif-body { flex: 1; min-width: 0; }
.notif-title {
    color: var(--fg);
    font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-detail {
    color: var(--fg-mute);
    font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-ts { color: var(--fg-mute); font-size: 10px; margin-top: 2px; }
.notif-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--fg-mute);
    font-style: italic;
}

/* ---------- HUD ambient grid for the auth pages ---------- */
@keyframes bizix-hud-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.ctxmenu-sep {
    height: 1px;
    background: var(--bd-soft);
    margin: 4px 0;
}
