/* ==========================================================================
   IE Comercial Secure Board — Sistema de diseño
   Identidad IE Grupo: negro/gris estructural + amarillo como acento.
   ========================================================================== */

:root {
  /* Primarios */
  --ie-yellow: #FFE100;
  --ie-yellow-dark: #E6CB00;
  --ie-yellow-soft: rgba(255, 225, 0, 0.12);
  --ie-black: #111111;
  --ie-dark: #1A1A1A;

  /* Grises */
  --g900: #222222;
  --g800: #333333;
  --g700: #4A4A4A;
  --g600: #666666;
  --g500: #888888;
  --g400: #B0B0B0;
  --g300: #D1D5DB;
  --g200: #E5E7EB;
  --g100: #F3F4F6;
  --g50: #F9FAFB;

  /* Estados */
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --info: #2563EB;
  --info-bg: #DBEAFE;

  /* Superficies */
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --border: #E3E6EA;
  --text: #16233A;
  --text-muted: #5B6676;

  --sidebar-w: 244px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow: 0 1px 3px rgba(17, 17, 17, 0.08), 0 4px 12px rgba(17, 17, 17, 0.04);
  --shadow-lg: 0 8px 30px rgba(17, 17, 17, 0.12);
  --font: 'Segoe UI', Inter, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ==========================================================================
   LOGIN / OTP / RESET — portal corporativo
   ========================================================================== */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 460px;
  background: var(--ie-black);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 64px;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 225, 0, 0.14) 0%, transparent 42%),
    linear-gradient(145deg, #111111 0%, #1A1A1A 45%, #262626 100%);
  color: #fff;
  overflow: hidden;
}

.auth-brand::after {
  content: '';
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 225, 0, 0.16);
  border-radius: 50%;
}

.auth-brand-inner { position: relative; z-index: 1; }

.auth-logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 72px;
}

.auth-logo-lockup img { height: 56px; width: auto; }

.auth-logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.auth-logo-text strong { font-size: 19px; letter-spacing: 0.02em; font-weight: 700; }
.auth-logo-text span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ie-yellow);
  font-weight: 600;
  margin-top: 3px;
}

.auth-headline {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
  max-width: 520px;
}

.auth-headline em {
  font-style: normal;
  color: var(--ie-yellow);
}

.auth-sub {
  margin-top: 20px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 460px;
  line-height: 1.65;
}

.auth-foot {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.7;
  max-width: 480px;
}

.auth-foot strong { color: rgba(255, 255, 255, 0.72); font-weight: 600; }

.auth-panel {
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.auth-form-wrap { width: 100%; max-width: 340px; }

.auth-form-wrap h1 {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.auth-form-wrap > p.lead {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 28px;
  line-height: 1.55;
}

.auth-mobile-logo { display: none; margin-bottom: 28px; }
.auth-mobile-logo img { height: 44px; }

/* ==========================================================================
   FORMULARIOS
   ========================================================================== */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--g700);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--g300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--g800);
  box-shadow: 0 0 0 3px rgba(255, 225, 0, 0.35);
}

.field textarea { resize: vertical; min-height: 90px; line-height: 1.55; }

.field .hint { font-size: 11.5px; color: var(--g500); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary { background: var(--ie-yellow); color: var(--ie-black); }
.btn-primary:hover { background: var(--ie-yellow-dark); }

.btn-dark { background: var(--ie-black); color: #fff; }
.btn-dark:hover { background: var(--g800); }

.btn-ghost {
  background: #fff;
  color: var(--g700);
  border-color: var(--g300);
}
.btn-ghost:hover { background: var(--g50); border-color: var(--g400); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
  border-left: 3px solid;
}

.alert-error { background: var(--danger-bg); color: #991B1B; border-color: var(--danger); }
.alert-success { background: var(--success-bg); color: #166534; border-color: var(--success); }
.alert-info { background: var(--info-bg); color: #1E40AF; border-color: var(--info); }
.alert-warning { background: var(--warning-bg); color: #92400E; border-color: var(--warning); }

.auth-links {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-links a { color: var(--g700); font-weight: 500; }
.auth-links a:hover { color: var(--ie-black); text-decoration: underline; }

.otp-input {
  letter-spacing: 0.5em;
  font-size: 24px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  padding: 14px 12px !important;
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--ie-black);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img { height: 38px; }
.sidebar-brand div { display: flex; flex-direction: column; line-height: 1.18; }
.sidebar-brand strong { font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em; }
.sidebar-brand span {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ie-yellow);
  margin-top: 3px;
  font-weight: 600;
}

.sidebar-nav { padding: 14px 10px; flex: 1; }

.nav-group-label {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
  padding: 14px 10px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.74);
  margin-bottom: 1px;
  transition: background 0.14s, color 0.14s;
  border-left: 2px solid transparent;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.nav-item.active {
  background: rgba(255, 225, 0, 0.1);
  color: var(--ie-yellow);
  border-left-color: var(--ie-yellow);
  font-weight: 600;
}

.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }

.sidebar-foot {
  padding: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.55;
}

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

.topbar {
  height: 58px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 30;
  gap: 16px;
}

.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-title h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title .crumbs {
  font-size: 11.5px;
  color: var(--g500);
  margin-top: 1px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ie-black);
  color: var(--ie-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta strong { font-size: 12.5px; font-weight: 600; }
.user-meta span { font-size: 10.5px; color: var(--g500); }

.content { padding: 24px 26px 56px; flex: 1; max-width: 1560px; width: 100%; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
}

/* ==========================================================================
   BARRA DE CONFIDENCIALIDAD
   ========================================================================== */

.confidential-bar {
  background: var(--ie-black);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 6px 26px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 2px solid var(--ie-yellow);
}

.confidential-bar .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ie-yellow);
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ==========================================================================
   TARJETAS Y KPI
   ========================================================================== */

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

.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.card-head .sub { font-size: 11.5px; color: var(--g500); font-weight: 400; margin-top: 2px; }

.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.section-title::before {
  content: '';
  width: 3px;
  height: 15px;
  background: var(--ie-yellow);
  border-radius: 2px;
}

.section-sub { font-size: 12.5px; color: var(--g500); margin-bottom: 16px; margin-left: 12px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 16px 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--g300);
}

.kpi.accent::before { background: var(--ie-yellow); }
.kpi.pos::before { background: var(--success); }
.kpi.neg::before { background: var(--danger); }

.kpi-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--g500);
  font-weight: 650;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-value small { font-size: 13px; font-weight: 600; color: var(--g500); margin-left: 2px; }

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--g500);
  flex-wrap: wrap;
}

.delta { font-weight: 700; font-size: 11.5px; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--g500); }

/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.badge-yellow { background: var(--ie-yellow-soft); color: #7A6A00; }
.badge-green { background: var(--success-bg); color: #166534; }
.badge-red { background: var(--danger-bg); color: #991B1B; }
.badge-gray { background: var(--g100); color: var(--g600); }
.badge-blue { background: var(--info-bg); color: #1E40AF; }
.badge-black { background: var(--ie-black); color: var(--ie-yellow); }

/* ==========================================================================
   TABLAS
   ========================================================================== */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.bi {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

table.bi thead th {
  background: var(--g900);
  color: rgba(255, 255, 255, 0.92);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650;
  padding: 9px 12px;
  text-align: right;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.bi thead th:first-child,
table.bi thead th.left { text-align: left; }

table.bi tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--g200);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.bi tbody td:first-child,
table.bi tbody td.left { text-align: left; white-space: normal; }

table.bi tbody tr:hover td { background: var(--g50); }

table.bi tbody tr.total td {
  background: var(--g100);
  font-weight: 700;
  border-top: 2px solid var(--g800);
  border-bottom: none;
}

table.bi tbody tr.sub td {
  color: var(--text-muted);
  font-style: italic;
}

.cell-name { font-weight: 550; color: var(--text); }
.cell-sub { font-size: 11px; color: var(--g500); margin-top: 1px; }

.num-neg { color: var(--danger); font-weight: 600; }
.num-pos { color: var(--success); font-weight: 600; }
.num-muted { color: var(--g500); }

/* barra de participación en tablas */
.share-bar {
  height: 4px;
  background: var(--g200);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
  min-width: 42px;
}
.share-bar i { display: block; height: 100%; background: var(--ie-yellow); border-radius: 3px; }

/* ==========================================================================
   GRÁFICOS
   ========================================================================== */

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.chart-box { position: relative; height: 258px; }
.chart-box.tall { height: 320px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--g600);
  margin-top: 12px;
}

.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* ==========================================================================
   FILTROS
   ========================================================================== */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 18px;
  padding: 13px 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filters .field { margin: 0; min-width: 132px; }
.filters .field label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.filters .field input, .filters .field select { padding: 7px 10px; font-size: 12.5px; }

/* ==========================================================================
   TABS
   ========================================================================== */

.tabs {
  display: flex;
  gap: 3px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  overflow-x: auto;
}

.tab {
  padding: 9px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--g600);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--ie-black); }
.tab.active { color: var(--ie-black); border-bottom-color: var(--ie-yellow); }

/* ==========================================================================
   RECOMENDACIONES IA
   ========================================================================== */

.rec-list { display: flex; flex-direction: column; gap: 13px; }

.rec {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  background: #fff;
  border-left: 3px solid var(--g400);
}

.rec.p-alta { border-left-color: var(--danger); }
.rec.p-media { border-left-color: var(--warning); }
.rec.p-baja { border-left-color: var(--g400); }

.rec-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.rec-title { font-size: 13.5px; font-weight: 650; line-height: 1.4; }

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px 18px;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--g300);
}

.rec-field label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--g500);
  font-weight: 700;
  margin-bottom: 2px;
}

.rec-field p { font-size: 12.5px; color: var(--g700); line-height: 1.5; }

.rec-evidence {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--g50);
  border: 1px solid var(--g200);
  border-radius: 5px;
  padding: 7px 10px;
  color: var(--g800);
  margin-top: 8px;
  line-height: 1.6;
}

/* ==========================================================================
   ACTAS
   ========================================================================== */

.minute-section {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.minute-section:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.minute-section h4 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  color: var(--g700);
}

.minute-section h4 .n {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  background: var(--ie-yellow);
  color: var(--ie-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.minute-body { font-size: 13px; line-height: 1.72; color: var(--g800); white-space: pre-wrap; }

.action-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--g200);
  align-items: start;
}
.action-row:last-child { border-bottom: none; }

.action-main { font-size: 13px; line-height: 1.55; }
.action-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 11px;
  color: var(--g500);
}
.action-meta b { color: var(--g700); font-weight: 600; }

/* ==========================================================================
   EMPTY / LOADING
   ========================================================================== */

.empty {
  text-align: center;
  padding: 46px 22px;
  color: var(--g500);
}
.empty h4 { font-size: 14px; color: var(--g700); margin-bottom: 5px; font-weight: 600; }
.empty p { font-size: 12.5px; max-width: 380px; margin: 0 auto; line-height: 1.6; }

.skeleton {
  background: linear-gradient(90deg, var(--g100) 25%, var(--g200) 50%, var(--g100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  height: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ==========================================================================
   WATERMARK DE SEGURIDAD
   ========================================================================== */

.watermark-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
  opacity: 0.055;
  user-select: none;
}

.watermark-layer span {
  position: absolute;
  font-size: 12px;
  font-weight: 600;
  color: #000;
  white-space: nowrap;
  transform: rotate(-28deg);
  letter-spacing: 0.03em;
}

/* Aviso flotante de confidencialidad */
.security-toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--ie-black);
  color: #fff;
  border-left: 3px solid var(--ie-yellow);
  border-radius: 7px;
  padding: 11px 15px;
  font-size: 11.5px;
  max-width: 310px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  line-height: 1.5;
  display: flex;
  gap: 9px;
  align-items: flex-start;
}
.security-toast.hidden { display: none; }
.security-toast button {
  background: none;
  border: none;
  color: var(--g400);
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 4px;
}

/* ==========================================================================
   IMPRESIÓN — bloqueo del tablero
   ========================================================================== */

@media print {
  body * { visibility: hidden !important; }
  body::before {
    content: 'DOCUMENTO CONFIDENCIAL — IE GRUPO. La impresión de este tablero está deshabilitada.';
    visibility: visible !important;
    display: block !important;
    position: fixed;
    top: 40%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    padding: 20px;
  }
}

/* ==========================================================================
   UTILIDADES
   ========================================================================== */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.text-right { text-align: right; }
.muted { color: var(--text-muted); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.pill-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  padding: 5px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--g100);
  color: var(--g600);
  border: 1px solid transparent;
}
.pill.active { background: var(--ie-black); color: var(--ie-yellow); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1080px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-mobile-logo { display: block; }
  .auth-panel { padding: 28px 22px; min-height: 100vh; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 18px 15px 48px; }
  .topbar { padding: 0 15px; }
  .confidential-bar { padding: 6px 15px; font-size: 10px; }
  .user-meta { display: none; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 20px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-box { height: 230px; }
  .section-title { font-size: 14px; }
  table.bi { font-size: 11.5px; }
  table.bi thead th, table.bi tbody td { padding: 7px 9px; }
}

@media (max-width: 560px) {
  .filters { flex-direction: column; align-items: stretch; }
  .filters .field { min-width: 0; }
  .btn-row .btn { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 18px; }
  .rec-grid { grid-template-columns: 1fr; }
  .security-toast { left: 12px; right: 12px; max-width: none; bottom: 12px; }
}

/* Overlay para móvil al abrir el menú */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  z-index: 35;
}
.sidebar-overlay.show { display: block; }

/* ==========================================================================
   Módulo de actas — historial y documento
   ========================================================================== */
.month-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px;margin-top:16px}
.month-card{border:1px solid #E5E7EB;border-radius:10px;padding:12px;background:#fff;text-decoration:none;color:inherit;display:block;transition:border-color .15s,box-shadow .15s}
.month-card:hover{border-color:#FFE100;box-shadow:0 2px 10px rgba(0,0,0,.07)}
.month-card.is-empty{background:#F9FAFB;opacity:.75}
.month-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-weight:700;color:#111111;font-size:14px}
.month-meta{display:flex;flex-direction:column;gap:2px;margin-top:8px;font-size:12px;color:#666666}

.minute-doc{background:#fff;border:1px solid #E5E7EB;border-radius:12px;padding:32px;max-width:960px;margin:0 auto}
.minute-header{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;border-bottom:3px solid #FFE100;padding-bottom:20px;flex-wrap:wrap}
.minute-eyebrow{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#888888;font-weight:700}
.minute-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-top:20px}
.minute-meta dt{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#888888;font-weight:700}
.minute-meta dd{margin:3px 0 0;font-size:14px;color:#222222;font-weight:600}
.minute-section{margin-top:30px;padding-top:22px;border-top:1px solid #E5E7EB}
.minute-body{font-size:14.5px;line-height:1.72;color:#333333;white-space:pre-line}
.minute-snapshot{background:#F9FAFB;border:1px solid #E5E7EB;border-left:4px solid #FFE100;border-radius:8px;padding:14px 18px;margin-top:18px;font-size:13px;color:#4A4A4A}
.minute-legal{margin-top:30px;padding:14px 18px;background:#F3F4F6;border-radius:8px;font-size:12px;color:#666666;line-height:1.6}

.finding-list{margin:0;padding-left:22px;color:#333333}
.finding-list li{margin-bottom:10px;line-height:1.65}
.finding-evidence{display:block;font-size:12.5px;color:#888888;margin-top:2px}

.raw-input{width:100%;min-height:220px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;line-height:1.6;padding:14px;border:1px solid #D1D5DB;border-radius:8px;resize:vertical}
.raw-input:focus{outline:none;border-color:#FFE100;box-shadow:0 0 0 3px rgba(255,225,0,.25)}

/* Editor de filas repetibles */
.repeat-list{display:flex;flex-direction:column;gap:14px;margin-top:14px}
.repeat-row{border:1px solid #E5E7EB;border-radius:10px;padding:16px;background:#F9FAFB}
.repeat-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.repeat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.repeat-row .btn-remove{margin-top:10px}

/* Seguimiento mes anterior */
.follow-row{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;border:1px solid #E5E7EB;border-radius:10px;padding:14px 16px;margin-bottom:10px;background:#fff;flex-wrap:wrap}
.follow-main{flex:1;min-width:240px}
.follow-controls{display:flex;flex-direction:column;gap:10px;align-items:flex-end}
.follow-ok{border-left:4px solid #16A34A;background:#F0FDF4}
.follow-bad{border-left:4px solid #DC2626;background:#FEF2F2}
.follow-pending{border-left:4px solid #F59E0B;background:#FFFBEB}
.radio-inline{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#333333;margin-left:14px;cursor:pointer;font-weight:600}

/* ==========================================================================
   Cargas mensuales — asistente y resultados
   ========================================================================== */
.wizard{display:flex;flex-direction:column;gap:20px}
.steps,.wizard-steps{display:flex;gap:10px;flex-wrap:wrap;list-style:none;padding:0;margin:0}
.steps li,.wizard-steps li{flex:1;min-width:140px;padding:12px 14px;border-radius:9px;background:#F3F4F6;border:1px solid #E5E7EB;font-size:13px;font-weight:700;color:#888888}
.steps li.is-active,.wizard-steps li.is-active{background:#111111;color:#FFE100;border-color:#111111}
.steps li.is-done,.wizard-steps li.is-done{background:#FFFDE6;color:#111111;border-color:#FFE100}

.progress{height:10px;background:#E5E7EB;border-radius:999px;overflow:hidden;margin-top:10px}
.progress-bar{height:100%;width:0;background:linear-gradient(90deg,#FFE100,#F5C400);transition:width .3s ease}
.progress-msg{margin-top:8px;font-size:13px;color:#666666}

.result-card{border:1px solid #E5E7EB;border-radius:12px;padding:20px;margin-top:18px;background:#fff}
.result-ok{border-left:5px solid #16A34A;background:#F0FDF4}
.result-bad{border-left:5px solid #DC2626;background:#FEF2F2}
.result-head{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:800;color:#111111}
.result-subtitle{font-size:13px;color:#666666;margin-top:4px}
.result-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:14px;margin-top:16px}
.result-body{margin-top:16px}

.issue-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.issue{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:8px;font-size:13px;line-height:1.55;border:1px solid #E5E7EB;background:#F9FAFB}
.issue-critical{border-color:#FCA5A5;background:#FEF2F2;color:#7F1D1D}
.issue-head{font-weight:800;margin-bottom:2px}
.row-critical{background:#FEF2F2}
.batch-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}

/* ==========================================================================
   Administración — permisos, formularios en línea, paginación
   ========================================================================== */
.branch-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:10px;margin-top:10px;max-height:340px;overflow-y:auto;padding:4px}
.branch-perm{display:flex;align-items:flex-start;gap:10px;border:1px solid #E5E7EB;border-radius:9px;padding:11px 13px;background:#fff;cursor:pointer;transition:border-color .15s}
.branch-perm:hover{border-color:#FFE100}
.branch-perm input{margin-top:3px}
.check-pill{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border:1px solid #D1D5DB;border-radius:999px;font-size:12.5px;font-weight:700;color:#333333;background:#fff;cursor:pointer}
.check-pill input{margin:0}
.check-sub{display:block;font-size:11.5px;color:#888888;font-weight:500}

.input-inline{padding:7px 10px;border:1px solid #D1D5DB;border-radius:7px;font-size:13px;min-width:130px}
.input-inline:focus{outline:none;border-color:#FFE100;box-shadow:0 0 0 3px rgba(255,225,0,.25)}
.inline-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.pager{display:flex;align-items:center;gap:8px;justify-content:flex-end;margin-top:14px;font-size:13px;color:#666666}
.req{color:#DC2626;font-weight:800}
.tight{padding:0}
.hidden{display:none !important}

/* ==========================================================================
   Impresión — bloqueo y degradación a blanco y negro
   ========================================================================== */
@media print{
  body *{visibility:hidden !important}
  body::after{
    content:"Documento confidencial. La impresión está deshabilitada.";
    visibility:visible !important;display:block;position:fixed;top:45%;left:0;right:0;
    text-align:center;font-size:20px;font-weight:800;color:#000;
  }
}
