/* =========================================================
   SUREX — Stylesheet
   Tema: emerald premium (verde garrafa + champagne dourado)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Manrope:wght@200;300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* ========= TOKENS ========= */
:root {
  --bg-abyss: #050F0A;
  --bg-base: #0A1F17;
  --bg-card: rgba(15, 42, 31, 0.7);
  --bg-card-elevated: rgba(20, 53, 39, 0.85);
  --bg-input: rgba(80, 200, 130, 0.04);
  --bg-input-focus: rgba(80, 200, 130, 0.08);
  --bg-overlay: rgba(5, 15, 10, 0.85);

  --border: rgba(80, 200, 130, 0.10);
  --border-strong: rgba(80, 200, 130, 0.18);
  --border-gold: rgba(212, 177, 107, 0.30);
  --border-emerald: rgba(45, 167, 111, 0.35);

  --text-primary: #E8F5EE;
  --text-secondary: #A8C9B5;
  --text-muted: #7A9A87;
  --text-faint: #4A6B57;

  --gold: #D4B16B;
  --gold-bright: #E6C789;
  --gold-dim: #A68845;

  --green: #5DCAA5;
  --green-bright: #7BDDBA;
  --emerald: #34D399;
  --emerald-dim: #1D9E75;
  --emerald-dark: #0F6E56;

  --red: #DC6E6E;
  --rose: #F87171;

  --amber: #FFD166;
  --amber-bright: #FFE9A8;

  --sky: #5DCAE5;

  --font-display: 'Fraunces', serif;
  --font-ui: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
}

/* ========= RESET ========= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { font-family: var(--font-ui); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
body {
  background:
    radial-gradient(1400px 700px at 85% -10%, rgba(212, 177, 107, 0.06), transparent 55%),
    radial-gradient(1000px 600px at 10% 40%, rgba(45, 167, 111, 0.07), transparent 60%),
    radial-gradient(800px 500px at 50% 100%, rgba(15, 110, 86, 0.05), transparent 60%),
    var(--bg-base);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; opacity: 0.018; z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

/* ========= TYPE ========= */
.font-display { font-family: var(--font-display); font-optical-sizing: auto; }
.font-mono { font-family: var(--font-mono); }
.italic { font-style: italic; }
.tabular { font-variant-numeric: tabular-nums; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; }
.h1 { font-size: 1.875rem; line-height: 1.15; }
.h2 { font-size: 1.5rem; line-height: 1.2; }
.h3 { font-size: 1.25rem; }

.gold-text {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 60%, var(--gold-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold-bright); }
.text-emerald { color: var(--emerald); }
.text-rose { color: var(--rose); }
.text-amber { color: var(--amber); }
.text-sky { color: var(--sky); }

.label-tiny {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-muted); font-weight: 500;
}

.text-xs { font-size: 11px; }
.text-sm { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 28px; line-height: 1; }
.text-4xl { font-size: 36px; line-height: 1; }
.text-5xl { font-size: 48px; line-height: 1; }
.font-medium { font-weight: 500; }
.font-light { font-weight: 300; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ========= APP LAYOUT ========= */
.app {
  display: grid; grid-template-columns: 220px 1fr;
  min-height: 100vh; position: relative; z-index: 2;
}

.sidebar {
  padding: 20px 14px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 31, 23, 0.4), rgba(10, 31, 23, 0.1));
  backdrop-filter: blur(12px);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px; padding: 0 6px;
}
.sidebar-logo-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-dim), var(--emerald-dark));
  color: var(--bg-abyss);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  box-shadow: 0 4px 12px rgba(15, 110, 86, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.sidebar-logo-text {
  font-family: var(--font-display); font-size: 18px; font-weight: 400;
  color: var(--text-primary); letter-spacing: 0.5px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 7px;
  font-size: 13px; color: var(--text-secondary);
  transition: all 160ms ease;
  position: relative;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(45, 167, 111, 0.10), rgba(45, 167, 111, 0.02));
  color: var(--emerald);
  box-shadow: inset 2px 0 0 var(--emerald-dim);
}
.nav-item-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }

.sidebar-user {
  margin-top: auto; padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.015);
}
.sidebar-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 177, 107, 0.25), rgba(212, 177, 107, 0.08));
  border: 1px solid rgba(212, 177, 107, 0.25);
  color: var(--gold-bright);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 500; color: var(--text-primary); }
.sidebar-user-plan {
  font-size: 10px; color: var(--gold-bright);
  font-family: var(--font-display); font-style: italic;
}

.main { overflow: hidden; }
.main-container { padding: 24px 32px; max-width: 1400px; }

/* ========= CARDS ========= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  transition: border-color 180ms ease, background 180ms ease;
}
.card:hover { border-color: var(--border-strong); }

.card-padding-xl { padding: 32px; }

.card-elevated {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card-premium {
  background:
    linear-gradient(90deg, rgba(212, 177, 107, 0.04), transparent 50%),
    var(--bg-card);
  border-color: var(--border-gold);
  position: relative;
}
.card-premium::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
}

/* ========= GRID ========= */
.grid { display: grid; gap: 12px; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-6 { gap: 24px; }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-baseline { align-items: baseline; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

/* ========= SPACING ========= */
.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.pt-3 { padding-top: 12px; } .pt-4 { padding-top: 16px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.border-t { border-top: 1px solid var(--border); }

.text-right { text-align: right; }
.text-center { text-align: center; }

/* ========= BUTTONS ========= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  transition: all 160ms ease;
  white-space: nowrap;
  font-family: var(--font-ui);
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 22px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  color: var(--bg-abyss);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(212, 177, 107, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-gold:hover {
  background: linear-gradient(180deg, #F0D49F 0%, var(--gold-bright) 50%, var(--gold) 100%);
  box-shadow: 0 6px 18px rgba(212, 177, 107, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-gold:active { transform: translateY(0); }

.btn-emerald {
  background: linear-gradient(180deg, var(--emerald) 0%, var(--emerald-dim) 100%);
  color: var(--bg-abyss); font-weight: 600;
  box-shadow: 0 4px 14px rgba(45, 167, 111, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-emerald:hover {
  background: linear-gradient(180deg, var(--green-bright) 0%, var(--emerald) 100%);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-strong);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-emerald);
  color: var(--text-primary);
}

/* ========= INPUTS / FORMS ========= */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 13px; color: var(--text-primary);
  font-family: var(--font-ui);
  transition: all 160ms ease;
}
.input:hover { border-color: var(--border-emerald); }
.input:focus {
  outline: none;
  border-color: var(--emerald-dim);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(45, 167, 111, 0.08);
}
.input::placeholder { color: var(--text-faint); }
.input:disabled { opacity: 0.5; cursor: not-allowed; }

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 12px; pointer-events: none;
}
.input-money { padding-left: 36px; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%237A9A87' stroke-width='1.5' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.range-input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border-strong);
  border-radius: 2px; outline: none; cursor: pointer;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold-bright);
  border: 2px solid var(--bg-base);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 177, 107, 0.4);
}
.range-input::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--gold-bright); border: 2px solid var(--bg-base);
}

/* ========= CHIPS / FILTERS ========= */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px;
}

.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  font-size: 11px; font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  color: var(--text-secondary);
  transition: all 160ms ease;
  cursor: pointer;
  font-family: var(--font-ui);
}
.filter-chip:hover {
  border-color: var(--border-emerald);
  color: var(--text-primary);
}
.filter-chip.active {
  background: rgba(45, 167, 111, 0.12);
  border-color: rgba(45, 167, 111, 0.45);
  color: var(--emerald);
}
.filter-divider {
  width: 1px; height: 18px; background: var(--border-strong);
}

/* ========= DOTS / BADGES ========= */
.dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
}
.dot-pulse {
  background: var(--rose);
  animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
  50% { opacity: 0.4; box-shadow: 0 0 0 4px rgba(248, 113, 113, 0); }
}

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 10px;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.badge-live { background: rgba(248, 113, 113, 0.12); color: var(--rose); border-color: rgba(248, 113, 113, 0.3); }
.badge-new { background: rgba(212, 177, 107, 0.12); color: var(--gold-bright); border-color: rgba(212, 177, 107, 0.3); }
.badge-green { background: rgba(45, 167, 111, 0.12); color: var(--emerald); border-color: rgba(45, 167, 111, 0.3); }
.badge-amber { background: rgba(255, 209, 102, 0.12); color: var(--amber); border-color: rgba(255, 209, 102, 0.3); }
.badge-rose { background: rgba(248, 113, 113, 0.12); color: var(--rose); border-color: rgba(248, 113, 113, 0.3); }

.badge-trial { background: rgba(212, 177, 107, 0.15); color: var(--gold-bright); border-color: rgba(212, 177, 107, 0.35); }
.badge-active { background: rgba(45, 167, 111, 0.15); color: var(--emerald); border-color: rgba(45, 167, 111, 0.35); }
.badge-expired { background: rgba(220, 110, 110, 0.15); color: var(--red); border-color: rgba(220, 110, 110, 0.35); }
.badge-cancelled { background: rgba(120, 120, 120, 0.15); color: var(--text-muted); border-color: rgba(120, 120, 120, 0.3); }
.badge-placed { background: rgba(93, 202, 229, 0.15); color: var(--sky); border-color: rgba(93, 202, 229, 0.35); }
.badge-partial { background: rgba(255, 209, 102, 0.15); color: var(--amber); border-color: rgba(255, 209, 102, 0.35); }
.badge-settled { background: rgba(45, 167, 111, 0.12); color: var(--emerald); border-color: rgba(45, 167, 111, 0.3); }
.badge-account-active { background: rgba(45, 167, 111, 0.15); color: var(--emerald); border-color: rgba(45, 167, 111, 0.35); }
.badge-account-limited { background: rgba(255, 209, 102, 0.15); color: var(--amber); border-color: rgba(255, 209, 102, 0.35); }
.badge-account-restricted { background: rgba(248, 113, 113, 0.15); color: var(--rose); border-color: rgba(248, 113, 113, 0.35); }
.badge-account-banned { background: rgba(60, 60, 60, 0.3); color: var(--text-muted); border-color: rgba(60, 60, 60, 0.5); }

/* ========= SUREBET CARD ========= */
.surebet-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.surebet-card:hover {
  border-color: var(--border-emerald);
  background: var(--bg-card-elevated);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.surebet-card.premium {
  background:
    linear-gradient(90deg, rgba(212, 177, 107, 0.05) 0%, transparent 50%),
    var(--bg-card);
  border-color: var(--border-gold);
}
.surebet-card.premium::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
}

/* ========= BOOKMAKER LOGO ========= */
.bm-logo {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-family: var(--font-display); font-weight: 600;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

/* ========= TABS ========= */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
}
.tab {
  padding: 11px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 160ms ease;
  cursor: pointer;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/* ========= TABLE ========= */
.table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.table thead th {
  text-align: left; padding: 12px 16px; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: rgba(80, 200, 130, 0.015);
}
.table tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr { transition: background 140ms ease; }
.table tbody tr:hover { background: rgba(80, 200, 130, 0.025); }
.table tbody tr:last-child td { border-bottom: none; }

/* ========= ALERTS ========= */
.alert {
  padding: 12px 16px; border-radius: 7px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-ok { background: rgba(45, 167, 111, 0.10); border-color: rgba(45, 167, 111, 0.3); color: var(--green-bright); }
.alert-error { background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.3); color: var(--rose); }
.alert-info { background: rgba(212, 177, 107, 0.08); border-color: rgba(212, 177, 107, 0.25); color: var(--gold-bright); }
.alert-warn { background: rgba(255, 209, 102, 0.08); border-color: rgba(255, 209, 102, 0.25); color: var(--amber); }

/* ========= PROGRESS BAR ========= */
.progress-bar {
  height: 6px; background: rgba(80, 200, 130, 0.06);
  border-radius: 3px; overflow: hidden;
}
.progress-fill {
  height: 100%; transition: width 400ms cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(90deg, var(--emerald-dim), var(--emerald));
  box-shadow: 0 0 8px rgba(45, 167, 111, 0.4);
}

/* ========= BET MINI ========= */
.bet-mini {
  padding: 10px 12px;
  background: rgba(80, 200, 130, 0.025);
  border: 1px solid var(--border);
  border-radius: 7px;
}

/* ========= MODAL ========= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  width: 100%; max-width: 720px; max-height: 90vh;
  overflow: auto;
  animation: modalSlide 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px 28px 0;
}
.modal-body { padding: 24px 28px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 140ms ease;
}
.modal-close:hover {
  background: rgba(248, 113, 113, 0.12);
  color: var(--rose);
}

/* ========= CONNECTION STATUS ========= */
.connection-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-family: var(--font-display); font-style: italic;
}
.conn-live { color: var(--emerald); }
.conn-stale { color: var(--amber); }
.conn-offline { color: var(--rose); }

/* ========= AUTH PAGES ========= */
.auth-bg {
  background:
    radial-gradient(900px 500px at 20% 30%, rgba(45, 167, 111, 0.06), transparent 55%),
    radial-gradient(700px 400px at 80% 70%, rgba(212, 177, 107, 0.05), transparent 55%),
    var(--bg-base);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.auth-bg::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth-wrap {
  width: 100%; max-width: 420px; padding: 24px;
  position: relative; z-index: 2;
}
.auth-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 40px 36px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.auth-logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-display); font-size: 26px;
  color: var(--text-primary); font-weight: 400;
}
.auth-logo-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-dim), var(--emerald-dark));
  color: var(--bg-abyss);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-family: var(--font-display); font-size: 18px;
  box-shadow: 0 6px 20px rgba(15, 110, 86, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ========= RESPONSIVE ========= */
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sidebar { padding: 16px 8px; }
  .sidebar-logo-text, .sidebar-user-info, .nav-item span { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .main-container { padding: 16px; }
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: 1fr; }
}

/* ========= INSTALLER ========= */
.installer {
  max-width: 560px; margin: 60px auto; padding: 32px;
}
.installer-step {
  display: flex; align-items: center; gap: 14px; margin-bottom: 28px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.installer-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 177, 107, 0.2), rgba(212, 177, 107, 0.08));
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 500;
}
.installer-step.done .installer-step-num {
  background: linear-gradient(135deg, var(--emerald-dim), var(--emerald-dark));
  border-color: transparent;
  color: var(--bg-abyss);
}

/* ========= METRIC CARDS (dashboard analytics) ========= */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.metric-grid-wide { grid-column: span 2; }

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  transition: all 200ms ease;
}
.metric-card:hover {
  border-color: var(--border-emerald);
  background: var(--bg-card-elevated);
}
.metric-card.premium {
  background: linear-gradient(135deg, rgba(212,177,107,0.06), transparent 60%), var(--bg-card);
  border-color: var(--border-gold);
}
.metric-card.premium::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
}

.metric-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.metric-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(45, 167, 111, 0.12);
  border: 1px solid rgba(45, 167, 111, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--emerald);
  flex-shrink: 0;
}
.metric-icon.gold {
  background: rgba(212, 177, 107, 0.12);
  border-color: rgba(212, 177, 107, 0.30);
  color: var(--gold-bright);
}
.metric-icon-svg { width: 14px; height: 14px; }
.metric-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.10em; font-weight: 500;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 14px;
}
.metric-value.gold {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 60%, var(--gold-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-breakdown {
  display: flex; flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.metric-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.metric-row-label { color: var(--text-muted); }
.metric-row-value {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.metric-footer {
  margin-top: 12px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.metric-tag {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 10px;
  background: rgba(45, 167, 111, 0.10);
  border: 1px solid rgba(45, 167, 111, 0.25);
  color: var(--emerald);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.metric-tag-gold {
  background: rgba(212, 177, 107, 0.10);
  border-color: rgba(212, 177, 107, 0.25);
  color: var(--gold-bright);
}
.metric-tag-rose {
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--rose);
}
.metric-tag-amber {
  background: rgba(255, 209, 102, 0.10);
  border-color: rgba(255, 209, 102, 0.25);
  color: var(--amber);
}

/* ========= CHARTS ========= */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  backdrop-filter: blur(8px);
}
.chart-head { margin-bottom: 16px; }
.chart-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 500;
  color: var(--text-primary);
}
.chart-sub {
  font-size: 11px; color: var(--text-muted);
  margin-top: 2px;
}
.chart-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.chart-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-secondary);
}
.chart-legend-dot {
  width: 8px; height: 8px; border-radius: 2px;
}
.chart-svg { width: 100%; height: 240px; display: block; }
.chart-svg-tall { height: 280px; }

.chart-footer {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 12px;
}

/* ========= RESPONSIVE METRIC GRID ========= */
@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid-wide { grid-column: span 2; }
}

/* ========= MISC UTILITIES ========= */
.hidden { display: none !important; }
.relative { position: relative; }
.absolute { position: absolute; }
.w-full { width: 100%; }
.cursor-pointer { cursor: pointer; }
