/* =========================================================
   RDS · estilos (oscuro por defecto + claro)
   ========================================================= */
:root,
[data-theme="dark"] {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* más separación entre fondo, tarjetas y lo que va dentro de las tarjetas */
  --bg: #0C0D11;
  --surface: #191B22;
  --surface-2: #22242D;
  --surface-3: #2C2F39;
  --line: #2E313B;
  --line-2: #3A3D49;
  --text: #ECEDF1;
  --muted: #9A9CA8;
  --faint: #6F7280;

  --accent: #5B84F7;
  --accent-2: #3D63DA;
  --accent-text: #FFFFFF;
  --accent-soft: rgba(91, 132, 247, .14);

  --ok: #3CC98F;   --ok-soft: rgba(60, 201, 143, .13);
  --warn: #F0B44C; --warn-soft: rgba(240, 180, 76, .13);
  --err: #F2706A;  --err-soft: rgba(242, 112, 106, .13);

  --sb-bg: #16171C;
  --sb-text: #C9CBD3;
  --sb-muted: #6F7280;
  --sb-hover: #1E1F25;
  --sb-active: #26272F;
  --sb-line: #25262D;

  --shadow-pop: 0 16px 48px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  --glow: .22;
  color-scheme: dark;

  --r-md: 10px;
  --r-lg: 14px;
  --sb-w: 250px;
  --sb-w-min: 72px;
  --top-h: 60px;
}

[data-theme="light"] {
  --bg: #E7EBF1;
  --surface: #FFFFFF;
  --surface-2: #F6F7FB;
  --surface-3: #EBEEF5;
  --line: #E1E5EE;
  --line-2: #CFD5E2;
  --text: #141826;
  --muted: #5B6275;
  --faint: #8C93A6;

  --accent: #3D6AE8;
  --accent-2: #2C53C9;
  --accent-soft: rgba(61, 106, 232, .1);

  --ok: #16865A;   --ok-soft: #E3F4EC;
  --warn: #A96A0C; --warn-soft: #FBF0DC;
  --err: #C8392F;  --err-soft: #FBE7E5;

  /* menú lateral blanco, separado del fondo gris */
  --sb-bg: #FFFFFF;
  --sb-text: #3F4A5C;
  --sb-muted: #6B7488;
  --sb-hover: #F1F4F9;
  --sb-active: rgba(61, 106, 232, .1);
  --sb-line: #E1E5EE;

  --shadow-pop: 0 16px 48px rgba(20, 24, 40, .16), 0 2px 6px rgba(20, 24, 40, .06);
  --glow: .1;
  color-scheme: light;
}

/* ---------- tema claro: menú, barra superior y pestañas en blanco, contenido sobre gris ---------- */
[data-theme="light"] .sidebar { border-right-color: #D5DBE5; box-shadow: 4px 0 18px -10px rgba(15,23,42,.14); }
[data-theme="light"] .sb-link.is-active { color: var(--accent-2); box-shadow: inset 3px 0 0 var(--accent); }
[data-theme="light"] .sb-link.is-active .ico { color: var(--accent); }
[data-theme="light"] .sb-text-tip, [data-theme="light"] .sb-tip { background: #1B2032; color: #fff; }
[data-theme="light"] .topbar { background: #FFFFFF; border-bottom: 1px solid #D5DBE5; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-theme="light"] .subnav { background: #FFFFFF; border-bottom-color: #D5DBE5; }

/* opción C: contenido claro, cards blancas con borde y encabezado blanco compacto */
[data-theme="light"] .panel { border-color: #D5DBE5; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
[data-theme="light"] .toolbar-card { border-color: #D5DBE5; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
[data-theme="light"] .table th { background: #EEF1F7; color: #3D4356; }
[data-theme="light"] .table th.dt-ordenable:hover { color: #141826; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.25; margin: 0; }
a { color: var(--accent); }
code { font-size: .88em; background: var(--surface-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.ico { width: 19px; height: 19px; flex: none; }

/* ---------- baldosas de ícono ---------- */
.tile {
  --c1: #5B84F7; --c2: #3D63DA;
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  box-shadow: 0 8px 18px -8px var(--c2), inset 0 1px 0 rgba(255,255,255,.18);
}
.tile .ico { width: 20px; height: 20px; }
.tile.lg { width: 52px; height: 52px; border-radius: 14px; }
.tile.lg .ico { width: 24px; height: 24px; }
.tile.sm { width: 32px; height: 32px; border-radius: 9px; }
.tile.sm .ico { width: 16px; height: 16px; }
.t-azul    { --c1: #6A90FA; --c2: #3D63DA; }
.t-verde   { --c1: #37C98C; --c2: #178A5E; }
.t-ambar   { --c1: #F4B04A; --c2: #D07F10; }
.t-violeta { --c1: #9B7BF7; --c2: #6B48DB; }
.t-rojo    { --c1: #F27469; --c2: #CC3B32; }
.t-cian    { --c1: #3EC5D8; --c2: #1690A8; }

/* ---------- estructura ---------- */
.main { min-height: 100vh; display: flex; flex-direction: column; margin-left: var(--sb-w); transition: margin-left .2s ease; }
.content { width: 100%; max-width: none; margin: 0; padding: 22px 26px 56px; outline: none; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
  width: var(--sb-w); display: flex; flex-direction: column;
  background: var(--sb-bg); border-right: 1px solid var(--sb-line); color: var(--sb-text);
  transition: width .2s ease, transform .25s ease;
}
.sb-brand { height: var(--top-h); display: flex; align-items: center; gap: 11px; padding: 0 12px 0 16px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, #6A90FA, #3D63DA);
  box-shadow: 0 8px 18px -8px #3D63DA;
}
.brand-mark svg { width: 22px; height: 22px; }
.sb-brand-text { min-width: 0; flex: 1; line-height: 1.2; }
.sb-brand-text strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: .01em; color: var(--text); }
.sb-brand-text small { color: var(--sb-muted); font-size: 11.5px; white-space: nowrap; }

.sb-btn {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--sb-line); border-radius: 8px; background: var(--surface-2);
  color: var(--sb-muted); cursor: pointer; text-decoration: none;
}
.sb-btn:hover { color: var(--text); border-color: var(--line-2); }
.sb-btn .ico { width: 16px; height: 16px; }
.sb-close { display: none; }

.sb-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 16px; border-top: 1px solid var(--sb-line); scrollbar-width: thin; scrollbar-color: var(--sb-line) transparent; }
.sb-section {
  margin: 18px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sb-muted);
}
.sb-link {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-height: 38px; padding: 7px 10px; margin: 1px 0; border-radius: 9px;
  color: var(--sb-text); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: background .15s, color .15s;
}
.sb-link .ico { color: var(--sb-muted); transition: color .15s; }
.sb-link:hover { background: var(--sb-hover); color: var(--text); }
.sb-link:hover .ico { color: var(--text); }
.sb-link.is-active { background: var(--sb-active); color: var(--text); font-weight: 800; }
.sb-link.is-active .ico { color: var(--accent); }
.sb-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sb-user { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 14px; border-top: 1px solid var(--sb-line); }
.sb-user-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 10px; padding: 4px; margin: -4px; }
.sb-user-info:hover { background: var(--sb-hover); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff;
  background: linear-gradient(150deg, #6A90FA, #3D63DA);
}
.sb-user-txt { min-width: 0; line-height: 1.25; }
.sb-user-txt strong { display: block; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-txt small { display: block; color: var(--sb-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.theme-switch { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--sb-line); }
.theme-switch button {
  width: 28px; height: 26px; display: grid; place-items: center; border: 1px solid transparent;
  border-radius: 7px; background: none; color: var(--sb-muted); cursor: pointer;
}
.theme-switch .ico { width: 15px; height: 15px; }
[data-theme="dark"] .theme-switch [data-tema="dark"],
.sb-logout { background: none; border-color: transparent; }

.sb-overlay { display: none; }

/* --- menú achicado (escritorio) --- */
@media (min-width: 901px) {
  .menu-colapsado .sidebar { width: var(--sb-w-min); }
  .menu-colapsado .main { margin-left: var(--sb-w-min); }
  .menu-colapsado .sb-brand { flex-direction: column; justify-content: center; gap: 0; padding: 0; position: relative; }
  .menu-colapsado .sb-brand-text,
  .menu-colapsado .sb-text,
  .menu-colapsado .sb-user-txt,
  .menu-colapsado .theme-switch { display: none; }
  .menu-colapsado .sb-collapse { position: absolute; right: -15px; top: 17px; z-index: 2; }
  .menu-colapsado .sb-collapse .ico { transform: scaleX(-1); }
  .menu-colapsado .sb-section { margin: 14px 12px 6px; height: 1px; background: var(--sb-line); }
  .menu-colapsado .sb-section span { display: none; }
  .menu-colapsado .sb-link { justify-content: center; padding: 7px; }
  .menu-colapsado .sb-user { flex-direction: column; gap: 10px; }
  .menu-colapsado .sb-user-info { flex: none; margin: 0; }

}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em; padding-left: 12px; position: relative; }
.page-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 3px; background: var(--accent); }
.page-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-grupo { color: var(--muted); font-weight: 600; }
.page-grupo::after { content: "/"; margin-left: 8px; color: var(--faint); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.topbar-menu { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: 9px; min-width: 210px; height: 36px; padding: 0 6px 0 11px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer;
}
.search-trigger:hover { border-color: var(--line-2); color: var(--text); }
.search-trigger .ico { width: 16px; height: 16px; }
.search-trigger span { flex: 1; text-align: left; }
kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
}

/* ---------- botones / formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: filter .15s, border-color .15s, background .15s;
}
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 8px 20px -10px var(--accent-2); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--line-2); background: var(--surface-2); }
.btn-block { width: 100%; }
.link { font-size: 13px; font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; height: 42px; padding: 0 13px; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.alert .ico { width: 18px; height: 18px; margin-top: 1px; }
.alert.err { background: var(--err-soft); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.info { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
  font-size: 12.5px; font-weight: 700;
}
.chip .ico { width: 14px; height: 14px; }

/* ---------- paneles ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.panel.acento { border-left: 3px solid var(--c, var(--ok)); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.panel-head .small { font-size: 12px; }
.panel-head .tile.sm { width: 26px; height: 26px; border-radius: 8px; box-shadow: none; }
.panel-head .tile.sm .ico { width: 14px; height: 14px; }
.h3-sub { font-weight: 600; color: var(--muted); }
.panel-head-filtros { flex-wrap: wrap; }
.filtro-alcance select { min-width: 200px; }
.filtro-alcance .combo { min-width: 220px; }
.filtro-alcance .combo-input { height: 38px; font-weight: 700; }
.alcance-activo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.alcance-en-panel { margin: 0; }
.chip-quitar { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 8px 4px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--accent-2); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.chip-quitar b { font-weight: 800; }
.chip-quitar > span[aria-hidden] { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; font-size: 11px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chip-quitar:hover > span[aria-hidden] { background: var(--accent); color: #fff; }
[data-theme="dark"] .chip-quitar { color: #C9D6FF; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 600px) { .filtro-alcance, .filtro-alcance label { width: 100%; } .filtro-alcance label .combo, .filtro-alcance label select { flex: 1; min-width: 0; } }
.panel-body { padding: 20px; }

.table-wrap { overflow-x: auto; }
.table { width: auto; min-width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 11px 20px; white-space: nowrap; background: var(--surface-2);
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
.table td { padding: 12px 20px; border-top: 1px solid var(--line); white-space: nowrap; }
.table tbody tr:hover td { background: var(--surface-2); }

/* ---------- hero (siempre oscuro, como encabezado de sección) ---------- */
.hero {
  position: relative; overflow: hidden; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 28px 32px; border-radius: 16px; color: #ECEDF1;
  background:
    radial-gradient(600px 240px at 78% 0%, rgba(91,132,247,.20), transparent 70%),
    radial-gradient(420px 200px at 100% 100%, rgba(155,123,247,.12), transparent 70%),
    #14151B;
  border: 1px solid #262731;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 75%); mask-image: linear-gradient(90deg, #000, transparent 75%);
}
.hero > * { position: relative; }
.hero-main { display: flex; align-items: flex-start; gap: 16px; max-width: 560px; }
.hero h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 6px 0 0; color: #A7A9B6; font-size: 14.5px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn {
  display: flex; flex-direction: column; gap: 2px; min-width: 170px; padding: 11px 16px;
  border-radius: 11px; text-decoration: none; color: #ECEDF1;
  border: 1px solid #33343F; background: rgba(255,255,255,.03); transition: border-color .15s, background .15s;
}
.hero-btn:hover { border-color: #4A4B58; background: rgba(255,255,255,.06); }
.hero-btn strong { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.hero-btn strong .ico { width: 16px; height: 16px; }
.hero-btn small { color: #8F92A0; font-size: 12px; padding-left: 24px; }
.hero-btn.primary { background: linear-gradient(150deg, #6A90FA, #3D63DA); border-color: transparent; box-shadow: 0 10px 24px -12px #3D63DA; }
.hero-btn.primary small { color: rgba(255,255,255,.8); }
.hero-btn.verde { border-color: rgba(55,201,140,.4); background: rgba(55,201,140,.07); }
.hero-btn.verde strong { color: #4ED39B; }
.hero-btn.verde small { color: #7FBFA3; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  --c: #5B84F7;
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  padding: 20px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
}
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--c), transparent); }
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -50px; width: 170px; height: 150px; pointer-events: none;
  background: radial-gradient(closest-side, var(--c), transparent); opacity: var(--glow);
}
.kpi > * { position: relative; z-index: 1; }
.kpi b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.k-azul { --c: #5B84F7; } .kpi.k-verde { --c: #37C98C; } .kpi.k-ambar { --c: #F4B04A; }
.kpi.k-violeta { --c: #9B7BF7; } .kpi.k-rojo { --c: #F27469; } .kpi.k-cian { --c: #3EC5D8; }

/* ---------- accesos directos ---------- */
.block { margin-bottom: 16px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.block-head h3 { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.shortcut {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line); color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.shortcut:hover { border-color: var(--line-2); background: var(--surface-2); transform: translateY(-1px); }
.shortcut strong { display: block; font-size: 14.5px; }
.shortcut small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.shortcut small.grp { margin: 0 0 1px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }

/* ---------- mi cuenta ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1.2fr; gap: 16px; align-items: start; }
.datos { margin: 0; padding: 6px 20px 12px; }
.datos div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.datos div:first-child { border-top: 0; }
.datos dt { color: var(--muted); font-size: 13.5px; }
.datos dd { margin: 0; font-weight: 700; text-align: right; }

/* ---------- vacío / sin acceso ---------- */
.empty { max-width: 520px; margin: 56px auto; text-align: center; }
.empty .tile { margin: 0 auto 18px; }
.empty h2 { font-size: 21px; font-weight: 800; }
.empty p { color: var(--muted); margin: 10px 0 0; }
.empty .btn { margin-top: 22px; }

/* ---------- buscador rápido (Ctrl K) ---------- */
.cmdk { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(5, 6, 10, .55); backdrop-filter: blur(3px); }
.cmdk-panel { width: 100%; max-width: 560px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-pop); animation: cmdk-in .16s ease-out; }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.cmdk-input .ico { color: var(--muted); }
.cmdk-input input { flex: 1; height: 54px; border: 0; background: none; font: inherit; font-size: 15.5px; color: var(--text); outline: none; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.cmdk-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.cmdk-list li small { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.cmdk-list li.is-sel { background: var(--accent-soft); color: var(--accent); }
.cmdk-list li.cmdk-vacio { color: var(--muted); font-weight: 500; cursor: default; }

/* ---------- aviso flotante ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 40px); padding: 12px 16px; border-radius: 12px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2);
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-pop); animation: toast-in .25s ease-out;
}
.toast .ico { width: 18px; height: 18px; }
.toast-ok .ico { color: var(--ok); }
.toast-err .ico { color: var(--err); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .main { margin-left: 0; }
  .sidebar { width: min(86vw, 290px); transform: translateX(-100%); }
  .app.is-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .sb-collapse { display: none; }
  .sb-close { display: grid; }
  .sb-link { min-height: 44px; }
  .sb-overlay {
    display: block; position: fixed; inset: 0; z-index: 45; background: rgba(5, 6, 10, .55);
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .app.is-open .sb-overlay { opacity: 1; pointer-events: auto; }

  .topbar { padding: 0 10px; gap: 4px; }
  .topbar-menu { display: grid; }
  .page-grupo { display: none; }
  .search-trigger { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: none; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger .ico { width: 19px; height: 19px; }
  .content { padding: 14px 12px 40px; }

  .hero { padding: 22px 20px; }
  .hero h2 { font-size: 22px; }
  .hero-actions { width: 100%; }
  .hero-btn { flex: 1 1 150px; min-width: 0; }
}

@media (max-width: 600px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi b { font-size: 24px; }
  .kpi .tile { width: 36px; height: 36px; border-radius: 10px; }
  .shortcuts { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel-head { padding: 10px 14px; }
  .hero-main .tile.lg { display: none; }
  .cmdk { padding-top: 8vh; }

  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 16px; border-top: 1px solid var(--line); }
  .table tbody tr:first-child { border-top: 0; }
  .table td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; white-space: normal; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; }
  .table td[colspan]::before { content: none; }
  .table tbody tr:hover td { background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Módulo operativo
   ========================================================= */
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert a { color: inherit; font-weight: 800; }
.bloque { margin-bottom: 14px; }
.wrap { white-space: normal !important; }
.badge:not(.ok):not(.err):not(.warn) { background: var(--surface-3); color: var(--muted); }
.link.volver { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); }
.link.volver .ico { width: 16px; height: 16px; }
.lista-simple { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 800; }

/* toolbar / filtros */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 16px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline label { color: var(--muted); }
.field.grow { flex: 1; min-width: 180px; }
.field.inline select, .field.inline input { height: 38px; }
.toolbar .btn { height: 38px; margin-left: auto; }
.toolbar .chip { margin-left: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.acciones { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline-flex; margin: 0; }
.inline-form select { height: 34px; padding: 0 10px; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; max-width: 240px; }
select { color: var(--text); }
.toolbar select, .panel-head select { height: 38px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; width: fit-content; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13.5px; }
.tabs a.is-active { background: var(--surface-3); color: var(--text); }

/* hero compacto */
.hero-compacto { padding: 22px 26px; }
.hero-compacto h2 { font-size: 21px; }
.hero-total { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.hero-total small { color: #8F92A0; font-size: 12.5px; }
.hero-total strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

/* importar: tarjetas de fuente */
.fuentes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fuente input { position: absolute; opacity: 0; pointer-events: none; }
.fuente-card {
  display: flex; align-items: center; gap: 12px; padding: 14px; height: 100%; cursor: pointer;
  border-radius: 13px; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.fuente-card strong { display: block; font-size: 14.5px; }
.fuente-card small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.fuente-card:hover { border-color: var(--line-2); }
.fuente input:checked + .fuente-card { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.fuente input:focus-visible + .fuente-card { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 42px; padding: 10px 14px;
  border: 1.5px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-weight: 600; cursor: pointer; text-align: center;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.con-archivo { border-color: var(--accent); color: var(--accent); }
.ayuda-fuente { display: flex; gap: 6px; align-items: flex-start; margin-top: 12px; }
.ayuda-fuente .ico { width: 15px; height: 15px; margin-top: 2px; }
.import-form .panel-body .acciones { margin-top: 16px; }
.table-wrap.alto { max-height: 420px; overflow-y: auto; }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn.is-loading { opacity: .8; }

/* calendario de días */
.cal { border-collapse: separate; border-spacing: 3px; font-size: 12px; padding: 10px 14px; }
.cal th { font-weight: 700; color: var(--muted); padding: 2px; min-width: 30px; text-align: center; line-height: 1.2; }
.cal th small { display: block; font-size: 10.5px; font-weight: 600; color: var(--faint); }
.cal thead th:first-child, .cal tbody th { text-align: left; min-width: 150px; }
.cal th.es-dom { color: var(--faint); }
.cal-fuente { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; white-space: nowrap; }
.cal td { height: 34px; border-radius: 7px; text-align: center; font-weight: 700; font-size: 11px; }
.cal td a, .cal td span { display: grid; place-items: center; width: 100%; height: 100%; color: inherit; text-decoration: none; }
.cal .c-ok { background: var(--ok-soft); color: var(--ok); }
.cal .c-falta { background: var(--err-soft); color: var(--err); }
.cal .c-falta a:hover { outline: 2px solid var(--err); border-radius: 7px; }
.cal .c-dom { background: var(--surface-2); }
.cal .c-fut { background: transparent; border: 1px dashed var(--line); }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-left: auto; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.dot.ok { background: var(--ok); } .dot.falta { background: var(--err); } .dot.dom { background: var(--surface-3); } .dot.fut { border: 1px dashed var(--line-2); }

/* tablas numéricas */
.table.num td:not(:first-child), .table.num th:not(:first-child) { text-align: right; }
.table tfoot th { text-align: left; padding: 12px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); font-size: 13.5px; text-transform: none; letter-spacing: 0; color: var(--text); }
.table.num tfoot th:not(:first-child) { text-align: right; }
.table tr.inactivo td { opacity: .55; }
.table tr.fila-alerta td { background: var(--warn-soft); }
.table tr.fila-premio td { background: var(--ok-soft); }
.table tr.clickable { cursor: pointer; }
.table td a { color: var(--text); font-weight: 700; text-decoration: none; }
.table td a:hover { color: var(--accent); }
.persona { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

/* switch */
.switch { position: relative; width: 38px; height: 22px; border: 0; border-radius: 999px; background: var(--surface-3); cursor: pointer; padding: 0; transition: background .15s; }
.switch span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(16px); }

/* KPIs de operatoria */
.kpis-op { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-op { flex-direction: column; align-items: stretch; gap: 4px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.kpi-op > span { font-size: 12.5px; }
.barra { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.barra i { display: block; height: 100%; border-radius: 999px; background: var(--c); }

/* liquidación */
.datos.calc .total { border-top: 1px solid var(--line-2); }
.datos.calc .total dt, .datos.calc .total dd { color: var(--text); font-weight: 800; font-size: 15px; }
.ajuste-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ajuste-form .field { min-width: 140px; }
.ajuste-form .field input, .ajuste-form .field select { height: 40px; }
.ajuste-form .btn { height: 40px; }

/* reglas */
.reglas .panel-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.regla { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.regla strong { font-size: 14px; }
.regla p { margin: 6px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.regla code { display: block; white-space: normal; font-size: 12px; }

@media (max-width: 1100px) {
  .fuentes, .kpis-op { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reglas .panel-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .fuentes, .reglas .panel-body { grid-template-columns: 1fr; }
  .hero-total { align-items: flex-start; text-align: left; }
  .toolbar .btn, .toolbar .chip { margin-left: 0; }
  .leyenda { margin-left: 0; }
  .ajuste-form .field { min-width: 100%; }
  .cal td, .cal th { min-width: 28px; }
}
.inline-form button.badge { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.dropzone.grande { flex-direction: column; gap: 10px; min-height: 220px; padding: 30px 20px; border-radius: 16px; background: var(--surface); margin-bottom: 14px; }
.dropzone.grande strong { font-size: 16px; color: var(--text); }
.dropzone.grande small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.dropzone.sobre { border-color: var(--accent); background: var(--accent-soft); }
.cal button.celda { display: grid; place-items: center; width: 100%; height: 100%; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 7px; }
.cal button.celda:hover { outline: 2px solid var(--ok); }
button.link { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--err); text-decoration: underline; }
.toolbar .saludo { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin-right: auto; }
.tabs.sin-margen { margin: 0; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pie-panel { padding: 0 20px 16px; }
@media (max-width: 1100px) { .kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .kpis-5 { grid-template-columns: 1fr 1fr; } .toolbar .saludo { width: 100%; } }
.permisos td:nth-child(2), .permisos td:nth-child(3), .permisos th:nth-child(2), .permisos th:nth-child(3) { width: 110px; text-align: center; }
.permisos .recordar { justify-content: center; }
.permisos .recordar input { position: absolute; opacity: 0; }
.permisos .recordar .sw { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); display: inline-block; }
.permisos .recordar .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .18s; }
.permisos .recordar input:checked + .sw { background: var(--accent); border-color: var(--accent); }
.permisos .recordar input:checked + .sw::after { transform: translateX(16px); }
.permisos .recordar input:disabled + .sw { opacity: .5; }
.permisos .recordar input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.table tr.fila-grupo td { background: var(--surface-2); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 20px; }
@media (max-width: 600px) { .permisos td:nth-child(2), .permisos td:nth-child(3) { width: 100%; } .permisos .recordar { justify-content: flex-end; } }

/* formulario de una columna */
.form-simple { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.form-simple .link.volver { margin-bottom: 0; }
.form-simple.form-ancho { max-width: 1180px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .form-cols { grid-template-columns: 1fr; } }
.panel-head-campo { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.panel-head-campo .campo-cabecera { width: 180px; margin: 0; }
.panel-head-campo .campo-cabecera label { font-size: 11px; margin-bottom: 4px; }
.panel-head-campo .campo-cabecera input { height: 32px; font-size: 13px; }
@media (max-width: 560px) { .panel-head-campo .campo-cabecera { width: 100%; } }
.form-pie { padding-top: 4px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.clave-wrap { position: relative; }
.clave-wrap input { padding-right: 46px; }
.clave-wrap .ver-clave { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.clave-wrap .ver-clave:hover { color: var(--text); background: var(--surface-3); }
.clave-wrap .ver-clave .ico { width: 17px; height: 17px; }
.clave-lista { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn.mini { width: 30px; height: 30px; }
.icon-btn.mini .ico { width: 16px; height: 16px; }
.field input:disabled { opacity: .7; }
@media (max-width: 700px) { .grid-3 { grid-template-columns: 1fr; } }

/* ---------- modal de progreso ---------- */
.prog-fondo { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 10, .55); backdrop-filter: blur(2px); }
.prog-caja { width: 100%; max-width: 380px; padding: 18px 20px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.prog-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.prog-cab strong { font-size: 15px; font-weight: 800; }
.prog-pct { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-barra { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-bottom: 16px; }
.prog-barra i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #9B7BF7); transition: width .35s ease; }
.indeterminado .prog-barra i { width: 35%; animation: prog-ida 1.3s ease-in-out infinite; }
@keyframes prog-ida { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.prog-pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.prog-pasos li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; font-weight: 600; color: var(--faint); }
.prog-txt { display: flex; flex-direction: column; min-width: 0; }
.prog-txt small { font-size: 12px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.prog-ico { width: 16px; height: 16px; flex: none; margin-top: 2px; display: grid; place-items: center; }
.prog-pasos li.pendiente .prog-ico::before { content: ""; width: 8px; height: 2px; border-radius: 2px; background: var(--faint); }
.prog-pasos li.hecho { color: var(--ok); }
.prog-pasos li.hecho .prog-ico::before { content: ""; width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.prog-pasos li.activo { color: var(--accent); }
.prog-pasos li.activo .prog-ico::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: girar .8s linear infinite; }
.prog-pasos li.error { color: var(--err); }
.prog-pasos li.error .prog-ico::before { content: "!"; font-weight: 800; font-size: 13px; }
.prog-pie { margin-top: 14px; font-size: 12px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.prog-acciones { display: flex; justify-content: flex-end; }
.prog-acciones:not(:empty) { margin-top: 12px; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .prog-pasos li.activo .prog-ico::before, .indeterminado .prog-barra i { animation-duration: 2s !important; } }

/* ---------- confirmación propia ---------- */
.conf-fondo { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 10, .55); backdrop-filter: blur(2px); animation: conf-in .15s ease-out; }
.conf-caja { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 22px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.conf-caja .tile { margin-bottom: 6px; }
.conf-caja h3 { font-size: 17px; font-weight: 800; }
.conf-texto { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.conf-detalle { font-size: 13px; color: var(--muted); line-height: 1.5; }
.conf-acciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 12px; }
.conf-acciones .btn { height: 42px; }
.btn-peligro { background: linear-gradient(150deg, #F27469, #CC3B32); color: #fff; box-shadow: 0 8px 20px -10px #CC3B32; }
.btn-peligro:hover { filter: brightness(1.08); }
@keyframes conf-in { from { opacity: 0; } }

/* ---------- alertas ---------- */
.sb-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: #E5484D; color: #fff; font-size: 11px; font-weight: 800; flex: none; }
@media (min-width: 901px) {
  .menu-colapsado .sb-badge { position: absolute; top: 4px; right: 10px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
}
.pill.rojo { background: rgba(229, 72, 77, .16); color: #F2706A; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-right: auto; }
.chips a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.chips a.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.alertas-lista { display: flex; flex-direction: column; gap: 12px; }
.alerta-card { display: flex; gap: 14px; padding: 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 80px; transition: border-color .2s; }
.alerta-card.no-leida { border-left: 3px solid var(--accent); }
.alerta-card.leida { opacity: .82; }
.alerta-card.resuelta { opacity: .7; }
.alerta-card.foco { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.alerta-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.alerta-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.alerta-top h3 { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.alerta-top .punto { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.alerta-det { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.que-hacer { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.que-hacer strong { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.que-hacer strong .ico { width: 14px; height: 14px; }
.que-hacer p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; }
.alerta-acc { display: flex; gap: 8px; flex-wrap: wrap; }

/* notificaciones al costado */
.notifs { position: fixed; top: 76px; right: 18px; z-index: 96; width: min(360px, calc(100vw - 36px)); display: flex; flex-direction: column; gap: 10px; }
.notif { position: relative; display: flex; gap: 12px; padding: 14px 38px 14px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: notif-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.notif-cuerpo { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-cuerpo strong { font-size: 14px; font-weight: 800; line-height: 1.3; }
.notif-cuerpo p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.notif-ver { font-size: 13px; font-weight: 800; text-decoration: none; margin-top: 2px; }
.notif-ver:hover { text-decoration: underline; }
.notif-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.notif-x:hover { background: var(--surface-3); color: var(--text); }
.notif-x .ico { width: 14px; height: 14px; }
.notif-mas { align-self: flex-end; font-size: 12.5px; font-weight: 700; }
@keyframes notif-in { from { opacity: 0; transform: translateX(24px); } }

/* eliminar usuario */
.acciones-fila { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn.peligro:hover { color: var(--err); background: var(--err-soft); }
.form-pie-izq { margin-right: auto; display: flex; align-items: center; gap: 8px; max-width: 60%; }
.texto-peligro { color: var(--err); }
.texto-peligro:hover { border-color: var(--err); background: var(--err-soft); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
@media (max-width: 600px) { .form-pie-izq { max-width: 100%; width: 100%; } }

/* validación de campos */
.error-campo { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--err); }
.field.invalido input, .field.invalido select { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.field.invalido label { color: var(--err); }

/* cartel con el nombre (menú achicado) */
.tip-menu {
  position: fixed; z-index: 140; transform: translateY(-50%); pointer-events: none;
  padding: 7px 11px; border-radius: 8px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-pop); animation: tip-in .12s ease-out;
}
.tip-menu::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: inherit; transform: translateY(-50%) rotate(45deg); border-radius: 1px; }
@keyframes tip-in { from { opacity: 0; transform: translate(-4px, -50%); } }
.sb-brand-text small { display: block; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Parámetros y reglas (pestañas) ---------- */
.param-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.param-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.param-tabs button { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.param-tabs button .ico { width: 16px; height: 16px; }
.param-tabs button:hover { color: var(--text); }
.param-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.param-tabs button[aria-selected="true"] .ico { color: var(--accent); }
.param-panel { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.reglas-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.formula-tira { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.formula-tira .ico { width: 16px; height: 16px; color: var(--accent); }
.formula-tira span { flex: 1; font-size: 13px; color: var(--muted); }
.formula-tira code { white-space: nowrap; font-size: 12px; }
.param-grid { display: grid; gap: 16px; }
.param-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.param-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.param-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcampo { display: flex; flex-direction: column; gap: 6px; }
.pcampo-lbl { font-size: 13px; font-weight: 700; }
.pcampo-in { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.pcampo-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pcampo-in i { font-style: normal; color: var(--muted); font-size: 13.5px; }
.pcampo-in input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 700; outline: none; }
.pcampo small { font-size: 12px; color: var(--faint); line-height: 1.45; }
.cat-col { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.cat-tit { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cat-tit.a { color: var(--ok); } .cat-tit.b { color: var(--warn); } .cat-tit.c { color: var(--err); }
.escala { display: flex; height: 36px; border-radius: 10px; overflow: hidden; font-size: 12.5px; font-weight: 800; }
.escala span { display: flex; align-items: center; justify-content: center; padding: 0 8px; text-align: center; }
.escala .ea { flex: 2; background: var(--ok-soft); color: var(--ok); }
.escala .eb { flex: 1; background: var(--warn-soft); color: var(--warn); }
.escala .ec { flex: 1.2; background: var(--err-soft); color: var(--err); }
.obj-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.obj-cab select { height: 36px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font: inherit; }
@media (max-width: 1000px) { .reglas-grid, .param-grid.g3, .param-grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .reglas-grid, .param-grid.g2, .param-grid.g3, .param-grid.g4 { grid-template-columns: 1fr; }
  .param-tabs button span { display: none; }
  .param-cab .btn { width: 100%; }
  .formula-tira { flex-wrap: wrap; }
}

/* filtro de período: Año y Mes */
.filtro-periodo { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filtro-periodo label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filtro-periodo select { height: 38px; padding: 0 30px 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.filtro-periodo select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filtro-periodo select[data-mes] { min-width: 140px; }

/* asignación de supervisor en lote */
.lote-barra { position: sticky; top: calc(var(--top-h) + 8px); z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.lote-barra span { font-size: 13.5px; }
.lote-barra select { height: 34px; padding: 0 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13.5px; }
.col-check { width: 40px; }
.col-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.aviso-homonimo { padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }

/* estado por fuente en Importar */
.fuentes-estado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.fuente-estado { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--line-2); }
.fuente-estado > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fuente-estado strong { font-size: 13.5px; }
.fuente-estado span { font-size: 12.5px; color: var(--muted); }
.fuente-estado span b { color: var(--text); }
.fuente-estado small { font-size: 11.5px; color: var(--faint); }
.fuente-estado.al-dia { border-left-color: var(--ok); }
.fuente-estado.atrasado { border-left-color: var(--warn); }
.fuente-estado.atrasado span { color: var(--warn); }
.fuente-estado.vacio { border-left-color: var(--err); opacity: .85; }
@media (max-width: 1000px) { .fuentes-estado { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .fuentes-estado { grid-template-columns: 1fr; } }

/* descuentos y bonos */
.novedad-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.novedad-form .field { min-width: 130px; }
.novedad-form .field.grow { flex: 1; min-width: 200px; }
.novedad-form .field input, .novedad-form .field select { height: 40px; }
.novedad-form .btn { height: 40px; }
.novedad-prev { width: 100%; margin: 0; font-weight: 600; color: var(--accent); }
.txt-ok { color: var(--ok); font-weight: 700; }
.txt-err { color: var(--err); font-weight: 700; }

/* ---------- gráficos ---------- */
.grafico { width: 100%; height: auto; display: block; }
.g-grilla { stroke: var(--line); stroke-width: 1; }
.g-eje { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.g-marca { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.g-barra { transition: opacity .15s; }
.g-barra:hover, .g-punto:hover { opacity: .8; }
.g-linea { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.g-ref { stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .8; }
.g-ref-txt { font-size: 11px; font-weight: 700; font-family: var(--font); }
.g-leyenda { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.g-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.g-leyenda i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.g-ranking { display: flex; flex-direction: column; gap: 8px; }
.g-fila { display: grid; grid-template-columns: 170px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.g-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-barra-h { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.g-barra-h i { display: block; height: 100%; border-radius: 999px; }
.g-fila b { text-align: right; font-variant-numeric: tabular-nums; }
.graficos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.graficos-grid .panel-body { padding: 16px 18px 14px; }
.kpi .var { font-size: 12px; font-weight: 800; margin-left: 6px; }
.kpi .var.sube { color: var(--ok); } .kpi .var.baja { color: var(--err); }
@media (max-width: 1100px) { .graficos-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .g-fila { grid-template-columns: 110px 1fr 70px; } }

/* ---------- tablas de datos ---------- */
.dt-barra { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.panel > .dt-barra:first-child, .dt-barra:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.dt-buscar { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.dt-buscar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dt-buscar .ico { width: 15px; height: 15px; }
.dt-buscar input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13.5px; outline: none; }
.dt-barra .btn-sm .ico { width: 15px; height: 15px; }
.dt-barra [aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.dt-cuenta { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.table th.dt-ordenable { cursor: pointer; user-select: none; }
.table th.dt-ordenable:hover { color: var(--text); }
.table th.dt-ordenable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dt-flecha { display: inline-block; width: 8px; margin-left: 4px; opacity: .35; }
.dt-flecha::after { content: "↕"; font-size: 11px; }
th.asc .dt-flecha, th.desc .dt-flecha { opacity: 1; color: var(--accent); }
th.asc .dt-flecha::after { content: "↑"; } th.desc .dt-flecha::after { content: "↓"; }
.table tr.dt-filtros th { padding: 6px 8px; background: var(--surface-2); text-transform: none; letter-spacing: 0; }
.table tr.dt-filtros input { width: 100%; min-width: 60px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 500; }
.table tr.dt-filtros input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 600px) { .dt-barra .btn-sm { flex: 1; justify-content: center; } .dt-cuenta { width: 100%; order: 5; } }

/* ---------- selector con búsqueda ---------- */
.combo { position: relative; width: 100%; }
.combo-nativo { position: absolute !important; opacity: 0; pointer-events: none; width: 1px !important; height: 1px !important; overflow: hidden; }
.combo-input {
  width: 100%; height: 42px; padding: 0 34px 0 13px; font: inherit; font-size: 14.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; cursor: text;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9CA8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.combo-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.combo-input::placeholder { color: var(--muted); }
.combo-input:disabled { opacity: .6; cursor: not-allowed; }
.combo.invalido .combo-input { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.combo-lista {
  position: fixed; z-index: 150; min-width: 220px;
  max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 11px; box-shadow: var(--shadow-pop);
}
.combo-lista li { padding: 8px 10px; border-radius: 7px; font-size: 14px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-lista li.activo { background: var(--accent-soft); color: var(--accent); }
.combo-lista li[aria-selected="true"] { font-weight: 700; }
.combo-lista li[aria-disabled="true"] { opacity: .5; cursor: default; }
.combo-lista li mark { background: none; color: var(--accent); font-weight: 800; }
.combo-lista li.combo-grupo { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); cursor: default; }
.combo-lista li.combo-vacio { color: var(--muted); cursor: default; }
/* dentro de barras y celdas compactas */
.toolbar .combo, .inline-form .combo, .lote-barra .combo { width: auto; min-width: 220px; }
.toolbar .combo-input, .inline-form .combo-input, .lote-barra .combo-input { height: 38px; }
.inline-form .combo-input { height: 34px; font-size: 13.5px; }
.novedad-form .combo-input, .ajuste-form .combo-input { height: 40px; }

/* ---------- pestañas de cada sección ---------- */
.subnav { display: flex; gap: 4px; padding: 8px 22px 0; border-bottom: 1px solid var(--line); background: var(--bg); overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--top-h); z-index: 25; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; margin-bottom: -1px; }
.subnav a .ico { width: 16px; height: 16px; }
.subnav a:hover { color: var(--text); }
.subnav a.is-active { color: var(--text); border-bottom-color: var(--accent); }
.subnav a.is-active .ico { color: var(--accent); }
.sb-nav { padding-top: 12px; }
@media (max-width: 900px) { .subnav { padding: 6px 10px 0; } .subnav a { padding: 10px 10px; } }

/* ---------- Para hacer (Inicio) ---------- */
.ph-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ph-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.ph-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.ph-item.leida { opacity: .75; }
.ph-txt { display: flex; flex-direction: column; min-width: 0; }
.ph-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-txt small { font-size: 12.5px; color: var(--accent); font-weight: 700; }
@media (max-width: 800px) { .ph-lista { grid-template-columns: 1fr; } }

/* ---------- variación mes contra mes ---------- */
.kpi .var.neutral { color: var(--muted); font-weight: 700; }
.segmentado { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.segmentado a { padding: 7px 13px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--muted); }
.segmentado a:hover { color: var(--text); }
.segmentado a.is-active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- combustible ---------- */
.remito-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.remito-foto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 220px; padding: 14px; text-align: center; border-radius: 14px; background: var(--surface-2); }
.remito-foto strong { font-size: 13px; font-weight: 700; }
.remito-foto img#dz-preview { max-width: 100%; max-height: 190px; border-radius: 10px; object-fit: contain; }
.remito-campos { display: flex; flex-direction: column; gap: 14px; }
.miniatura { display: block; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 800px) { .remito-grid { grid-template-columns: 1fr; } }

/* botón "Leer" en el remito */
.remito-foto.invalido { outline: 2px solid var(--err); outline-offset: -2px; }
.oblig { color: var(--err); font-weight: 800; }
.remito-foto { position: relative; overflow: hidden; }
#btn-leer-ia { position: relative; z-index: 2; margin-top: 4px; transition: background .25s, color .25s; display: inline-flex; align-items: center; gap: 7px; }
#btn-leer-ia .btn-ico { display: inline-flex; width: 16px; height: 16px; }
#btn-leer-ia .btn-ico .ico { width: 16px; height: 16px; }
#btn-leer-ia.btn-leyendo .btn-ico { animation: girar-ico 1s linear infinite; }
#btn-leer-ia.btn-listo { background: linear-gradient(150deg, #37C98C, #178A5E); color: #fff; border-color: transparent; }
#btn-leer-ia:disabled { opacity: 1; cursor: default; }
@keyframes girar-ico { to { transform: rotate(360deg); } }
.remito-foto.leyendo::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background: linear-gradient(120deg, transparent 20%, var(--accent-soft) 50%, transparent 80%);
  background-size: 250% 100%; animation: brillo-lee 1.6s ease-in-out infinite;
}
@keyframes brillo-lee { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
#leer-ia-estado { position: relative; z-index: 2; margin: 4px 0 0; font-size: 12px; max-width: 190px; }
#leer-ia-estado.ia-error { color: var(--err); }
@media (prefers-reduced-motion: reduce) { #btn-leer-ia.btn-leyendo .btn-ico, .remito-foto.leyendo::after { animation: none; } }

/* ---------- tarjeta de Calidad: franja de color + escala A-B-C chica ---------- */
.panel-claro { padding: 0; }
.pc-acciones { display: flex; align-items: center; gap: 10px; }
.pc-cuerpo { display: grid; grid-template-columns: 1fr 1fr; }
.pc-col { padding: 16px 18px 14px; min-width: 0; }
.pc-col + .pc-col { border-left: 1px solid var(--line); }
.pc-col-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pc-col-nombre { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pc-badge-cat { font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pc-badge-cat.verde { background: var(--ok-soft); color: var(--ok); }
.pc-badge-cat.ambar { background: var(--warn-soft); color: var(--warn); }
.pc-badge-cat.rojo { background: var(--err-soft); color: var(--err); }
.pc-num-fila { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; margin-top: 10px; }
.pc-num { font-size: 34px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.pc-num.verde { color: var(--ok); } .pc-num.ambar { color: var(--warn); } .pc-num.rojo { color: var(--err); }
.pc-num small { font-size: 12px; font-weight: 800; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.pc-num-fila .pc-pie { margin: 0 0 0 auto; }
.pc-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pc-chip { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; min-width: 0; }
.pc-chip + .pc-chip { border-left: 1px solid var(--line); }
.pc-chip b { font-size: 16px; font-weight: 800; white-space: nowrap; }
.pc-chip small { font-size: 10.5px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.pc-chip.verde b { color: var(--ok); } .pc-chip.ambar b { color: var(--warn); } .pc-chip.rojo b { color: var(--err); }
.pc-pie { margin: 0; }
.pc-marca { text-align: right; padding: 7px 18px; margin: 0; font-size: 11px; color: var(--faint); border-top: 1px solid var(--line); }
.pc-vacio { padding: 4px 20px 20px; margin: 0; font-size: 13.5px; }
.btn-icono { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icono .ico { width: 16px; height: 16px; }
.btn-icono.generando .ico { animation: girar-ico 1s linear infinite; }
@media (max-width: 720px) {
  .pc-cuerpo { grid-template-columns: 1fr; }
  .pc-col + .pc-col { border-left: 0; border-top: 1px solid var(--line); }
  .pc-chips { grid-template-columns: 1fr 1fr; }
  .pc-chip:nth-child(3) { border-left: 0; }
  .pc-chip:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- métricas personalizables (estilo original: color por operatoria + barra) ---------- */
.metricas-cab { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.metricas-tit { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 11.5px; }
.metricas-acc { display: flex; gap: 8px; }
.metricas-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metricas-grid .kpi.metrica-card { padding: 13px 15px 12px; gap: 3px; align-items: stretch; flex-direction: column; }
.metricas-grid .kpi.metrica-card b { font-size: 21px; }
.metricas-grid .kpi.metrica-card span { font-size: 11.5px; }
.metricas-grid .kpi-top.metrica-nombre { font-size: 12px; font-weight: 700; color: var(--c); margin-bottom: 1px; }
.metricas-grid .badge { font-size: 10.5px; padding: 1px 7px; }
.metricas-grid .barra { margin-top: 5px; height: 4px; }
.metrica-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font-size: 13px; line-height: 1; display: none; align-items: center; justify-content: center; cursor: pointer; }
.metricas-grid.editando .metrica-x { display: flex; }
.metricas-grid.editando .metrica-card { border-style: dashed; cursor: grab; }
.metrica-card.arrastrando { opacity: .4; }
.metrica-card.metrica-oculta { display: none; }
.metrica-agregar { display: flex; align-items: center; justify-content: center; padding: 14px; border-radius: 12px; border: 1.5px dashed var(--line-2); background: transparent; }
.metrica-agregar select { width: 100%; height: 34px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; text-align: center; cursor: pointer; }
.metrica-agregar select:focus { outline: none; }
@media (max-width: 1200px) { .metricas-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .metricas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .metricas-grid { grid-template-columns: 1fr; } }

/* doble clic en fila = editar */
.table tbody tr:has(.acciones-fila a) { cursor: pointer; }
.table tbody tr:has(.acciones-fila a) td { user-select: none; }
.table tbody tr:has(.acciones-fila a) .acciones-fila { cursor: default; user-select: auto; }

/* histórico del año: gráfico dinámico con chips */
.grafico-ancho { max-height: 320px; }
.grafico-ancho .g-eje { font-size: 12px; }
.hist-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 0; }
.hist-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.hist-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); opacity: .35; }
.hist-chip.on { color: var(--text); border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface-2)); }
.hist-chip.on i { opacity: 1; }
.hist-chip:hover { color: var(--text); }
.metricas-grid:not(.editando) .metrica-card { cursor: pointer; }

/* ---------- Equipos: tablero de asignación ---------- */
.eq-buscar { flex: 1; max-width: 320px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.eq-tablero { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.eq-col { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 160px; transition: border-color .15s, background .15s; }
.eq-col-libre { border-style: dashed; }
.eq-col.sobre { border-color: var(--accent); background: var(--accent-soft); }
.eq-col-cab { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.eq-col-nombre { flex: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; min-width: 0; }
.eq-col-nombre .ico { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.eq-col-n { font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.eq-lista { padding: 10px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.eq-card { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); cursor: grab; }
.eq-card:active { cursor: grabbing; }
.eq-card.arrastrando { opacity: .4; }
.eq-card.eq-guardando { opacity: .6; }
.eq-card.eq-oculta { display: none; }
.eq-card-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.eq-card-txt strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eq-card-txt small { font-size: 11px; color: var(--muted); }
.eq-mover { width: 30px; height: 28px; padding: 0; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: transparent; font-size: 0; cursor: pointer; flex-shrink: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9CA8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; background-size: 15px; }
.eq-mover option { color: var(--text); font-size: 13px; }
.eq-vacio { margin: 4px 2px; }
@media (hover: none) { .eq-card { cursor: default; } }

/* ---------- escaneo automático ---------- */
.remito-foto-col { display: flex; flex-direction: column; gap: 8px; }
.btn-auto-escaneo { position: relative; justify-content: center; text-align: center; width: 100%; }
.btn-auto-escaneo input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hint-auto { margin: 0; font-size: 11.5px; text-align: center; }

/* ---------- valores en los gráficos y tooltip ---------- */
.g-valor { fill: var(--muted); font-size: 10.5px; font-weight: 700; font-family: var(--font); pointer-events: none; }
.g-punto { cursor: pointer; transition: r .12s; }
.g-punto:hover { r: 6; }
.g-barra { cursor: pointer; transition: opacity .12s; }
.g-barra:hover { opacity: .8; }
.g-tip { position: fixed; z-index: 200; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); font-size: 12.5px; color: var(--text);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.g-tip.on { opacity: 1; transform: none; }
.g-tip i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.g-tip .g-tip-etq { color: var(--muted); }
.g-tip .g-tip-serie { color: var(--muted); }
.g-tip .g-tip-serie::before { content: "·"; margin-right: 6px; }
.g-tip .g-tip-serie[hidden] { display: none; }
.g-tip b { font-weight: 800; }

/* sub-etiqueta dentro del número grande de un KPI */
.kpi b .kpi-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 2px; }

/* líneas / barras en el histórico */
.hist-acc { display: flex; align-items: center; gap: 8px; }
.segmentado-sm a { padding: 5px 10px; font-size: 12px; }

/* KPI compactos (fila de resumen de General): apenas más grandes que las tarjetas de operatoria */
.kpis-compacto .kpi { padding: 14px 16px; gap: 12px; }
.kpis-compacto .kpi .tile { width: 38px; height: 38px; border-radius: 11px; }
.kpis-compacto .kpi .tile .ico { width: 17px; height: 17px; }
.kpis-compacto .kpi b { font-size: 22px; }
.kpis-compacto .kpi b .kpi-sub { font-size: 11px; }
.kpis-compacto .kpi span { font-size: 11.5px; }

/* ---------- panel lateral de desglose (drill-down) ---------- */
.drill-fondo { position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.45); }
.drill { position: fixed; top: 0; right: 0; bottom: 0; z-index: 160; width: 400px; max-width: 100%; background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: -12px 0 40px rgba(0,0,0,.35);
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drill.abierto { transform: none; }
.drill-cab { --c: var(--accent); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); border-top: 4px solid var(--c); }
.drill-op { display: block; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.drill-total { display: block; font-size: 26px; font-weight: 900; line-height: 1.1; }
.drill-ayuda { padding: 10px 20px 0; margin: 0; }
.drill-lista { padding: 10px 12px 24px; overflow-y: auto; flex: 1; }
.drill-sup { margin-bottom: 4px; }
.drill-fila { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; width: 100%; padding: 10px 10px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; }
.drill-fila-sup { cursor: pointer; font-weight: 800; }
.drill-fila-sup:hover, .drill-fila-sup.abierta { background: var(--surface-2); }
.drill-fila-sup .drill-nom::before { content: "▸"; display: inline-block; margin-right: 7px; color: var(--muted); transition: transform .15s; }
.drill-fila-sup.abierta .drill-nom::before { transform: rotate(90deg); }
.drill-fila-tec { padding-left: 28px; font-size: 13px; }
.drill-nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drill-num { display: inline-flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.drill-num b { font-weight: 800; }
.drill-num small { color: var(--muted); font-size: 11.5px; }
.drill-barra { grid-column: 1 / -1; display: block; height: 4px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.drill-barra em { display: block; height: 100%; border-radius: 999px; }
.drill-tecs { padding: 2px 0 6px; }
.drill-vacio, .drill-nota { padding: 12px 10px; margin: 0; font-size: 13px; }
@media (max-width: 480px) { .drill { width: 100%; } }

/* KPI de Calidad: la letra de la categoría como ícono, sin que el número se corte */
.tile-letra { font-size: 22px; font-weight: 900; letter-spacing: -.02em; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.kpi-cal > div { min-width: 0; }
.kpi-cal-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.kpi-cal-nombre { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kpi-cal b { white-space: nowrap; }
.kpi-sin-tile { padding-left: 22px; }

/* ---------- Informe mensual (Reporte diario) ---------- */
.informe .panel-head .btn .ico { width: 16px; height: 16px; }
.inf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 16px 18px 4px; }
.inf-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.inf-bloque { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.inf-bloque h4 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; min-height: 40px; padding: 6px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.inf-bloque h4 .badge { letter-spacing: 0; text-transform: none; }
.inf-lista { margin: 0; }
.inf-lista > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.inf-lista > div:first-child { border-top: 0; }
.inf-lista dt { color: var(--text); font-weight: 600; }
.inf-lista dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.inf-lista .inf-total { background: var(--accent-soft); }
.inf-lista .inf-total dt { font-weight: 800; }
.inf-lista .inf-total dd { color: var(--accent-2); font-size: 15px; }
[data-theme="dark"] .inf-lista .inf-total dd { color: #AFC3FF; }
.inf-autos { border-top: 1px solid var(--line); }
.inf-calidad { display: grid; grid-template-columns: 1fr 1fr; }
.inf-cal { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; text-align: center; }
.inf-cal + .inf-cal { border-left: 1px solid var(--line); }
.inf-cal-tipo { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.inf-cat { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 22px; font-weight: 900; }
.inf-cat.ok { background: var(--ok-soft); color: var(--ok); } .inf-cat.warn { background: var(--warn-soft); color: var(--warn); } .inf-cat.err { background: var(--err-soft); color: var(--err); }
.inf-cal-num { font-size: 15px; font-weight: 800; }
.inf-cal-num small { font-size: 11px; font-weight: 600; color: var(--muted); }
.inf-cal-pct { font-size: 13px; font-weight: 700; color: var(--muted); }
.inf-vacio { margin: 0; padding: 12px; font-size: 13px; color: var(--muted); }
.inf-nd { color: var(--faint); font-weight: 600; }
.inf-claro h4 .btn-icono { width: 32px; height: 32px; }
.inf-dato { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-top: 1px solid var(--line); }
.inf-claro h4 + .inf-dato { border-top: 0; }
.inf-dato-etq { font-size: 12px; font-weight: 700; color: var(--muted); }
.inf-dato-val { font-size: 28px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.inf-pie-dato { margin: 0; padding: 8px 12px 12px; font-size: 11.5px; color: var(--muted); }
.inf-editor { padding: 12px; border-top: 1px dashed var(--line-2); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.inf-editor-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.inf-editor label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.inf-editor input, .inf-editor select { height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; width: 100%; min-width: 0; }
.inf-editor input:focus, .inf-editor select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inf-editor-acciones { display: flex; justify-content: flex-end; gap: 8px; }
.inf-error { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--err); }
.inf-tabla-wrap { margin: 14px 18px 6px; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.inf-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.inf-tabla th, .inf-tabla td { padding: 8px 12px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); }
.inf-tabla thead th { border-top: 0; background: var(--surface-2); font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.inf-tabla th[scope="row"], .inf-tabla thead th:first-child { text-align: left; }
.inf-tabla th[scope="row"] { font-weight: 700; color: var(--text); }
.inf-tabla .inf-col-proy { background: var(--accent-soft); font-weight: 800; }
.inf-pct { display: inline-block; min-width: 76px; padding: 3px 8px; border-radius: 7px; font-weight: 800; text-align: center; }
.inf-pct.ok { background: var(--ok-soft); color: var(--ok); } .inf-pct.warn { background: var(--warn-soft); color: var(--warn); } .inf-pct.err { background: var(--err-soft); color: var(--err); }
.inf-tabla-barra { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 14px 18px -4px; }
.inf-tabla-barra .segmentado a { min-width: 32px; text-align: center; }
.inf-tabla [hidden] { display: none; }
.grafico-compacto .grafico { max-height: 260px; }
.inf-grafico { margin: 14px 18px 6px; }
.inf-grafico .grafico-compacto { padding: 12px 14px 8px; }
.inf-nota { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.inf-aviso { margin: 0; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--warn); }
.switch:disabled { opacity: .6; cursor: progress; }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.table tr.inactivo td[data-label="Habilitado"] { opacity: 1; }
#detalle-produccion .panel-head .segmentado { margin-right: auto; }
#detalle-produccion .segmentado a .muted { font-weight: 600; }
.inf-trab { color: var(--warn); }

/* informe: versión visual */
.inf-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 16px 18px 0; }
.inf-kpi { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--cb); background: linear-gradient(135deg, var(--cs), transparent 70%), var(--surface); }
.inf-kpi-ico { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--c); color: #fff; box-shadow: 0 8px 18px -10px var(--c); }
.inf-kpi-ico .ico { width: 20px; height: 20px; }
.inf-kpi b { display: block; font-size: 24px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.inf-kpi > div > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.inf-bloque { --c: var(--accent); --cs: var(--accent-soft); --cb: var(--line); border-color: var(--cb); }
.inf-bloque h4 { justify-content: flex-start; gap: 8px; background: var(--cs); border-bottom-color: var(--cb); color: var(--text); }
.inf-bloque h4 .badge, .inf-bloque h4 .btn-icono { margin-left: auto; }
.inf-h-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--c); color: #fff; flex: none; }
.inf-h-ico .ico { width: 13px; height: 13px; }
.inf-lista > div { position: relative; padding-bottom: 9px; }
.inf-barra { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 999px; background: var(--cs); overflow: hidden; }
.inf-barra::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: 999px; background: var(--c); }
.inf-lista .inf-total { background: var(--cs); padding-bottom: 6px; }
.inf-lista .inf-total dd { color: var(--text); font-size: 16px; }
[data-theme="dark"] .inf-lista .inf-total dd { color: #fff; }
.inf-cat { width: 46px; height: 46px; font-size: 24px; }
.inf-kpi-cal { display: grid; grid-template-columns: 1fr 1fr; flex: 1; min-width: 0; }
.inf-kpi-cal-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inf-kpi-cal-item + .inf-kpi-cal-item { padding-left: 12px; margin-left: 12px; border-left: 1px solid var(--cb); }
.inf-kpi-cal-top { display: flex; align-items: center; gap: 8px; }
.inf-kpi-cal-item b { font-size: 18px; white-space: nowrap; }
.inf-kpi-cal-item > span { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inf-cat.inf-cat-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 15px; flex: none; }
.inf-cat:not(.ok):not(.warn):not(.err) { background: var(--surface-2); color: var(--muted); }

/* ---------- Crecimiento del año (Producción → General) ---------- */
#detalle-general .panel-head .segmentado { margin-right: auto; }
.detalle-nota .btn .ico { width: 15px; height: 15px; }
.crec-wrap { padding: 14px 18px 12px; background: var(--surface); }
.crec-titulo { margin: 0 0 10px; font-size: 13px; font-weight: 800; color: var(--muted); }
.crec-wrap .table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.crec-tabla { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.crec-tabla th, .crec-tabla td { padding: 7px 10px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); }
.crec-tabla th[scope="row"] { text-align: left; font-weight: 700; color: var(--text); position: sticky; left: 0; background: var(--surface); }
.crec-cab th { background: var(--surface-2); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); border-top: 2px solid var(--c); }
.crec-cab th[scope="col"]:first-child { text-align: left; color: var(--text); position: sticky; left: 0; }
.crec-tabla tbody tr:first-child th { border-top-width: 2px; }
.crec-fuerte th, .crec-fuerte td { font-weight: 800; background: var(--surface-2); }
.crec-tabla .crec-actual { background: var(--accent-soft); }
.crec-cab th.crec-actual { color: var(--accent); }
.crec-nd { color: var(--faint); }
.crec-cat { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; font-weight: 900; font-size: 12px; }
.crec-cat.ok { background: var(--ok-soft); color: var(--ok); } .crec-cat.warn { background: var(--warn-soft); color: var(--warn); } .crec-cat.err { background: var(--err-soft); color: var(--err); }
.crec-pie { margin: 8px 2px 0; font-size: 11px; color: var(--faint); }
.crec-sep td { height: 14px; padding: 0; border: 0; background: var(--bg); }
.crec-cab th { background: var(--cs); border-top: 0; color: var(--c); }
.crec-cab th[scope="col"]:first-child { background: var(--cs); color: var(--text); font-size: 12.5px; }
.crec-cab th.crec-actual { background: var(--cs); color: var(--c); text-decoration: underline; text-underline-offset: 3px; }
.crec-marca { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--c); vertical-align: 1px; }
.crec-cab + tr th, .crec-cab + tr td { border-top: 0; }
.crec-fuerte th[scope="row"] { background: var(--surface-2); }
.crec-tabla .crec-sep + .crec-cab th { border-top: 0; }
.crec-tabla tbody tr:first-child th { border-top-width: 0; }

/* tarjetas de importes (Liquidación): 4 por fila, montos sin centavos */
.metricas-grid.metricas-dinero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metricas-dinero .kpi.metrica-card b { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metricas-dinero .metrica-sub { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.metricas-dinero .metrica-sub .var { margin-left: 0; }
.metricas-grid.metricas-dinero:not(.editando) .metrica-card { cursor: default; }
@media (max-width: 760px) { .metricas-grid.metricas-dinero { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .metricas-grid.metricas-dinero { grid-template-columns: 1fr; } }

/* Cargas: tarjetas chicas de resumen */
.kpis.kpis-compactos { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpis-compactos .kpi { padding: 12px 16px; }
.kpis-compactos .kpi b { font-size: 19px; }
.kpis-compactos .kpi span { font-size: 12px; }

/* fila a la que se vuelve desde un detalle */
@keyframes fila-volver { 0%, 60% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } 100% { background: transparent; box-shadow: none; } }
.table tbody tr.fila-volver td { animation: fila-volver 2.6s ease-out; }

/* Cargas → Recibos de sueldo */
.rec-drop { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.rec-drop:hover, .rec-drop.sobre { border-color: var(--accent); background: var(--accent-soft); }
.rec-drop strong { color: var(--text); }
.rec-estado { margin: 10px 2px 0; }
#rec-previa { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
#rec-previa[hidden] { display: none; }
.rec-resumen { font-size: 13.5px; line-height: 1.7; }
.rec-acciones { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.rec-acciones .muted { margin-right: auto; }
.rec-sel { height: 34px; max-width: 240px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.txt-warn { color: var(--warn); font-weight: 700; }

/* Cargas → Descuentos y bonos: tablero (personas · conceptos · datos · lista) */
.nov-tablero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; padding: 16px 18px 0; align-items: start; }
.nov-personas, .nov-conceptos { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.nov-personas-cab, .nov-conceptos-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.nov-personas-cab strong, .nov-conceptos-cab strong, .nov-sel strong { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.nov-personas-cab .nov-buscar { width: 100%; }
.nov-conceptos-cab .nov-buscar { flex: 1; min-width: 180px; max-width: 280px; margin-left: auto; }
.nov-buscar { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.nov-buscar:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nov-personas-lista { max-height: 430px; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 10px; }
.nov-grupo-p { display: flex; flex-direction: column; gap: 5px; }
.nov-grupo-p-cab { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.nov-grupo-p-cab .link-btn { font-size: 11.5px; text-transform: none; letter-spacing: 0; text-decoration: none; }
.nov-persona { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 44px; padding: 6px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.nov-persona:hover { border-color: var(--accent); }
.nov-persona.on { border-color: var(--accent); background: var(--accent-soft); }
.nov-av { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }
.nov-persona-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.nov-persona-txt strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nov-persona-txt small { font-size: 11px; color: var(--muted); }
.nov-check { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); color: transparent; font-size: 12px; font-weight: 900; flex: none; }
.nov-persona.on .nov-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.nov-tipo a { display: inline-flex; align-items: center; gap: 7px; }
.nov-pt { width: 8px; height: 8px; border-radius: 50%; }
.nov-pt.err { background: var(--err); } .nov-pt.ok { background: var(--ok); }
.nov-columnas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 10px; max-height: 430px; overflow-y: auto; align-items: start; }
.nov-col { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.nov-col header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.nov-col.desc header { color: var(--err); background: var(--err-soft); }
.nov-col.bono header { color: var(--ok); background: var(--ok-soft); }
.nov-col header span { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.nov-col-lista { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.nov-con { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; min-height: 36px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.nov-con span { flex: 1; }
.nov-con small { font-size: 11px; color: var(--muted); font-weight: 600; }
.nov-con .nov-cu { padding: 0 6px; border-radius: 6px; background: var(--surface-2); }
.nov-con:hover { border-color: var(--accent); }
.nov-con.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.nov-con.on small { color: rgba(255,255,255,.85); background: transparent; }
.nov-barra { margin: 14px 18px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.nov-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.nov-tag { padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 12.5px; }
.nov-tag.ok { background: var(--ok-soft); color: var(--ok); } .nov-tag.err { background: var(--err-soft); color: var(--err); }
.nov-datos { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.nov-datos .field { margin: 0; min-width: 120px; }
.nov-datos .field.grow { flex: 1; min-width: 220px; }
.nov-datos input, .nov-datos select, .nov-datos .btn { height: 40px; }
.nov-prev { margin: 0; min-height: 18px; font-size: 13px; font-weight: 600; color: var(--muted); }
.nov-lista { margin: 14px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.nov-lista[hidden] { display: none; }
.nov-lista .table-wrap { border: 1px solid var(--line); border-radius: 12px; }
.nov-guardar { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }
#nov { padding-bottom: 18px; }
.invalido { border-color: var(--err) !important; box-shadow: 0 0 0 3px var(--err-soft) !important; }
@media (max-width: 900px) { .nov-tablero { grid-template-columns: 1fr; } .nov-personas-lista { max-height: 260px; } }

/* ---------- tema oscuro: tarjetas que se despegan del fondo ---------- */
[data-theme="dark"] .panel,
[data-theme="dark"] .kpi,
[data-theme="dark"] .toolbar-card { border-color: var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 28px -12px rgba(0,0,0,.65); }
[data-theme="dark"] .panel-head { background: rgba(255,255,255,.015); }
[data-theme="dark"] .main, [data-theme="dark"] .content { background: var(--bg); }
/* dentro de una tarjeta: cada nivel un poco más claro */
[data-theme="dark"] .nov-personas, [data-theme="dark"] .nov-conceptos, [data-theme="dark"] .nov-barra { background: var(--surface-2); border-color: var(--line-2); }
[data-theme="dark"] .nov-personas-cab, [data-theme="dark"] .nov-conceptos-cab { border-color: var(--line-2); }
[data-theme="dark"] .nov-col { background: var(--surface); border-color: var(--line-2); }
[data-theme="dark"] .nov-col header span { background: var(--surface-2); }
[data-theme="dark"] .nov-con, [data-theme="dark"] .nov-persona { background: var(--surface-3); border-color: #3E4250; }
[data-theme="dark"] .nov-con .nov-cu { background: var(--surface-2); }
[data-theme="dark"] .nov-con:hover, [data-theme="dark"] .nov-persona:hover { border-color: var(--accent); background: #333744; }
[data-theme="dark"] .nov-persona.on { background: rgba(91,132,247,.22); border-color: var(--accent); }
[data-theme="dark"] .nov-buscar { background: var(--surface); border-color: var(--line-2); }
[data-theme="dark"] .nov-check { border-color: #555A69; }
[data-theme="dark"] .eq-col { background: var(--surface); border-color: var(--line-2); }
[data-theme="dark"] .eq-card { background: var(--surface-3); border-color: #3E4250; }
[data-theme="dark"] .inf-bloque { background: var(--surface-2); }

/* aviso de novedades al entrar (técnicos y supervisores) */
dialog.avisos { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog.avisos::backdrop { background: rgba(8, 10, 16, .55); backdrop-filter: blur(2px); }
.avisos-cab { display: flex; align-items: center; gap: 14px; padding: 20px 20px 12px; }
.avisos-cab h2 { margin: 0; font-size: 18px; font-weight: 800; }
.avisos-cab p { margin: 2px 0 0; }
.avisos-lista { list-style: none; margin: 0; padding: 0 20px; display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; }
.aviso { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); border-left-width: 1px; }
.aviso strong { font-size: 14px; }
.aviso span { font-size: 13.5px; }
.aviso-warn strong { color: var(--warn); } .aviso-ok strong { color: var(--ok); } .aviso-err strong { color: var(--err); }
.avisos-acc { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; margin: 0; }

/* Inicio del técnico: accesos a sus pantallas */
.accesos-tec { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.acceso-tec { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.acceso-tec:hover { border-color: var(--accent); transform: translateY(-1px); color: var(--text); }
.acceso-tec strong { display: block; font-size: 15px; }
.acceso-tec small { color: var(--muted); font-size: 12.5px; }
