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

    :root {
      --bg: #0c1222;
      --bg-sidebar: #0a0f1e;
      --bg-card: #131c30;
      --bg-input: #182338;
      --bg-hover: #1a2744;
      --border: rgba(148,163,184,0.08);
      --border-focus: #38bdf8;
      --text: #f1f5f9;
      --text-secondary: #94a3b8;
      --text-muted: #475569;
      --primary: #6366f1;
      --accent: #38bdf8;
      --accent-hover: #0ea5e9;
      --accent-glow: rgba(56,189,248,0.10);
      --success: #22c55e;
      --warning: #f59e0b;
      --error: #ef4444;
      --radius: 10px;
      --radius-lg: 14px;
      --transition: all 0.15s ease;
    }

    /* ══ Light Theme ══════════════════════════════════ */
    [data-theme="light"] {
      --bg: #f8fafc;
      --bg-sidebar: #ffffff;
      --bg-card: #ffffff;
      --bg-input: #f1f5f9;
      --bg-hover: #e2e8f0;
      --border: rgba(15,23,42,0.08);
      --border-focus: #0284c7;
      --text: #0f172a;
      --text-secondary: #475569;
      --text-muted: #94a3b8;
      --primary: #4f46e5;
      --accent: #0284c7;
      --accent-hover: #0369a1;
      --accent-glow: rgba(2,132,199,0.08);
      --success: #16a34a;
      --warning: #d97706;
      --error: #dc2626;
    }

    [data-theme="light"] .sidebar {
      box-shadow: 1px 0 0 var(--border);
    }

    [data-theme="light"] .card,
    [data-theme="light"] .stat-card,
    [data-theme="light"] .table-container {
      box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    }

    [data-theme="light"] .modal-overlay {
      background: rgba(15,23,42,0.3);
    }

    [data-theme="light"] .sidebar-logo h1 {
      background: linear-gradient(135deg, #0284c7, #6366f1);
      -webkit-background-clip: text;
      background-clip: text;
    }

    [data-theme="light"] .toast.success { background: rgba(22,163,74,0.08); border-color: rgba(22,163,74,0.15); }
    [data-theme="light"] .toast.error { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.15); }
    [data-theme="light"] .toast.info { background: rgba(2,132,199,0.08); border-color: rgba(2,132,199,0.15); }

    [data-theme="light"] .skeleton {
      background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
      background-size: 200% 100%;
    }

    /* ── Theme Toggle ─────────────────────────────────── */
    .theme-toggle {
      display: flex; align-items: center; justify-content: center;
      gap: 8px; padding: 8px 14px; border-radius: 8px;
      border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text-secondary); font-family: inherit; font-size: 0.72rem;
      font-weight: 600; cursor: pointer; transition: var(--transition); width: 100%;
    }
    .theme-toggle:hover { background: var(--bg-hover); color: var(--text); }
    .theme-toggle svg { width: 14px; height: 14px; }

    body {
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      height: 100vh;
      overflow: hidden;
    }

    /* ══ Layout ═══════════════════════════════════════ */
    .app {
      display: grid;
      grid-template-columns: 220px 1fr;
      height: 100vh;
    }

    /* ══ Sidebar Nav ══════════════════════════════════ */
    .sidebar {
      background: var(--bg-sidebar);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 20px 0;
      overflow-y: auto;
    }

    .sidebar-logo {
      padding: 0 20px 20px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 8px;
    }

    .sidebar-logo h1 {
      font-size: 0.95rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 8px;
      background: linear-gradient(135deg, #38bdf8, #818cf8);
      -webkit-background-clip: text;
      background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .sidebar-logo .subtitle {
      font-size: 0.68rem;
      color: var(--text-muted);
      margin-top: 2px;
    }

    .nav-section-label {
      font-size: 0.62rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      padding: 16px 20px 6px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 20px;
      cursor: pointer;
      transition: var(--transition);
      font-size: 0.84rem;
      font-weight: 500;
      color: var(--text-secondary);
      border-left: 2px solid transparent;
    }

    .nav-item:hover { background: var(--bg-hover); color: var(--text); }

    .nav-item.active {
      color: var(--accent);
      background: var(--accent-glow);
      border-left-color: var(--accent);
      font-weight: 600;
    }

    .nav-icon { width: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .nav-icon svg { width: 18px; height: 18px; }

    .sidebar-footer {
      margin-top: auto;
      padding: 16px 14px;
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .domain-badge {
      font-size: 0.72rem; color: var(--text-muted); padding: 8px 12px;
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; font-family: 'SF Mono', Consolas, monospace;
      text-align: center;
    }

    /* ══ Sidebar Overlay (mobile only) ═══════════════ */
    .sidebar-overlay { display: none; }

    /* ══ Content Panel ════════════════════════════════ */
    .content {
      padding: 32px 40px;
      overflow-y: auto;
      max-height: 100vh;
    }

    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 28px;
    }

    .page-header h2 {
      font-size: 1.25rem;
      font-weight: 700;
    }

    .page-desc {
      font-size: 0.82rem;
      color: var(--text-secondary);
      margin-top: 4px;
    }

    /* ── Cards ──────────────────────────────────────── */
    .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 28px; }

    .card, .stat-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 24px;
      transition: var(--transition);
    }

    .stat-card:hover { border-color: rgba(148,163,184,0.14); transform: translateY(-1px); }

    .card-title {
      font-size: 0.72rem;
      font-weight: 700;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border);
    }

    .stat-label {
      font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: 0.06em; margin-bottom: 8px; font-weight: 600;
    }
    .stat-value { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
    .stat-change { font-size: 0.75rem; margin-top: 4px; color: var(--text-secondary); }
    .stat-change.up { color: var(--success); }
    .stat-change.down { color: var(--error); }

    /* ── Tables ─────────────────────────────────────── */
    .table-container {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px;
    }
    .table-header {
      display: flex; justify-content: space-between; align-items: center;
      padding: 16px 20px; border-bottom: 1px solid var(--border);
    }
    .table-header h3 { font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
    table { width: 100%; border-collapse: collapse; }
    th {
      text-align: left; padding: 12px 20px; font-size: 0.68rem; font-weight: 700;
      color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
      border-bottom: 1px solid var(--border);
    }
    td { padding: 14px 20px; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
    tr:last-child td { border-bottom: none; }
    tr:hover td { background: var(--bg-hover); }
    .code-cell {
      font-family: 'SF Mono', Consolas, monospace; color: var(--accent);
      font-weight: 500; font-size: 0.82rem;
    }
    .url-cell { color: var(--text-secondary); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tag {
      display: inline-flex; padding: 2px 8px; font-size: 0.68rem; border-radius: 50px;
      background: var(--accent-glow); color: var(--accent); font-weight: 600; margin-right: 4px;
    }
    .status-active { color: var(--success); font-weight: 500; }
    .status-inactive { color: var(--text-muted); }
    .clicks-badge {
      display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
      background: rgba(148,163,184,0.06); border-radius: 50px; font-size: 0.78rem;
      font-weight: 500; color: var(--text-secondary);
    }

    /* ── Buttons (CX Center style) ────────────────── */
    .btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: 6px; padding: 9px 14px; border-radius: 8px;
      border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text-secondary); font-family: inherit; font-size: 0.78rem;
      font-weight: 600; cursor: pointer; transition: var(--transition);
      text-decoration: none;
    }
    .btn:hover { background: var(--bg-hover); color: var(--text); border-color: rgba(148,163,184,0.14); }
    .btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
    .btn-primary:hover { background: var(--accent-hover); }
    .btn-danger { background: transparent; color: var(--error); border-color: rgba(239,68,68,0.2); }
    .btn-danger:hover { background: rgba(239,68,68,0.08); }
    .btn-sm { padding: 6px 10px; font-size: 0.72rem; }
    .range-btn.active, .gran-btn.active, .metric-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

    /* ── Modal ──────────────────────────────────────── */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center; z-index: 1000;
      opacity: 0; pointer-events: none; transition: opacity 0.2s;
    }
    .modal-overlay.active { opacity: 1; pointer-events: auto; }
    .modal {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px;
      width: 520px; max-width: 90vw; max-height: 80vh; overflow-y: auto; padding: 28px;
      transform: scale(0.95); transition: transform 0.2s;
    }
    .modal-overlay.active .modal { transform: scale(1); }
    .modal h3 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; }

    /* ── Forms (CX Center tokens) ─────────────────── */
    .form-group { margin-bottom: 16px; }
    .form-group label {
      display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px;
      text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600;
    }
    .form-input {
      width: 100%; padding: 10px 14px; background: var(--bg-input);
      border: 1px solid var(--border); border-radius: 8px; color: var(--text);
      font-size: 0.88rem; font-family: inherit; outline: none; transition: var(--transition);
    }
    .form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }
    .form-input::placeholder { color: var(--text-muted); }
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

    /* ── QR Preview ─────────────────────────────────── */
    .qr-preview {
      background: white; border-radius: var(--radius); padding: 24px; text-align: center;
      display: inline-block;
    }
    .qr-preview img { width: 200px; height: 200px; }

    /* ── Toast (CX Center style) ──────────────────── */
    .toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; }
    .toast {
      padding: 12px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 500;
      backdrop-filter: blur(12px); min-width: 280px; max-width: 480px; text-align: center;
      transform: translateY(-40px); opacity: 0;
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; border: 1px solid;
    }
    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.success { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.15); }
    .toast.error { background: rgba(239,68,68,0.1); color: var(--error); border-color: rgba(239,68,68,0.15); }
    .toast.info { background: rgba(56,189,248,0.1); color: var(--accent); border-color: rgba(56,189,248,0.15); }

    /* ── Empty State ───────────────────────────────── */
    .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
    .empty-state .emoji { font-size: 2.5rem; margin-bottom: 12px; }
    .empty-state h4 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 4px; }
    .empty-state p { font-size: 0.82rem; margin-bottom: 20px; }

    /* ── Skeleton / Search ─────────────────────────── */
    .skeleton { background: linear-gradient(90deg, var(--bg-input) 25%, rgba(148,163,184,0.06) 50%, var(--bg-input) 75%);
      background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; height: 20px; }
    @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

    /* ── Spinner ───────────────────────────────────── */
    .spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
    @keyframes spin { to { transform: rotate(360deg); } }

    .search-bar { display: flex; gap: 10px; align-items: center; }
    .search-input {
      flex: 1; padding: 9px 14px; background: var(--bg-input); border: 1px solid var(--border);
      border-radius: 8px; color: var(--text); font-size: 0.82rem; outline: none;
      transition: var(--transition); font-family: inherit;
    }
    .search-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-glow); }

    /* ══ Login Screen — split-screen macondo light, matches the wallets Pass Studio sign-in ══ */
    .login-screen {
      position: fixed; inset: 0; z-index: 5000; display: flex;
      background: #ffffff; font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }
    .login-left {
      flex: 1 1 54%; min-width: 0; display: flex; align-items: center;
      justify-content: center; padding: 40px 28px; overflow-y: auto;
    }
    .login-form-col { width: 380px; max-width: 100%; }
    .login-hero {
      flex: 1 1 46%;
      background: #111827 url('/dashboard/assets/signin-hero.jpg') center/cover no-repeat;
    }
    @media (max-width: 860px) { .login-hero { display: none; } }
    .login-wordmark { height: 30px; display: block; }
    .login-title { font-size: 24px; font-weight: 600; color: #111827; margin: 28px 0 6px; }
    .login-sub { color: #9ca3af; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
    .login-label {
      font-size: 12px; font-weight: 500; color: #4a5565; display: block; margin-top: 16px;
    }
    .login-input {
      width: 100%; height: 40px; padding: 8px 12px; border-radius: 12px;
      border: 1px solid #dcdcdc; background: #ffffff; color: #111827;
      font-size: 14px; font-family: inherit; box-sizing: border-box; margin-top: 6px; outline: none;
    }
    .login-input:focus { border-color: #edaa73; box-shadow: 0 0 0 2px rgba(237,170,115,.55); }
    .login-btn {
      width: 100%; height: 44px; border-radius: 12px; border: none; color: #fff;
      background: #111827; font-size: 14px; font-weight: 600; cursor: pointer;
      margin-top: 18px; font-family: inherit;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .login-btn:hover:not(:disabled) { background: #000; }
    .login-btn:disabled { opacity: 0.85; cursor: default; }
    .login-btn-ghost {
      width: 100%; height: 44px; border-radius: 12px; background: transparent;
      color: #4a5565; border: 1px solid #e7e7e7; font-size: 14px; font-weight: 600;
      cursor: pointer; margin-top: 14px; font-family: inherit;
    }
    .login-btn-ghost:hover { background: #f0f0f0; }
    .login-error {
      background: #fdecef; color: #b3243c; padding: 9px 11px; border-radius: 10px;
      font-size: 13px; margin: 0 0 12px; border: 1px solid #f2aeba; display: none;
    }
    .vendor-list { max-height: 480px; overflow-y: auto; margin-top: 8px; }
    .vendor-item {
      width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px;
      border: 1px solid #e7e7e7; background: #ffffff; cursor: pointer; margin-top: 6px;
      color: #111827; font-family: inherit; display: block;
    }
    .vendor-item:hover { background: #f0f0f0; }
    .vendor-item .vname { font-weight: 600; font-size: 13px; color: #111827; }
    .vendor-item .vid { font-size: 11px; color: #9ca3af; }
    .vendor-count { font-size: 11px; color: #9ca3af; margin-top: 6px; }
    .vendor-empty { color: #9ca3af; font-size: 13px; padding: 10px 2px; }
    .vendor-loading {
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      padding: 44px 0 40px; gap: 16px;
    }
    .vendor-loading-label { color: #4a5565; font-size: 13.5px; font-weight: 500; }
    .spin-white {
      display: inline-block; width: 16px; height: 16px;
      border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
      border-radius: 50%; animation: login-spin .6s linear infinite;
    }
    .spin-ink {
      display: inline-block; width: 26px; height: 26px;
      border: 3px solid rgba(17,24,39,.15); border-top-color: #111827;
      border-radius: 50%; animation: login-spin .7s linear infinite;
    }
    @keyframes login-spin { to { transform: rotate(360deg); } }
    /* Cross-fade/slide when swapping the sign-in form for the vendor list. */
    @keyframes login-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
    .login-view { animation: login-view-in .3s cubic-bezier(.2,.8,.2,1); }

    /* ── Sidebar user section ─────────────────────── */
    .user-badge {
      padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
      border-radius: 8px; font-size: 0.75rem; margin-bottom: 6px;
    }
    .user-badge .user-email {
      color: var(--text-secondary); white-space: nowrap; overflow: hidden;
      text-overflow: ellipsis; margin-bottom: 4px; font-weight: 500;
    }
    .user-badge .vendor-name {
      color: var(--accent); font-weight: 600; font-size: 0.72rem;
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .sidebar-btn {
      display: flex; align-items: center; justify-content: center;
      gap: 6px; padding: 8px 14px; border-radius: 8px;
      border: 1px solid var(--border); background: var(--bg-card);
      color: var(--text-secondary); font-family: inherit; font-size: 0.72rem;
      font-weight: 600; cursor: pointer; transition: var(--transition); width: 100%;
    }
    .sidebar-btn:hover { background: var(--bg-hover); color: var(--text); }
    .sidebar-btn.danger { color: var(--error); border-color: rgba(239,68,68,0.15); }
    .sidebar-btn.danger:hover { background: rgba(239,68,68,0.06); }

    /* ── Sidebar Toggle (hamburger) ──────────────── */
    .sidebar-toggle {
      display: none; position: fixed; top: 12px; left: 12px; z-index: 1100;
      background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
      padding: 8px; cursor: pointer; color: var(--text-secondary);
      transition: var(--transition);
    }
    .sidebar-toggle:hover { background: var(--bg-hover); color: var(--text); }

    /* ── Pagination ───────────────────────────────── */
    .pagination {
      display: flex; justify-content: space-between; align-items: center;
      padding: 12px 20px; border-top: 1px solid var(--border);
      font-size: 0.75rem; color: var(--text-muted);
    }
    .pagination-info { font-weight: 500; }
    .pagination-controls { display: flex; gap: 4px; }
    .pagination-controls button {
      padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
      background: var(--bg-card); color: var(--text-secondary); font-family: inherit;
      font-size: 0.72rem; font-weight: 600; cursor: pointer; transition: var(--transition);
    }
    .pagination-controls button:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
    .pagination-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
    .pagination-controls button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

    /* ── Responsive: Tablet (<=1024px) ────────────── */
    @media (max-width: 1024px) {
      .content { padding: 24px 20px; }
      .cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
    }

    /* ── Responsive: Mobile (<=768px) ─────────────── */
    @media (max-width: 768px) {
      .sidebar-toggle { display: flex; }
      .app { grid-template-columns: 1fr; }
      .sidebar {
        position: fixed; left: -260px; top: 0; bottom: 0; width: 250px;
        z-index: 1050; transition: left 0.25s ease;
        box-shadow: none;
      }
      .sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
      .sidebar-overlay {
        display: block;
        position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1040;
        opacity: 0; pointer-events: none; transition: opacity 0.25s;
      }
      .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
      .content { padding: 60px 16px 20px; max-height: 100vh; }
      .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
      .cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
      .form-row { grid-template-columns: 1fr; }
      table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .stat-value { font-size: 1.4rem; }
      .modal { width: 95vw; padding: 20px; max-height: 90vh; }
      .table-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    }

    /* ── Responsive: Small Mobile (<=480px) ────────── */
    @media (max-width: 480px) {
      .cards-grid { grid-template-columns: 1fr; }
      .stat-value { font-size: 1.2rem; }
      .content { padding: 56px 12px 16px; }
    }
