/* ============================================================
   Billi IT · Epic Accounts
   Paleta: azul, blanco y negro.
   ============================================================ */

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;

  --bg: #f3f6fc;
  --bg-soft: #e9eff9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5fb;
  --text: #0b1220;
  --text-2: #445268;
  --text-3: #7b8aa3;
  --muted: #94a3b8;
  --border: #e2e8f2;
  --border-strong: #cbd5e6;

  --primary: var(--blue-600);
  --primary-2: var(--blue-500);
  --primary-soft: rgba(37, 99, 235, 0.09);
  --primary-soft-2: rgba(37, 99, 235, 0.16);
  --black: #0b1220;
  --white: #ffffff;

  --success: #0f9f6e;
  --success-soft: rgba(15, 159, 110, 0.12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -18px rgba(15, 23, 42, 0.35);
  --shadow-lg: 0 24px 64px -24px rgba(15, 23, 42, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --sidebar-w: 264px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme='dark'] {
  --bg: #060a13;
  --bg-soft: #0a1120;
  --surface: #0e1728;
  --surface-2: #111d33;
  --surface-3: #152239;
  --text: #e8eefb;
  --text-2: #a9b8d0;
  --text-3: #7488a6;
  --muted: #64748b;
  --border: #1d2b45;
  --border-strong: #2a3b5c;

  --primary: var(--blue-500);
  --primary-2: #60a5fa;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --primary-soft-2: rgba(59, 130, 246, 0.26);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 18px 46px -22px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll { overflow: hidden; }

a { color: var(--primary); }

button { font-family: inherit; }

svg { display: block; }

[data-lucide] { width: 18px; height: 18px; stroke-width: 2; }

/* ============================================================
   Botones e inputs
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  white-space: nowrap;
  color: var(--text);
  background: transparent;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn i, .btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-500));
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(37, 99, 235, 0.8);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--blue-700), var(--blue-600)); }

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: transparent;
}
.btn-soft:hover:not(:disabled) { background: var(--primary-soft-2); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: rgba(220, 38, 38, 0.18); }

.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.16s ease;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn i, .icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; }

.field label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.input::placeholder, .textarea::placeholder { color: var(--muted); }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
  background: var(--surface);
}

.select { appearance: none; background-image: none; }

.textarea { resize: vertical; min-height: 84px; }

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 170px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}

/* Conectar cuenta */

.connect-card.collapsed .card-head { padding: 18px 20px; }

.connect-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.connect-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}

.connect-step.primary {
  background:
    linear-gradient(180deg, var(--primary-soft), transparent 42%),
    var(--surface);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.connect-step-head { display: flex; align-items: flex-start; gap: 11px; }

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 800;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.connect-step.primary .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.9);
}

.connect-step-head h3 { margin: 0; font-size: 13.5px; font-weight: 750; letter-spacing: -0.01em; }
.connect-step-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

.connect-fields { display: grid; gap: 12px; }

.connect-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.connect-actions .btn { width: 100%; }

.connect-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}
.connect-note i, .connect-note svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

.auth-progress {
  margin: 0;
  margin-top: auto;
  padding: 9px 11px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.hint {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ============================================================
   Estructura general
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 16px;
  z-index: 50;
  transition: transform 0.22s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 6px 20px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(140deg, var(--blue-600), var(--blue-500) 60%, #0b1220);
  box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.9);
  flex-shrink: 0;
}

.brand-mark.brand-image { padding: 0; overflow: hidden; background: #060a13; }
.brand-mark.brand-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.brand-text span { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }

.sidebar-close { display: none; margin-left: auto; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item i, .nav-item svg { width: 18px; height: 18px; color: var(--text-3); transition: color 0.15s ease; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover i, .nav-item:hover svg { color: var(--text-2); }

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav-item.active i, .nav-item.active svg { color: var(--primary); }

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(140deg, var(--blue-600), #0b1220);
  flex-shrink: 0;
}

.user-chip div { display: flex; flex-direction: column; min-width: 0; }
.user-chip strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip span { font-size: 11px; color: var(--text-3); }

.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.menu-btn { display: none; }

.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.topbar-title p { margin: 2px 0 0; font-size: 12px; color: var(--text-3); }

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

.content { padding: 26px 30px 48px; width: 100%; max-width: 1320px; margin: 0 auto; }

.view { display: none; animation: fadeUp 0.25s ease; }
.view.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-gap { margin-bottom: 22px; }

/* ============================================================
   Tarjetas
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 0;
}

.card-title { display: flex; align-items: center; gap: 10px; }
.card-title i, .card-title svg { width: 18px; height: 18px; color: var(--primary); }
.card-title h2 { margin: 0; font-size: 14.5px; font-weight: 750; letter-spacing: -0.01em; }
.card-sub { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }

.card-body { padding: 18px 20px 20px; }

.card + .card { margin-top: 18px; }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(59, 130, 246, 0.55) 0%, rgba(37, 99, 235, 0) 55%),
    linear-gradient(135deg, #0b1220 0%, #101c33 55%, #12305f 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
  margin-bottom: 22px;
}

.hero::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  right: -90px;
  bottom: -180px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.55), transparent 65%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #bcd4ff; margin-bottom: 10px; }
.hero-kicker span { width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.22); }
.hero h2 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -0.03em; }
.hero p { margin: 8px 0 0; font-size: 13.5px; color: #c3d4f1; max-width: 560px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: #0b1220; box-shadow: none; }
.hero .btn-primary:hover { background: #eaf1ff; }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #eaf1ff; }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* ============================================================
   Stats
   ============================================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat::before {
  content: '';
  position: absolute;
  inset: 0 0 auto auto;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--primary-soft);
  transform: translate(34%, -40%);
}

.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon i, .stat-icon svg { width: 17px; height: 17px; }
.stat-value { position: relative; margin-top: 12px; font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-foot { position: relative; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.stat.green .stat-icon { background: var(--success-soft); color: var(--success); }
.stat.green::before { background: var(--success-soft); }
.stat.amber .stat-icon { background: var(--warn-soft); color: var(--warn); }
.stat.amber::before { background: var(--warn-soft); }
.stat.dark .stat-icon { background: rgba(11, 18, 32, 0.08); color: var(--text); }
.stat.dark::before { background: rgba(11, 18, 32, 0.06); }
[data-theme='dark'] .stat.dark .stat-icon { background: rgba(255, 255, 255, 0.08); color: var(--text); }
[data-theme='dark'] .stat.dark::before { background: rgba(255, 255, 255, 0.05); }

/* ============================================================
   Grid de dos columnas
   ============================================================ */

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 18px;
  align-items: start;
}

/* ============================================================
   Listas y tablas
   ============================================================ */

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .cell-strong { color: var(--text); font-weight: 650; }
.table .cell-muted { color: var(--text-3); font-size: 11.5px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 38px 20px;
  color: var(--text-3);
  font-size: 13px;
}
.empty i, .empty svg { width: 30px; height: 30px; color: var(--border-strong); }
.empty strong { color: var(--text-2); font-size: 13.5px; }

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--surface-3); color: var(--text-3); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--surface-3);
  color: var(--text-2);
}
.chip.blue { background: var(--primary-soft); color: var(--primary); }
.chip.green { background: var(--success-soft); color: var(--success); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.red { background: var(--danger-soft); color: var(--danger); }

/* ============================================================
   Cuentas
   ============================================================ */

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.account-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.account-card.needs-auth { border-color: color-mix(in srgb, var(--warn) 42%, var(--border)); }

.account-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.account-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.account-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--primary-soft); color: var(--primary);
  text-transform: uppercase;
}
.account-name { font-size: 14px; font-weight: 750; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.account-data {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.kv-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.kv-value { font-size: 13px; font-weight: 750; color: var(--text); }
.kv-value.blue { color: var(--primary); }
.kv-value.amber { color: var(--warn); }
.kv-value.muted { color: var(--text-3); font-weight: 600; }

.account-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 11.5px;
  line-height: 1.45;
}

.account-note .input { padding: 8px 10px; font-size: 11.5px; }

.account-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.account-actions .btn { flex: 1; min-width: 92px; }

/* ============================================================
   Switch
   ============================================================ */

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.switch input:checked + .slider {
  background: var(--primary);
  border-color: var(--primary);
}
.switch input:checked + .slider::before { transform: translate(20px, -50%); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============================================================
   Progress
   ============================================================ */

.progress {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--blue-600)); }
.progress-bar.done { background: linear-gradient(90deg, #10b981, #0f9f6e); }

/* ============================================================
   Detalle / modal
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 10, 19, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.18s ease;
}
.modal-backdrop.hidden { display: none; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.modal-head p { margin: 3px 0 0; font-size: 12px; color: var(--text-3); }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 9px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.detail-item .kv-value { font-size: 16px; }

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  max-width: 360px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #0b1220;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #60a5fa; flex-shrink: 0; }
.toast.success::before { background: #34d399; }
.toast.error::before { background: #f87171; }

/* ============================================================
   Login
   ============================================================ */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: var(--bg);
}

.login-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px;
  color: #fff;
  background:
    radial-gradient(90% 90% at 10% 0%, rgba(59, 130, 246, 0.55) 0%, rgba(37, 99, 235, 0) 55%),
    radial-gradient(80% 80% at 100% 100%, rgba(96, 165, 250, 0.35) 0%, rgba(37, 99, 235, 0) 60%),
    linear-gradient(150deg, #060a13 0%, #0b1730 55%, #12305f 100%);
}

.login-aside::after {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  right: -140px;
  top: 20%;
  border: 1px solid rgba(147, 197, 253, 0.25);
  box-shadow: 0 0 0 60px rgba(147, 197, 253, 0.06), 0 0 0 120px rgba(147, 197, 253, 0.04);
  pointer-events: none;
}

.login-aside-inner { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 46px; height: 46px; font-size: 22px; }
.login-brand strong { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; display: block; }
.login-brand span { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #a9c6f8; }

.login-copy { position: relative; z-index: 1; margin: auto 0; padding: 40px 0; max-width: 440px; }
.login-copy h1 { margin: 0 0 14px; font-size: 38px; line-height: 1.08; font-weight: 800; letter-spacing: -0.04em; }
.login-copy h1 em { font-style: normal; color: #93c5fd; }
.login-copy p { margin: 0; font-size: 14px; line-height: 1.7; color: #c3d4f1; }

.login-points { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.login-point { display: flex; align-items: center; gap: 11px; font-size: 13px; color: #dbe9ff; }
.login-point .dot-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: rgba(96, 165, 250, 0.16); color: #93c5fd; flex-shrink: 0; }
.login-point .dot-ico i, .login-point .dot-ico svg { width: 15px; height: 15px; }

.login-aside-foot { position: relative; z-index: 1; font-size: 11.5px; color: #8fadde; }

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  position: relative;
}

.login-theme { position: absolute; top: 22px; right: 22px; }

.login-card { width: 100%; max-width: 390px; }
.login-card h2 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -0.03em; }
.login-card > p { margin: 8px 0 26px; font-size: 13.5px; color: var(--text-3); }

.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-form .btn { padding: 12px 16px; font-size: 14px; margin-top: 4px; }

.login-error {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
}
.login-error.show { display: block; }

.login-foot { margin-top: 26px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.login-foot i, .login-foot svg { width: 14px; height: 14px; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-104%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .connect-grid { grid-template-columns: 1fr; }
  .backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(6, 10, 19, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .backdrop.show { opacity: 1; pointer-events: auto; }
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

@media (max-width: 620px) {
  .topbar { padding: 13px 16px; }
  .content { padding: 18px 16px 40px; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .hero h2 { font-size: 21px; }
  .form-row > .field { min-width: 100%; }
  .connect-actions { grid-template-columns: 1fr; }
  .account-data { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar-title p { display: none; }
  .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
