/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables NODO/BRIO ── */
:root {
  --prim:       #2c64a8;
  --prim-h:     #4682c5;
  --prim-d:     #1a3a6c;
  --acento:     #ffe79a;
  --bg:         #f5f5f5;
  --bg2:        #fff;
  --bg3:        #ececec;
  --texto:      #1e1e1e;
  --texto2:     #555;
  --texto3:     #777;
  --borde:      #c5c5c5;
  --borde-in:   #7a7a7a;
  --ok:         #2a8a3a;
  --warn:       #d4a000;
  --peligro:    #a40000;
  --info:       #4682c5;
  --radio:      0px;
  --header-h:   44px;
  --nav-h:      54px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--texto);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 13px;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "Consolas", "Courier New", monospace; font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }

/* ── Login ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(150deg, #0d1b2e 0%, #1a3a6c 55%, #0f2b10 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.login-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.45), 0 4px 16px rgba(0,0,0,.2);
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-app-icon {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  margin-bottom: 14px;
}

.login-brand {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.login-brand span { color: #3ab54a; }

.login-ver {
  font-size: 10px;
  color: #aaa;
  letter-spacing: 0.3px;
  margin-bottom: 28px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.login-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  color: #aaa;
  pointer-events: none;
  transition: color 0.2s;
}

.login-input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 44px;
  border: 1.5px solid #e4e4e4;
  border-radius: 10px;
  background: #f8f8f8;
  color: #1a1a1a;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.login-input:focus {
  border-color: #3ab54a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(58,181,74,.14);
}
.login-field:focus-within .login-field-icon { color: #3ab54a; }

.login-btn {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(46,125,50,.4);
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 2px;
}
.login-btn:hover   { opacity: .93; box-shadow: 0 6px 20px rgba(46,125,50,.5); }
.login-btn:active  { transform: scale(.98); }
.login-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.login-error {
  font-size: 12px;
  color: #c62828;
  text-align: center;
  min-height: 14px;
  font-weight: 600;
  background: #fff3f3;
  border-radius: 6px;
  padding: 6px 10px;
  display: none;
}
.login-error:not(:empty) { display: block; }

.btn-instalar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 36px;
  background: transparent;
  color: #2c64a8;
  border: 1.5px solid rgba(44,100,168,.3);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-instalar:hover { background: rgba(44,100,168,.07); border-color: #2c64a8; }
.btn-instalar i { font-size: 14px; }

/* ── App layout ── */
.app { display: flex; flex-direction: column; height: 100dvh; }

/* ── Header (topbar NODO/BRIO) ── */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: var(--header-h);
  background: var(--prim);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid var(--prim-d);
}

.header-titulo {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-version {
  font-size: 10px;
  color: rgba(255,255,255,.6);
}

.btn-icono {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radio);
  line-height: 1;
}

.btn-icono:hover  { background: rgba(255,255,255,.15); color: #fff; }
.btn-icono:active { background: rgba(0,0,0,.15); }

/* ── Main ── */
.main-content { flex: 1; overflow-y: auto; background: var(--bg); }
.seccion { padding: 12px; }

/* ── Nav inferior (bottom tab bar) ── */
.nav-inferior {
  display: flex;
  background: var(--bg2);
  border-top: 1px solid var(--borde);
  height: var(--nav-h);
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 9px;
  color: var(--texto3);
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s;
  letter-spacing: 0.1px;
  font-family: inherit;
  min-width: 0;
}

.nav-btn i { font-size: 1.1rem; }
.nav-btn.activo { color: var(--prim); font-weight: 600; }
.nav-btn:hover  { color: var(--prim-h); }
.nav-btn-disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 10px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 0;
  font-size: 12px;
  z-index: 300;
  max-width: calc(100% - 32px);
  white-space: normal;
  text-align: center;
  background: #1e1e1e;
  color: #fff;
  border: 1px solid #000;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  animation: fadeInOut 2.8s ease forwards;
}

@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Card (panel) — estilo BRIO ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.card-titulo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--texto2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg3);
}

.card-titulo i   { font-size: 12px; color: var(--prim); }
.card-obs        { font-size: 9px; font-weight: 400; color: var(--texto3); font-style: italic; margin-left: 6px; }

/* ── Dashboard filtros ── */
.dash-filtros {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  background: var(--bg2);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 10px 12px;
}

/* Chips (filtros rápidos) — estilo BRIO */
.dash-rangos {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}
.dash-rangos::-webkit-scrollbar { display: none; }

.dash-rango-btn {
  height: 26px;
  padding: 0 12px;
  border: 1px solid var(--borde);
  background: var(--bg2);
  color: var(--texto);
  font: inherit;
  font-size: 11px;
  border-radius: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}

.dash-rango-btn:hover {
  background: var(--acento);
  border-color: var(--warn);
}

.dash-rango-btn.activo {
  background: var(--prim);
  border-color: var(--prim-d);
  color: #fff;
  font-weight: 700;
}

/* Select sucursal — estilo BRIO input */
.dash-sucursal-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.dash-sucursal-wrap > i {
  position: absolute;
  left: 9px;
  color: var(--texto2);
  font-size: 12px;
  pointer-events: none;
}

#dash-sucursal {
  height: 28px;
  padding: 0 10px 0 28px;
  border: 1px solid var(--borde-in);
  background: var(--bg2);
  color: var(--texto);
  font: inherit;
  font-size: 12px;
  width: 100%;
  outline: none;
  border-radius: var(--radio);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%23555' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

#dash-sucursal:focus { outline: 2px solid rgba(70,130,197,.3); outline-offset: -1px; }

/* ── KPI grande — primeras 3 tarjetas (fondo sólido) ── */
.kpi-grande {
  padding: 16px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 108px;
  border: none;
}
.kg-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  opacity: 0.88;
}
.kg-valor {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.kg-icono { font-size: 22px; opacity: 0.8; flex-shrink: 0; }
.kg-num {
  font-size: 21px;
  font-weight: 800;
  font-family: "Consolas", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
  word-break: break-all;
}
.kg-hint { font-size: 10px; opacity: 0.75; }

/* ── Card flush (sin padding horizontal) ── */
.card-flush { padding-left: 0; padding-right: 0; overflow: hidden; }
.card-flush .card-titulo { padding-left: 14px; padding-right: 14px; }

/* ── KPI grid — estilo BRIO ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

@media (min-width: 560px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(5, 1fr); } }

/* p-dashboard-kpi BRIO: fondo blanco, border-left 4px coloreado */
.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--borde);
  border-left: 4px solid var(--clr, var(--prim));
  border-radius: var(--radio);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.kpi-label {
  font-size: 9px;
  color: var(--texto2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.kpi-icon {
  font-size: 13px;
  color: var(--clr, var(--prim));
  opacity: 0.7;
}

.kpi-valor {
  font-size: 20px;
  font-weight: 700;
  color: var(--texto);
  line-height: 1.1;
  font-family: "Consolas", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* ── KPI grid variantes ── */
.kpi-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-2 { grid-template-columns: repeat(2, 1fr); }

/* ── KPI hint ── */
.kpi-hint {
  font-size: 10px;
  color: var(--texto3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Gráficos ── */
.chart-wrap      { position: relative; height: 190px; }
.chart-wrap.chart-sm   { height: 160px; }
.chart-wrap.chart-tall { height: 240px; }

/* Fila 2 gráficos — torta 38% + barras 62% */
.dash-row-2col {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
@media (max-width: 560px) {
  .dash-row-2col { grid-template-columns: 1fr; }
}

/* ── Sección título (Inventarios) ── */
.seccion-titulo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--texto2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 2px 6px;
  border-bottom: 2px solid var(--prim);
  margin-bottom: 8px;
}
.seccion-titulo i { color: var(--prim); font-size: 14px; }

/* ── Heatmap ── */
.heatmap-scroll { overflow-x: auto; padding: 0 4px 4px; }

.heatmap-tabla {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 10px;
  width: 100%;
}

.heatmap-tabla th {
  background: transparent;
  color: var(--texto3);
  font-weight: 600;
  padding: 2px 2px 4px;
  text-align: center;
  border: none;
  white-space: nowrap;
  min-width: 36px;
  font-size: 10px;
}

.hm-corner { min-width: 20px !important; }

.hm-dia {
  background: transparent;
  color: var(--texto2);
  font-weight: 700;
  padding: 2px 6px;
  border: none;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
}

.hm-cel {
  border-radius: 0;
  height: 36px;
  min-width: 36px;
  cursor: default;
  transition: opacity 0.1s;
  text-align: center;
  vertical-align: middle;
}
.hm-cel:hover { opacity: 0.75; outline: 2px solid var(--prim); outline-offset: -1px; }
.hm-val {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #374151;
  pointer-events: none;
}

@media (max-width: 560px) {
  .heatmap-tabla th { min-width: 24px; font-size: 9px; padding: 1px; }
  .hm-dia           { min-width: 14px; padding: 1px 3px; font-size: 10px; }
  .hm-cel           { min-width: 24px; height: 26px; }
  .hm-val           { font-size: 8px; }
  .heatmap-tabla    { border-spacing: 1px; }
}

/* ── Tabla — estilo grilla BRIO ── */
.tabla {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.tabla thead th {
  background: var(--bg3);
  color: var(--texto);
  font-weight: 600;
  text-align: left;
  padding: 4px 8px;
  height: 24px;
  border-bottom: 1px solid var(--borde);
  border-right: 1px solid #d8d8d8;
  white-space: nowrap;
  font-size: 11px;
}

.tabla thead th:last-child { border-right: none; }
.tabla thead th.num { text-align: right; }

.tabla tbody td {
  padding: 5px 8px;
  height: 26px;
  border-bottom: 1px solid #ececec;
  border-right: 1px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  vertical-align: middle;
}

.tabla tbody td:last-child { border-right: none; }
.tabla tbody tr:nth-child(even) { background: #fafafa; }
.tabla tbody tr:hover { background: var(--acento); cursor: default; }
.tabla tbody tr:last-child td { border-bottom: none; }

.tabla .num   { text-align: right; font-family: "Consolas", monospace; font-variant-numeric: tabular-nums; }
.tabla .monto { color: var(--ok); font-weight: 700; font-family: "Consolas", monospace; }
.tabla .nombre { max-width: 140px; font-size: 12px; }

/* ── Rank badges — estilo BRIO pill ── */
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 0;
  font-size: 9px;
  font-weight: 700;
  margin-right: 5px;
  vertical-align: middle;
  background: var(--bg3);
  color: var(--texto2);
  border: 1px solid var(--borde);
  flex-shrink: 0;
}

.rank-1 { background: #fef3c7; color: #92400e; border-color: #d97706; }
.rank-2 { background: #f1f5f9; color: #334155; border-color: #94a3b8; }
.rank-3 { background: #fff7ed; color: #7c2d12; border-color: #c2410c; }

.tabla tfoot .fila-total td {
  background: var(--bg3);
  font-weight: 700;
  border-top: 2px solid var(--borde);
  padding: 6px 8px;
}
.tabla .txt2 { color: var(--texto3); }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.badge-ok     { background: #dcfce7; color: #166534; }
.badge-warn   { background: #fef9c3; color: #854d0e; }
.badge-peligro{ background: #fee2e2; color: #7f1d1d; }
.badge-info   { background: #dbeafe; color: #1e3a5f; }

/* ── Botón ver fila ── */
.btn-ver {
  background: none;
  border: 1px solid var(--borde);
  color: var(--texto2);
  cursor: pointer;
  padding: 3px 8px;
  font-size: 13px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.btn-ver:hover { background: var(--prim); color: #fff; border-color: var(--prim); }

/* ── Header de módulo (Cajas, Facturas, etc.) ── */
.modulo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.modulo-titulo-wrap { display: flex; flex-direction: column; gap: 1px; }
.modulo-subtitulo   { font-size: 9px; color: var(--texto3); font-style: italic; padding-left: 2px; }
.modulo-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--texto2);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-refrescar {
  background: none;
  border: 1px solid var(--borde);
  color: var(--texto3);
  cursor: pointer;
  padding: 5px 10px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.btn-refrescar:hover { background: var(--bg3); color: var(--texto); }

.sin-datos {
  color: var(--texto3);
  font-size: 12px;
  padding: 20px 0;
  text-align: center;
}

/* ── Avance mes actual ── */
.avance-mes { margin-bottom: 10px; }
.avance-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--texto2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bg3);
}
.avance-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--warn);
  color: #fff;
  padding: 2px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.avance-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.avance-meta-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--texto3); }
.avance-meta-val {
  font-size: 12px;
  font-weight: 700;
  font-family: "Consolas", "Courier New", monospace;
  color: var(--texto2);
}
.avance-bar-outer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.avance-bar-wrap {
  flex: 1;
  position: relative;
  background: var(--bg3);
  height: 30px;
}
.avance-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  min-width: 0;
  transition: width 0.5s ease;
}
.avance-bar-pct {
  font-size: 20px;
  font-weight: 800;
  font-family: "Consolas", "Courier New", monospace;
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}
.avance-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}
.avance-acum { display: flex; align-items: baseline; gap: 5px; }
.avance-acum-val {
  font-size: 16px;
  font-weight: 700;
  font-family: "Consolas", "Courier New", monospace;
}
.avance-acum-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--texto3); }
.avance-nota { font-size: 9px; color: var(--texto3); font-style: italic; }

/* ── Panel detalle (Cajas, Facturas, Tickets) ── */
.detalle-panel {
  position: fixed;
  inset: 0;
  top: var(--header-h);
  bottom: var(--nav-h);
  background: var(--bg);
  z-index: 40;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.detalle-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 10px;
  background: var(--bg2);
  border-bottom: 1px solid var(--borde);
  flex-shrink: 0;
}
.detalle-panel-titulo {
  font-size: 13px;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detalle-panel-header .btn-icono {
  color: var(--texto2);
  background: none;
  border: 1px solid var(--borde);
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detalle-panel-header .btn-icono:hover { background: var(--bg3); color: var(--texto); }
/* Botón compartir empuja al extremo derecho */
.detalle-panel-header .detalle-panel-titulo { flex: 1; }

/* Celda con texto truncado */
.col-ellipsis {
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tabla con filas clickeables */
.tabla-clickable tbody tr { cursor: pointer; }
.tabla-clickable tbody tr:hover { background: var(--acento) !important; }

/* ── Filtros ── */
/* ── Medios de pago valores ── */
.valores-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px 4px;
  font-size: 10px;
  color: var(--texto3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--bg3);
}
/* Tabla de valores: quitar negrita de montos normales */
.valores-tabla .monto { font-weight: 400; color: var(--texto2); }
/* Fila efectivo — toda la fila invertida */
.valores-efectivo,
.valores-efectivo:nth-child(even) { background: #d4a000 !important; }
.valores-efectivo:hover            { background: #c49000 !important; }
.valores-efectivo td               { color: #fff !important; font-weight: 700; border-color: rgba(255,255,255,.2); }
.valores-tabla .valores-efectivo .monto { color: #fff !important; font-weight: 800; }
/* Label efectivo dentro de la fila invertida — solo icono + texto, sin fondo propio */
.efectivo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  font-size: 12px;
}

.filtros-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--bg3);
  margin-bottom: 4px;
}
.filtro-busqueda {
  border: 1px solid var(--borde);
  background: var(--bg2);
  color: var(--texto);
  padding: 6px 10px;
  font-size: 11px;
  flex: 2;
  min-width: 180px;
  outline: none;
}
.filtro-busqueda:focus { border-color: var(--prim); }
.filtro-sel {
  border: 1px solid var(--borde);
  background: var(--bg2);
  color: var(--texto);
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
  flex: 1;
  min-width: 130px;
}
.detalle-panel-cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

/* ── Campos de detalle ── */
.det-cabecera { margin-bottom: 10px; }
.det-fila-badge { margin-bottom: 10px; }
.det-badge { font-size: 10px; padding: 3px 10px; }
.det-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.det-campo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.det-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--texto3);
  display: flex;
  align-items: center;
  gap: 3px;
}
.det-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
}
.det-html { font-size: 12px; }

/* ── Detalle producto ── */
.tabla-det { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-det td { padding: 6px 12px; border-bottom: 1px solid var(--bg3); vertical-align: top; }
.tabla-det .det-lbl { color: var(--texto3); font-size: 11px; width: 110px; white-space: nowrap; }
.det-checks {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  padding: 10px 12px; border-top: 1px solid var(--bg3);
  font-size: 12px; color: var(--texto2);
}
.det-checks label { display: flex; align-items: center; gap: 5px; cursor: default; }
/* Botones de acción en detalle */
.det-acciones { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--bg3); }
.btn-det-accion {
  flex: 1; padding: 9px 10px; border: none; border-radius: 0;
  font-size: 12px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  color: #fff;
}
.btn-accion-ext { background: #00897b; }
.btn-accion-ext:hover { background: #006d61; }
.btn-accion-est { background: #1565c0; }
.btn-accion-est:hover { background: #0d47a1; }
/* Títulos de grilla con fondos de color */
.card-tit-precios  { background: #1565c0; color: #fff; }
.card-tit-deposito { background: #2e7d32; color: #fff; }
.card-tit-especial { background: #6a1b9a; color: #fff; }
.card-tit-insumos  { background: #e65100; color: #fff; }
.card-tit-chart    { background: #00695c; color: #fff; }
/* Tabla depósitos — sin scroll */
.tabla-deposito { table-layout: fixed; width: 100%; }
.tabla-deposito th:first-child,
.dep-nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabla-deposito th:nth-child(2),
.tabla-deposito td:nth-child(2),
.tabla-deposito th:nth-child(3),
.tabla-deposito td:nth-child(3) { width: 72px; }
.cel-neg { color: #a40000 !important; font-weight: 600; }
.td-vacio { text-align: center; padding: 10px; font-size: 12px; color: var(--texto3); }

/* ── Extracto ── */
.ext-filtro-bar { padding: 10px 12px 0; }
.ext-dep-label  { font-size: 11px; color: var(--texto3); display: block; margin-bottom: 4px; }
.ext-filtro-row { display: flex; gap: 8px; padding-bottom: 10px; align-items: center; }
.btn-ext-actualizar {
  padding: 6px 14px; background: #2e7d32; color: #fff; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.btn-ext-actualizar:hover { background: #1b5e20; }
/* Tabla extracto */
.ext-tabla thead tr { background: #1b5e20; color: #fff; }
.ext-tabla th { color: #fff; white-space: nowrap; }
.ext-th-saldo, .ext-td-saldo {
  background: #e0f0ff; color: #003366 !important; font-weight: 700;
}
.ext-row-verde   { background: #d4edda !important; }
.ext-row-rojo    { background: #f8d7da !important; }
.ext-row-amarillo{ background: #fff3cd !important; }
/* KPIs extracto */
.ext-kpis-wrap { padding: 0; }
.ext-kpi-row { display: flex; gap: 12px; padding: 0 0 12px; }
.ext-kpi-card { flex: 1; }
.ext-kpi-label { font-size: 11px; color: var(--texto3); margin-bottom: 4px; }
.ext-kpi-val   { font-size: 26px; font-weight: 700; }
/* Gráfico */
.ext-chart-wrap { padding: 8px 4px 12px; max-height: 260px; }
/* Grid KPIs estadística */
.est-kpis-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; padding: 0 0 8px; }
/* KPIs sólidos estadística */
.est-kpi-card-solid {
  padding: 14px 16px; color: #fff;
}
.est-kpi-solid-label { font-size: 11px; font-weight: 600; text-transform: uppercase; opacity: .85; margin-bottom: 6px; }
.est-kpi-solid-val   { font-size: 22px; font-weight: 700; }
/* Ranking estadística */
.est-ranking-val { font-size: 22px; font-weight: 700; padding: 10px 12px; color: var(--texto); }

/* ── Formulario anulación ── */
.anular-card { margin: 16px; }
.anular-aviso { padding: 10px 12px; font-size: 13px; color: var(--texto2); }
.anular-lbl   { display: block; padding: 0 12px 4px; font-size: 11px; color: var(--texto3); }
.anular-textarea {
  display: block; width: calc(100% - 24px); margin: 0 12px 12px;
  border: 1px solid var(--borde); background: var(--bg2); color: var(--texto);
  padding: 8px 10px; font-size: 13px; resize: vertical; font-family: inherit;
}
.anular-btns { display: flex; gap: 8px; padding: 0 12px 16px; flex-wrap: wrap; }
.btn-anular-confirmar {
  flex: 1; padding: 10px; background: #a40000; color: #fff; border: none;
  font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 6px;
}
.btn-anular-confirmar:disabled { opacity: .6; cursor: default; }
.btn-anular-cancelar {
  flex: 1; padding: 10px; background: var(--bg3); color: var(--texto); border: 1px solid var(--borde);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.fac-anular-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg3);
}
.fac-btn-anular-txt {
  background: none;
  border: 1.5px solid #a40000;
  color: #a40000;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fac-btn-anular-txt:hover { background: #a40000; color: #fff; }

/* ── HTML ticket (VERTICKET) ── */
.tkt-html-wrap {
  background: var(--bg2);
  border: 1px solid var(--borde);
  padding: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--texto);
}



/* ── Scroll contenedor de tabla ── */
.tabla-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 380px;
}

/* ── Paginación ── */
.pag-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid var(--bg3);
}
.pag-btn {
  background: none;
  border: 1px solid var(--borde);
  color: var(--texto2);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.pag-btn:hover:not(:disabled) { background: var(--prim); color: #fff; border-color: var(--prim); }
.pag-btn:disabled { opacity: 0.35; cursor: default; }
.pag-info { font-size: 11px; color: var(--texto2); font-weight: 600; }
.pag-total { color: var(--texto3); font-weight: 400; }

/* ── Loading ── */
.dash-cuerpo.cargando { opacity: 0.5; pointer-events: none; }

/* ── Responsive mobile ── */
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-valor { font-size: 17px; }
}
@media (max-width: 559px) {
  .kpi-3 { grid-template-columns: 1fr; }
}

/* ── Contador (reportes contables) ── */
.contador-aviso {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eaf2fb;
  border: 1px solid #b9d3ee;
  padding: 10px 12px;
  font-size: 11.5px;
  color: var(--prim-d);
  line-height: 1.4;
  margin-bottom: 10px;
}
.contador-aviso i { font-size: 14px; margin-top: 1px; flex-shrink: 0; }

.fecha-input {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--borde-in);
  background: var(--bg2);
  color: var(--texto);
  font: inherit;
  font-size: 12px;
  border-radius: var(--radio);
  outline: none;
}
.fecha-input:focus { outline: 2px solid rgba(70,130,197,.3); outline-offset: -1px; }

/* Selector de período — año + grilla de meses */
.contador-anio-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}
.contador-anio-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--texto);
  min-width: 46px;
  text-align: center;
}
.btn-icono-mini {
  width: 28px;
  height: 28px;
  border: 1px solid var(--borde);
  background: var(--bg2);
  color: var(--texto2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.btn-icono-mini:hover { background: var(--prim); color: #fff; border-color: var(--prim); }

.contador-meses-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (min-width: 420px) { .contador-meses-grid { grid-template-columns: repeat(6, 1fr); } }

.mes-btn {
  height: 30px;
  border: 1px solid var(--borde);
  background: var(--bg2);
  color: var(--texto);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.mes-btn:hover { background: var(--acento); border-color: var(--warn); }
.mes-btn.activo { background: var(--prim); border-color: var(--prim-d); color: #fff; }

.contador-periodo-label {
  font-size: 10.5px;
  color: var(--texto3);
  padding: 10px 2px 2px;
  font-style: italic;
  text-align: center;
}

/* Correo del contador */
.contador-email-row { display: flex; gap: 8px; align-items: center; }
.contador-email-input { flex: 1; min-width: 0; }

.rep-list { display: flex; flex-direction: column; gap: 8px; }
.rep-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--borde);
  padding: 10px 12px;
  background: var(--bg2);
}
.rep-item-top { display: flex; align-items: center; gap: 10px; }
.rep-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  background: var(--clr, var(--prim));
}
.rep-info { flex: 1; min-width: 0; }
.rep-nombre { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--texto); }
.rep-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--texto3);
  border: 1px solid var(--borde);
  padding: 1px 5px;
  letter-spacing: 0.3px;
}
.rep-desc { font-size: 11px; color: var(--texto3); margin-top: 2px; }

.rep-acciones { display: flex; gap: 8px; }
.rep-acciones button {
  flex: 1;
  height: 30px;
  padding: 0 12px;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}
.btn-rep-descargar { background: var(--prim); color: #fff; }
.btn-rep-descargar:hover:not(:disabled) { background: var(--prim-d); }
.btn-rep-descargar:disabled { opacity: 0.6; cursor: default; }

.btn-rep-enviar { background: var(--bg2); color: var(--prim); border: 1px solid var(--prim) !important; }
.btn-rep-enviar:hover:not(:disabled) { background: var(--prim); color: #fff; }
.btn-rep-enviar:disabled { opacity: 0.6; cursor: default; }
