/* ══════════════════════════════════════════════════════════════
   ContaFlow Enterprise — app.css  v3.0
   Firma: MAS CONSULTA  |  2026
   
   SECCIONES:
     1.  Design Tokens (variables CSS)
     2.  Reset & Base
     3.  LOGIN SCREEN  ← nuevo
     4.  Sidebar
     5.  Main / Topbar
     6.  Sections
     7.  Buttons
     8.  KPI Cards
     9.  Cards & Charts
    10.  Tables
    11.  Forms
    12.  Modals
    13.  Drawer (panel lateral)
    14.  GESTIONES — timeline  ← nuevo
    15.  PASOS — subformulario  ← nuevo
    16.  ARCHIVOS — panel upload  ← nuevo
    17.  COMENTARIOS — inmutables  ← nuevo
    18.  EMPRESA — selector multi  ← nuevo
    19.  Badges & Tags
    20.  Calendar
    21.  Organigrama
    22.  Intercompañías
    23.  Timeline
    24.  Toast
    25.  Misc helpers
    26.  Scrollbar
    27.  Responsive
══════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* Marca */
  --brand:       #C8410A;
  --brand-h:     #A83509;
  --brand-light: #F26522;
  --brand-pale:  #FFF0E8;
  /* Tinta */
  --ink:         #141217;
  --ink2:        #2A2730;
  --ink3:        #625E6D;
  /* Superficies */
  --surface:     #F6F5F2;
  --surface2:    #EDECEA;
  --white:       #FFFFFF;
  /* Bordes */
  --border:      #E2E0DB;
  --border2:     #CAC8C2;
  /* Estados */
  --ok:          #16A34A;   --ok-bg:     #DCFCE7;
  --warn:        #CA8A04;   --warn-bg:   #FEF9C3;
  --danger:      #DC2626;   --danger-bg: #FEE2E2;
  --info:        #2563EB;   --info-bg:   #DBEAFE;
  --purple:      #7C3AED;   --purple-bg: #EDE9FE;
  --teal:        #0891B2;   --teal-bg:   #CFFAFE;
  /* Layout */
  --r:           8px;
  --r-lg:        14px;
  --r-xl:        20px;
  --sh:          0 1px 3px rgba(20,18,23,.07), 0 4px 16px rgba(20,18,23,.06);
  --sh-lg:       0 8px 32px rgba(20,18,23,.14);
  --sh-xl:       0 20px 60px rgba(20,18,23,.22);
  --sidebar-w:   246px;
  --topbar-h:    56px;
  --ease:        cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── 2. RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════════════════
   3. LOGIN SCREEN
   Pantalla completa que cubre todo hasta que el usuario
   se autentique. Se oculta con .hidden tras el login exitoso.
══════════════════════════════════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fondo con gradiente de marca */
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%,
                    rgba(200,65,10,.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 90%,
                    rgba(200,65,10,.12) 0%, transparent 60%),
    linear-gradient(135deg, #0F0D12 0%, #1C1820 50%, #141217 100%);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
#login-screen.hiding {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}
#login-screen.hidden { display: none; }

/* Patrón decorativo de fondo */
#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* Tarjeta de login */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  padding: 44px 40px 40px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(200,65,10,.15),
    var(--sh-xl);
  animation: loginIn .6s var(--ease-spring);
}
@keyframes loginIn {
  from { opacity:0; transform: translateY(28px) scale(.96); }
  to   { opacity:1; transform: none; }
}

/* Logo en la tarjeta */
.login-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 32px;
}
.login-logo-mark {
  width: 44px; height: 44px;
  background: var(--brand);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(200,65,10,.4);
  flex-shrink: 0;
}
.login-logo-text .ln {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  color: #fff;
  line-height: 1.1;
}
.login-logo-text .lt {
  font-size: 9px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-top: 2px;
}

/* Título y subtítulo */
.login-title {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: rgba(255,255,255,.4);
  margin-bottom: 30px;
}

/* Campos del formulario de login */
.login-field {
  margin-bottom: 16px;
}
.login-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 7px;
}
.login-input {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: all .18s var(--ease);
}
.login-input::placeholder { color: rgba(255,255,255,.25); }
.login-input:focus {
  border-color: var(--brand-light);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(200,65,10,.2);
}
.login-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,.2);
}

/* Campo contraseña con ojo */
.login-pass-wrap {
  position: relative;
}
.login-pass-wrap .login-input {
  padding-right: 42px;
}
.login-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,.35);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color .16s;
  line-height: 1;
}
.login-eye:hover { color: rgba(255,255,255,.7); }

/* Mensaje de error */
.login-error {
  background: rgba(220,38,38,.15);
  border: 1px solid rgba(220,38,38,.35);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12.5px;
  color: #FCA5A5;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}
.login-error.show { display: flex; }

/* Botón de login */
.login-btn {
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 13px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.login-btn:hover:not(:disabled) {
  background: var(--brand-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,65,10,.4);
}
.login-btn:active { transform: none; }
.login-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.login-btn .spin {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sp .6s linear infinite;
}

/* Footer de la tarjeta */
.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,.2);
}

/* ── Forgot password link (login screen) ─── */
.login-forgot {
  text-align: center;
  margin-top: 14px;
}
.login-forgot-link {
  font-size: 12.5px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: color .18s var(--ease);
}
.login-forgot-link:hover {
  color: var(--brand-light);
  text-decoration: underline;
}

/* ── Back to login link ─── */
.login-back {
  text-align: center;
  margin-top: 16px;
}
.login-back-link {
  font-size: 12.5px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: color .18s var(--ease);
}
.login-back-link:hover {
  color: var(--brand-light);
  text-decoration: underline;
}

/* ── Forgot / Reset message boxes ─── */
.forgot-msg, .reset-msg {
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
  align-items: center;
  gap: 8px;
}
.forgot-msg { display: none; }
.reset-msg  { display: none; }
.forgot-msg.show, .reset-msg.show { display: flex; }
.forgot-msg.success, .reset-msg.success {
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.35);
  color: #86EFAC;
}
.forgot-msg.error, .reset-msg.error {
  background: rgba(220,38,38,.15);
  border: 1px solid rgba(220,38,38,.35);
  color: #FCA5A5;
}

/* ── Password strength indicator ─── */
.password-strength {
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width .3s var(--ease), background .3s var(--ease);
}
.password-strength-text {
  font-size: 11px;
  margin-top: 4px;
  color: rgba(255,255,255,.4);
  min-height: 16px;
}

/* ── 4. SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--ink);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform .3s var(--ease);
}
.sb-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px;
  background: var(--brand);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-style: italic;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  transition: background .2s;
}
.logo-text .ln {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: #fff;
  line-height: 1.1;
}
.logo-text .lt {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin-top: 2px;
}
.nav { flex: 1; padding: 8px 0; }
.ns {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.2);
  padding: 14px 18px 4px;
  font-weight: 700;
}
.ni {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: rgba(255,255,255,.42);
  font-size: 12.5px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all .16s var(--ease);
  user-select: none;
  cursor: pointer;
}
.ni:hover { color: rgba(255,255,255,.78); background: rgba(255,255,255,.04); }
.ni.active {
  color: #fff;
  border-left-color: var(--brand-light);
  background: rgba(242,101,34,.13);
}
.ni-ic { width: 17px; text-align: center; font-size: 13px; flex-shrink: 0; }
.ni-badge {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Usuario en sidebar */
.sb-user {
  padding: 12px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.av {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.av-info { flex: 1; min-width: 0; }
.av-name {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.av-role { font-size: 10px; color: rgba(255,255,255,.3); }
.sb-logout {
  background: none;
  border: none;
  color: rgba(255,255,255,.28);
  font-size: 14px;
  padding: 4px;
  border-radius: 5px;
  transition: all .16s;
}
.sb-logout:hover { color: var(--danger); background: rgba(220,38,38,.15); }

/* ── 5. MAIN / TOPBAR ──────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}
.tp-left .tp-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--ink);
}
.tp-left .tp-sub { font-size: 11px; color: var(--ink3); margin-top: 1px; }
.tp-right { display: flex; align-items: center; gap: 10px; }
.week-chip {
  font-size: 11px;
  color: var(--ink3);
  background: var(--surface2);
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.conn-dot { font-size: 14px; color: var(--border2); cursor: default; transition: color .3s; }
.conn-dot.online  { color: var(--ok); }
.conn-dot.offline { color: var(--danger); }
.content { padding: 26px 30px; flex: 1; }

/* ── SELECTOR DE EMPRESA (topbar) ── */
.empresa-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 5px 10px 5px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink2);
  cursor: pointer;
  transition: all .16s;
  max-width: 200px;
}
.empresa-selector:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.empresa-selector .emp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.empresa-selector .emp-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* ── 6. SECTIONS ───────────────────────────────────────────── */
.sec { display: none; animation: fadeUp .22s var(--ease); }
.sec.active { display: block; }
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:none; }
}

/* ── 7. BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: all .16s var(--ease);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-h); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(200,65,10,.28); }
.btn-outline  { background: transparent; color: var(--ink2); border: 1.5px solid var(--border2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost    { background: var(--surface2); color: var(--ink3); }
.btn-ghost:hover  { background: var(--border); color: var(--ink); }
.btn-ok       { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #15803D; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-warn     { background: var(--warn); color: #fff; }
.btn-teal     { background: var(--teal); color: #fff; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* ── 8. KPI CARDS ──────────────────────────────────────────── */
.kpi-grid { display: grid; gap: 12px; margin-bottom: 16px; }
.kpi-4 { grid-template-columns: repeat(4,1fr); }
.kpi-5 { grid-template-columns: repeat(5,1fr); }
.kpi {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all .16s var(--ease);
}
.kpi:hover { box-shadow: var(--sh); transform: translateY(-1px); }
.kpi-stripe { position: absolute; top:0; left:0; bottom:0; width: 3.5px; }
.kpi-lbl { font-size: 9.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink3); font-weight: 700; margin-bottom: 8px; }
.kpi-val { font-family: 'DM Serif Display', serif; font-size: 36px; color: var(--ink); line-height: 1; }
.kpi-meta { font-size: 10.5px; color: var(--ink3); margin-top: 5px; }
.kpi-ico { position: absolute; right: 14px; bottom: 10px; font-size: 30px; opacity: .09; }

/* ── 9. CARDS & CHARTS ─────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chart-wrap { position: relative; height: 210px; }
.g2   { display: grid; grid-template-columns: 2fr 1fr;    gap: 14px; margin-bottom: 16px; }
.g3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.g2-eq { display: grid; grid-template-columns: 1fr 1fr;   gap: 14px; margin-bottom: 16px; }

/* ── 10. TABLES ────────────────────────────────────────────── */
.tcard {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.thead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
}
.thead-title { font-family: 'DM Serif Display', serif; font-size: 14.5px; }
.thead-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tscroll { overflow-x: auto; }
.fbar {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  align-items: center;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.fbar .fi { min-width: 0; flex: 1; font-size: 12px; }
.fbar .fi.fi-s { flex: 1.5; min-width: 160px; }
.fi {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: all .16s;
}
.fi:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200,65,10,.1); }
.fi-s { min-width: 190px; }
select.fi { cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface);
  padding: 8px 14px;
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink3);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(200,65,10,.025); cursor: pointer; }
tbody td { padding: 9px 14px; vertical-align: middle; font-size: 12.5px; }
.tpag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--ink3);
}
.pbtns { display: flex; gap: 4px; }
.pbtn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--ink3);
  transition: all .16s;
}
.pbtn:hover, .pbtn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

/* ── 11. FORMS ─────────────────────────────────────────────── */
.fgrid  { display: grid; gap: 13px; }
.frow   { display: grid; grid-template-columns: 1fr 1fr;       gap: 13px; }
.frow3  { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 13px; }
.frow4  { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 13px; }
.fg     { display: flex; flex-direction: column; gap: 4px; }
.lbl    { font-size: 10.5px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .5px; }
.lbl.req::after { content: ' *'; color: var(--brand); }
.inp {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 8px 11px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: all .16s;
  width: 100%;
}
.inp:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200,65,10,.1); }
.inp:disabled { background: var(--surface); color: var(--ink3); }
.inp:read-only { background: var(--surface); color: var(--ink3); cursor: default; }
textarea.inp { resize: vertical; min-height: 76px; }
select.inp { cursor: pointer; }

/* Input fecha con día/mes/año visible */
input[type="date"].inp {
  cursor: pointer;
}
input[type="date"].inp::-webkit-calendar-picker-indicator {
  opacity: .5;
  cursor: pointer;
}

/* ── 12. MODALS ────────────────────────────────────────────── */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20,18,23,.5);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding: 36px 20px;
  overflow-y: auto;
}
.ov.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 680px;
  box-shadow: var(--sh-lg);
  animation: mIn .22s var(--ease);
}
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-sm { max-width: 480px; }
@keyframes mIn { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }
.mh {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mh-title { font-family: 'DM Serif Display', serif; font-size: 19px; }
.mclose {
  background: var(--surface2);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--ink3);
  transition: all .16s;
}
.mclose:hover { background: var(--danger-bg); color: var(--danger); }
.mb { padding: 18px 24px; }
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .16s;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── 13. DRAWER ────────────────────────────────────────────── */
.drw-ov {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(20,18,23,.35);
  backdrop-filter: blur(2px);
}
.drw-ov.open { display: block; }
.drw {
  position: fixed;
  top: 0; right: -660px;
  width: 640px; height: 100vh;
  background: var(--white);
  z-index: 401;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(20,18,23,.15);
  transition: right .3s var(--ease);
}
.drw.open { right: 0; }
.drw-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drw-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drw-foot { padding: 12px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════════
   14. GESTIONES — Timeline profesional
   Cada módulo (jurídico, requerimientos, embargos, etc.)
   muestra su bitácora con este diseño.
══════════════════════════════════════════════════════════════ */
.gestiones-section {
  margin-top: 20px;
}
.gestiones-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.gestiones-title {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  color: var(--ink);
}
/* Lista de gestiones en timeline */
.gestiones-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}
/* Línea vertical del timeline */
.gestiones-list::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
/* Tarjeta de gestión individual */
.gestion-item {
  display: flex;
  gap: 14px;
  padding: 0 0 16px 0;
  position: relative;
}
/* Ícono circular en la línea del tiempo */
.gestion-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
  transition: all .16s;
}
.gestion-item:hover .gestion-dot {
  border-color: var(--brand);
  background: var(--brand-pale);
}
/* Estado bloqueado — ícono de candado */
.gestion-item.bloqueado .gestion-dot {
  background: var(--surface2);
  border-color: var(--border2);
}
/* Cuerpo de la gestión */
.gestion-body {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: all .16s;
}
.gestion-item:hover .gestion-body { border-color: var(--brand); }
.gestion-item.bloqueado .gestion-body {
  background: var(--surface);
  border-style: dashed;
}
/* Encabezado de la gestión */
.gestion-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.gestion-tipo {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink3);
}
.gestion-fecha {
  font-size: 11px;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 4px;
}
.gestion-titulo {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 5px;
}
.gestion-desc {
  font-size: 12.5px;
  color: var(--ink3);
  line-height: 1.5;
  white-space: pre-wrap;
}
/* Footer de la gestión: usuario + acciones */
.gestion-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 6px;
}
.gestion-autor {
  font-size: 11px;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 5px;
}
.gestion-actions { display: flex; gap: 4px; }
/* Badge de bloqueado */
.badge-bloqueado {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface2);
  color: var(--ink3);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .3px;
}
.badge-bloqueado::before { content: '🔒'; font-size: 10px; }

/* ── Archivos adjuntos dentro de gestión ── */
.gestion-archivos {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.archivo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--ink3);
  text-decoration: none;
  transition: all .14s;
  cursor: pointer;
}
.archivo-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-pale);
}
.archivo-chip .archivo-ic { font-size: 13px; }

/* ══════════════════════════════════════════════════════════════
   15. PASOS — subformulario enriquecido
   Para actividades: paso a paso de la gestión.
══════════════════════════════════════════════════════════════ */
.paso-list { display: flex; flex-direction: column; gap: 10px; }
.paso {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--white);
  overflow: hidden;
  transition: all .16s;
}
.paso:hover { border-color: var(--brand); }
.paso.done  { border-color: #BBF7D0; background: #F0FDF4; }
.paso.bloqueado { border-style: dashed; background: var(--surface); }
/* Cabecera del paso */
.paso-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.paso-n {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--ink3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.paso.done  .paso-n { background: var(--ok); color: #fff; }
.paso.bloqueado .paso-n { background: var(--surface2); }
.paso-info { flex: 1; }
.paso-t    { font-weight: 600; font-size: 13px; }
.paso-d    { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
/* Fechas del paso */
.paso-fechas {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink3);
  margin-top: 3px;
}
.paso-fecha-item { display: flex; align-items: center; gap: 3px; }
/* Cuerpo expandible del paso */
.paso-body {
  padding: 0 14px 14px 51px;
  border-top: 1px solid var(--border);
  display: none;
}
.paso-body.open { display: block; }
.paso-detalle {
  font-size: 12.5px;
  color: var(--ink3);
  line-height: 1.6;
  white-space: pre-wrap;
  padding-top: 12px;
  margin-bottom: 10px;
}
/* Progress slider del paso */
.paso-prog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.paso-prog-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand);
  height: 4px;
  cursor: pointer;
}
.paso-prog-row input[type="range"]:disabled { cursor: default; opacity: .5; }
.paso-prog-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink3);
  min-width: 32px;
  text-align: right;
}

/* ══════════════════════════════════════════════════════════════
   16. ARCHIVOS — panel de carga y listado
══════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--brand);
  background: var(--brand-pale);
}
.upload-zone-ic { font-size: 28px; margin-bottom: 8px; }
.upload-zone-txt { font-size: 12.5px; color: var(--ink3); }
.upload-zone-sub { font-size: 11px; color: var(--ink3); opacity: .7; margin-top: 3px; }
/* Chips de archivos a subir */
.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.upload-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
}
.upload-chip-rm {
  background: none;
  border: none;
  color: var(--ink3);
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
}
.upload-chip-rm:hover { color: var(--danger); }

/* ══════════════════════════════════════════════════════════════
   17. COMENTARIOS — panel inmutable
══════════════════════════════════════════════════════════════ */
.comentarios-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.comentario-item {
  background: var(--surface);
  border-radius: var(--r);
  padding: 12px 14px;
  border-left: 3px solid var(--border2);
}
.comentario-item.tipo-alerta  { border-left-color: var(--warn); }
.comentario-item.tipo-aprobacion { border-left-color: var(--ok); }
.comentario-item.tipo-rechazo { border-left-color: var(--danger); }
.comentario-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--ink3);
}
.comentario-autor { font-weight: 700; color: var(--ink2); }
.comentario-texto { font-size: 12.5px; color: var(--ink); line-height: 1.5; }
.comentario-inmutable {
  font-size: 10px;
  color: var(--ink3);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  opacity: .6;
}
/* Formulario de nuevo comentario */
.comentario-new {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
}
.comentario-new textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 10px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: border-color .16s;
  font-family: inherit;
}
.comentario-new textarea:focus { border-color: var(--brand); }
.comentario-new-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink3);
}

/* ══════════════════════════════════════════════════════════════
   18. EMPRESA — selector multi-empresa
══════════════════════════════════════════════════════════════ */
.empresa-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  min-width: 260px;
  z-index: 600;
  overflow: hidden;
  animation: mIn .18s var(--ease);
}
.epd-header {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink3);
  border-bottom: 1px solid var(--border);
}
.epd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
  font-size: 13px;
}
.epd-item:hover { background: var(--surface); }
.epd-item.active { background: var(--brand-pale); }
.epd-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.epd-name { font-weight: 600; color: var(--ink); }
.epd-nit  { font-size: 10.5px; color: var(--ink3); }
.epd-all {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background .1s;
}
.epd-all:hover { background: var(--brand-pale); }

/* ── 19. BADGES & TAGS ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .2px;
}
.b-ok     { background: var(--ok-bg);     color: #15803D; }
.b-danger { background: var(--danger-bg); color: #B91C1C; }
.b-warn   { background: var(--warn-bg);   color: #92400E; }
.b-info   { background: var(--info-bg);   color: #1D4ED8; }
.b-gray   { background: var(--surface2);  color: var(--ink3); }
.b-purple { background: var(--purple-bg); color: #5B21B6; }
.b-teal   { background: var(--teal-bg);   color: #0E7490; }
.b-brand  { background: var(--brand-pale); color: var(--brand); }
.prog { display: flex; align-items: center; gap: 7px; min-width: 100px; }
.prog-bar { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.prog-lbl { font-size: 10.5px; color: var(--ink3); min-width: 28px; text-align: right; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag { background: var(--surface2); color: var(--ink3); padding: 2px 7px; border-radius: 20px; font-size: 10.5px; font-weight: 500; }
.tag-brand { background: var(--brand-pale); color: var(--brand); }
.ico-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 4px 7px;
  color: var(--ink3);
  font-size: 11.5px;
  transition: all .14s;
  line-height: 1;
  cursor: pointer;
}
.ico-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ── 20. CALENDAR ──────────────────────────────────────────── */
.cal-type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.caltab {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--ink3);
  transition: all .16s;
}
.caltab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.cal-month { font-family: 'DM Serif Display', serif; font-size: 22px; color: var(--ink); }
.cal-wrap  { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.cal-head-row { display: grid; grid-template-columns: repeat(7,1fr); background: var(--surface); border-bottom: 1px solid var(--border); }
.cal-dh { padding: 8px 0; text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink3); }
.cal-body { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell { min-height: 96px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--white); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other { background: var(--surface); opacity: .6; }
.cal-cell.today { background: #FFFAF7; }
.cal-num { font-size: 11.5px; font-weight: 600; color: var(--ink3); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin-bottom: 3px; }
.cal-cell.today .cal-num { background: var(--brand); color: #fff; }
.cal-ev { font-size: 9.5px; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; cursor: pointer; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; transition: opacity .14s; }
.cal-ev:hover { opacity: .82; }
.cal-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink3); }
.cl-dot  { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── 21. ORGANIGRAMA ───────────────────────────────────────── */
.org-wrap { overflow-x: auto; padding: 16px 0; }

/* ── 22. INTERCOMPAÑÍAS ────────────────────────────────────── */
.icomp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 12px; }
.icomp-node { background: var(--white); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 13px 16px; transition: all .16s; }
.icomp-node:hover { border-color: var(--brand); box-shadow: var(--sh); }
.icomp-node.matriz { border-color: var(--brand); background: var(--brand-pale); }
.icomp-nit  { font-size: 10.5px; color: var(--ink3); margin-bottom: 3px; }
.icomp-name { font-weight: 700; font-size: 13px; margin-bottom: 7px; }
.icomp-rel  { font-size: 11px; color: var(--ink3); display: flex; gap: 5px; align-items: flex-start; padding: 2px 0; }

/* ── 23. TIMELINE ──────────────────────────────────────────── */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; z-index: 1; border: 2px solid var(--white); }
.tl-body { flex: 1; }
.tl-h    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.tl-name { font-weight: 700; font-size: 12.5px; }
.tl-date { font-size: 10.5px; color: var(--ink3); }
.tl-txt  { font-size: 12px; color: var(--ink3); }

/* ── 24. TOAST ─────────────────────────────────────────────── */
#toasts {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 10px 15px;
  border-radius: var(--r);
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: var(--sh-lg);
  animation: tIn .2s var(--ease);
  pointer-events: all;
  max-width: 310px;
}
.toast.ok   { background: #15803D; }
.toast.err  { background: var(--danger); }
.toast.warn { background: var(--warn); }
@keyframes tIn { from { opacity:0; transform:translateY(8px) scale(.97); } to { opacity:1; transform:none; } }

/* ── 25. MISC HELPERS ──────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 32px; color: var(--ink3); font-size: 13px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: sp .6s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes sp { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 20px; color: var(--ink3); }
.empty-ic { font-size: 44px; opacity: .3; margin-bottom: 12px; }
.empty-t { font-family: 'DM Serif Display', serif; font-size: 16px; color: var(--ink2); margin-bottom: 6px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink3); margin-bottom: 8px; display: block; }
.color-palette { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid transparent; transition: all .16s; }
.swatch.on, .swatch:hover { border-color: var(--ink); transform: scale(1.15); }

/* ── 26. SCROLLBAR ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink3); }

/* ── 27. RESPONSIVE — sistema completo móvil/tablet/desktop ── */

/* ── Botón hamburguesa (solo visible en móvil) ─────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--r);
  color: var(--ink3);
  font-size: 20px;
  line-height: 1;
  transition: background .15s;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.hamburger:hover { background: var(--surface2); }

/* ── Overlay oscuro detrás del sidebar en móvil ────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ══ 1200px — tablet grande ════════════════════════════════ */
@media (max-width: 1200px) {
  .kpi-5 { grid-template-columns: repeat(3, 1fr); }
  .g3    { grid-template-columns: 1fr 1fr; }
}

/* ══ 1024px — tablet ════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .kpi-5 { grid-template-columns: repeat(2, 1fr); }
  .g3    { grid-template-columns: 1fr 1fr; }
  .content { padding: 20px 16px; }
}

/* ══ 900px — tablet pequeña / móvil grande ══════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 260px; }

  /* Sidebar oculto por defecto, desliza desde la izquierda */
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: translateX(0); }

  /* Main ocupa todo el ancho */
  .main { margin-left: 0 !important; }

  /* Botón hamburguesa visible */
  .hamburger { display: flex; }

  /* Topbar ajustes */
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .tp-left { flex: 1; min-width: 0; }
  .tp-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tp-sub   { display: none; }
  .tp-right { gap: 6px; flex-shrink: 0; }
  .week-chip { display: none; }

  /* Empresa selector compacto */
  .empresa-selector { max-width: 140px; }
  .emp-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

  /* Grids */
  .g2, .g2-eq, .g3 { grid-template-columns: 1fr; }
  .kpi-4, .kpi-5   { grid-template-columns: 1fr 1fr; }

  /* Drawer full-width */
  .drw { width: 100% !important; right: -100%; }
  .drw.open { right: 0; }

  /* Tablas con scroll horizontal */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }

  /* Formularios full width */
  .frow, .frow3, .frow4 { grid-template-columns: 1fr; }
  .fg { min-width: 0; }

  /* Modales full width */
  .modal { align-items: flex-end; }
  .modal-box {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  /* Login */
  .login-card { padding: 32px 24px; }

  /* Botones touch-friendly */
  .btn { min-height: 40px; padding: 8px 14px; }
  .ni  { min-height: 44px; padding: 10px 18px; }

  /* Content padding */
  .content { padding: 16px 12px; }
}

/* ══ 640px — móvil ══════════════════════════════════════════ */
@media (max-width: 640px) {
  .kpi-4, .kpi-5 { grid-template-columns: 1fr 1fr; }
  .frow, .frow3, .frow4 { grid-template-columns: 1fr; }

  /* KPI cards más compactas */
  .kpi { padding: 14px 12px; min-height: 80px; }
  .kpi-val { font-size: 26px; }

  /* Topbar ultra compacto */
  .tp-title { font-size: 14px; }
  .conn-dot { display: none; }

  /* Botones de acción */
  .btn-group { flex-wrap: wrap; gap: 6px; }
  .btn-group .btn { flex: 1; min-width: 120px; }

  /* Table acciones apiladas */
  .td-actions { display: flex; flex-wrap: wrap; gap: 4px; }

  /* Sección padding */
  .content { padding: 12px 10px; }

  /* Login */
  .login-card { margin: 16px; max-width: none; padding: 28px 20px; }
}

/* ══ 480px — móvil pequeño ══════════════════════════════════ */
@media (max-width: 480px) {
  .kpi-4, .kpi-5 { grid-template-columns: 1fr; }
  .kpi { padding: 12px; }

  /* Topbar mínimo */
  .topbar { padding: 0 10px; height: 52px; }

  /* Empresa selector oculto en pantallas muy pequeñas */
  .empresa-selector .emp-name { display: none; }

  /* Drawer full screen */
  .drw { height: 100vh; border-radius: 0; }
  .drw-header { padding: 16px; }

  /* Cards */
  .card { padding: 14px 12px; }
  .card h3 { font-size: 13px; }

  /* Tabla scroll */
  table { min-width: 500px; font-size: 12px; }
  th, td { padding: 8px 10px; }

  /* Modal bottom-sheet */
  .modal-box { padding: 20px 16px; }

  /* Login */
  .login-card { margin: 12px; padding: 24px 16px; }
  .login-title { font-size: 22px; }
}

/* ══ Print friendly ══════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .hamburger, .sidebar-overlay,
  .btn-group, .drw, .modal { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0; }
}

/* ── COLUMNAS ORDENABLES ───────────────────────────────────── */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
th.sortable:hover {
  background: var(--surface2);
  color: var(--brand);
}
th.sort-active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, transparent);
}
.sort-ic {
  font-size: 10px;
  opacity: .35;
  margin-left: 3px;
  vertical-align: middle;
  transition: opacity .12s;
}
.sort-ic-on {
  opacity: 1;
  color: var(--brand);
}

/* ── APP CONTAINER ─────────────────────────────────────────── */
#cf-app {
  display: flex;
  width: 100%;
  min-height: 100vh;
}
#cf-app[style*="display:none"],
#cf-app[style*="display: none"] {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════
   NIGC COMPATIBILITY LAYER — Estilos del modulo de empleados
   Importado desde NIGC Suite para Gestion Humana
   ══════════════════════════════════════════════════════════════ */

/* Variables NIGC mapeadas a ContaFlow */
:root {
  --or: #C8410A; --or2: #A83509; --or3: #FFF0E8; --or4: #ffd9b8;
  --nv: #2A2730; --nv2: #141217; --nv3: #3d3944; --nv4: #4a4654; --nv5: #f0eef3; --nv6: #d8d5de;
  --w: #fff; --g1: #F6F5F2; --g2: #E2E0DB; --g3: #625E6D; --g4: #2A2730; --g5: #141217; --tx: #141217;
  --gn: #16A34A; --gnb: #DCFCE7; --rd: #DC2626; --rdb: #FEE2E2;
  --go: #CA8A04; --gob: #FEF9C3; --pu: #7C3AED; --pub: #EDE9FE;
}

/* Page Header */
.page { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.page.show { display: flex; }
.ph { background: var(--w); border-bottom: 1px solid var(--g2); padding: 13px 26px; display: flex; align-items: center; gap: 13px; flex-shrink: 0; box-shadow: var(--sh); }
.phs { width: 4px; height: 36px; border-radius: 2px; background: var(--or); flex-shrink: 0; }
.phs.bl { background: var(--nv); } .phs.gn { background: var(--gn); }
.pht { font-family: 'Inter', sans-serif; font-size: 19px; font-weight: 800; color: var(--nv); letter-spacing: -.3px; line-height: 1.1; }
.phs2 { font-size: 11.5px; color: var(--g3); margin-top: 1px; }
.phsp { flex: 1; }
.btns { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

/* Buttons NIGC */
.btn { padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 5px; transition: .15s; white-space: nowrap; }
.btn.bg { background: var(--w); border: 1.5px solid var(--g2); color: var(--g4); }
.btn.bg:hover { border-color: var(--or); color: var(--or); }
.btn.bor { background: var(--or); color: #fff; font-weight: 700; }
.btn.bor:hover { background: var(--or2); }
.btn.bnv { background: var(--nv); color: #fff; }
.btn.bem { background: var(--nv); color: #fff; font-weight: 700; }
.bsm { padding: 5px 11px; font-size: 11.5px; }
.bxs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }

/* Content Area */
.ca { padding: 20px 26px; flex: 1; overflow-y: auto; min-height: 0; }

/* Grid Layouts */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }

/* Section Divider */
.sdiv { font-size: 11.5px; font-weight: 800; color: var(--g3); letter-spacing: 2px; text-transform: uppercase; padding-bottom: 8px; border-bottom: 2px solid var(--g2); margin-bottom: 15px; }

/* Cards NIGC */
.card { background: var(--w); border: 1px solid var(--g2); border-radius: 12px; margin-bottom: 14px; overflow: hidden; box-shadow: var(--sh); }
.chdr { padding: 12px 17px; border-bottom: 1px solid var(--g2); display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; transition: .12s; }
.chdr:hover { background: var(--g1); }
.chdr h3 { font-size: 14.5px; font-weight: 700; color: var(--nv); flex: 1; letter-spacing: -.2px; }
.cbdy { padding: 17px; }
.cbdy.hide { display: none; }
.cch { color: var(--g3); font-size: 10px; transition: .2s; }
.chdr.coll .cch { transform: rotate(-90deg); }

/* Stat Cards */
.sc { background: var(--w); border: 1px solid var(--g2); border-radius: 12px; padding: 17px 19px; box-shadow: var(--sh); position: relative; overflow: hidden; }
.sc::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--or); }
.sc.bl::before { background: var(--nv); } .sc.gn::before { background: var(--gn); } .sc.rd::before { background: var(--rd); }
.scv { font-size: 30px; font-weight: 800; color: var(--nv); line-height: 1; }
.scl { font-size: 11.5px; color: var(--g3); margin-top: 4px; font-weight: 500; }
.scd { font-size: 11px; font-weight: 600; margin-top: 7px; }
.du { color: var(--gn); } .dw { color: var(--rd); } .dn { color: var(--g3); }

/* Form Elements NIGC */
.fg { margin-bottom: 12px; }
.fg label { display: block; font-size: 10px; font-weight: 700; color: var(--g4); margin-bottom: 4px; letter-spacing: 1px; text-transform: uppercase; }
.fg label .req { color: var(--rd); }
.fi, .fs, .ft { width: 100%; border: 1.5px solid var(--g2); border-radius: 8px; padding: 8px 11px; font-size: 13px; color: var(--tx); background: var(--w); outline: none; transition: .2s; }
.fi:focus, .fs:focus, .ft:focus { border-color: var(--or); box-shadow: 0 0 0 3px rgba(200,65,10,.07); }
.fi::placeholder, .ft::placeholder { color: var(--g2); }
.ft { resize: vertical; min-height: 78px; line-height: 1.55; }
.sp { background: linear-gradient(to right, var(--nv5) 0%, var(--w) 100%); font-weight: 600; }
.sp:focus { background: var(--w); }

/* Tables NIGC */
.tw { overflow-x: auto; border-radius: 9px; border: 1px solid var(--g2); }
/* Tabla PRINCIPAL de empleados (no tablas internas del modal) */
#sec-gh_empleados > .sc > .cbdy table,
#sec-gh_empleados > .sc table,
#tb-empleados { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#tb-empleados tr { border-bottom: 1px solid var(--g2); }
#tb-empleados tr:last-child { border: none; }
#tb-empleados tr:hover { background: #fafbff; }
#tb-empleados td { padding: 8px 11px; vertical-align: middle; }

/* Header oscuro SOLO en la tabla principal de empleados */
#sec-gh_empleados .page-empleados > .sc thead tr,
table:has(> tbody#tb-empleados) thead tr { background: var(--nv); }
table:has(> tbody#tb-empleados) thead th { padding: 9px 11px; font-size: 11px; font-weight: 700; color: rgba(255,255,255,.6); text-align: left; letter-spacing: .8px; text-transform: uppercase; }

/* Tablas internas del modal de empleado (Docs Personales, CVs, Caps, etc.) */
#emp-modal table thead tr { background: var(--surface, #f1f5f9); }
#emp-modal table thead th { padding: 9px 11px; font-size: 11px; font-weight: 700; color: var(--nv, #1e3a5f); text-align: left; letter-spacing: .8px; text-transform: uppercase; }
.tc { border: none; background: transparent; font-size: 12.5px; color: var(--tx); width: 100%; outline: none; }
.tsel { border: none; background: transparent; font-size: 12.5px; color: var(--tx); outline: none; cursor: pointer; width: 100%; }
.tsel.sp { background: linear-gradient(to right, var(--nv5), var(--w)); font-weight: 600; }

/* Badges */
.bd { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.bok { background: var(--gnb); color: var(--gn); }
.bpd { background: var(--gob); color: #a06000; }
.brv { background: var(--nv5); color: var(--nv); }
.brd2 { background: var(--rdb); color: var(--rd); }

/* Tags */
.tag { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 4px; letter-spacing: .5px; text-transform: uppercase; }
.tor { background: rgba(200,65,10,.1); color: var(--or); }

/* Alerts */
.al { border-radius: 8px; padding: 10px 13px; font-size: 12.5px; margin-bottom: 14px; display: flex; gap: 9px; line-height: 1.5; }
.alw { background: var(--gob); border: 1px solid #fce0a0; color: #7a4800; }
.ali { background: var(--nv5); border: 1px solid var(--nv6); color: var(--nv2); }
.ale { background: var(--rdb); border: 1px solid #ffc4cb; color: #8b0020; }
.alor { background: var(--or3); border: 1px solid var(--or4); color: var(--or2); }

/* Employee Tab Buttons */
.emp-tab-btn { border: none; background: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--g3); border-bottom: 3px solid transparent; white-space: nowrap; padding: 10px 16px; transition: .15s; }
.emp-tab-btn:hover { color: var(--nv); background: var(--g1); }
.emp-tab-btn.on { color: var(--or); border-bottom-color: var(--or); background: var(--or3); font-weight: 700; }

/* Employee Tab Panels */
.emp-tab-panel { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Stat card orange variant */
.sc.or::before { background: var(--or); }

/* Required field marker */
.req { color: var(--rd); font-weight: 700; }

/* Additional form layout helpers from NIGC */
.fg select.fs { appearance: auto; background: var(--w); }
.fg textarea.fi { resize: vertical; min-height: 70px; }

/* Search input with icon */
.fi::placeholder { color: #bbb; }

/* Button colors for modal footer */
.btn.bg { background: var(--w); border: 1.5px solid var(--g2); color: var(--g4); }

/* Sub-tab content panels for documents */
.docs-sub-tab { display: none; }
.docs-sub-tab.active { display: block; }

/* File upload zone */
.upload-zone { border: 2px dashed var(--g2); border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; transition: .15s; }
.upload-zone:hover { border-color: var(--or); background: var(--or3); }

/* KPIs and evaluations inside modal */
#kpis-lista .kpi-item, #evaluaciones-lista .eval-item { background: var(--g1); border-radius: 8px; padding: 12px; margin-bottom: 8px; }

/* Modal overlay display fix */
#emp-modal[style*="display:flex"], #emp-import-modal[style*="display:flex"] {
  display: flex !important;
}

/* Employee Sector Labels */
.emp-sector-lbl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--g4); cursor: pointer; padding: 5px 8px; border-radius: 6px; transition: .12s; }
.emp-sector-lbl:hover { background: var(--g1); }
.emp-sector-lbl input { accent-color: var(--or); }

/* Document Sub-tabs */
.docs-tab-btn { border: none; background: none; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--g3); padding: 6px 12px; border-radius: 6px; white-space: nowrap; transition: .12s; }
.docs-tab-btn:hover { background: var(--g1); color: var(--nv); }
.docs-tab-btn.on { background: var(--or); color: #fff; }

/* Toast NIGC compat */
.toast-nigc { position: fixed; bottom: 20px; right: 20px; z-index: 99999; padding: 12px 20px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; background: var(--nv); box-shadow: 0 8px 30px rgba(0,0,0,.2); animation: toastIn .3s var(--ease); }

/* Import modal */
#emp-import-modal .import-card { background: var(--w); border-radius: 14px; width: min(600px, 95vw); padding: 24px; box-shadow: var(--sh-xl); }

/* Responsive NIGC compat */
@media (max-width: 768px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .ph { padding: 12px 18px; }
  .ca { padding: 14px 16px; }
  .emp-tab-btn { padding: 8px 10px; font-size: 11px; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr; }
  .g2 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   28. INDICADORES MODULE — Decision Engine Dashboards
══════════════════════════════════════════════════════════════ */

/* --- Loading --- */
.ind-loading { display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 0; }
.ind-spinner { width:36px;height:36px;border:3px solid var(--border);border-top-color:var(--brand);border-radius:50%;animation:indSpin .7s linear infinite; }
@keyframes indSpin { to { transform:rotate(360deg); } }
.ind-empty { text-align:center;padding:60px 20px;color:var(--ink3);font-size:14px; }
.ind-empty-sm { text-align:center;padding:24px;color:var(--ink3);font-size:13px; }

/* --- KPI Row --- */
.ind-kpi-row { display:grid;grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));gap:16px; }
.ind-kpi-card { background:var(--white);border-radius:14px;padding:18px 20px;display:flex;align-items:flex-start;gap:14px;box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);transition:box-shadow .2s,transform .2s;position:relative;overflow:hidden; }
.ind-kpi-card:hover { box-shadow:0 4px 16px rgba(0,0,0,.1);transform:translateY(-2px); }
.ind-kpi-compact { padding:14px 18px; }
.ind-kpi-icon { width:44px;height:44px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0; }
.ind-kpi-body { flex:1;min-width:0; }
.ind-kpi-label { font-size:12px;font-weight:600;color:var(--ink3);text-transform:uppercase;letter-spacing:.5px;margin-bottom:4px; }
.ind-kpi-value { font-size:28px;font-weight:800;color:var(--ink);line-height:1.1; }
.ind-kpi-sub { font-size:12px;color:var(--ink3);margin-top:4px;display:flex;align-items:center;gap:6px;flex-wrap:wrap; }
.ind-kpi-spark { position:absolute;right:16px;bottom:16px;width:60px;height:28px; }

/* --- Arrows --- */
.ind-arrow { font-size:11px;font-weight:700;padding:2px 6px;border-radius:6px;display:inline-flex;align-items:center;gap:2px; }
.ind-up { color:#059669;background:#ECFDF5; }
.ind-down { color:#DC2626;background:#FEF2F2; }
.ind-neutral { color:#6B7280;background:#F3F4F6; }

/* --- Budget bar --- */
.ind-budget-bar { position:absolute;bottom:0;left:0;right:0;height:4px;background:#E5E7EB;border-radius:0 0 14px 14px;overflow:hidden; }
.ind-budget-fill { height:100%;border-radius:0 0 14px 14px;transition:width .6s ease; }

/* --- Cards --- */
.ind-card { background:var(--white);border-radius:14px;padding:20px;box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04); }
.ind-card-header { margin-bottom:16px; }
.ind-card-title { font-size:15px;font-weight:700;color:var(--ink); }
.ind-card-sub { font-size:12px;color:var(--ink3);margin-top:2px; }
.ind-chart-wrap { height:240px;position:relative; }

/* --- Grid layouts --- */
.ind-grid-2 { display:grid;grid-template-columns:1fr 1fr;gap:16px; }
.ind-grid-sidebar { display:grid;grid-template-columns:auto 1fr;gap:16px; }

/* --- Tables --- */
.ind-table { width:100%;border-collapse:collapse;font-size:12.5px; }
.ind-table th { padding:10px 12px;text-align:left;font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--ink3);border-bottom:2px solid var(--border);background:var(--surface); }
.ind-table td { padding:10px 12px;border-bottom:1px solid var(--border); }
.ind-table tr:hover td { background:var(--surface); }

/* --- Semaforo --- */
.ind-semaforo-summary { display:flex;gap:16px;flex-wrap:wrap; }
.ind-sem-pill { display:flex;align-items:center;gap:10px;padding:16px 24px;border-radius:14px;min-width:160px;box-shadow:0 1px 3px rgba(0,0,0,.06); }
.ind-sem-verde    { background:#ECFDF5; }
.ind-sem-amarillo { background:#FFFBEB; }
.ind-sem-rojo     { background:#FEF2F2; }
.ind-sem-dot { width:14px;height:14px;border-radius:50%;flex-shrink:0;box-shadow:0 0 8px currentColor; }
.ind-sem-count { font-size:28px;font-weight:800;color:var(--ink); }
.ind-sem-label { font-size:12px;font-weight:600;color:var(--ink3);text-transform:uppercase;letter-spacing:.5px; }

.ind-dot { display:inline-block;width:12px;height:12px;border-radius:50%;box-shadow:0 0 6px currentColor; }

.ind-sem-row-rojo td { background:#FEF2F2 !important; }
.ind-sem-row-amarillo td { background:#FFFBEB !important; }

.ind-prog-bar { width:80px;height:6px;background:#E5E7EB;border-radius:3px;overflow:hidden;display:inline-block;vertical-align:middle;margin-right:6px; }
.ind-prog-fill { height:100%;border-radius:3px;transition:width .4s ease; }

.ind-state-badge { font-size:10.5px;font-weight:700;padding:3px 8px;border-radius:6px;background:var(--surface);color:var(--ink3);white-space:nowrap; }

/* --- Severity badges --- */
.ind-sev { font-size:10px;font-weight:800;padding:3px 8px;border-radius:6px;letter-spacing:.5px;white-space:nowrap; }
.ind-sev-alta  { background:#FEE2E2;color:#991B1B; }
.ind-sev-media { background:#FEF3C7;color:#92400E; }
.ind-sev-baja  { background:#F3F4F6;color:#374151; }

/* --- Risk list --- */
.ind-risk-list { display:flex;flex-direction:column;gap:0; }
.ind-risk-item { display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border); }
.ind-risk-item:last-child { border-bottom:none; }
.ind-risk-rank { width:28px;height:28px;border-radius:50%;background:var(--surface);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800;color:var(--ink3);flex-shrink:0; }
.ind-risk-body { flex:1;min-width:0; }
.ind-risk-name { font-size:13px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.ind-risk-project { font-size:11px;color:var(--ink3); }
.ind-risk-level { font-size:10px;font-weight:800;padding:3px 8px;border-radius:6px;letter-spacing:.5px;flex-shrink:0; }
.ind-risk-critico { background:#FEE2E2;color:#991B1B; }
.ind-risk-alto    { background:#FEF3C7;color:#92400E; }
.ind-risk-medio   { background:#E0F2FE;color:#0369A1; }
.ind-risk-bajo    { background:#F3F4F6;color:#374151; }

/* --- Alertas --- */
.ind-alertas-summary { display:flex;gap:20px;flex-wrap:wrap;margin-bottom:20px; }
.ind-alerta-stat { background:var(--white);border-radius:14px;padding:20px 28px;box-shadow:0 1px 3px rgba(0,0,0,.06);text-align:center;min-width:140px; }
.ind-alerta-stat-num { font-size:36px;font-weight:800;line-height:1; }
.ind-alerta-stat-label { font-size:12px;font-weight:600;color:var(--ink3);margin-top:6px;text-transform:uppercase;letter-spacing:.5px; }

.ind-tipo-pills { display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px; }
.ind-tipo-pill { display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:10px;border:1px solid var(--border);background:var(--white);cursor:pointer;font-size:12px;font-weight:600;color:var(--ink3);transition:all .2s; }
.ind-tipo-pill:hover { border-color:var(--brand);color:var(--brand); }
.ind-tipo-active { background:var(--brand) !important;color:#fff !important;border-color:var(--brand) !important; }
.ind-tipo-cnt { font-size:10px;font-weight:800;background:rgba(0,0,0,.1);padding:1px 5px;border-radius:4px; }
.ind-tipo-active .ind-tipo-cnt { background:rgba(255,255,255,.25); }

.ind-alertas-list { display:flex;flex-direction:column;gap:12px; }
.ind-alert-card { display:flex;align-items:flex-start;gap:14px;padding:16px 20px;background:var(--white);border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.06);transition:box-shadow .2s; }
.ind-alert-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.1); }
.ind-alert-icon { font-size:24px;flex-shrink:0;margin-top:2px; }
.ind-alert-body { flex:1;min-width:0; }
.ind-alert-title { font-size:14px;font-weight:700;color:var(--ink);margin-bottom:4px; }
.ind-alert-detail { font-size:12.5px;color:var(--ink3);line-height:1.5; }
.ind-alert-meta { font-size:11px;color:var(--ink3);margin-top:6px;font-style:italic; }
.ind-alert-sev { flex-shrink:0;margin-top:2px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .ind-grid-2 { grid-template-columns:1fr; }
  .ind-grid-sidebar { grid-template-columns:1fr; }
  .ind-kpi-row { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
  .ind-kpi-row { grid-template-columns:1fr 1fr; }
  .ind-semaforo-summary { flex-direction:column; }
  .ind-alertas-summary { flex-direction:column; }
  .ind-kpi-value { font-size:22px; }
}
