/* ============================================================
   1ContaBot — Sistema de diseño (Fase 1: capa visual)
   Tema claro · Sidebar oscuro · Acentos dorados
   Tipografía: Inter (Google Fonts)
   ------------------------------------------------------------
   Este archivo es la ÚNICA fuente de verdad de estilos.
   Los tokens viven en :root; los nombres de variables legados
   (--panel, --accent, etc.) se conservan como alias para no
   romper las páginas existentes mientras se migran por fases.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* --- Azules de marca --- */
  --navy-900:  #0F2A52;   /* base sidebar / azul profundo */
  --navy-800:  #1B3A6B;   /* sidebar superior (degradado) */
  --blue-600:  #2563EB;   /* botón primario / ítem activo */
  --blue-500:  #3B82F6;   /* hover / acentos */

  /* --- Dorado / ámbar --- */
  --gold:      #E2A828;
  --gold-from: #F4C430;
  --gold-to:   #C8901A;

  /* --- Superficies --- */
  --bg:        #F3F6FB;   /* fondo de la app */
  --surface:   #FFFFFF;   /* tarjetas */
  --border:    #E5E9F0;   /* borde sutil */

  /* --- Texto --- */
  --text:      #1E293B;   /* texto principal */
  --text-dim:  #64748B;   /* texto secundario */

  /* --- Texto sobre el sidebar oscuro --- */
  --side-text:        #CBD5E1;
  --side-text-active: #FFFFFF;
  --side-muted:       #8AA0BE;

  /* --- Estados (texto / fondo) --- */
  --success:     #16A34A;  --success-bg: #DCFCE7;
  --warning:     #D97706;  --warning-bg: #FEF3C7;
  --info:        #2563EB;  --info-bg:    #DBEAFE;
  --danger:      #DC2626;  --danger-bg:  #FEE2E2;
  --orange:      #C2410C;  --orange-bg:  #FFEDD5;

  /* --- Alias legados (compatibilidad con páginas no migradas) --- */
  --panel:   var(--surface);
  --panel2:  #F1F5FB;
  --accent:  var(--blue-600);
  --accent2: var(--navy-800);

  /* --- Radios --- */
  --radius:     14px;   /* tarjetas */
  --radius-sm:  10px;
  --radius-btn:  9px;   /* botones */
  --radius-pill: 999px; /* chips / badges */

  /* --- Sombras --- */
  --shadow-sm: 0 1px 2px rgba(15,42,82,0.05), 0 1px 3px rgba(15,42,82,0.06);
  --shadow-md: 0 6px 18px rgba(15,42,82,0.08);
  --shadow-lg: 0 18px 48px rgba(15,42,82,0.18);
  --shadow:    var(--shadow-md);

  /* --- Otros --- */
  --font:       'Inter', system-ui, -apple-system, sans-serif;
  --sidebar-w:  268px;
  --transition: 0.18s ease;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   SIDEBAR (oscuro, navegación jerárquica)
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
}
.sidebar-logo img {
  max-height: 46px;
  max-width: 100%;
  width: auto;
  display: block;
}
/* Fallback textual si el PNG aún no está en el repo */
.brand-fallback {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand-fallback .b-1 {
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.brand-fallback .b-rest { color: #fff; }

/* --- Navegación --- */
.sidebar-nav {
  padding: 10px 12px 18px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 3px; }

/* Etiqueta de sección (ANALÍTICAS, AUTOMATIZACIONES, …) */
.nav-section {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--side-muted);
  padding: 16px 12px 6px;
}

/* Ítem de menú (icono + etiqueta) */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--side-text);
  font-size: 0.86rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active {
  background: var(--blue-600);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37,99,235,0.40);
}
/* Dashboard: ítem destacado con fondo sutil permanente */
.nav-home { background: rgba(255,255,255,0.05); }
.nav-home.active { background: var(--blue-600); }

.nav-ico { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; }
.nav-ico svg { width: 100%; height: 100%; }

/* Tarjeta promocional al pie del menú */
.nav-promo {
  margin: 14px 14px 4px;
  padding: 18px 16px;
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--blue-600) 0%, var(--navy-800) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.nav-promo-ico {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(255,255,255,0.16);
  display: grid; place-items: center;
  margin-bottom: 12px;
  color: #fff;
}
.nav-promo-ico svg { width: 20px; height: 20px; }
.nav-promo h4 { font-size: 0.92rem; font-weight: 700; line-height: 1.25; margin-bottom: 6px; }
.nav-promo p { font-size: 0.74rem; color: rgba(255,255,255,0.82); line-height: 1.4; margin-bottom: 14px; }
.nav-promo .btn-promo {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: var(--blue-600);
  font-size: 0.78rem; font-weight: 700;
  padding: 7px 16px; border-radius: var(--radius-btn);
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-promo .btn-promo:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }

/* --- Perfil al pie --- */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 14px;
}
.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.profile:hover { background: rgba(255,255,255,0.06); }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-500), var(--navy-800));
  flex-shrink: 0;
}
.profile-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.profile-info strong { font-size: 0.82rem; color: #fff; font-weight: 600; }
.profile-info span {
  font-size: 0.72rem; color: var(--side-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile .chev { width: 16px; height: 16px; opacity: 0.6; flex-shrink: 0; }

/* ============================================================
   MAIN / TOPBAR
   ============================================================ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.topbar-titles { flex: 1; min-width: 220px; }
.topbar-titles h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1.2;
}
.topbar-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Selector de empresa */
.empresa-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  box-shadow: var(--shadow-sm);
}
.empresa-switch .e-ico { color: var(--blue-600); display: inline-flex; }
.empresa-switch .e-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); line-height: 1; margin-bottom: 2px; display: block;
}
.empresa-switch select {
  border: none; background: none; font-family: var(--font);
  font-size: 0.86rem; font-weight: 600; color: var(--text);
  cursor: pointer; outline: none; max-width: 180px;
}

/* Iconos circulares del topbar */
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--info-bg); color: var(--blue-600); border-color: var(--blue-500); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 0.62rem; font-weight: 700;
  border-radius: 999px; display: grid; place-items: center;
  border: 2px solid var(--surface);
}
.icon-btn.avatar-btn {
  background: linear-gradient(135deg, var(--blue-500), var(--navy-800));
  color: #fff; border: none;
}

.hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  place-items: center;
}
.hamburger svg { width: 22px; height: 22px; }

.page-content { padding: 28px 32px 40px; flex: 1; }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.28);
}
.btn-primary:hover { background: #1d4fd8; box-shadow: 0 6px 18px rgba(37,99,235,0.36); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(200,144,26,0.4);
}
.btn-gold:hover { box-shadow: 0 6px 20px rgba(200,144,26,0.5); filter: brightness(1.03); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--blue-500); color: var(--blue-600); }

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22,163,74,0.25);
}
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* ============================================================
   TARJETAS GENÉRICAS / PANELES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.card-value { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.card-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2, .panel-head h3 {
  font-size: 1rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.panel-head h2 svg, .panel-head h3 svg { width: 18px; height: 18px; flex: 0 0 auto; }
.panel-head .link-more {
  font-size: 0.82rem; font-weight: 600; color: var(--blue-600);
  display: inline-flex; align-items: center; gap: 4px;
}
.panel-head .link-more svg { width: 15px; height: 15px; }

/* ============================================================
   DASHBOARD — HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 85% 10%, rgba(37,99,235,0.10), transparent 60%),
    linear-gradient(120deg, #FFFFFF 0%, #EEF3FB 55%, #E7EEFA 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 38px 40px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}
.hero-content { flex: 1; min-width: 0; max-width: 560px; }
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: var(--navy-900);
}
.hero-title .gold {
  display: block;
  background: linear-gradient(135deg, var(--gold-from), var(--gold-to));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin: 14px 0 22px;
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 440px;
}
.hero-art { flex-shrink: 0; width: 320px; max-width: 38%; }
.hero-art svg { width: 100%; height: auto; display: block; }

/* ============================================================
   DASHBOARD — TARJETAS KPI (métricas)
   ============================================================ */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-500), var(--navy-800));
}
.metric-icon svg { width: 24px; height: 24px; }
.metric-body { min-width: 0; }
.metric-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-dim); margin-bottom: 4px;
}
.metric-value {
  font-size: 1.7rem; font-weight: 700; color: var(--text); line-height: 1;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.metric-delta {
  font-size: 0.78rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 2px;
}
.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--danger); }
.metric-foot { font-size: 0.74rem; color: var(--text-dim); margin-top: 5px; }

/* ============================================================
   DASHBOARD — ACCESOS RÁPIDOS
   ============================================================ */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.qa-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--blue-500); }
.qa-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--blue-600); background: var(--info-bg);
}
.qa-icon svg { width: 21px; height: 21px; }
.qa-body { flex: 1; min-width: 0; }
.qa-title { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.qa-desc { font-size: 0.78rem; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.qa-chev { color: var(--text-dim); flex-shrink: 0; margin-top: 2px; }
.qa-chev svg { width: 18px; height: 18px; }
/* Módulo aún no disponible: tarjeta atenuada, sin interacción */
.qa-card-soon { opacity: 0.62; cursor: default; }
.qa-card-soon:hover { box-shadow: var(--shadow-sm); transform: none; border-color: var(--border); }
.qa-card-soon .qa-icon { color: var(--text-dim); background: var(--surface-2, rgba(148,163,184,0.14)); }
.qa-card-soon .badge { align-self: flex-start; flex-shrink: 0; }

/* ============================================================
   DASHBOARD — AUTOMATIZACIONES DESTACADAS
   ============================================================ */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.auto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.auto-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.auto-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.auto-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--navy-800); background: var(--info-bg);
}
.auto-icon svg { width: 20px; height: 20px; }
.auto-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.auto-cat { font-size: 0.74rem; color: var(--text-dim); margin-top: 1px; }

/* ============================================================
   BADGES DE ESTADO (diseño 1ContaBot)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }

/* ============================================================
   DASHBOARD — ACTIVIDAD + ALERTAS (2 columnas)
   ============================================================ */
.dash-cols {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 20px;
  margin-top: 26px;
}
.alert-stack { display: flex; flex-direction: column; gap: 14px; }
.alert-card {
  display: flex;
  gap: 13px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert-card.warn   { background: #FFFBEB; border-color: #FCE7B8; }
.alert-card.danger { background: #FEF6F6; border-color: #F8D2D2; }
.alert-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
}
.alert-card.warn   .alert-ico { background: var(--warning-bg); color: var(--warning); }
.alert-card.danger .alert-ico { background: var(--danger-bg);  color: var(--danger); }
.alert-ico svg { width: 20px; height: 20px; }
.alert-body { flex: 1; min-width: 0; }
.alert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.alert-title { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.alert-text { font-size: 0.8rem; color: var(--text-dim); margin: 3px 0 6px; }
.alert-count {
  flex-shrink: 0; font-size: 0.68rem; font-weight: 700;
  padding: 2px 9px; border-radius: var(--radius-pill);
}
.alert-card.warn   .alert-count { background: var(--warning-bg); color: var(--warning); }
.alert-card.danger .alert-count { background: var(--danger-bg);  color: var(--danger); }
.alert-link { font-size: 0.8rem; font-weight: 600; color: var(--blue-600); }

.row-menu {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 2px; border-radius: 6px;
}
.row-menu:hover,
.row-menu[aria-expanded="true"] { background: var(--panel2); color: var(--text); }
.row-menu svg { width: 18px; height: 18px; display: block; }

/* Menú contextual (kebab) de cada fila.
   Se posiciona con `position: fixed` desde JS para no quedar recortado por
   contenedores con overflow (p. ej. `.table-wrapper`). */
.row-actions { position: relative; display: inline-flex; }
.row-menu-list {
  position: fixed;
  z-index: 1000;
  min-width: 188px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row-menu-list[hidden] { display: none; }
.row-menu-list form { margin: 0; width: 100%; }
.row-menu-list a,
.row-menu-list button {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text);
  background: none; border: none; border-radius: 8px;
  text-align: left; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.row-menu-list a:hover,
.row-menu-list button:hover { background: var(--panel2); }
.row-menu-list a svg,
.row-menu-list button svg { width: 15px; height: 15px; flex-shrink: 0; display: block; }
.row-menu-list hr { border: none; border-top: 1px solid var(--border); margin: 4px 2px; }
.row-menu-list .menu-danger { color: var(--danger); }
.row-menu-list .menu-danger:hover { background: var(--danger-bg); }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.form-section h2 {
  font-size: 1rem; font-weight: 700; margin-bottom: 18px; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--panel2);
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 16px;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--blue-500); background: var(--info-bg); }
.drop-zone .drop-icon { font-size: 2.2rem; margin-bottom: 8px; }
.drop-zone .drop-text { font-size: 0.9rem; color: var(--text-dim); }
.drop-zone .drop-text strong { color: var(--blue-600); cursor: pointer; }
.drop-zone input[type="file"] { display: none; }
.file-chosen { font-size: 0.8rem; color: var(--success); margin-top: 8px; min-height: 18px; font-weight: 600; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 180px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-group input[type="file"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus, .form-group select:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-check {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 0.85rem; color: var(--text-dim); cursor: pointer;
}
.form-check input[type="checkbox"] { accent-color: var(--blue-600); width: 16px; height: 16px; }

/* Listas de configuración repetibles (cuentas/bancos de la empresa) */
.config-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.config-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.config-row input[type="text"] {
  font-size: 0.85rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.config-row input.mono { font-family: monospace; width: 200px; flex: 0 0 auto; }
.config-row input:not(.mono) { flex: 1; min-width: 180px; }
.config-row input:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.btn-row-del { flex: 0 0 auto; color: var(--danger); }
.btn-row-del:hover { border-color: var(--danger); background: var(--danger-bg); }

/* ============================================================
   MÓDULO EMPRESAS
   ============================================================ */
/* Cabecera de tarjeta: icono + títulos + acciones */
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}
.card-head-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.card-head-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--blue-600); background: var(--info-bg);
}
.card-head-ico svg { width: 22px; height: 22px; }
.card-head-text h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.25; }
.card-head-text p {
  font-size: 0.84rem; color: var(--text-dim);
  margin-top: 5px; max-width: 660px; line-height: 1.5;
}
.card-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Caja de búsqueda */
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box svg {
  position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--text-dim); pointer-events: none;
}
.search-box input {
  padding: 9px 14px 9px 35px;
  border: 1px solid var(--border); border-radius: var(--radius-btn);
  font-family: var(--font); font-size: 0.85rem; color: var(--text);
  background: var(--surface); min-width: 230px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box input:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* Tabla de empresas */
.tbl-scroll { overflow-x: auto; }
.empresa-sigla { font-weight: 700; color: var(--text); margin-right: 8px; }
.empresa-row td { padding: 14px; }
.empresa-activa td { background: rgba(37,99,235,0.05); }
.empresa-activa td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }
.cell-ico {
  display: inline-flex; vertical-align: middle; margin-right: 7px;
  color: var(--text-dim);
}
.cell-ico svg { width: 16px; height: 16px; }
td code {
  font-family: monospace; font-size: 0.78rem; color: var(--text-dim);
  background: var(--panel2); padding: 2px 7px; border-radius: 6px;
}
td.mono { font-family: monospace; font-size: 0.82rem; }

/* Botones de acción de fila */
.tbl-actions { display: inline-flex; gap: 7px; align-items: center; justify-content: flex-end; }
.tbl-action {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); display: grid; place-items: center; cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.tbl-action:hover { border-color: var(--blue-500); color: var(--blue-600); background: var(--info-bg); }
.tbl-action svg { width: 16px; height: 16px; display: block; }
.tbl-action.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.row-menu-list button[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Pie de tabla: conteo + paginador */
.tbl-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 16px;
}
.tbl-foot .muted { font-size: 0.82rem; }
.pager { display: inline-flex; gap: 6px; align-items: center; }
.pager button, .pager .page {
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-dim);
  display: grid; place-items: center; cursor: pointer;
  font-size: 0.82rem; font-weight: 600;
}
.pager button:disabled { opacity: 0.45; cursor: default; }
.pager button:not(:disabled):hover { border-color: var(--blue-500); color: var(--blue-600); }
.pager button svg { width: 15px; height: 15px; }
.pager .page.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }

/* Grid inferior (subir maestros + tip · crear empresa) */
.empresas-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 20px; align-items: start; margin-top: 20px;
}
.col-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Campos de formulario genéricos del módulo */
.form-field { margin-bottom: 15px; }
.form-field > label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-dim); margin-bottom: 6px;
}
.form-field .req { color: var(--danger); }
.form-field .hint { font-weight: 400; color: var(--text-dim); font-size: 0.74rem; }
.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%; font-family: var(--font); font-size: 0.85rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field textarea { resize: vertical; font-family: monospace; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-subtitle { font-size: 0.92rem; font-weight: 700; color: var(--text); margin: 4px 0 14px; }

/* Campo de archivo (label + input nativo "Elegir archivo") */
.file-field {
  display: grid; grid-template-columns: 210px 1fr; gap: 14px;
  align-items: center; margin-bottom: 14px;
}
.file-field > label { font-size: 0.82rem; font-weight: 600; color: var(--text-dim); }
.file-field input[type="file"] { font-size: 0.8rem; color: var(--text-dim); min-width: 0; }
.file-field input[type="file"]::file-selector-button {
  padding: 7px 14px; margin-right: 12px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  font-family: var(--font); font-weight: 600; font-size: 0.8rem; cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.file-field input[type="file"]::file-selector-button:hover {
  border-color: var(--blue-500); color: var(--blue-600);
}
.file-field-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.maestro-dl {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 0.75rem; font-weight: 600; color: var(--blue-600); text-decoration: none;
}
.maestro-dl svg { width: 13px; height: 13px; }
.maestro-dl:hover { text-decoration: underline; }
.maestro-none { font-size: 0.75rem; }
.maestro-dl[hidden], .maestro-none[hidden] { display: none; }

/* Acordeón (secciones avanzadas de "Crear empresa") */
.accordion {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 10px; overflow: hidden; background: var(--surface);
}
.accordion > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 13px; padding: 13px 15px;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { background: var(--panel2); }
.accordion-ico {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--blue-600); background: var(--info-bg);
}
.accordion-ico svg { width: 19px; height: 19px; }
.accordion-text { flex: 1; min-width: 0; }
.accordion-text strong { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text); }
.accordion-text span { font-size: 0.78rem; color: var(--text-dim); }
.accordion-chev { flex-shrink: 0; color: var(--text-dim); transition: transform var(--transition); }
.accordion-chev svg { width: 18px; height: 18px; display: block; }
.accordion[open] .accordion-chev { transform: rotate(90deg); }
.accordion[open] > summary { border-bottom: 1px solid var(--border); background: var(--panel2); }
.accordion-body { padding: 16px; }
.accordion-body .muted { font-size: 0.8rem; line-height: 1.45; margin-bottom: 12px; }

/* Tarjeta "¿Sabías que?" */
.card-tip { display: flex; gap: 16px; align-items: center; }
.card-tip-ico {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--gold); background: var(--warning-bg);
}
.card-tip-ico svg { width: 22px; height: 22px; }
.card-tip h3 { font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.card-tip p { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }

/* Acciones centradas (botones de envío) */
.card-actions-center {
  display: flex; justify-content: center; align-items: center;
  gap: 10px; margin-top: 18px;
}

@media (max-width: 1100px) {
  .empresas-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form-cols { grid-template-columns: 1fr; }
  .file-field { grid-template-columns: 1fr; gap: 6px; }
}

/* ============================================================
   PIE DE MÓDULO — GUÍA RÁPIDA (stepper) + ACTIVIDAD RECIENTE
   Componentes reutilizables para los módulos de Automatizaciones.
   ============================================================ */
.modulo-bottom {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}

/* — Guía rápida (pasos) — */
.guia-sub { font-size: 0.82rem; color: var(--text-dim); margin: -6px 0 20px; }
.guia-steps { display: flex; align-items: flex-start; gap: 4px; }
.guia-step {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 9px;
}
.guia-circle {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.guia-circle svg { width: 22px; height: 22px; }
.guia-num {
  position: absolute; top: -5px; right: -5px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.68rem; font-weight: 700;
  display: grid; place-items: center;
}
.guia-step-title { font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.guia-step-desc { font-size: 0.74rem; color: var(--text-dim); line-height: 1.35; }
.guia-arrow { flex: 0 0 auto; margin-top: 18px; color: #CBD5E1; }
.guia-arrow svg { width: 20px; height: 20px; display: block; }

/* Colores por paso (círculo y título) */
.guia-c-blue   { background: var(--blue-500); }
.guia-c-green  { background: var(--success); }
.guia-c-orange { background: var(--warning); }
.guia-c-purple { background: #8B5CF6; }
.guia-t-blue   { color: var(--blue-600); }
.guia-t-green  { color: var(--success); }
.guia-t-orange { color: var(--warning); }
.guia-t-purple { color: #8B5CF6; }

.guia-footer { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); text-align: center; }
.guia-tutorial summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.82rem; font-weight: 600; color: var(--blue-600);
}
.guia-tutorial summary::-webkit-details-marker { display: none; }
.guia-tutorial summary svg { width: 15px; height: 15px; }
.guia-tutorial[open] summary { margin-bottom: 4px; }

/* — Actividad reciente (histórico del módulo) — */
.act-list { display: flex; flex-direction: column; }
.act-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 2px;
  border-top: 1px solid var(--border);
}
.act-item:first-child { border-top: none; }
.act-icon {
  flex: 0 0 auto;
  width: 42px; height: 48px;
  border-radius: 8px;
  background: var(--panel2);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.act-icon svg { width: 18px; height: 18px; color: var(--text-dim); }
.act-ext { font-size: 0.5rem; font-weight: 800; color: var(--success); letter-spacing: 0.04em; }
.act-main { flex: 1; min-width: 0; }
.act-name {
  font-size: 0.86rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-status { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; margin-top: 3px; }
.act-status svg { width: 13px; height: 13px; }
.act-status.ok   { color: var(--success); }
.act-status.proc { color: var(--warning); }
.act-status.err  { color: var(--danger); }
.act-date { flex: 0 0 auto; font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.act-badge {
  flex: 0 0 auto; text-align: center;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-weight: 700; line-height: 1.15; font-size: 0.92rem;
}
.act-badge small { display: block; font-size: 0.64rem; font-weight: 500; }
.act-badge.ok   { background: var(--success-bg); color: var(--success); }
.act-badge.proc { background: var(--warning-bg); color: var(--warning); }
.act-badge.err  { background: var(--danger-bg);  color: var(--danger); }
.act-empty { padding: 28px 10px; text-align: center; color: var(--text-dim); font-size: 0.84rem; }

@media (max-width: 980px) {
  .modulo-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .guia-steps { flex-wrap: wrap; justify-content: center; }
  .guia-arrow { display: none; }
  .guia-step { flex: 1 1 42%; }
  .act-date { display: none; }
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
  position: fixed; top: 20px; right: 24px; z-index: 1500;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.flash {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.4;
  border-left: 4px solid;
  box-shadow: var(--shadow-md);
  background: var(--surface);
  animation: slideIn 0.25s ease;
}
.flash.success { background: var(--success-bg); border-color: var(--success); color: #166534; }
.flash.error   { background: var(--danger-bg);  border-color: var(--danger);  color: #991B1B; }
.flash.info    { background: var(--info-bg);    border-color: var(--info);    color: #1E40AF; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   TABLAS
   ============================================================ */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
thead th {
  background: var(--panel2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--panel2); }
tbody td { padding: 11px 14px; vertical-align: middle; color: var(--text); }

/* Estados de fila (compatibilidad páginas existentes) */
tr.row-pendiente   td { background: rgba(220,38,38,0.05); }
tr.row-pendiente   td:nth-child(7) { color: var(--danger); font-weight: 700; }
tr.row-sugerida    td { background: rgba(217,119,6,0.06); }
tr.row-sugerida    td:nth-child(7) { color: var(--orange); font-weight: 600; }
tr.row-ok          td { background: transparent; }
tr.row-sin-tercero td { background: rgba(217,119,6,0.05); }

/* ============================================================
   PILLS LEGADAS (resultado / banco)
   ============================================================ */
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 0.7rem; font-weight: 600; }
.pill-pendiente { background: var(--danger-bg);  color: var(--danger); }
.pill-sugerida  { background: var(--orange-bg);  color: var(--orange); }
.pill-ok        { background: var(--success-bg); color: var(--success); }
.pill-warn      { background: var(--warning-bg); color: var(--warning); }
.pill-info      { background: var(--info-bg);    color: var(--info); }
.pill-muted     { background: var(--bg-soft, #F1F5F9); color: var(--text-dim); }

/* ============================================================
   TABS
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 10px 20px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-dim); font-family: var(--font); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: color var(--transition), border-color var(--transition); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   CONFIRM FORM (cuenta pendiente)
   ============================================================ */
.confirm-form { display: flex; gap: 6px; align-items: center; }
.confirm-form input[type="text"] {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-family: var(--font); font-size: 0.8rem; padding: 5px 10px;
  width: 120px; transition: border-color var(--transition);
}
.confirm-form input[type="text"]:focus { outline: none; border-color: var(--blue-500); }

/* ============================================================
   MODAL (Automatizar proceso)
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,42,82,0.45);
  backdrop-filter: blur(3px);
  z-index: 1800;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 9px; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  width: 34px; height: 34px; border-radius: 8px; font-size: 1.4rem; line-height: 1;
}
.modal-close:hover { background: var(--panel2); color: var(--text); }
.modal-body { padding: 24px; }

/* ============================================================
   SPINNER / LOADING
   ============================================================ */
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,42,82,0.55); z-index: 2000;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  backdrop-filter: blur(4px);
}
.loading-overlay.visible { display: flex; }
.loading-overlay .loader {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loading-overlay p { color: #fff; font-size: 0.92rem; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 16px; }
.section-header h2 { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.moneda { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.text-dim { color: var(--text-dim); }
.muted { color: var(--text-dim); }
.small { font-size: 0.8rem; }
.mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.gap-8 { gap: 8px; } .flex { display: flex; } .flex-center { display: flex; align-items: center; }
.grow { flex: 1; }
.valor-pos { color: var(--success); font-weight: 600; }
.valor-neg { color: var(--danger); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: grid; }
  .topbar { padding: 14px 18px; }
  .topbar-titles h1 { font-size: 1.2rem; }
  .page-content { padding: 18px 16px 32px; }
  .hero { padding: 26px 22px; flex-direction: column; align-items: flex-start; }
  .hero-art { width: 100%; max-width: 280px; align-self: center; }
  .stats-grid, .metric-grid { grid-template-columns: 1fr; }
}

/* Backdrop para cerrar el sidebar en móvil */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,42,82,0.4);
  z-index: 90;
}
.sidebar-backdrop.show { display: block; }
@media (min-width: 769px) { .sidebar-backdrop { display: none !important; } }
