/* ============================================================
   Sistema de diseño — GNC Volumétricos SaaS
   Estilo enterprise: Manrope + Space Grotesk. Basado en el diseño GNC.
   ============================================================ */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --navy: #081226;
  --brand: #1b56db;
  --brand-hover: #0e3fae;
  --cyan: #4dd8f5;
  --text: #16233c;
  --text-2: #3d4a61;
  --muted: #8794ab;
  --faint: #a3aec2;
  --border: #e4e9f2;
  --border-soft: #f0f3f8;
  --avatar-bg: #eaf0fd;
  --danger: #cf2f2f;
  --danger-bg: #fdeceb;
  --warn: #c47f00;
  --warn-2: #e0a63a;
  --success: #0f8f5f;
  --radius: 10px;
  --radius-sm: 8px;
  --sidebar-w: 266px;
}

* { box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: #cfd8e8 transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfd8e8; border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
.mono { font-family: 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  flex: none; width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  flex: none; background: var(--navy);
  padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 9px;
}
.sidebar__brand img { height: 22px; width: auto; object-fit: contain; align-self: flex-start; }
.sidebar__eyebrow { display: flex; align-items: center; gap: 8px; }
.sidebar__eyebrow .rule { width: 16px; height: 1px; background: var(--cyan); }
.sidebar__eyebrow span:last-child { font-size: 10px; font-weight: 800; letter-spacing: 2.6px; color: var(--cyan); }

.tenant-switch { flex: none; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.tenant-switch__label { font-size: 9.5px; font-weight: 800; letter-spacing: 1.6px; color: var(--muted); margin-bottom: 7px; }
.tenant-switch__box {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.tenant-switch__avatar {
  flex: none; width: 26px; height: 26px; border-radius: 6px;
  background: var(--avatar-bg); color: var(--brand);
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.tenant-switch__name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-switch__meta { font-size: 10.5px; font-weight: 500; color: var(--muted); }

.nav { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 20px; display: flex; flex-direction: column; gap: 16px; }
.nav__group-title { font-size: 9.5px; font-weight: 800; letter-spacing: 1.6px; color: var(--faint); padding: 4px 10px 6px; }
.nav__item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: 7px; color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.nav__item:hover { background: #f2f5fa; color: var(--text-2); }
.nav__item.is-active { background: var(--avatar-bg); color: var(--brand); font-weight: 700; }
.nav__item .ico { flex: none; width: 15px; height: 15px; }
.nav__item.is-active .ico { color: var(--brand); }

.sidebar__user { flex: none; border-top: 1px solid var(--border-soft); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.sidebar__user .avatar {
  flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--navy); color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar__user .name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user .role { font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  flex: none; height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
}
.topbar h1 { font-size: 16px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.topbar .sub { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.topbar__spacer { flex: 1; }
.topbar .burger { display: none; }

.content { padding: 24px 26px 40px; display: flex; flex-direction: column; gap: 18px; }
.page-intro { display: flex; flex-direction: column; gap: 3px; }
.page-intro h2 { font-size: 18px; font-weight: 800; margin: 0; }
.page-intro p { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- Cards / KPI ---------- */
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card--pad { padding: 17px 18px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 20px 14px; border-bottom: 1px solid var(--border-soft); }
.card__title { font-size: 13.5px; font-weight: 800; }
.card__desc { font-size: 11px; font-weight: 500; color: var(--muted); }
.card__body { padding: 18px 20px; }

.kpi { display: flex; flex-direction: column; gap: 12px; }
.kpi__label { font-size: 10px; font-weight: 800; letter-spacing: 1.3px; color: var(--muted); }
.kpi__value { font-family: 'Space Grotesk', sans-serif; font-size: 31px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.kpi__row { display: flex; align-items: center; justify-content: space-between; }
.kpi__foot { font-size: 11px; font-weight: 500; color: var(--muted); }
.text-danger { color: var(--danger); } .text-warn { color: var(--warn); } .text-success { color: var(--success); }

/* ---------- Buttons ---------- */
.btn { height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; }
.btn:hover { border-color: #cfd8e8; background: #fafbfe; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn--sm { height: 36px; padding: 0 13px; font-size: 12.5px; }
.btn--block { width: 100%; }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 700; color: var(--text-2); }
.input {
  height: 44px; padding: 0 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 13px; font-family: inherit; color: var(--text); width: 100%;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(27,86,219,.1); }
.input::placeholder { color: var(--faint); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th { text-align: left; font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
table.data tr:hover td { background: #fafbfe; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.badge--ok { background: #e7f6ef; color: var(--success); }
.badge--off { background: var(--border-soft); color: var(--muted); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Icons (mask) ---------- */
.ico { display: inline-block; background: currentColor;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; }
.alert--error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 10px 40px rgba(8,18,38,.18); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(8,18,38,.4); z-index: 30; }
  .topbar .burger { display: inline-flex; }
  .content { padding: 18px 16px 32px; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ===== Ayuda contextual por vista ("¿Qué estoy viendo?") ===== */
.help { border: 1px solid var(--border); border-left: 3px solid var(--brand); background: #f4f7ff; border-radius: var(--radius); }
.help > summary { cursor: pointer; padding: 11px 16px; font-weight: 700; font-size: 12.5px; color: var(--brand); display: flex; align-items: center; gap: 8px; list-style: none; user-select: none; }
.help > summary::-webkit-details-marker { display: none; }
.help > summary::before { content: "?"; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; flex: none; }
.help[open] > summary { border-bottom: 1px dashed var(--border); }
.help__body { padding: 12px 16px 15px; font-size: 12.5px; color: var(--text-2, #46536b); line-height: 1.6; display: flex; flex-direction: column; gap: 10px; }
.help__body b { color: var(--text); }
.help__body a { color: var(--brand); font-weight: 700; }
.help dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; }
.help dt { font-weight: 700; color: var(--text); white-space: nowrap; }
.help dd { margin: 0; }
@media (max-width: 640px) { .help dl { grid-template-columns: 1fr; } .help dd { margin-bottom: 6px; } }

/* ===== Chips de resumen (KPIs rápidos arriba de una tabla) ===== */
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-chip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 14px; display: flex; flex-direction: column; gap: 1px; min-width: 110px; }
.kpi-chip b { font-size: 17px; letter-spacing: -0.02em; }
.kpi-chip span { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-chip--ok b { color: var(--success); }
.kpi-chip--warn b { color: var(--warn); }
.kpi-chip--bad b { color: var(--danger); }

/* ===== Estado vacío con siguiente paso ===== */
.empty { text-align: center; padding: 34px 20px; color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty b { color: var(--text); font-size: 13.5px; }
.empty a { color: var(--brand); font-weight: 700; }

/* ===== Pasos del flujo de trabajo (tablero) ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.step { position: relative; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.step:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(27, 86, 219, .10); }
.step__num { width: 22px; height: 22px; border-radius: 50%; background: var(--avatar-bg); color: var(--brand); font-weight: 800; font-size: 11.5px; display: flex; align-items: center; justify-content: center; }
.step__title { font-weight: 800; font-size: 12.5px; color: var(--text); }
.step__desc { font-size: 11px; color: var(--muted); line-height: 1.45; }

/* ===== Mejora de legibilidad de tablas ===== */
.table-wrap { max-height: 72vh; overflow: auto; }                 /* scroll propio: el encabezado no se pierde */
table.data thead th { position: sticky; top: 0; background: var(--surface); z-index: 2; box-shadow: 0 1px 0 var(--border); }
table.data td { background: var(--surface); }
table.data tbody tr:nth-child(even) td { background: #fafbfe; }   /* cebra suave */
table.data tbody tr:hover td { background: #f1f5fd; }
table.data td.mono { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data th.num { text-align: right; }

/* Encabezado agrupado (dos filas): la primera fila nombra el bloque de columnas */
table.data thead tr.grupos th {
  text-align: center; font-size: 9.5px; letter-spacing: 1.2px; color: var(--brand);
  background: #f4f7ff; border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border); top: 0; padding: 7px 10px; height: 28px; box-sizing: border-box;
}
table.data thead tr.grupos th:first-child { border-left: none; }
table.data thead tr.grupos + tr th { top: 28px; }                 /* la 2a fila se pega debajo de la 1a */

/* Primera columna fija para tablas muy anchas */
table.data--fija1 th:first-child, table.data--fija1 td:first-child {
  position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--border);
}
table.data--fija1 thead th:first-child { z-index: 3; }
table.data--fija1 thead tr.grupos th:first-child { background: var(--surface); }

/* ===== Badges de producto con su color comercial ===== */
.badge--magna { background: #e7f6ef; color: #0f8f5f; }
.badge--premium { background: #fdeceb; color: #cf2f2f; }
.badge--diesel { background: #edeff3; color: #3d4a63; }

/* ===== Secciones comparativas (Conciliación) ===== */
.section-title { font-size: 11.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); margin: 6px 2px -8px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.fuente { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 800; }
.fuente::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.fuente--nexus::before { background: var(--cyan); }

/* ===== Celda con dato obligatorio faltante: TODA la celda en rojo ===== */
.falta { color: var(--danger); font-weight: 800; font-size: 10px; letter-spacing: 0.06em; }
table.data td:has(> .falta),
table.data tbody tr:nth-child(even) td:has(> .falta),
table.data tbody tr:hover td:has(> .falta) {
  background: var(--danger-bg);
  box-shadow: inset 3px 0 0 var(--danger);
}

/* ===== Centro de cargas ===== */
.tipos { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tipo { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.tipo:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(27, 86, 219, .12); transform: translateY(-1px); }
.tipo__ico { width: 38px; height: 38px; border-radius: 10px; background: var(--avatar-bg); color: var(--brand);
  display: flex; align-items: center; justify-content: center; }
.tipo__titulo { font-weight: 800; font-size: 14px; }
.tipo__patron { font-family: ui-monospace, monospace; font-size: 10.5px; color: var(--brand); background: #f4f7ff;
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; width: fit-content; }
.tipo__desc { font-size: 11.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.tipo__estado { font-size: 11px; font-weight: 700; color: var(--text-2, #46536b); border-top: 1px dashed var(--border); padding-top: 9px;
  display: flex; justify-content: space-between; gap: 8px; }
.tipo__estado .mono { color: var(--muted); font-weight: 600; }

/* Pestañas entre tipos de carga */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); }
.tab { padding: 9px 16px 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* Asistente de pasos (Seleccionar → Revisar → Guardado) */
.wizard { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wizard__paso { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.wizard__num { width: 20px; height: 20px; border-radius: 50%; background: var(--border-soft); color: var(--muted);
  display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; }
.wizard__paso.is-activo { color: var(--brand); }
.wizard__paso.is-activo .wizard__num { background: var(--brand); color: #fff; }
.wizard__paso.is-hecho { color: var(--success); }
.wizard__paso.is-hecho .wizard__num { background: #e7f6ef; color: var(--success); }
.wizard__sep { width: 26px; height: 1px; background: var(--border); }

/* Zona de arrastrar y soltar */
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); background: #fafbfe;
  padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: #f0f5ff; }
.dropzone__titulo { font-weight: 800; font-size: 13px; }
.dropzone__desc { font-size: 11.5px; color: var(--muted); }
.dropzone input[type="file"] { display: none; }
.dropzone__lista { font-size: 11.5px; color: var(--text-2, #46536b); font-weight: 700; display: flex; flex-direction: column; gap: 2px; }

/* ===== Envíos: tablero de cumplimiento ===== */
.badge--warn { background: #fff6e6; color: var(--warn); }

.kpis a.kpi-chip { text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.kpis a.kpi-chip:hover { border-color: var(--brand); }
.kpi-chip--activo { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* Matriz estación × día */
.matriz-wrap { overflow-x: auto; padding: 14px 18px 4px; }
table.matriz { border-collapse: separate; border-spacing: 3px; }
table.matriz thead th { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; padding: 0 0 3px; }
table.matriz th.est { text-align: right; padding-right: 10px; white-space: nowrap; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.celda { display: block; width: 24px; height: 24px; line-height: 24px; border-radius: 7px; font-size: 10px; font-weight: 800;
  text-align: center; text-decoration: none; transition: transform .1s; }
a.celda:hover { transform: scale(1.18); }
.celda--ok { background: #e7f6ef; color: var(--success); }
.celda--parcial { background: #fff6e6; color: var(--warn); }
.celda--plazo { background: var(--border-soft); color: var(--muted); }
.celda--vencida { background: var(--danger); color: #fff; }
.celda--vacia { background: transparent; border: 1px dashed var(--border); color: var(--faint); }
.leyenda { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 10px 18px 16px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.leyenda > span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda .celda { width: 15px; height: 15px; line-height: 15px; border-radius: 5px; }

/* Checklist: subencabezado por estación con barra de avance */
tr.subgrupo td { background: #eef2fa; border-bottom: 1px solid var(--border); padding: 8px 14px; }
table.data tr.subgrupo:hover td { background: #eef2fa; }
.avance { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
.avance__bar { display: inline-block; width: 110px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.avance__fill { display: block; height: 100%; border-radius: 999px; background: var(--success); }

/* Pastillas de pasos (Enviado → Procesado → Portal) */
.pasos { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pasos form { margin: 0; }
.paso { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-size: 11px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s, color .12s; white-space: nowrap; }
.paso::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; flex: none; }
.paso:hover { border-color: var(--brand); color: var(--brand); }
.paso input { display: none; }
.paso--on { background: #e7f6ef; border-color: #bfe7d6; color: var(--success); }
.paso--on::before { opacity: 1; }
.paso--on:hover { border-color: var(--success); color: var(--success); }
.paso--bloqueado { cursor: default; }
.paso--bloqueado:hover { border-color: var(--border); color: var(--muted); }
span.paso--bloqueado.paso--on:hover { border-color: #bfe7d6; color: var(--success); }

/* Estado de la fila */
tr.fila--vencida > td { background: #fdf3f2; }
table.data tr.fila--vencida:hover > td { background: #fbecea; }
tr.fila--vencida > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.fila--ok > td:first-child { box-shadow: inset 3px 0 0 var(--success); }
table.data tr[id] { scroll-margin-top: 84px; }

/* ===== Conciliación: tablas unificadas Diario vs Nexus ===== */
table.data th.sep, table.data td.sep { border-left: 1px solid var(--border); }
.dif { font-weight: 700; }
.dif--ok { color: var(--success); opacity: .85; }
.dif--mal { color: var(--danger); font-weight: 800; background: var(--danger-bg); padding: 2px 7px; border-radius: 6px; }

/* ===== Tarjetas plegables (detalle por fuente) ===== */
details.card--plegable > summary { cursor: pointer; user-select: none; list-style: none;
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-weight: 800; font-size: 13px; }
details.card--plegable > summary::-webkit-details-marker { display: none; }
details.card--plegable > summary::after { content: "▾"; color: var(--muted); font-size: 12px; transition: transform .15s; }
details.card--plegable[open] > summary::after { transform: rotate(180deg); }
details.card--plegable[open] > summary { border-bottom: 1px solid var(--border); }
.plegable__hint { font-weight: 600; font-size: 11.5px; color: var(--muted); }

/* ===== Chips-botón (filtro en cliente, p. ej. Facturación) ===== */
button.kpi-chip { cursor: pointer; font: inherit; text-align: left; transition: border-color .15s, box-shadow .15s; }
button.kpi-chip:hover { border-color: var(--brand); }
