    :root {
      --bg: #f8f9fa;
      --surface: #ffffff;
      --surface2: #f1f3f4;
      --border: #dadce0;
      --text: #202124;
      --text2: #5f6368;
      --text3: #80868b;
      --primary: #1a73e8;
      --primary-hover: #1765cc;
      --primary-bg: #e8f0fe;
      --green: #1e8e3e;
      --green-bg: #e6f4ea;
      --red: #d93025;
      --red-bg: #fce8e6;
      --orange: #e37400;
      --orange-bg: #fef7e0;
      --purple: #7627bb;
      --purple-bg: #f3e8fd;
      --sidebar-w: 256px;
      --sidebar-collapsed: 56px;
      --topbar-h: 64px;
      --shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
      --shadow-lg: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
      --radius: 8px;
      --radius-lg: 12px;
    }
    [data-theme="dark"] {
      --bg: #1f1f1f;
      --surface: #292a2d;
      --surface2: #35363a;
      --border: #3c4043;
      --text: #e8eaed;
      --text2: #9aa0a6;
      --text3: #80868b;
      --primary: #8ab4f8;
      --primary-hover: #aecbfa;
      --primary-bg: #303742;
      --green: #81c995;
      --green-bg: #2d3b30;
      --red: #f28b82;
      --red-bg: #3c2a28;
      --orange: #fdd663;
      --orange-bg: #3e3422;
      --purple: #d7aefb;
      --purple-bg: #352f3e;
      --shadow: 0 1px 2px 0 rgba(0,0,0,0.6), 0 1px 3px 1px rgba(0,0,0,0.4);
      --shadow-lg: 0 1px 3px 0 rgba(0,0,0,0.5), 0 4px 8px 3px rgba(0,0,0,0.35);
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      font-size: 14px;
      transition: background 0.2s, color 0.2s;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    /* ── TOP BAR ───────────────────────────────────────────────── */
    .topbar {
      height: var(--topbar-h);
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 16px;
      gap: 8px;
      z-index: 200;
      flex-shrink: 0;
    }
    .hamburger {
      width: 40px; height: 40px;
      border: none; background: transparent;
      cursor: pointer; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: var(--text2); transition: background 0.2s;
      flex-shrink: 0;
    }
    .hamburger:hover { background: var(--surface2); }

    .topbar-brand {
      display: flex; align-items: center; gap: 12px;
      padding: 0 4px; min-width: 180px;
    }
    .brand-icon {
      width: 32px; height: 32px;
      background: var(--primary);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .brand-text { font-size: 18px; font-weight: 400; color: var(--text); letter-spacing: -0.01em; }
    .brand-sub { font-size: 11px; color: var(--text3); font-weight: 400; letter-spacing: 0.02em; }

    .search-wrap {
      flex: 1; max-width: 720px; margin: 0 16px; position: relative;
    }
    .search-input {
      width: 100%; height: 46px;
      border: none; border-radius: 24px;
      padding: 0 48px 0 48px;
      font-size: 14px; background: var(--surface2); color: var(--text);
      outline: none; transition: 0.2s; cursor: pointer; font-family: inherit;
    }
    .search-input:focus { background: var(--surface); box-shadow: var(--shadow-lg); }
    .search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
    .search-kbd {
      position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
      font-size: 11px; color: var(--text3); background: var(--surface);
      padding: 2px 8px; border-radius: 4px; font-family: 'Roboto Mono', monospace; pointer-events: none;
      border: 1px solid var(--border);
    }

    .topbar-spacer { flex: 1; }
    .topbar-actions { display: flex; align-items: center; gap: 4px; }

    .live-badge {
      display: flex; align-items: center; gap: 6px;
      font-size: 12px; color: var(--text3); padding: 0 12px;
      font-weight: 500;
    }
    .live-dot {
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--green); animation: pulse 2s ease-in-out infinite;
    }
    @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

    .icon-btn {
      width: 40px; height: 40px;
      border: none; background: transparent;
      cursor: pointer; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: var(--text2); position: relative; transition: background 0.2s;
    }
    .icon-btn:hover { background: var(--surface2); }
    .notif-dot {
      position: absolute; top: 8px; right: 8px;
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--red); border: 2px solid var(--surface);
    }

    .avatar-btn {
      width: 32px; height: 32px;
      background: var(--primary);
      border-radius: 50%; border: none;
      color: white; font-size: 14px; font-weight: 500;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: opacity 0.2s; flex-shrink: 0;
      font-family: 'Google Sans', sans-serif;
    }
    .avatar-btn:hover { opacity: 0.85; }

    /* ── DROPDOWN ──────────────────────────────────────────────── */
    .dropdown { position: relative; }
    .dropdown-menu {
      display: none; position: absolute; right: 0; top: calc(100% + 8px);
      background: var(--surface); border: none;
      border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
      min-width: 220px; z-index: 500; overflow: hidden;
    }
    .dropdown-menu.open { display: block; animation: fadeUp 0.15s ease-out; }
    @keyframes fadeUp { from{opacity:0;transform:translateY(-4px)} to{opacity:1;transform:translateY(0)} }
    .dd-header { padding: 16px 16px 4px; font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; }
    .dd-user { padding: 8px 16px 16px; }
    .dd-name { font-size: 14px; font-weight: 500; }
    .dd-email { font-size: 12px; color: var(--text2); margin-top: 2px; }
    .dd-divider { height: 1px; background: var(--border); margin: 0; }
    .dd-item {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 16px; font-size: 14px; cursor: pointer;
      transition: background 0.15s; color: var(--text); font-weight: 400;
    }
    .dd-item:hover { background: var(--surface2); }
    .dd-item.danger { color: var(--red); }

    /* ── APP BODY ──────────────────────────────────────────────── */
    .app-body { display: flex; flex: 1; overflow: hidden; }

    /* ── SIDEBAR ───────────────────────────────────────────────── */
    .sidebar {
      width: var(--sidebar-w);
      background: var(--surface);
      border-right: 1px solid var(--border);
      display: flex; flex-direction: column;
      flex-shrink: 0; overflow-x: hidden; overflow-y: auto;
      transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
      z-index: 100;
      padding-top: 8px;
    }
    .sidebar.collapsed { width: var(--sidebar-collapsed); }

    .nav-section { padding: 4px 0; }
    .nav-section-label {
      font-size: 11px; font-weight: 500; text-transform: none;
      color: var(--text3); padding: 16px 20px 4px;
      letter-spacing: 0.02em; white-space: nowrap;
      transition: opacity 0.2s;
    }
    .sidebar.collapsed .nav-section-label { opacity: 0; }

    .nav-item {
      display: flex; align-items: center; gap: 12px;
      padding: 0 12px; height: 40px; margin: 1px 8px;
      cursor: pointer; border-radius: 20px;
      color: var(--text2); font-weight: 500;
      transition: background 0.15s, color 0.15s;
      white-space: nowrap; overflow: hidden; position: relative;
    }
    .nav-item:hover { background: var(--surface2); color: var(--text); }
    .nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 500; }
    .nav-icon {
      width: 24px; height: 24px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .nav-item.active .nav-icon { color: var(--primary); background: none; }
    .nav-item:not(.active):hover .nav-icon { background: none; }
    .nav-label { font-size: 14px; font-weight: 500; transition: opacity 0.2s; }
    .sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }
    .nav-tooltip {
      display: none; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
      background: var(--text); color: var(--bg);
      font-size: 12px; padding: 6px 12px; border-radius: 4px;
      white-space: nowrap; pointer-events: none; z-index: 500; margin-left: 8px;
      font-weight: 500;
    }
    .nav-tooltip::before {
      content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
      border: 5px solid transparent; border-right-color: var(--text);
    }
    .sidebar.collapsed .nav-item:hover .nav-tooltip { display: block; }

    .nav-divider { height: 1px; background: var(--border); margin: 8px 20px; }

    /* ── MAIN ──────────────────────────────────────────────────── */
    .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

    .crumb-bar {
      height: 48px; padding: 0 24px;
      border-bottom: 1px solid var(--border);
      background: var(--surface);
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
    .crumb-sep { color: var(--text3); }
    .crumb-current { color: var(--text); font-weight: 500; }
    .crumb-sub { font-size: 12px; color: var(--text3); }

    .content { flex: 1; padding: 24px; overflow-y: auto; overflow-x: hidden; }

    /* ── STAT CARDS ────────────────────────────────────────────── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px; margin-bottom: 24px;
    }
    .stat-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px 24px;
      display: flex; align-items: flex-start; gap: 16px;
      transition: border-color 0.2s;
    }
    .stat-card:hover { border-color: var(--text3); }
    .stat-icon {
      width: 48px; height: 48px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
    .stat-icon.green { background: var(--green-bg); color: var(--green); }
    .stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
    .stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
    [data-theme="dark"] .stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
    [data-theme="dark"] .stat-icon.green { background: var(--green-bg); color: var(--green); }
    [data-theme="dark"] .stat-icon.orange { background: var(--orange-bg); color: var(--orange); }
    [data-theme="dark"] .stat-icon.purple { background: var(--purple-bg); color: var(--purple); }
    .stat-body { flex: 1; min-width: 0; }
    .stat-label { font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 8px; }
    .stat-value { font-size: 28px; font-weight: 400; color: var(--text); line-height: 1.2; margin-bottom: 4px; font-family: 'Google Sans', sans-serif; }
    .stat-trend { font-size: 12px; color: var(--text3); font-weight: 400; }

    /* ── CHARTS ROW ────────────────────────────────────────────── */
    .charts-row {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 16px; margin-bottom: 24px;
    }

    /* ── CARDS ─────────────────────────────────────────────────── */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden;
    }
    .card-header {
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between;
    }
    .card-title {
      font-size: 14px; font-weight: 500; color: var(--text);
      display: flex; align-items: center; gap: 8px;
    }
    .card-title svg { color: var(--text2); }
    .card-body { padding: 20px 24px; }
    .card-link { font-size: 13px; color: var(--primary); cursor: pointer; font-weight: 500; }
    .card-link:hover { text-decoration: underline; }

    /* ── RESOURCE METERS ───────────────────────────────────────── */
    .res-row {
      display: flex; align-items: center; gap: 14px;
      padding: 12px 0; border-bottom: 1px solid var(--border);
    }
    .res-row:last-child { border-bottom: none; }
    .res-icon { color: var(--text3); flex-shrink: 0; }
    .res-label { font-size: 14px; flex: 1; color: var(--text); font-weight: 400; }
    .res-bar-wrap { width: 100px; }
    .res-bar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
    .res-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.6s ease; }
    .res-fill.warn { background: var(--orange); }
    .res-fill.danger { background: var(--red); }
    .res-val { font-size: 13px; font-weight: 500; color: var(--text); min-width: 48px; text-align: right; }

    /* ── SERVICE HEALTH CARDS ──────────────────────────────────── */
    .health-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px; margin-bottom: 24px;
    }
    .health-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius-lg); padding: 24px;
    }
    .health-card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
    .health-svc-icon {
      width: 40px; height: 40px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
    }
    .health-svc-icon.ok { background: var(--green-bg); color: var(--green); }
    .health-svc-icon.err { background: var(--red-bg); color: var(--red); }
    .health-svc-name { font-size: 14px; font-weight: 500; }
    .health-svc-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }

    /* ── TABLES ────────────────────────────────────────────────── */
    .table-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow: hidden; margin-bottom: 24px;
    }
    .table-toolbar {
      padding: 12px 24px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
    }
    .tbl-search {
      height: 36px; border: 1px solid var(--border); border-radius: 8px;
      padding: 0 14px; font-size: 14px;
      background: var(--surface); color: var(--text); outline: none;
      width: 240px; transition: 0.2s; font-family: inherit;
    }
    .tbl-search:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-bg); }
    table { width: 100%; border-collapse: collapse; }
    th {
      text-align: left; padding: 12px 16px;
      font-size: 12px; font-weight: 500;
      border-bottom: 1px solid var(--border);
      background: transparent; color: var(--text2); white-space: nowrap;
    }
    td {
      padding: 12px 16px; font-size: 14px;
      border-bottom: 1px solid var(--border);
      color: var(--text); vertical-align: middle;
    }
    tr:last-child td { border-bottom: none; }
    tbody tr { transition: background 0.1s; }
    tbody tr:hover td { background: var(--surface2); }

    /* ── BADGES ────────────────────────────────────────────────── */
    .badge {
      font-size: 12px; font-weight: 500; padding: 4px 12px;
      border-radius: 100px; display: inline-flex; align-items: center; gap: 4px;
    }
    .badge.ok { background: var(--green-bg); color: var(--green); }
    .badge.err { background: var(--red-bg); color: var(--red); }
    .badge.warn { background: var(--orange-bg); color: var(--orange); }
    .badge.neutral { background: var(--surface2); color: var(--text2); }

    /* ── BUTTONS ───────────────────────────────────────────────── */
    .btn {
      display: inline-flex; align-items: center; gap: 8px;
      background: var(--primary); color: white;
      border: none; padding: 8px 24px;
      font-size: 14px; font-weight: 500; font-family: 'Google Sans', sans-serif;
      border-radius: 20px; cursor: pointer; transition: box-shadow 0.2s, background 0.2s;
      letter-spacing: 0.01em;
    }
    .btn:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.3); background: var(--primary-hover); }
    .btn-sm { padding: 6px 16px; font-size: 13px; }
    .btn-outline { background: var(--surface); color: var(--primary); border: 1px solid var(--border); }
    .btn-outline:hover { background: var(--primary-bg); border-color: var(--primary-bg); box-shadow: none; }
    .btn-ghost { background: transparent; color: var(--primary); border: none; }
    .btn-ghost:hover { background: var(--primary-bg); box-shadow: none; }
    .btn-danger { background: var(--red); }
    .btn-danger:hover { background: #c5221f; }

    /* ── PAGES ─────────────────────────────────────────────────── */
    .page { display: none; }
    .page.active { display: block; animation: fadeIn 0.15s ease-out; }
    @keyframes fadeIn { from{opacity:0} to{opacity:1} }

    .page-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 24px;
    }
    .page-title { font-size: 22px; font-weight: 400; font-family: 'Google Sans', sans-serif; }
    .page-subtitle { font-size: 14px; color: var(--text2); margin-top: 4px; font-weight: 400; }
    .page-desc { font-size: 13px; color: var(--text2); margin-top: 4px; }
    .page-actions { display: flex; gap: 8px; align-items: center; }

    /* ── MODALS ────────────────────────────────────────────────── */
    .modal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.32);
      z-index: 1000; align-items: center; justify-content: center;
    }
    .modal-overlay.open { display: flex; }
    .modal {
      background: var(--surface); border: none;
      width: 480px; max-width: 95vw; border-radius: 28px;
      box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease-out;
    }
    @keyframes modalIn { from{opacity:0;transform:scale(0.95)} to{opacity:1;transform:scale(1)} }
    .modal-header {
      padding: 24px 24px 16px;
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal-header h3 { font-size: 18px; font-weight: 400; font-family: 'Google Sans', sans-serif; }
    .modal-body { padding: 0 24px 24px; }
    .modal-footer {
      padding: 16px 24px; border-top: 1px solid var(--border);
      display: flex; justify-content: flex-end; gap: 8px;
    }
    .close-btn {
      width: 36px; height: 36px; border: none; background: transparent;
      cursor: pointer; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: var(--text2); transition: background 0.2s;
    }
    .close-btn:hover { background: var(--surface2); }
    .form-group { margin-bottom: 20px; }
    .form-label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 8px; color: var(--text2); }
    .form-input {
      width: 100%; height: 40px;
      border: 1px solid var(--border); border-radius: var(--radius);
      padding: 0 12px; font-size: 14px;
      background: var(--surface); color: var(--text);
      font-family: inherit; outline: none; transition: 0.2s;
    }
    .form-input:focus { border-color: var(--primary); border-width: 2px; padding: 0 11px; }

    /* ── TOASTS ────────────────────────────────────────────────── */
    .toast-stack { position: fixed; bottom: 24px; left: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
    .toast-item {
      background: #323232; border: none;
      border-radius: 8px; box-shadow: var(--shadow-lg);
      padding: 14px 16px; display: flex; align-items: center; gap: 12px;
      min-width: 300px; max-width: 400px; font-size: 14px; color: #fff;
      animation: toastIn 0.25s ease-out;
    }
    [data-theme="dark"] .toast-item { background: var(--surface2); }
    @keyframes toastIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
    .toast-ico {
      width: 24px; height: 24px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    }
    .toast-ico.ok { background: rgba(30,142,62,0.3); color: #81c995; }
    .toast-ico.err { background: rgba(217,48,37,0.3); color: #f28b82; }
    .toast-msg { flex: 1; font-weight: 400; }

    /* ── LOG VIEWER ────────────────────────────────────────────── */
    .log-win {
      background: #1e1e1e; color: #d4d4d4;
      font-family: 'Roboto Mono', 'Consolas', monospace;
      font-size: 13px; line-height: 1.7;
      padding: 20px; height: 420px; overflow: auto;
      border-radius: var(--radius-lg);
      border: 1px solid var(--border);
    }
    .log-line { padding: 1px 0; white-space: pre-wrap; word-break: break-all; }
    .log-err { color: #f28b82; }
    .log-warn { color: #fdd663; }
    .log-ok { color: #81c995; }
    .log-ts { color: #9aa0a6; }

    /* ── COMMAND PALETTE ───────────────────────────────────────── */
    .pal-overlay {
      display: none; position: fixed; inset: 0;
      background: rgba(0,0,0,0.32);
      z-index: 4000; align-items: flex-start; justify-content: center; padding-top: 100px;
    }
    .pal-overlay.open { display: flex; }
    .palette {
      background: var(--surface); border: none;
      border-radius: 24px; box-shadow: var(--shadow-lg);
      width: 600px; max-width: 95vw; animation: modalIn 0.15s ease-out; overflow: hidden;
    }
    .pal-input-wrap { position: relative; }
    .pal-input {
      width: 100%; height: 56px; border: none;
      border-bottom: 1px solid var(--border);
      padding: 0 20px 0 52px;
      font-size: 16px; background: transparent; color: var(--text);
      font-family: 'Google Sans', sans-serif; outline: none;
    }
    .pal-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--text3); }
    .pal-list { padding: 8px; max-height: 400px; overflow-y: auto; }
    .pal-item {
      display: flex; align-items: center; gap: 14px;
      padding: 12px 14px; border-radius: 12px;
      cursor: pointer; transition: background 0.15s;
    }
    .pal-item:hover, .pal-item.sel { background: var(--surface2); }
    .pal-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--text2); flex-shrink: 0; }
    .pal-item.sel .pal-ico, .pal-item:hover .pal-ico { background: var(--primary-bg); color: var(--primary); }
    .pal-name { font-size: 14px; font-weight: 500; }
    .pal-desc { font-size: 12px; color: var(--text3); }
    .pal-item.sel .pal-desc, .pal-item:hover .pal-desc { color: var(--text2); }
    .pal-foot {
      padding: 12px 20px; border-top: 1px solid var(--border);
      font-size: 12px; color: var(--text3);
      display: flex; gap: 16px;
    }
    .pal-foot kbd { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; font-family: 'Roboto Mono', monospace; font-size: 11px; }

    /* ── UPLOAD ZONE ───────────────────────────────────────────── */
    .upload-zone {
      border: 2px dashed var(--border); border-radius: var(--radius-lg);
      padding: 56px 24px; text-align: center; cursor: pointer;
      transition: 0.2s; background: var(--surface); margin-bottom: 24px;
    }
    .upload-zone:hover { border-color: var(--primary); background: var(--primary-bg); }
    .upload-zone h3 { font-size: 16px; font-weight: 500; margin-bottom: 8px; font-family: 'Google Sans', sans-serif; }
    .upload-zone p { font-size: 14px; color: var(--text2); }

    /* ── EMPTY STATE ───────────────────────────────────────────── */
    .empty-state { text-align: center; padding: 56px 24px; color: var(--text2); }
    .empty-state svg { opacity: 0.3; margin-bottom: 16px; }
    .empty-state h4 { font-size: 16px; font-weight: 500; margin-bottom: 4px; font-family: 'Google Sans', sans-serif; }
    .empty-state p { font-size: 14px; }

    /* ── MONO ──────────────────────────────────────────────────── */
    .mono { font-family: 'Roboto Mono', 'Consolas', monospace; font-size: 13px; }

    /* ── SCROLLBAR ─────────────────────────────────────────────── */
    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--text3); }

    /* ── RESPONSIVE ────────────────────────────────────────────── */
    @media (max-width: 1100px) {
      .stats-grid { grid-template-columns: repeat(2,1fr); }
      .charts-row { grid-template-columns: 1fr; }
      .health-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 700px) {
      .stats-grid { grid-template-columns: 1fr; }
      .topbar-brand { min-width: 0; }
      .brand-text, .brand-sub { display: none; }
    }
    /* ── RELAY MONITOR ─────────────────────────────────────────── */
    .relay-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
    @media (max-width: 1100px) { .relay-cards { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 700px) { .relay-cards { grid-template-columns: 1fr; } }

    .relay-card {
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
      padding: 20px 24px; position: relative; overflow: hidden;
    }
    .relay-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
    .relay-card-name { font-size: 14px; font-weight: 500; text-transform: capitalize; }
    .circuit-badge {
      font-size: 11px; font-weight: 500; padding: 4px 12px; border-radius: 100px;
    }
    .circuit-badge.closed { background: var(--green-bg); color: var(--green); }
    .circuit-badge.open { background: var(--red-bg); color: var(--red); }
    .circuit-badge.half_open { background: var(--orange-bg); color: var(--orange); }

    .relay-health-bar { height: 4px; background: var(--surface2); border-radius: 2px; margin: 12px 0 10px; overflow: hidden; }
    .relay-health-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease, background 0.3s; }

    .relay-metric { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-top: 6px; }
    .relay-metric-val { font-weight: 500; color: var(--text); }

    /* Flow Diagram */
    .flow-container {
      background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
      padding: 24px; margin-bottom: 24px; overflow-x: auto;
    }
    .flow-container h3 { font-size: 16px; font-weight: 400; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-family: 'Google Sans', sans-serif; }

    .flow-svg { width: 100%; min-width: 700px; height: 240px; }
    .flow-node-rect { rx: 12; ry: 12; stroke-width: 1; transition: fill 0.3s, stroke 0.3s; }
    .flow-node-text { font-size: 11px; font-weight: 500; fill: var(--text); font-family: 'Google Sans', sans-serif; }
    .flow-node-sub { font-size: 9px; fill: var(--text2); font-family: 'Roboto', sans-serif; }
    .flow-path-line { stroke-width: 1.5; fill: none; stroke-dasharray: 6 3; }
    .flow-dot {
      r: 3; fill: var(--primary);
      animation: flowMove 2.5s linear infinite;
    }
    @keyframes flowMove { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } }
    @keyframes flowPulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }

    /* Failover Feed */
    .failover-chain-pills { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
    .fc-pill {
      font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 100px;
      display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    }
    .fc-pill.fail { background: var(--red-bg); color: var(--red); }
    .fc-pill.ok { background: var(--green-bg); color: var(--green); }
    .fc-arrow { color: var(--text3); font-size: 11px; }

    /* Relay bottom row */
    .relay-bottom { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
    @media (max-width: 1100px) { .relay-bottom { grid-template-columns: 1fr; } }

    /* ═══ CARDS GRID UTIL ═══════════════════════════════════════════════════ */
    .cards-grid { display: grid; }

    /* ═══ MOBILE RESPONSIVE ═══════════════════════════════════════════════════ */
    @media (max-width: 768px) {
      .sidebar {
        position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
        width: 280px; transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
        z-index: 300; box-shadow: none;
      }
      .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
      }
      .sidebar.collapsed {
        width: 280px; transform: translateX(-100%);
      }
      .sidebar.collapsed.mobile-open { transform: translateX(0); }
      .sidebar.collapsed .nav-label { opacity: 1; pointer-events: auto; }
      .sidebar.collapsed .nav-section-label { opacity: 1; }

      .sidebar-backdrop {
        display: none; position: fixed; inset: 0; top: var(--topbar-h);
        background: rgba(0,0,0,0.32); z-index: 250;
      }
      .sidebar-backdrop.visible { display: block; }

      .topbar { padding: 0 8px; height: 56px; }
      .topbar-brand { min-width: 0; }
      .brand-text, .brand-sub { display: none; }
      .search-wrap { display: none; }
      .search-kbd { display: none; }
      .live-badge { display: none; }

      .content { padding: 16px; }
      .crumb-bar { padding: 0 16px; height: 40px; }
      .crumb-sub, #bc-sub { display: none; }

      .page-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
      .page-title { font-size: 18px; }
      .page-actions { width: 100%; flex-wrap: wrap; }

      .stats-grid { grid-template-columns: 1fr !important; gap: 12px; }
      .stat-card { padding: 16px 20px; gap: 12px; }
      .stat-icon { width: 40px; height: 40px; }
      .stat-value { font-size: 22px; }

      .charts-row { grid-template-columns: 1fr !important; }

      .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .table-card table { min-width: 500px; }
      .tbl-search { width: 160px; }
      .tbl-search:focus { width: 200px; }

      .relay-cards { grid-template-columns: 1fr !important; }
      .relay-bottom { grid-template-columns: 1fr !important; }
      .health-grid { grid-template-columns: 1fr !important; }

      .anl-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
      .anl-charts-row { grid-template-columns: 1fr !important; }
      .anl-domain-grid { grid-template-columns: 1fr !important; }

      .modal { width: 95vw; max-width: 95vw; border-radius: 16px; }
      .modal-body { padding: 16px 20px; }
      .modal-header { padding: 20px 20px 12px; }
      .modal-footer { padding: 12px 20px; }
      .modal-form-grid { grid-template-columns: 1fr !important; }

      .flow-svg { min-width: 500px; height: 180px; }
      .flow-container { padding: 16px; }

      .toast-stack { right: 12px; left: 12px; bottom: 16px; }
      .toast-item { min-width: 0; max-width: 100%; }

      .card-header { padding: 14px 16px; }
      .card-body { padding: 16px; }
      .card-title { font-size: 13px; }

      .log-win { height: 280px; padding: 12px; font-size: 12px; }

      .palette { width: 95vw; border-radius: 16px; }
      .pal-overlay { padding-top: 60px; }
    }

    @media (max-width: 400px) {
      .anl-kpi-grid { grid-template-columns: 1fr !important; }
      .stat-value { font-size: 20px; }
      .content { padding: 12px; }
    }
