@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f6fb;
  --bg-primary: #f4f6fb;
  --bg-secondary: #f9fafb;
  --bg-card: #ffffff;
  --bg-sidebar: #141c34;
  --bg-input: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e5e9f3;
  --border-color: #e5e9f3;
  --border-focus: rgba(112, 101, 239, 0.4);
  --text: #182037;
  --text-primary: #182037;
  --text-secondary: #6b7280;
  --text-muted: #78849a;
  --primary: #7065ef;
  --primary-light: rgba(112,101,239,0.12);
  --primary-dark: #5d52dc;
  --color-primary: #7065ef;
  --color-primary-hover: #5d52dc;
  --color-accent: #7065ef;
  --color-accent-hover: #5d52dc;
  --green: #27b981;
  --green-light: rgba(39,185,129,0.12);
  --color-buy: #27b981;
  --color-buy-rgb: 39, 185, 129;
  --red: #f36f7c;
  --red-light: rgba(243,111,124,0.13);
  --color-sell: #f36f7c;
  --color-sell-rgb: 243, 111, 124;
  --amber: #eea347;
  --amber-light: rgba(238,163,71,0.15);
  --color-warning: #eea347;
  --sidebar-muted: #aab6d0;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --sidebar-width: 220px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* ===== APP LAYOUT ===== */
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: none;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  padding: 18px 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 24px;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #8a7cff, #3b96ff);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 0.95rem;
}

.sidebar-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.3px; color: #fff; }
.sidebar-title span { color: var(--sidebar-muted); font-weight: 500; font-size: 0.65rem; display: block; margin-top: 1px; }

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  padding: 15px 9px 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: 0.2s ease;
  margin-bottom: 2px;
  border: none;
}

.nav-item:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-item.active { color: #fff; background: rgba(112,101,239,0.25); box-shadow: inset 3px 0 #968dff; font-weight: 600; }
.nav-item.active svg { stroke: #fff; }

.nav-badge {
  margin-left: auto;
  background: rgba(243,111,124,0.2);
  color: #ff9c9c;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin: 0 5px 18px;
}

.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #8a7cff, #3b96ff);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 0.8rem;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.user-role { font-size: 0.7rem; color: var(--sidebar-muted); }

.logout-btn { color: #ff9c9c !important; font-size: 12px; }
.logout-btn:hover { background: rgba(255,255,255,0.06) !important; color: #ff9c9c !important; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.topbar-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-rates {
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.rate-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
}
.rate-item .label { color: var(--text-muted); font-weight: 600; }
.rate-item .value { color: var(--text); font-weight: 700; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--text-muted); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.content-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.3px; }
.header-actions { display: flex; gap: 8px; }
.content-body { display: flex; flex-direction: column; gap: 20px; padding: 28px; }

/* ===== CARDS / PANELS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header .actions {
  display: flex;
  gap: 8px;
}

.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title { font-size: 0.95rem; font-weight: 700; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.admin-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.full-width { grid-column: 1 / -1; }

@media (max-width: 1200px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; }
  .main-content { padding: 20px 24px; }
  .grid-2 { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 240px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
  .mobile-header {
    display: flex !important;
    align-items: center; justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  .hamburger-btn {
    background: none; border: none; color: var(--text-primary);
    font-size: 1.5rem; cursor: pointer; padding: 4px 8px;
  }
  .main-content { margin-left: 0; padding: 12px; }
  .content-header { flex-direction: column; gap: 8px; align-items: flex-start; }
  .content-header .page-title { font-size: 1.1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .admin-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.1rem; }
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  .card { padding: 14px; }
  .modal-content { width: 95%; max-width: 95%; }
  .auth-card { padding: 24px 20px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .header-actions { flex-wrap: wrap; }
  .btn { padding: 8px 14px; font-size: 0.8rem; }
  .balances-grid { grid-template-columns: 1fr; }
  .account-row { flex-wrap: wrap; }
  .account-row-amount { width: 100%; margin-top: 6px; }
}

@media (max-width: 480px) {
  .main-content { padding: 10px; }
  .card { padding: 12px; }
  .stat-card { padding: 12px 14px; }
  .stat-value { font-size: 1rem; }
  .page-title { font-size: 1rem; }
  .auth-logo { width: 40px; height: 40px; font-size: 1.2rem; }
  .auth-title { font-size: 1rem; }
  .auth-subtitle { font-size: 0.75rem; }
  .btn { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; }
  .data-table { min-width: 400px; font-size: 0.75rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .nav-item { font-size: 0.8rem; padding: 8px 10px; }
  .sidebar-brand { padding: 16px 12px; }
  .sidebar-title { font-size: 1rem; }
  .modal-content { width: 98%; max-width: 98%; border-radius: var(--radius-md); }
  .modal-body { padding: 14px; }
  .content-header { gap: 6px; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .queue-stats { flex-wrap: wrap; gap: 8px; }
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }

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

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.stat-icon.green { background: var(--green-light); }
.stat-icon.red { background: var(--red-light); }
.stat-icon.indigo { background: var(--primary-light); }
.stat-icon.amber { background: var(--amber-light); }

.stat-trend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
.stat-trend.up { background: var(--green-light); color: var(--green); }
.stat-trend.down { background: var(--red-light); color: var(--red); }

.stat-label {
  font-size: 0.78rem; color: var(--text-muted);
  font-weight: 500;
}

.stat-value { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.5px; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.blue { color: var(--primary); }

/* ===== FORMS ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }

.input-field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(112, 101, 239, 0.1);
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none; font-weight: 600; cursor: pointer;
  transition: all 0.15s; font-size: 0.82rem; gap: 6px;
  text-decoration: none; font-family: inherit;
}

.btn-primary { background: var(--primary); color: white; box-shadow: 0 6px 14px rgba(112,101,239,0.25); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 8px 18px rgba(112,101,239,0.3); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface); border-color: var(--text-muted); }
.btn-ghost { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: #fff1f3; color: var(--red); }
.btn-danger:hover { background: #ffe5e8; }
.btn-success { background: var(--green); color: white; }
.btn-sm { padding: 5px 10px; font-size: 0.76rem; border-radius: 8px; }

.btn-icon {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface-2); }
.btn-icon.edit { color: var(--primary); }
.btn-icon.edit:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-icon.del { color: var(--red); }
.btn-icon.del:hover { background: var(--red-light); border-color: var(--red-light); }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
}

.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.84rem; }
.data-table th {
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 700; padding: 12px 22px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.data-table td { padding: 14px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.mono-text { font-family: var(--font-mono); }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 600; }
.badge-success { background: var(--green-light); color: var(--green); }
.badge-danger { background: var(--red-light); color: var(--red); }
.badge-warning { background: var(--amber-light); color: var(--amber); }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-indigo { background: var(--primary-light); color: var(--primary-dark); }

/* Borsa type pills */
.borsa-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
}
.borsa-pill.bluex { background: #eff6ff; color: #2563eb; }
.borsa-pill.dyorex { background: #fff7ed; color: #ea580c; }
.borsa-pill.bridex { background: #fdf4ff; color: #c026d3; }

/* Wallet address */
.wallet-addr {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--green);
  font-weight: 600;
}

/* Balance values */
.bal-green { color: var(--green); font-weight: 700; }
.bal-red { color: var(--red); font-weight: 700; }

/* ===== MODAL ===== */
.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex; justify-content: center; align-items: center;
  z-index: 2000; backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 22px; }

/* ===== ACCOUNTS POOL ===== */
.accounts-pool {
  max-height: 300px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.account-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.account-item:hover { background: var(--surface); }
.account-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.account-item-details { flex: 1; display: flex; justify-content: space-between; align-items: center; }
.account-item-name { font-weight: 500; font-size: 0.8rem; color: var(--text); }
.account-item-owner { font-size: 0.7rem; color: var(--text-muted); background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }

/* User Groups */
.user-group { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.user-group-header { background: var(--surface-2); padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); color: var(--text); }
.user-group-name { font-weight: 600; font-size: 0.8rem; }
.user-group-accounts { padding: 8px; }
.account-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 4px; }
.account-row:hover { background: var(--surface-2); }
.account-row-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.account-row-name { font-size: 0.8rem; font-weight: 500; }
.account-row-balance { font-size: 0.7rem; color: var(--text-muted); }
.account-row-amount { width: 100px; }

/* ===== QUEUE TRACKER ===== */
.queue-tracker {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.queue-header { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 600; }
.progress-bar-container { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(to right, var(--primary), var(--primary-dark)); width: 0%; transition: width 0.3s ease; }
.queue-stats { display: flex; gap: 14px; font-size: 0.75rem; }

/* ===== ALERTS ===== */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-danger { background: var(--red-light); color: var(--red); border: 1px solid #fef2f2; }

/* ===== ERROR CARD ===== */
.error-card {
  background: var(--red-light);
  border: 1px solid #fef2f2;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.error-card .error-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.error-item {
  background: var(--surface);
  border: 1px solid #fef2f2;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.error-item:last-child { margin-bottom: 0; }
.error-item .name { font-weight: 600; color: var(--text); font-size: 0.84rem; }
.error-item .msg { font-size: 0.78rem; color: var(--red); margin-top: 3px; }
.error-item .meta { font-size: 0.7rem; color: var(--text-muted); margin-top: 5px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 30px; color: var(--text-muted); }

/* ===== AUTH ===== */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  display: flex; flex-direction: column; gap: 24px;
  box-shadow: var(--shadow-md);
}
.auth-header { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.auth-logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm); margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.auth-title { font-size: 1.25rem; font-weight: 800; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-secondary); }

/* ===== LEGACY COMPAT ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px 20px 20px; }

.app-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 16px 0; margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 1rem;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.brand-name { font-size: 1rem; font-weight: 700; }
.user-controls { display: flex; align-items: center; gap: 8px; }
.user-controls strong { margin: 0 4px; font-size: 0.85rem; }

.role-badge {
  background: var(--primary-light); color: var(--primary-dark);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
}
.role-badge.admin { background: var(--red-light); color: var(--red); border-color: rgba(239, 68, 68, 0.2); }

.profile-dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 150px;
  z-index: 1000; box-shadow: var(--shadow-md); margin-top: 6px;
}
.dropdown-item { padding: 8px 14px; cursor: pointer; font-size: 0.8rem; color: var(--text); transition: background 0.15s; }
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Balances */
.balances-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.balance-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.balance-card-header { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary); }
.balance-card-value { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; }
.balance-card-details { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Energy gradient card */
.energy-card {
  background: linear-gradient(135deg, #7065ef 0%, #8b5cf6 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(112,101,239,0.2);
}
.energy-card .info h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.energy-card .info p { font-size: 0.8rem; opacity: 0.8; }
.energy-stats { display: flex; gap: 32px; }
.energy-stat { text-align: center; }
.energy-stat .val { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.3px; }
.energy-stat .lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; margin-top: 2px; }

/* Two column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
