/* ====================================================================
   Nexus Design System — derivado del handoff de Claude Design.
   Carga en base.html. Convive con clases viejas via la capa de compat
   al final del archivo (--bg, --bg2, --accent, --accent2, .card, .btn).
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── 1. CHROME (sidebar + topbar) — siempre dark, no cambia con tema ── */
:root {
  --chrome-bg:           #0A0B14;
  --chrome-bg-elevated:  #12131E;
  --chrome-bg-hover:     #1B1C28;
  --chrome-bg-active:    rgba(56, 189, 248, 0.12);

  --chrome-text-100:     rgba(255, 255, 255, 1.00);
  --chrome-text-82:      rgba(255, 255, 255, 0.82);
  --chrome-text-50:      rgba(255, 255, 255, 0.50);
  --chrome-text-28:      rgba(255, 255, 255, 0.28);

  --chrome-divider:      rgba(255, 255, 255, 0.06);
  --chrome-border:       rgba(255, 255, 255, 0.08);

  /* Tipografía */
  --font-ui:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --font-hero:  'Instrument Serif', Georgia, serif;

  /* Escala tipográfica */
  --t-xs:  12px;  --t-sm:  13px;  --t-md:  14px;  --t-lg:  16px;
  --t-xl:  18px;  --t-2xl: 22px;  --t-3xl: 28px;  --t-4xl: 36px;

  /* Spacing 4-base */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px;  --s-8: 32px;  --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Radius (escalan con --radius-scale para tweak global) */
  --radius-scale: 1;
  --r-sm:   calc(6px  * var(--radius-scale));
  --r-md:   calc(10px * var(--radius-scale));
  --r-lg:   calc(16px * var(--radius-scale));
  --r-full: 9999px;

  /* Densidad default */
  --row-h:        44px;
  --input-pad-y:  10px;
  --input-pad-x:  14px;
  --body-size:    var(--t-md);

  --focus-ring-width: 3px;

  /* Layout */
  --topbar-h:  56px;
  --sidebar-w: 240px;
}

.density-compact     { --row-h: 36px; --input-pad-y: 6px;  --input-pad-x: 10px; --body-size: var(--t-sm); }
.density-default     { --row-h: 44px; --input-pad-y: 10px; --input-pad-x: 14px; --body-size: var(--t-md); }
.density-comfortable { --row-h: 52px; --input-pad-y: 12px; --input-pad-x: 16px; --body-size: var(--t-lg); }

/* ── 2. TEMA DARK (content) ─────────────────────────────────────────── */
:root,
.theme-dark {
  --surface-0: #12121A;
  --surface-1: #1B1B26;
  --surface-2: #252533;
  --surface-3: #2F2F40;

  --text-100: rgba(255, 255, 255, 1.00);
  --text-82:  rgba(255, 255, 255, 0.82);
  --text-50:  rgba(255, 255, 255, 0.50);
  --text-28:  rgba(255, 255, 255, 0.28);

  --accent-500:       #38BDF8;
  --accent-700:       #0284C7;
  --accent-tint-8:    rgba(56, 189, 248, 0.08);
  --accent-tint-16:   rgba(56, 189, 248, 0.16);
  --accent-glow:      rgba(56, 189, 248, 0.25);
  --accent-on:        #06121C;

  --success-500:      #05A46E;
  --success-700:      #047A53;
  --success-tint-12:  rgba(5, 164, 110, 0.14);
  --success-on:       #06140E;

  --warning-500:      #FBBF24;
  --warning-tint-12:  rgba(251, 191, 36, 0.14);
  --warning-on:       #1A1003;
  --error-500:        #F87171;
  --error-tint-12:    rgba(248, 113, 113, 0.14);
  --error-on:         #1A0606;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.20);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.48);

  color-scheme: dark;
}

/* ── 3. TEMA LIGHT (content, WCAG-safe) ─────────────────────────────── */
.theme-light {
  --surface-0: #EEEFF3;
  --surface-1: #F9FAFC;
  --surface-2: #F1F2F6;
  --surface-3: #E5E7EE;

  --text-100: rgba(10, 10, 15, 1.00);
  --text-82:  rgba(10, 10, 15, 0.82);
  --text-50:  rgba(10, 10, 15, 0.50);
  --text-28:  rgba(10, 10, 15, 0.28);

  --accent-500:       #0EA5E9;
  --accent-700:       #0369A1;
  --accent-tint-8:    rgba(14, 165, 233, 0.08);
  --accent-tint-16:   rgba(14, 165, 233, 0.14);
  --accent-glow:      rgba(14, 165, 233, 0.28);
  --accent-on:        #FFFFFF;

  --success-500:      #047857;
  --success-700:      #065F46;
  --success-tint-12:  rgba(4, 120, 87, 0.12);
  --success-on:       #FFFFFF;

  --warning-500:      #D97706;
  --warning-tint-12:  rgba(217, 119, 6, 0.12);
  --warning-on:       #FFFFFF;
  --error-500:        #DC2626;
  --error-tint-12:    rgba(220, 38, 38, 0.10);
  --error-on:         #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, 0.10);

  color-scheme: light;
}

/* ── 4. RESET + BASE ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.nx-shell {
  font-family: var(--font-ui);
  font-size: var(--body-size);
  line-height: 1.45;
  color: var(--text-82);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
  /* Layout app-shell: el body NO scrollea, sólo .nx-content (y dentro
     de cada pantalla, sus propios scrolls). Esto deja sidebar fijo a la
     izquierda y devbanner fijo abajo, como en cualquier app moderna.
     Pantallas largas siguen scrolleando porque .nx-content tiene
     overflow-y:auto — visualmente igual que antes para el usuario. */
  height: 100dvh;
  overflow: hidden;
}
html { height: 100dvh; }
body.nx-shell button { font-family: inherit; }
body.nx-shell input, body.nx-shell textarea, body.nx-shell select {
  font-family: inherit; font-size: inherit; color: inherit;
}
/* Fix modo oscuro: el panel desplegado de <select> usa estilos del
   browser y hereda solo color, no background. Sin esto, las opciones
   aparecen texto-claro sobre fondo-claro (invisibles) en dark mode. */
body.nx-shell select option,
body.nx-shell select optgroup {
  background-color: var(--bg);
  color: var(--text-100);
}

.tabular { font-variant-numeric: tabular-nums; }

/* Scrollbar sutil */
.nx-shell ::-webkit-scrollbar { width: 10px; height: 10px; }
.nx-shell ::-webkit-scrollbar-track { background: transparent; }
.nx-shell ::-webkit-scrollbar-thumb { background: var(--text-28); border: 2px solid transparent; background-clip: content-box; border-radius: 999px; }
.nx-shell ::-webkit-scrollbar-thumb:hover { background: var(--text-50); background-clip: content-box; border: 2px solid transparent; }

/* Focus ring estándar */
.nx-shell :focus-visible {
  outline: none;
  box-shadow: 0 0 0 var(--focus-ring-width) var(--accent-glow);
  border-radius: var(--r-sm);
}
.nx-shell ::selection { background: var(--accent-tint-16); color: var(--text-100); }

a { color: var(--accent-500); text-decoration: none; }
a:hover { color: var(--accent-700); }

/* ── 5. APP LAYOUT (sidebar + main) ─────────────────────────────────── */
.nx-app {
  display: flex;
  width: 100%;
  /* Toma el alto del viewport descontando el .nx-devbanner fixed (56px
     desktop / 38px mobile). Sidebar y main viven adentro. */
  height: 100dvh;
  padding-bottom: 56px;
  box-sizing: border-box;
}
.nx-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; min-height: 0;
  overflow: hidden;
  background: var(--surface-0);
}
.nx-content {
  flex: 1;
  padding: var(--s-6) var(--s-8);
  min-width: 0; min-height: 0;
  /* Único scroll del área de contenido. Cada pantalla puede tener su
     propio scroll interno; si no, este overflow:auto cumple el rol. */
  overflow-y: auto;
}
/* Compat: algunos templates usan <main class="content"> en lugar de
   <main class="nx-content">. Mismo comportamiento. */
main.content {
  flex: 1;
  min-width: 0; min-height: 0;
  overflow-y: auto;
}

/* ── 6. SIDEBAR ─────────────────────────────────────────────────────── */
.nx-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--chrome-bg);
  color: var(--chrome-text-82);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--chrome-divider);
  height: 100%;
  overflow-y: auto;
  z-index: 50;
}
.nx-sb-brand {
  padding: 18px 16px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nx-sb-brand-mark {
  width: 28px; height: 32px;
  /* Monograma PepperLabs flotando sobre el chrome navy (fondo transparente).
     Aspect ratio vertical (~237×288), object-fit lo escala sin deformar. */
  display: grid; place-items: center;
  flex-shrink: 0;
}
.nx-sb-brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.nx-sb-brand-name {
  font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--chrome-text-100);
}
.nx-sb-brand-sub {
  font-size: 11px;
  color: var(--chrome-text-50);
  margin-top: -1px;
}

.nx-sb-bizswitch {
  margin: 0 12px 12px;
  padding: 8px 10px;
  background: var(--chrome-bg-elevated);
  border: 1px solid var(--chrome-border);
  border-radius: var(--r-sm);
  color: var(--chrome-text-82);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; text-align: left;
  text-decoration: none;
}
.nx-sb-bizswitch:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-82); }
.nx-sb-biz-avatar {
  width: 22px; height: 22px; border-radius: 5px;
  background: #252533;
  display: grid; place-items: center;
  color: var(--chrome-text-100);
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.nx-sb-biz-meta { flex: 1; min-width: 0; }
.nx-sb-biz-name {
  color: var(--chrome-text-100); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nx-sb-biz-sub { color: var(--chrome-text-50); font-size: 11px; }

.nx-sb-nav {
  padding: 4px 8px; flex: 1;
  display: flex; flex-direction: column; gap: 1px;
  overflow-y: auto;
}
.nx-sb-section {
  padding: 8px 8px 6px;
  font-size: 10px; font-weight: 600;
  color: var(--chrome-text-50);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.nx-sb-section + .nx-sb-section { padding-top: 14px; }

.nx-sb-item {
  appearance: none; border: none; background: transparent;
  text-align: left; cursor: pointer; font-family: inherit;
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--chrome-text-82);
  font-size: 13px; font-weight: 400;
  text-decoration: none;
  transition: background 100ms ease, color 100ms ease;
  width: 100%;
}
.nx-sb-item:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-100); }
.nx-sb-item.active {
  background: var(--chrome-bg-active);
  color: var(--accent-500);
  font-weight: 500;
}
.nx-sb-item.active::before {
  content: ''; position: absolute;
  left: -8px; top: 8px; bottom: 8px; width: 2px;
  background: var(--accent-500); border-radius: 2px;
}
.nx-sb-item > i.bi { font-size: 16px; flex-shrink: 0; }
.nx-sb-item > .label { flex: 1; }
.nx-sb-item .nx-badge-count {
  background: var(--accent-tint-16); color: var(--accent-500);
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px;
  min-width: 18px; text-align: center;
}
.nx-sb-item .caret {
  font-size: 11px; color: var(--chrome-text-50);
  transition: transform 150ms ease;
}
.nx-sb-item.expanded .caret { transform: rotate(90deg); }

/* Submenu */
.nx-sb-submenu {
  display: none;
  background: var(--chrome-bg-elevated);
  border-left: 2px solid var(--accent-500);
  margin: 2px 8px 4px 16px;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 4px 0;
}
.nx-sb-submenu.open { display: block; }
.nx-sb-sub-section {
  font-size: 9px; font-weight: 600;
  color: var(--chrome-text-50);
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 8px 12px 4px;
}
.nx-sb-sub-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--chrome-text-82);
  text-decoration: none;
  border-radius: var(--r-sm);
  margin: 0 4px;
}
.nx-sb-sub-item:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-100); }
.nx-sb-sub-item.active { color: var(--accent-500); background: var(--chrome-bg-active); }
.nx-sb-sub-item > i.bi { font-size: 13px; flex-shrink: 0; }

.nx-sb-user {
  padding: 10px 12px;
  border-top: 1px solid var(--chrome-divider);
  display: flex; align-items: center; gap: 10px;
}
.nx-sb-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
}
.nx-sb-user-name { color: var(--chrome-text-100); font-size: 13px; font-weight: 500; }
.nx-sb-user-role { color: var(--chrome-text-50); font-size: 11px; }
.nx-sb-user-action {
  background: transparent; border: none;
  color: var(--chrome-text-50); cursor: pointer;
  padding: 6px; border-radius: 6px; display: flex;
  text-decoration: none;
}
.nx-sb-user-action:hover { color: var(--chrome-text-100); background: var(--chrome-bg-hover); }

/* ── 7. TOPBAR ──────────────────────────────────────────────────────── */
.nx-topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-divider);
  display: flex; align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.nx-tb-burger {
  display: none; /* visible solo en mobile */
  background: transparent; border: none;
  color: var(--chrome-text-82); cursor: pointer;
  padding: 6px; border-radius: var(--r-sm);
}
.nx-tb-burger:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-100); }
.nx-tb-breadcrumb {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.nx-tb-bc-grupo { color: var(--chrome-text-50); }
.nx-tb-bc-sep { color: var(--chrome-text-28); font-size: 11px; }
.nx-tb-bc-page { color: var(--chrome-text-100); font-weight: 500; }
.nx-tb-search {
  flex: 1; max-width: 520px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--chrome-bg); border-radius: var(--r-sm);
  padding: 0 10px; height: 34px;
  border: 1px solid var(--chrome-border);
}
.nx-tb-search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--chrome-text-100); font-size: 13px; font-family: inherit;
}
.nx-tb-search input::placeholder { color: var(--chrome-text-50); }
.nx-tb-search > i.bi { color: var(--chrome-text-50); font-size: 14px; }
.nx-tb-search kbd {
  font-size: 10px; color: var(--chrome-text-50);
  background: var(--chrome-bg-hover); padding: 2px 6px;
  border-radius: 4px; font-family: var(--font-mono);
  border: 1px solid var(--chrome-border);
}
.nx-tb-iconbtn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--chrome-bg); border: 1px solid var(--chrome-border);
  color: var(--chrome-text-82); cursor: pointer;
  display: grid; place-items: center;
  position: relative;
  text-decoration: none;
}
.nx-tb-iconbtn:hover { background: var(--chrome-bg-hover); color: var(--chrome-text-100); }
.nx-tb-iconbtn > i.bi { font-size: 15px; }
.nx-tb-iconbtn .nx-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--warning-500);
  box-shadow: 0 0 0 2px var(--chrome-bg);
}
.nx-tb-session {
  display: flex; flex-direction: column; align-items: flex-end;
  font-size: 11px; color: var(--chrome-text-50);
  line-height: 1.25;
  padding-left: 12px;
  border-left: 1px solid var(--chrome-divider);
  height: 36px; justify-content: center;
}
.nx-tb-session-line1 { color: var(--chrome-text-82); }

/* ── 8. BUTTONS ─────────────────────────────────────────────────────── */
.nx-btn {
  appearance: none; border: none; cursor: pointer;
  font-weight: 500; font-size: var(--t-md);
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
  font-family: inherit;
  line-height: 1;
  user-select: none;
  height: 38px; padding: 0 14px;
  text-decoration: none;
}
.nx-btn.sm { height: 32px; padding: 0 12px; font-size: var(--t-sm); }
.nx-btn.lg { height: 44px; padding: 0 18px; font-size: var(--t-md); }
.nx-btn:active:not(:disabled) { transform: translateY(0.5px); }
.nx-btn:disabled, .nx-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.nx-btn > i.bi { font-size: 15px; }

.nx-btn.primary { background: var(--accent-500); color: var(--accent-on); }
.nx-btn.primary:hover:not(:disabled) { background: var(--accent-700); color: var(--accent-on); }
.nx-btn.success { background: var(--success-500); color: var(--success-on); }
.nx-btn.success:hover:not(:disabled) { background: var(--success-700); color: var(--success-on); }
.nx-btn.secondary {
  background: var(--surface-2); color: var(--text-100);
  box-shadow: inset 0 0 0 1px var(--surface-3);
}
.nx-btn.secondary:hover:not(:disabled) {
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--text-28);
}
.nx-btn.ghost { background: transparent; color: var(--text-82); }
.nx-btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text-100); }
.nx-btn.danger { background: transparent; color: var(--error-500); }
.nx-btn.danger:hover:not(:disabled) { background: var(--error-tint-12); }
.nx-btn.danger-solid { background: var(--error-500); color: var(--error-on); }
.nx-btn.danger-solid:hover:not(:disabled) { background: #B91C1C; }
.nx-btn.icon { width: 38px; padding: 0; }
.nx-btn.icon.sm { width: 32px; }

/* ── 9. CARD ────────────────────────────────────────────────────────── */
.nx-card {
  background: var(--surface-1);
  border-radius: var(--r-md);
  padding: var(--s-5);
}
.nx-card.tight { padding: 0; }
.nx-card.surf2 { background: var(--surface-2); }
.nx-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
}
.nx-card-title {
  margin: 0; font-size: var(--t-lg); font-weight: 600; color: var(--text-100);
}
.nx-card-sub {
  font-size: var(--t-xs); color: var(--text-50); margin-top: 2px;
}

/* ── 10. KPI ────────────────────────────────────────────────────────── */
.nx-kpi {
  background: var(--surface-1);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex; align-items: flex-start; gap: var(--s-3);
  text-decoration: none; color: inherit;
  transition: background 120ms ease;
  position: relative;
}
.nx-kpi:hover { background: var(--surface-2); color: inherit; }
.nx-kpi-icon {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--accent-tint-16); color: var(--accent-500);
  display: grid; place-items: center; flex-shrink: 0;
}
.nx-kpi-icon > i.bi { font-size: 18px; }
.nx-kpi-icon.success { background: var(--success-tint-12); color: var(--success-500); }
.nx-kpi-icon.warning { background: var(--warning-tint-12); color: var(--warning-500); }
.nx-kpi-icon.error   { background: var(--error-tint-12);   color: var(--error-500); }
.nx-kpi-icon.neutral { background: var(--surface-2);       color: var(--text-82); }
.nx-kpi-body { flex: 1; min-width: 0; }
.nx-kpi-label {
  color: var(--text-50); font-size: var(--t-sm);
  margin-bottom: 4px; font-weight: 500;
}
.nx-kpi-value {
  font-size: var(--t-3xl); font-weight: 600;
  color: var(--text-100); line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.nx-kpi-sub {
  margin-top: 6px; font-size: var(--t-xs); color: var(--text-50);
}
.nx-kpi-delta {
  display: inline-flex; align-items: center; gap: 3px; font-weight: 500;
}
.nx-kpi-delta.up { color: var(--success-500); }
.nx-kpi-delta.down { color: var(--error-500); }

/* Alert card (KPI con borde-left semántico) */
.nx-kpi.alert-warn   { border-left: 3px solid var(--warning-500); }
.nx-kpi.alert-danger { border-left: 3px solid var(--error-500); }
.nx-kpi.alert-info   { border-left: 3px solid var(--accent-500); }
.nx-kpi.alert-success{ border-left: 3px solid var(--success-500); }

/* ── 11. BADGE ──────────────────────────────────────────────────────── */
.nx-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: var(--t-xs); font-weight: 500; line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-2); color: var(--text-82);
}
.nx-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-50); flex-shrink: 0;
}
.nx-badge.success { background: var(--success-tint-12); color: var(--success-500); }
.nx-badge.success .dot { background: var(--success-500); }
.nx-badge.warning { background: var(--warning-tint-12); color: var(--warning-500); }
.nx-badge.warning .dot { background: var(--warning-500); }
.nx-badge.error   { background: var(--error-tint-12);   color: var(--error-500); }
.nx-badge.error .dot   { background: var(--error-500); }
.nx-badge.info    { background: var(--accent-tint-16);  color: var(--accent-500); }
.nx-badge.info .dot    { background: var(--accent-500); }

/* ── 12. INPUTS ─────────────────────────────────────────────────────── */
.nx-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.nx-field-label {
  font-size: var(--t-sm); color: var(--text-82);
  display: flex; align-items: center; gap: 6px;
}
.nx-field-required { color: var(--accent-500); font-size: 18px; line-height: 0; margin-top: 4px; }
.nx-field-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px transparent;
  padding: var(--input-pad-y) var(--input-pad-x);
  color: var(--text-100);
  transition: box-shadow 120ms ease, background 120ms ease;
  min-height: var(--row-h);
}
.nx-field-wrap:focus-within {
  box-shadow: inset 0 0 0 1px var(--accent-500), 0 0 0 3px var(--accent-glow);
}
.nx-field-wrap.error {
  box-shadow: inset 0 0 0 1px var(--error-500);
}
.nx-field-wrap > i.bi { color: var(--text-50); font-size: 15px; }
.nx-field-wrap input,
.nx-field-wrap select,
.nx-field-wrap textarea {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-100); font-size: inherit;
}
.nx-field-hint {
  font-size: var(--t-xs); color: var(--text-50);
}
.nx-field-hint.error { color: var(--error-500); }

/* ── 13. TABLE ──────────────────────────────────────────────────────── */
.nx-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--t-sm);
}
.nx-table thead th {
  text-align: left;
  padding: 10px 20px;
  font-size: var(--t-xs); color: var(--text-50);
  font-weight: 500;
  background: var(--surface-1);
  border-bottom: 1px solid var(--surface-2);
  text-transform: none; letter-spacing: 0.01em;
}
.nx-table tbody tr {
  cursor: pointer;
  transition: background 100ms ease;
}
.nx-table tbody tr:hover { background: var(--surface-2); }
.nx-table tbody td {
  padding: 0 20px;
  height: var(--row-h);
  border-top: 1px solid var(--surface-2);
  color: var(--text-82);
  vertical-align: middle;
}
.nx-table tbody tr:first-child td { border-top: none; }
.nx-table .num,
.nx-table .num td { text-align: right; font-variant-numeric: tabular-nums; }
.nx-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.nx-table td.mono { font-family: var(--font-mono); font-size: 12px; }
.nx-table td.bold { color: var(--text-100); font-weight: 600; }
.nx-table tr.anulado td { opacity: 0.5; }
.nx-table tr.anulado td.bold { text-decoration: line-through; }

/* ── 14. ALERT inline ───────────────────────────────────────────────── */
.nx-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  background: var(--surface-2);
  color: var(--text-82);
  border-left: 3px solid var(--text-50);
  margin-bottom: 12px;
}
.nx-alert > i.bi { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.nx-alert.info    { background: var(--accent-tint-8); border-left-color: var(--accent-500); }
.nx-alert.info > i.bi { color: var(--accent-500); }
.nx-alert.success { background: var(--success-tint-12); border-left-color: var(--success-500); }
.nx-alert.success > i.bi { color: var(--success-500); }
.nx-alert.warning, .nx-alert.warn { background: var(--warning-tint-12); border-left-color: var(--warning-500); }
.nx-alert.warning > i.bi, .nx-alert.warn > i.bi { color: var(--warning-500); }
.nx-alert.error, .nx-alert.danger { background: var(--error-tint-12); border-left-color: var(--error-500); }
.nx-alert.error > i.bi, .nx-alert.danger > i.bi { color: var(--error-500); }

/* ── 15. TOAST ──────────────────────────────────────────────────────── */
.nx-toast-stack {
  position: fixed;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 1000;
  pointer-events: none;
}
.nx-toast {
  background: var(--surface-3);
  color: var(--text-100);
  border-left: 3px solid var(--success-500);
  border-radius: var(--r-sm);
  padding: 12px 14px 12px 14px;
  padding-right: 36px;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 10px;
  min-width: 280px; max-width: 380px;
  position: relative;
  pointer-events: auto;
  animation: nx-toast-in 220ms cubic-bezier(.2,.7,.3,1);
}
.nx-toast.info    { border-left-color: var(--accent-500); }
.nx-toast.warning { border-left-color: var(--warning-500); }
.nx-toast.error   { border-left-color: var(--error-500); }
.nx-toast > i.bi  { color: var(--success-500); font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.nx-toast.info > i.bi    { color: var(--accent-500); }
.nx-toast.warning > i.bi { color: var(--warning-500); }
.nx-toast.error > i.bi   { color: var(--error-500); }
.nx-toast .body { flex: 1; min-width: 0; }
.nx-toast .title { font-weight: 600; font-size: var(--t-md); color: var(--text-100); }
.nx-toast .msg { font-size: var(--t-sm); color: var(--text-82); margin-top: 2px; }
.nx-toast .close {
  position: absolute; top: 8px; right: 8px;
  background: transparent; border: none; color: var(--text-50);
  cursor: pointer; padding: 4px; border-radius: 4px;
  display: flex;
}
.nx-toast .close:hover { background: var(--surface-2); color: var(--text-100); }

@keyframes nx-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes nx-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes nx-shimmer  { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

.nx-skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 800px 100%;
  animation: nx-shimmer 1.4s linear infinite;
  border-radius: 4px;
}

/* ── 16. MODAL ──────────────────────────────────────────────────────── */
.nx-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: grid; place-items: center; z-index: 200;
  backdrop-filter: blur(2px);
  animation: nx-fade-in 150ms ease;
}
.nx-modal {
  background: var(--surface-3); border-radius: var(--r-md);
  width: 480px; max-width: calc(100% - 48px);
  max-height: calc(100% - 48px);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: nx-modal-in 200ms cubic-bezier(.2,.7,.3,1);
  overflow: hidden;
}
.nx-modal-head { padding: 20px 24px 16px; }
.nx-modal-title { margin: 0; font-size: var(--t-xl); font-weight: 600; color: var(--text-100); }
.nx-modal-sub { margin: 4px 0 0; color: var(--text-50); font-size: var(--t-sm); }
.nx-modal-body { padding: 0 24px 16px; overflow-y: auto; flex: 1; }
.nx-modal-foot {
  padding: 16px 24px;
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--surface-2);
}

/* ── 17. HERO / SECTION title ───────────────────────────────────────── */
.nx-hero {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--s-6); margin-bottom: var(--s-5);
}
.nx-hero h1 {
  margin: 4px 0 0;
  font-size: var(--t-3xl); font-weight: 600;
  color: var(--text-100);
  letter-spacing: -0.015em;
}
.nx-hero h1 .accent { color: var(--accent-500); }
.nx-hero-date { font-size: var(--t-sm); color: var(--text-50); text-transform: capitalize; }
.nx-hero-meta { color: var(--text-50); font-size: var(--t-sm); margin-top: 6px; }
.nx-hero-actions { display: flex; gap: var(--s-2); }

.nx-section-title {
  font-size: var(--t-xs); font-weight: 600;
  color: var(--text-50);
  letter-spacing: 0.05em; text-transform: uppercase;
  margin: var(--s-6) 0 var(--s-3);
}

/* ── 18. GRIDS ──────────────────────────────────────────────────────── */
.nx-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
.nx-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.nx-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.nx-grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-4); }
.nx-grid-main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--s-4);
  align-items: flex-start;
}
.nx-stack { display: flex; flex-direction: column; gap: var(--s-4); }

/* ── 18.5. NOTIFY: toast + modal (nxToast, nxConfirm, nxAlert) ───── */
.nx-toasts {
  position: fixed; right: 20px; bottom: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9100;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}
.nx-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-1);
  color: var(--text-100);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), inset 0 0 0 1px var(--surface-2);
  pointer-events: auto;
  opacity: 0; transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.nx-toast.is-in { opacity: 1; transform: translateY(0); }
.nx-toast.is-out { opacity: 0; transform: translateY(8px); }
.nx-toast-icon { font-size: 18px; flex-shrink: 0; padding-top: 1px; }
.nx-toast.is-success .nx-toast-icon { color: var(--success-500); }
.nx-toast.is-error   .nx-toast-icon { color: var(--error-500); }
.nx-toast.is-warning .nx-toast-icon { color: var(--warning-500); }
.nx-toast.is-info    .nx-toast-icon { color: var(--accent-500); }
.nx-toast-body { flex: 1; min-width: 0; }
.nx-toast-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.nx-toast-msg { font-size: 12px; color: var(--text-50); margin-top: 2px; line-height: 1.4; }
.nx-toast-close {
  appearance: none; border: none; background: transparent;
  color: var(--text-50); cursor: pointer; font-size: 16px;
  padding: 0; margin: -2px -4px 0 0; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: var(--r-sm);
  display: grid; place-items: center;
}
.nx-toast-close:hover { background: var(--surface-2); color: var(--text-100); }

/* Modal (confirm/alert) */
.nx-modal-back {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .16s ease;
}
.nx-modal-back.is-in { opacity: 1; }
.nx-modal-back.is-out { opacity: 0; }
.nx-modal-box {
  background: var(--surface-1);
  color: var(--text-100);
  border-radius: var(--r-md);
  max-width: 440px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  transform: scale(0.96);
  transition: transform .16s ease;
}
.nx-modal-back.is-in .nx-modal-box { transform: scale(1); }
.nx-modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 12px;
}
.nx-modal-head.is-warning .nx-modal-ico { color: var(--warning-500); }
.nx-modal-head.is-error   .nx-modal-ico { color: var(--error-500); }
.nx-modal-head.is-success .nx-modal-ico { color: var(--success-500); }
.nx-modal-head.is-info    .nx-modal-ico { color: var(--accent-500); }
.nx-modal-ico { font-size: 22px; }
.nx-modal-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.nx-modal-body {
  padding: 0 20px 16px;
  color: var(--text-82); font-size: 13px; line-height: 1.5;
}
.nx-modal-actions {
  padding: 12px 16px 16px;
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--surface-0);
  border-top: 1px solid var(--surface-2);
}

/* ── 19. EMPTY STATE ────────────────────────────────────────────────── */
.nx-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 20px; text-align: center; gap: 8px;
}
.nx-empty-icon {
  width: 48px; height: 48px; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--text-50);
  display: grid; place-items: center; margin-bottom: 4px;
}
.nx-empty-icon > i.bi { font-size: 22px; }
.nx-empty-title { font-weight: 600; color: var(--text-100); }
.nx-empty-msg { color: var(--text-50); font-size: var(--t-sm); max-width: 300px; }

/* ── 20. SCREENSAVER ────────────────────────────────────────────────── */
.screensaver {
  position: fixed; inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  align-items: center; justify-content: center;
  cursor: none;
  user-select: none; -webkit-user-select: none;
}
.screensaver.activo { display: flex; }
.screensaver .ss-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .8s ease;
}
.screensaver .ss-img.visible { opacity: 1; }
.screensaver .ss-logo {
  max-width: 40vw; max-height: 40vh;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .85;
}
.screensaver .ss-reloj {
  position: absolute; top: 24px; right: 32px;
  color: rgba(255,255,255,.65);
  font-size: 16px; font-weight: 500;
  letter-spacing: .04em; font-variant-numeric: tabular-nums;
}
.screensaver .ss-hint {
  position: absolute; bottom: 24px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,.35);
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
}

/* ── 21. LOCALE PICKER (en topbar) ──────────────────────────────────── */
.nx-locale-wrap { position: relative; }
.nx-locale-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 260px;
  background: var(--surface-3); color: var(--text-100);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px 0;
  z-index: 200;
  display: none;
  max-height: 80vh; overflow-y: auto;
}
.nx-locale-menu.open { display: block; }
.nx-locale-group {
  font-size: 10px; font-weight: 600;
  color: var(--text-50);
  letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 16px 6px;
}
.nx-locale-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; color: var(--text-82);
  text-decoration: none; font-size: 13px;
  transition: background .15s;
}
.nx-locale-item:hover { background: var(--surface-2); color: var(--text-100); }
.nx-locale-item.active { background: var(--accent-tint-8); color: var(--accent-500); }
.nx-locale-item .bandera { font-size: 22px; line-height: 1; flex-shrink: 0; }
.nx-locale-item .region { font-weight: 500; font-size: 13px; }
.nx-locale-item .idioma { font-size: 11px; color: var(--text-50); margin-top: 1px; }
.nx-locale-item .check { margin-left: auto; color: var(--accent-500); font-size: 14px; visibility: hidden; }
.nx-locale-item.active .check { visibility: visible; }

/* ── 22. FOOTER dev banner ──────────────────────────────────────────── */
.nx-devbanner {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 56px; padding: 0 20px;
  background: var(--chrome-bg);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  z-index: 90;
  border-top: 1px solid var(--chrome-divider);
}
.nx-devbanner .dev-txt {
  color: var(--chrome-text-82);
  font-size: 10px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.nx-devbanner .dev-link {
  display: inline-flex; align-items: center;
  text-decoration: none;
  transition: transform .15s, filter .15s;
  line-height: 1;
}
.nx-devbanner .dev-logo {
  height: 26px; width: auto; display: block;
  object-fit: contain;
}
.nx-devbanner a:hover { transform: scale(1.04); filter: brightness(1.10); }

/* ── 23. RESPONSIVE: drawer mobile ──────────────────────────────────── */
@media (max-width: 900px) {
  .nx-sidebar {
    position: fixed; top: 0; left: -260px; bottom: 0; height: 100vh;
    transition: left 220ms ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .nx-sidebar.open { left: 0; }
  .nx-tb-burger { display: flex; }
  /* Topbar mobile: solo burger + breadcrumb + theme (resto vive en el menú lateral). */
  .nx-topbar { padding: 0 12px; gap: 8px; overflow: hidden; }
  .nx-tb-search { display: none; }
  .nx-tb-session { display: none; }
  /* Mantenemos sólo el toggle de tema en mobile. El resto (docs, núcleo, idioma, etc.) está en el menú. */
  .nx-topbar > .nx-tb-iconbtn:not(#nx-theme-toggle) { display: none; }
  .nx-tb-bc-grupo, .nx-tb-bc-sep { display: none; }
  .nx-tb-bc-page { font-size: 14px; }
  .nx-content { padding: var(--s-5); overflow-x: hidden; min-width: 0; max-width: 100vw; }
  .nx-grid-main { grid-template-columns: 1fr; }
  .nx-grid-4, .nx-grid-3, .nx-grid-2 { grid-template-columns: 1fr; }
  .nx-grid-kpi { grid-template-columns: 1fr 1fr; }
  .nx-devbanner { height: 38px; }
  .nx-devbanner .dev-logo { height: 18px; }
  .nx-devbanner .dev-txt { font-size: 9px; }
  /* En mobile el devbanner mide 38px → ajustamos el padding-bottom del shell. */
  .nx-app { padding-bottom: 38px; }
  /* Tablas anchas (>9 col) → scroll dentro del card, no de la página. */
  .nx-card { min-width: 0; max-width: 100%; }
  .nx-card.tight > div[style*="overflow-x: auto"],
  .nx-card > div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  /* Hero header: en mobile que se apile vertical en vez de empujar ancho. */
  .nx-hero {
    flex-direction: column; align-items: flex-start; gap: var(--s-3);
    margin-bottom: var(--s-4);
  }
  .nx-hero-actions { flex-wrap: wrap; }
  /* Grids en inline-style de los dashboards (/inicio): forzar 1 columna en
     mobile chico — los templates definen `grid-template-columns: repeat(4,1fr)`
     etc. via style="" que tiene specificity alta. Necesita !important. */
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1.4fr"],
  div[style*="grid-template-columns: 1.4fr 1fr"],
  div[style*="grid-template-columns: 1.4fr 1"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 600px) {
  /* Refuerzo: por si algún dashboard tiene queries propias que ganan al 768. */
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns: 2fr"] {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 480px) {
  .nx-grid-kpi { grid-template-columns: 1fr; }
}

/* Backdrop para drawer mobile */
.nx-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 49;
  display: none;
  opacity: 0; transition: opacity 220ms ease;
}
.nx-drawer-backdrop.open { display: block; opacity: 1; }

/* ============================================================ *
 * CAPA DE COMPAT — clases viejas mapeadas a tokens nuevos.
 * Permite que los 30+ módulos sigan funcionando sin re-escribir.
 * Cuando portemos un módulo, las eliminamos progresivamente.
 * ============================================================ */

/* Variables del sistema viejo, mapeadas */
:root {
  --dark:    var(--chrome-bg);
  --accent:  var(--accent-500);
  --accent2: var(--accent-700);
  --bg:      var(--surface-0);
  --bg2:     var(--surface-1);
  --border:  var(--surface-2);
  --text:    var(--text-100);
  --text2:   var(--text-50);
  --radius:  var(--r-md);
}

/* Fix dropdown nativo de <select>: las <option> heredan colores del SO/browser
   y a veces ignoran `color-scheme`, dejando texto blanco sobre fondo blanco.
   Forzamos colores explícitos por tema. */
.theme-dark select option,
.theme-dark optgroup {
    background-color: #1B1B26;
    color: #FFFFFF;
}
.theme-light select option,
.theme-light optgroup {
    background-color: #FFFFFF;
    color: #1A1A1A;
}

/* Compat .card → .nx-card (background + radius + padding por defecto) */
.card {
  background: var(--surface-1);
  border-radius: var(--r-md);
  border: none;
  padding: 16px 18px;
}
.stat-card {
  background: var(--surface-1);
  border-radius: var(--r-sm);
  padding: 16px;
  border: none;
}
.stat-label { font-size: var(--t-xs); color: var(--text-50); margin-bottom: 6px; }
.stat-val   { font-size: var(--t-3xl); font-weight: 600; color: var(--text-100); }
.stat-sub   { font-size: var(--t-xs); color: var(--text-50); margin-top: 4px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text-100);
  text-decoration: none;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.btn:hover { background: var(--surface-3); }
.btn-primary { background: var(--accent-500); color: var(--accent-on); border-color: var(--accent-500); }
.btn-primary:hover { background: var(--accent-700); border-color: var(--accent-700); color: var(--accent-on); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 500;
  color: var(--text-50);
  border-bottom: 1px solid var(--surface-2);
  text-transform: uppercase; letter-spacing: .04em;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--surface-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

.form-group { margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 500; color: var(--text-82); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--surface-2);
  background: var(--surface-2);
  font-size: 13px; color: var(--text-100); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.alert {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: 16px;
  border-left: 3px solid var(--text-50);
  background: var(--surface-2);
  color: var(--text-82);
}
.alert-error, .alert-danger {
  background: var(--error-tint-12); color: var(--error-500); border-left-color: var(--error-500);
}
.alert-success {
  background: var(--success-tint-12); color: var(--success-500); border-left-color: var(--success-500);
}
.alert-warning, .alert-warn {
  background: var(--warning-tint-12); color: var(--warning-500); border-left-color: var(--warning-500);
}
.alert-info {
  background: var(--accent-tint-8); color: var(--accent-500); border-left-color: var(--accent-500);
}
