/* ==========================================================================
   Global Lists — sistema visual
   Tokens (color, tipografia, espacio), layout y componentes.
   Tema claro y oscuro: [data-theme="light"|"dark"] en <html>.
   ========================================================================== */

:root {
  /* Marca (tomada del logo) */
  --brand: #22c55e;
  --brand-strong: #16a34a;
  --brand-soft: rgba(34, 197, 94, .12);

  /* Riesgo */
  --risk-high: #e5484d;
  --risk-high-soft: rgba(229, 72, 77, .12);
  --risk-mid: #f59e0b;
  --risk-mid-soft: rgba(245, 158, 11, .14);
  --risk-low: #3b82f6;
  --risk-low-soft: rgba(59, 130, 246, .12);

  /* Tema claro (por defecto) */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --sidebar-bg: #0b1220;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-item-active: rgba(34, 197, 94, .14);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, .18);
  --focus: 0 0 0 3px rgba(34, 197, 94, .35);

  /* Tipografia */
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  /* Espacio y forma */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

[data-theme="dark"] {
  --brand-soft: rgba(34, 197, 94, .16);
  --risk-high-soft: rgba(229, 72, 77, .18);
  --risk-mid-soft: rgba(245, 158, 11, .18);
  --risk-low-soft: rgba(59, 130, 246, .18);
  --bg: #0a0f1a;
  --surface: #111827;
  --surface-2: #0f1623;
  --surface-hover: #1a2333;
  --border: #1f2a3b;
  --border-strong: #2c3a50;
  --text: #e8edf5;
  --text-2: #a8b3c4;
  --text-3: #7d8aa0;
  --sidebar-bg: #070b14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, .55);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
@media (min-width: 961px) { .app { background: linear-gradient(to right, var(--sidebar-bg) var(--sidebar-w), transparent 0); } }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 20px 14px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand-name { color: #fff; font-weight: 800; font-size: 16px; letter-spacing: .02em; line-height: 1.1; }
.brand-name small { display: block; color: var(--sidebar-text); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #5b6b84; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  color: var(--sidebar-text); text-decoration: none; font-weight: 600;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a i { width: 18px; text-align: center; font-size: 15px; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav a[aria-current="page"] { background: var(--sidebar-item-active); color: var(--sidebar-text-active); }
.nav a[aria-current="page"] i { color: var(--brand); }
.sidebar-foot { margin-top: auto; padding: 12px; font-size: 11px; color: #5b6b84; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 18px; font-weight: 700; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn.menu-toggle { display: none; }
.content { padding: 28px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--text-2); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Controles ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .05s;
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #052e14; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn { width: 38px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.input, .select {
  height: 40px; width: 100%; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }

.range { width: 100%; accent-color: var(--brand); height: 40px; }
.range-value { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.segmented button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 7px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Idioma */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.lang-switch button { border: 0; background: transparent; height: 34px; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--text); }

/* Menu de usuario */
.user-menu { position: relative; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-weight: 800; font-size: 13px; border: 1px solid var(--border); overflow: hidden; }
[data-theme="dark"] .avatar { color: var(--brand); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: 999px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head strong { display: block; }
.dropdown-head span { color: var(--text-3); font-size: 12px; word-break: break-all; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-weight: 600; }
.dropdown a:hover { background: var(--surface-hover); }
.dropdown a i { width: 16px; color: var(--text-3); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; }
.card-head p { color: var(--text-3); font-size: 12px; }
.card-head .actions { margin-left: auto; }
.card-body { padding: 18px 20px 20px; }

.grid { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* KPI */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 13px; }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); font-size: 13px; }
[data-theme="dark"] .kpi-icon { color: var(--brand); }
.kpi-icon.high { background: var(--risk-high-soft); color: var(--risk-high); }
.kpi-icon.mid { background: var(--risk-mid-soft); color: var(--risk-mid); }
.kpi-icon.low { background: var(--risk-low-soft); color: var(--risk-low); }
.kpi-value { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); min-height: 18px; }
.delta { font-weight: 700; font-size: 12px; padding: 1px 6px; border-radius: 999px; }
.delta.up { color: var(--brand-strong); background: var(--brand-soft); }
.delta.down { color: var(--risk-high); background: var(--risk-high-soft); }
.delta.flat { color: var(--text-3); background: var(--surface-2); }
.meter { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .6s var(--ease); }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 240px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: 13px; padding: 20px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  position: sticky; top: 0;
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); background: var(--surface-2);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text); }
.table th .sort { margin-left: 6px; opacity: .45; font-size: 10px; }
.table th[aria-sort] .sort { opacity: 1; color: var(--brand-strong); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .t-right { text-align: right; }
.cell-main { font-weight: 700; }
.cell-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.table-toolbar .input-icon { flex: 1 1 220px; max-width: 320px; }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }
.pager { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* Chips y etiquetas */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.high { color: var(--risk-high); background: var(--risk-high-soft); }
.chip.mid { color: #b45309; background: var(--risk-mid-soft); }
[data-theme="dark"] .chip.mid { color: var(--risk-mid); }
.chip.low { color: var(--risk-low); background: var(--risk-low-soft); }
.chip.clear { color: var(--brand-strong); background: var(--brand-soft); }
[data-theme="dark"] .chip.clear { color: var(--brand); }
.chip.neutral { color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); }
.chip.neutral::before { display: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 12px; font-weight: 600; text-transform: uppercase; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }

.sim { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.sim-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.sim-bar > span { display: block; height: 100%; border-radius: inherit; }
.sim-val { font-family: var(--font-mono); font-weight: 600; font-size: 13px; width: 44px; text-align: right; }

/* ---------- Estados ---------- */
.state { padding: 56px 24px; text-align: center; color: var(--text-2); }
.state-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.state-icon.ok { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
.state-icon.err { background: var(--risk-high-soft); color: var(--risk-high); border-color: transparent; }
.state h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.state p { max-width: 460px; margin: 0 auto; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.2s infinite; }
[data-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Busqueda ---------- */
.search-hero { padding: 22px; }
.search-row { display: flex; gap: 12px; }
.search-row .input-icon { flex: 1; }
.search-row .input { height: 52px; font-size: 16px; border-radius: var(--radius-lg); }
.search-row .input-icon > i { left: 18px; font-size: 16px; }
.search-row .input-icon > .input { padding-left: 48px; }
.filters { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--border); }
.hint { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.hint kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }
.results-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.results-head h2 { font-size: 16px; }
.results-head .summary { display: flex; flex-wrap: wrap; gap: 6px; }
.results-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Panel lateral (detalle) ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s var(--ease); z-index: 90; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer.open + .drawer-backdrop, .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; gap: 12px; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 18px; line-height: 1.3; }
.drawer-head .btn { margin-left: auto; flex: none; }
.drawer-body { padding: 20px 22px; overflow-y: auto; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 12px 16px; }
.dl dt { color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.score-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.score-box > div { padding: 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.score-box strong { display: block; font-size: 24px; font-family: var(--font-mono); }
.score-box span { font-size: 12px; color: var(--text-3); font-weight: 600; }

/* ---------- Avisos (toasts) ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { display: flex; gap: 12px; align-items: flex-start; min-width: 280px; max-width: 400px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--text-3); box-shadow: var(--shadow-lg); animation: toast-in .25s var(--ease); }
.toast.success { border-left-color: var(--brand); }
.toast.error { border-left-color: var(--risk-high); }
.toast.warning { border-left-color: var(--risk-mid); }
.toast.info { border-left-color: var(--risk-low); }
.toast i { margin-top: 2px; }
.toast.success i { color: var(--brand); } .toast.error i { color: var(--risk-high); } .toast.warning i { color: var(--risk-mid); } .toast.info i { color: var(--risk-low); }
.toast button { margin-left: auto; border: 0; background: none; color: var(--text-3); cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Cuenta ---------- */
.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 20px; }
.profile-card .avatar { width: 96px; height: 96px; font-size: 32px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.login-art {
  position: relative; overflow: hidden; color: #e2e8f0;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(34, 197, 94, .22), transparent 60%),
              radial-gradient(900px 500px at 90% 90%, rgba(59, 130, 246, .18), transparent 60%),
              #070b14;
  padding: 48px; display: flex; flex-direction: column;
}
.login-art::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); pointer-events: none; }
.login-art .brand-name { font-size: 18px; }
.login-pitch { margin-top: auto; max-width: 520px; position: relative; z-index: 1; }
.login-pitch h1 { font-size: 40px; line-height: 1.12; color: #fff; letter-spacing: -.025em; }
.login-pitch h1 em { font-style: normal; color: var(--brand); }
.login-pitch p { margin-top: 16px; font-size: 16px; color: #94a3b8; }
.login-points { display: grid; gap: 12px; margin-top: 28px; padding: 0; list-style: none; }
.login-points li { display: flex; gap: 12px; align-items: center; color: #cbd5e1; font-weight: 600; }
.login-points i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(34, 197, 94, .14); color: var(--brand); }
.login-mark { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); width: 420px; opacity: .08; pointer-events: none; }
.login-panel { display: flex; flex-direction: column; padding: 32px 48px; }
.login-panel .top { display: flex; justify-content: flex-end; gap: 8px; }
.login-box { margin: auto; width: 100%; max-width: 380px; }
.login-box img { width: 64px; height: 64px; margin-bottom: 20px; }
.login-box h2 { font-size: 26px; }
.login-box p { color: var(--text-2); margin: 8px 0 28px; }
.login-box .btn { width: 100%; }
.login-note { display: flex; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.login-note i { color: var(--brand); margin-top: 3px; }
.login-foot { text-align: center; color: var(--text-3); font-size: 12px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .25s var(--ease); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .btn.menu-toggle { display: inline-flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field:last-child { grid-column: 1 / -1; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 16px; }
  .grid-kpi { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi-value { font-size: 24px; }
  .search-row { flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 4px 0; }
  .dl dd { margin-bottom: 10px; }
  .user-name { display: none; }
  .login-panel { padding: 24px 16px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 960px) { #accountGrid { grid-template-columns: 1fr !important; } }
.drawer:not(.open) { visibility: hidden; box-shadow: none; transition: transform .25s var(--ease), visibility 0s .25s; }
.table td.mono, .table td.num { white-space: nowrap; }
.field > .lang-switch, .field > .segmented { align-self: flex-start; }
