/* ═══════════════════════════════════════════════════
   GESTIÓN DE RUTAS — Estilos enterprise light v2
   Prefijo: .gr-
   Tema: hero azul #1a3c8f + contenido blanco
   ═══════════════════════════════════════════════════ */

.gr-wrap {
  --gr-blue:    #1a3c8f;
  --gr-blue2:   #2251b8;
  --gr-border:  rgba(0,0,0,.1);
  --gr-bg:      #f1f3f8;
  --gr-surface: #ffffff;
  --gr-text:    #18181b;
  --gr-muted:   #4b5563;
  --gr-success: #059669;
  --gr-warn:    #d97706;
  --gr-danger:  #dc2626;
  --gr-radius:  8px;

  display: flex;
  flex-direction: column;
  min-height: 500px;
  font-size: 14px;
  background: var(--gr-bg);
  color: var(--gr-text);
}

/* ── Hero head: título + botones ─────────────────── */
.gr-hero-head {
  background: var(--gr-blue);
  padding: 14px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.gr-hero-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.gr-hero-icon { font-size: 20px; line-height: 1; }
.gr-hero-title b { font-size: 16px; font-weight: 500; }
.gr-hero-sub {
  display: block;
  font-size: 11px;
  opacity: .72;
  margin-top: 2px;
}
.gr-hero-actions { display: flex; align-items: center; gap: 8px; }
.gr-btn-hero {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.38);
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .13s;
}
.gr-btn-hero:hover { background: rgba(255,255,255,.26); }
.gr-info-hero {
  background: none;
  border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.82);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity .13s;
}
.gr-info-hero:hover { opacity: 1; }

/* ── KPI Strip ──────────────────────────────────────── */
.gr-kpis {
  background: var(--gr-blue);
  display: flex;
  gap: 10px;
  padding: 12px 20px 16px;
  flex-wrap: wrap;
}
.gr-kpi-item {
  flex: 1;
  min-width: 130px;
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.38);
  border-radius: var(--gr-radius);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gr-kpi-n {
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.gr-kpi-l {
  font-size: 11px;
  color: rgba(255,255,255,.88);
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* ── hint texto bajo selects del modal ─────────────── */
.gr-hint {
  font-size: .8rem;
  color: var(--gr-muted);
  min-height: 14px;
  margin-top: -4px;
  margin-bottom: 4px;
}

/* ── modal ancho para Nueva Ruta ───────────────────── */
.gr-modal-wide { max-width: 520px; }

/* ── Sub-tabs ───────────────────────────────────────── */
.gr-tabs {
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: .5px solid var(--gr-border);
}
.gr-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--gr-muted);
  padding: 11px 20px;
  cursor: pointer;
  font-size: 13px;
  transition: color .15s, border-color .15s;
}
.gr-tab:hover { color: var(--gr-text); }
.gr-tab.active {
  color: var(--gr-blue);
  border-bottom-color: var(--gr-blue);
  font-weight: 500;
}
.gr-info-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: .55;
  padding: 8px 14px;
  transition: opacity .13s;
}
.gr-info-btn:hover { opacity: 1; }

/* ── Paneles ─────────────────────────────────────────── */
.gr-panel { padding: 14px 16px; flex: 1; background: var(--gr-bg); }
.gr-hidden { display: none !important; }

/* ── Salida: layout dos columnas ────────────────────── */
.gr-salida-layout {
  display: grid;
  grid-template-columns: 275px 1fr;
  gap: 14px;
  min-height: 480px;
}

/* Sidebar izquierdo */
.gr-sidebar {
  background: var(--gr-surface);
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.09), 0 0 0 1px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gr-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: .5px solid var(--gr-border);
  font-weight: 500;
  font-size: 11px;
  color: var(--gr-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #f8f9fb;
}
.gr-filter-sel {
  margin: 8px 10px;
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
  width: calc(100% - 20px);
  cursor: pointer;
}
.gr-ruta-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.gr-ruta-card {
  padding: 11px 13px;
  border-bottom: .5px solid var(--gr-border);
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: background .12s, border-left-color .12s;
}
.gr-ruta-card:last-child { border-bottom: none; }
.gr-ruta-card:hover { background: #f5f7ff; }
.gr-ruta-card.active {
  background: #eef2ff;
  border-left-color: var(--gr-blue);
  box-shadow: inset 0 0 0 1px rgba(26,60,143,.08);
}
.gr-ruta-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.gr-ruta-cod { font-weight: 500; font-size: 13px; }
.gr-ruta-card.active .gr-ruta-cod { color: var(--gr-blue); }
.gr-ruta-card-info { font-size: 12px; color: var(--gr-muted); margin-bottom: 4px; }
.gr-ruta-card-vals {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gr-text);
}

/* Detalle derecho */
.gr-detalle {
  background: var(--gr-surface);
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,.09), 0 0 0 1px rgba(0,0,0,.06);
  overflow: hidden;
  overflow-y: auto;
}
.gr-detalle-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--gr-muted);
  gap: 10px;
}
.gr-det-empty-icon { font-size: 3rem; opacity: .18; }
.gr-det-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: .5px solid var(--gr-border);
  gap: 12px;
  flex-wrap: wrap;
}
.gr-det-title { margin: 0 0 3px; font-size: 1rem; font-weight: 600; }
.gr-det-meta { font-size: 12px; color: var(--gr-muted); }
.gr-det-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.gr-det-kpis {
  display: flex;
  border-bottom: 1px solid var(--gr-border);
  background: linear-gradient(to bottom, #f8f9fb, #f1f3f8);
}
.gr-det-kpi {
  flex: 1;
  padding: 12px 14px;
  border-right: .5px solid var(--gr-border);
  text-align: center;
  transition: background .12s;
}
.gr-det-kpi:last-child { border-right: none; }
.gr-det-kpi:hover { background: #eef2ff; }
.gr-det-kpi span { display: block; font-size: 1.25rem; font-weight: 700; color: var(--gr-blue); line-height: 1.15; }
.gr-det-kpi label {
  display: block;
  font-size: 9.5px;
  color: var(--gr-muted);
  text-transform: uppercase;
  margin-top: 3px;
  letter-spacing: .5px;
  font-weight: 500;
}
.gr-det-table-wrap { overflow-x: auto; }

/* ── Tablas ──────────────────────────────────────────── */
.gr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.gr-table th {
  background: #f8f9fb;
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--gr-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: .5px solid var(--gr-border);
  white-space: nowrap;
}
.gr-table td {
  padding: 9px 12px;
  border-bottom: .5px solid var(--gr-border);
  vertical-align: middle;
}
.gr-table tr:last-child td { border-bottom: none; }
.gr-table tbody tr:hover td { background: #f4f7ff; }
.gr-tfoot td {
  font-weight: 600;
  background: #f1f3f8;
  color: var(--gr-blue);
  border-top: 1px solid var(--gr-border);
}
.gr-fila-cancelada td { background: rgba(5,150,105,.04); }
.gr-fila-parcial   td { background: rgba(217,119,6,.04); }
.gr-cobrado { color: var(--gr-success, #059669) !important; font-weight: 500; }
.gr-credito { color: var(--gr-warn,    #d97706) !important; font-weight: 500; }
.gr-warn    { color: var(--gr-danger,  #dc2626) !important; font-weight: 500; }

/* ── Badges ──────────────────────────────────────────── */
.gr-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.gr-badge.borrador  { background: #fef3c7; color: #92400e; }
.gr-badge.en_ruta   { background: #dbeafe; color: #1e40af; }
.gr-badge.liquidada { background: #d1fae5; color: #065f46; }
.gr-badge.cancelada { background: #fee2e2; color: #991b1b; }
.gr-badge.pendiente { background: #fef3c7; color: #92400e; }
.gr-badge.parcial   { background: #fff7ed; color: #c2410c; }
.gr-badge.credito   { background: #ede9fe; color: #5b21b6; }

/* ── Reporte ─────────────────────────────────────────── */
.gr-reporte-filters {
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  border-radius: var(--gr-radius);
  padding: 11px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.gr-reporte-filters input,
.gr-reporte-filters select {
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 6px 10px;
  border-radius: 5px;
  font-size: 13px;
  min-width: 120px;
}
.gr-rep-summary { font-size: 12px; color: var(--gr-muted); margin-bottom: 8px; }
.gr-pager { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.gr-page-btn {
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  transition: all .13s;
}
.gr-page-btn.active { background: var(--gr-blue); border-color: var(--gr-blue); color: #fff; }
.gr-page-btn:hover:not(.active) { border-color: var(--gr-blue); color: var(--gr-blue); }

/* ── Cobros ──────────────────────────────────────────── */
.gr-cobros-mode {
  display: flex;
  border: .5px solid var(--gr-border);
  border-radius: var(--gr-radius);
  overflow: hidden;
  width: fit-content;
  margin-bottom: 16px;
  background: var(--gr-surface);
}
.gr-mode-btn {
  background: none;
  border: none;
  color: var(--gr-muted);
  padding: 9px 20px;
  cursor: pointer;
  font-size: 13px;
  transition: all .15s;
}
.gr-mode-btn.active { background: var(--gr-blue); color: #fff; font-weight: 500; }
.gr-cobros-selector {
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  border-radius: var(--gr-radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.gr-cobros-selector label { font-size: 13px; color: var(--gr-muted); white-space: nowrap; }
.gr-cobros-selector select {
  flex: 1;
  max-width: 420px;
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 7px 10px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}
.gr-table-cobros .gr-sel-tipo,
.gr-table-cobros .gr-sel-medio {
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 12px;
  width: 100%;
}
.gr-table-cobros .gr-inp-monto {
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 12px;
  width: 110px;
  transition: border-color .13s;
}
.gr-table-cobros .gr-inp-monto:focus { border-color: var(--gr-blue); outline: none; }
.gr-table-cobros .gr-inp-monto:disabled { opacity: .35; cursor: not-allowed; }
.gr-cobros-footer {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  border-radius: var(--gr-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.gr-cobros-totales { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.gr-val-cobro { color: var(--gr-success); font-size: 1.05rem; font-weight: 500; }
.gr-val-cred  { color: var(--gr-warn);    font-size: 1.05rem; font-weight: 500; }
.gr-buscar-fac { margin-bottom: 12px; }
.gr-buscar-fac input {
  width: 100%;
  max-width: 500px;
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 9px 13px;
  border-radius: var(--gr-radius);
  font-size: 14px;
  outline: none;
  transition: border-color .13s;
}
.gr-buscar-fac input:focus { border-color: var(--gr-blue); }

/* ── Resultados de búsqueda ─────────────────────────── */
.gr-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  font-size: 13px;
  transition: border-color .12s, background .12s;
}
.gr-search-item:hover { border-color: var(--gr-blue); background: #eef2ff; }
.gr-search-item small { font-size: 11px; color: var(--gr-muted); }

/* ── Tarjeta de factura seleccionada ───────────────── */
.gr-fac-card {
  background: var(--gr-surface);
  border: .5px solid var(--gr-border);
  border-radius: var(--gr-radius);
  padding: 18px 20px;
  max-width: 520px;
  margin-top: 12px;
}
.gr-fac-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 500;
}
.gr-fac-card-info { font-size: 13px; color: var(--gr-muted); margin-bottom: 10px; }
.gr-fac-card-saldo { margin-bottom: 12px; }
.gr-fac-card-saldo label {
  font-size: 11px;
  color: var(--gr-muted);
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.gr-fac-card-saldo b { font-size: 1.4rem; color: var(--gr-danger); }
.gr-hr { border: none; border-top: .5px solid var(--gr-border); margin: 12px 0; }
.gr-fac-abono-form { display: flex; flex-direction: column; gap: 8px; }
.gr-fac-abono-form label {
  font-size: 11px;
  color: var(--gr-muted);
  text-transform: uppercase;
  letter-spacing: .3px;
}
.gr-fac-abono-form input,
.gr-fac-abono-form select {
  background: #f8f9fb;
  border: .5px solid var(--gr-border);
  color: var(--gr-text);
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color .13s;
}
.gr-fac-abono-form input:focus { border-color: var(--gr-blue); }
.gr-abono-actions { display: flex; gap: 10px; margin-top: 6px; }

/* ── Botones ─────────────────────────────────────────── */
.gr-btn-primary, .gr-btn-secondary, .gr-btn-success,
.gr-btn-danger, .gr-btn-ghost, .gr-btn-big {
  border-radius: 6px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, opacity .12s, transform .08s;
  white-space: nowrap;
  border: none;
}
.gr-btn-primary   { background: var(--gr-blue,    #1a3c8f); color: #fff; }
.gr-btn-secondary { background: var(--gr-surface, #ffffff); border: .5px solid var(--gr-border, rgba(0,0,0,.1)); color: var(--gr-text, #18181b); }
.gr-btn-success   { background: var(--gr-success, #059669); color: #fff; }
.gr-btn-danger    { background: var(--gr-danger,  #dc2626); color: #fff; }
.gr-btn-ghost     { background: transparent; border: .5px solid var(--gr-border, rgba(0,0,0,.1)); color: var(--gr-blue, #1a3c8f); }
.gr-btn-big       { padding: 10px 22px; font-size: 14px; }

.gr-btn-primary:hover   { background: var(--gr-blue2, #2251b8); }
.gr-btn-success:hover,
.gr-btn-danger:hover    { opacity: .88; }
.gr-btn-secondary:hover,
.gr-btn-ghost:hover     { border-color: var(--gr-blue); background: #eef2ff; }
.gr-btn-primary:active,
.gr-btn-success:active,
.gr-btn-danger:active   { transform: scale(.97); }

.gr-btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 3px 6px;
  color: var(--gr-muted);
  border-radius: 4px;
  transition: color .12s, background .12s;
}
.gr-btn-icon:hover { color: var(--gr-danger); background: rgba(220,38,38,.08); }

/* ══════════════════════════════════════════════════════════
   MODALES — diseño enterprise v6
   ══════════════════════════════════════════════════════════ */

/* Backdrop con blur */
.gr-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: grBgFadeIn .18s ease;
}
@keyframes grBgFadeIn { from { opacity:0 } to { opacity:1 } }

/* Contenedor: flex column → footer siempre visible */
.gr-modal {
  background: #fff;
  border-radius: 14px;
  width: 500px;
  max-width: 96vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.10);
  animation: grModalSlideIn .22s cubic-bezier(.4,0,.2,1);
}
@keyframes grModalSlideIn {
  from { opacity:0; transform:scale(.93) translateY(16px) }
  to   { opacity:1; transform:scale(1)   translateY(0) }
}
.gr-modal-wide { width: 760px; }

/* Cabecera genérica */
.gr-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 14px 14px 0 0;
  flex-shrink: 0;
}
.gr-modal-head h3 { margin:0; font-size:.95rem; font-weight:600; color:#111827; }
.gr-modal-head > button {
  background: none; border: none; color: #6b7280;
  font-size: 18px; cursor: pointer; line-height: 1; transition: color .12s; padding:2px;
}
.gr-modal-head > button:hover { color: #111827; }

/* Header AZUL — botón ✕ circular blanco */
.gr-modal-head.gr-head-blue {
  background: linear-gradient(135deg, #1a3c8f 0%, #2251b8 100%);
  border-bottom: none;
  padding: 18px 22px;
  flex-shrink: 0;
}
.gr-modal-head.gr-head-blue h3 {
  margin: 0; color: #fff; font-size: 1.02rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.gr-modal-head.gr-head-blue .gr-mh-sub {
  display: block; color: rgba(255,255,255,.72); font-size: 11.5px;
  margin-top: 3px; font-weight: 400;
}
.gr-modal-head.gr-head-blue > button {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.32);
  color: #fff; border-radius: 50%;
  width: 32px; height: 32px; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
  flex-shrink: 0;
}
.gr-modal-head.gr-head-blue > button:hover {
  background: rgba(255,255,255,.3); transform: rotate(90deg);
}

/* Cuerpo scrollable */
.gr-modal-body {
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
  font-size: 13px; overflow-y: auto; flex: 1;
}
.gr-modal-body label {
  display: block;
  font-size: 10.5px; color: #6b7280;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 5px; font-weight: 500;
}
.gr-modal-body input,
.gr-modal-body textarea,
.gr-modal-body select {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  color: #111827;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; outline: none;
  width: 100%; box-sizing: border-box;
  transition: border-color .14s, box-shadow .14s;
  font-family: inherit;
}
.gr-modal-body input:focus,
.gr-modal-body textarea:focus,
.gr-modal-body select:focus {
  border-color: #1a3c8f;
  box-shadow: 0 0 0 3px rgba(26,60,143,.10);
  background: #fff;
}
.gr-modal-body input[readonly] {
  background: #f1f5f9; color: #374151; cursor: default;
}
.gr-modal-body p  { margin:0; }
.gr-modal-body ul { margin:4px 0; padding-left:20px; }
.gr-modal-body code {
  background:#f1f5f9; padding:1px 5px; border-radius:3px; font-size:12px;
}

/* Footer — siempre visible */
.gr-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  background: #f9fafb;
  border-radius: 0 0 14px 14px;
  flex-shrink: 0;
}

/* 2 columnas en modal nueva ruta */
.gr-nruta-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

/* Preview de barrios */
.gr-nruta-preview {
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 8px; padding: 8px 12px;
  font-size: .8rem; color: #1e40af;
  margin-top: -8px; display: none; line-height: 1.6;
}
.gr-nruta-preview.visible { display: block; }

/* Botón CTA grande */
.gr-btn-big { padding: 10px 26px; font-size: 13.5px; font-weight: 600; min-width: 148px; }

/* ── Recibo de impresión ────────────────────────────── */
.gr-recibo-head { margin-bottom: 14px; border-bottom: .5px solid var(--gr-border); padding-bottom: 12px; }
.gr-recibo-head h2 { margin: 0 0 4px; color: var(--gr-blue); }
.gr-recibo-num { font-size: 1.05rem; color: var(--gr-muted); }
.gr-recibo-info { margin-bottom: 14px; font-size: 13px; border-collapse: collapse; width: auto; }
.gr-recibo-info td { padding: 3px 12px 3px 0; border: none; }
.gr-recibo-info td:first-child { color: var(--gr-muted); white-space: nowrap; }
.gr-recibo-totales {
  margin-top: 16px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 12px 14px;
  background: #eef2ff;
  border-radius: 6px;
  border-left: 3px solid var(--gr-blue);
}

/* Fila de separación por cliente en recibo agrupado */
.gr-recibo-cliente-row td {
  background: #f0f4ff;
  border-top: 2px solid #c7d2fe;
  font-size: 12.5px;
  padding: 6px 10px;
  color: #1e3a8a;
}
.gr-recibo-cliente-row:first-child td { border-top: none; }

/* ── Empty & error ───────────────────────────────────── */
.gr-empty { text-align: center; color: var(--gr-muted); padding: 28px 16px; font-size: 13px; }
.gr-err   { color: var(--gr-danger) !important; }

/* ── Toast ───────────────────────────────────────────── */
.gr-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  max-width: 400px;
  animation: grToastIn .22s ease;
}
.gr-toast-ok   { background: #065f46; color: #fff; }
.gr-toast-err  { background: #991b1b; color: #fff; }
.gr-toast-warn { background: #92400e; color: #fff; }
@keyframes grToastIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .gr-hero-head { padding: 12px 14px 0; }
  .gr-kpis      { padding: 10px 14px 12px; }
  .gr-salida-layout { grid-template-columns: 1fr; }
  .gr-panel { padding: 10px; }
  .gr-tab   { padding: 10px 14px; font-size: 12px; }
  .gr-cobros-footer { flex-direction: column; align-items: flex-start; }
  .gr-modal-wide { width: 95vw; }
}

/* ══════════════════════════════════════════════════════
   BI — REPORTE INTERACTIVO
   ══════════════════════════════════════════════════════ */

/* KPI Cards */
.gr-bi-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.gr-bi-kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,.09);
  border-top: 4px solid var(--color);
}
.gr-bi-kpi-card .kpi-val {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color);
  line-height: 1.2;
  margin-bottom: 2px;
}
.gr-bi-kpi-card .kpi-label {
  font-size: .75rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
  font-weight: 600;
}
.gr-bi-kpi-card .kpi-sub {
  font-size: .8rem;
  color: #9ca3af;
  margin-top: 4px;
  line-height: 1.35;
}

/* Sub-tabs BI */
.gr-bi-subtabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
  flex-wrap: wrap;
}
.gr-bi-stab {
  padding: 8px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: .85rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color .13s, border-color .13s;
}
.gr-bi-stab:hover { color: #374151; }
.gr-bi-stab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  font-weight: 600;
}

/* Tablas BI */
.gr-bi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.gr-bi-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #374151;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.gr-bi-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.gr-bi-table tbody tr:hover td { background: #f4f7ff; }
.gr-bi-table tfoot tr.totals td {
  background: #f0f9ff;
  font-weight: 700;
  border-top: 2px solid #bae6fd;
}
.gr-bi-table .monto {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.gr-bi-table .efectividad-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}
.gr-bi-bar {
  height: 6px;
  border-radius: 3px;
  background: #e5e7eb;
  flex: 1;
  min-width: 60px;
}
.gr-bi-bar-fill {
  height: 6px;
  border-radius: 3px;
  background: #10b981;
  transition: width .3s ease;
}

/* Filtros globales BI */
.gr-bi-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.gr-bi-filters input[type=date] {
  padding: 7px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .875rem;
  background: #fff;
  color: #111827;
  outline: none;
  transition: border-color .13s;
}
.gr-bi-filters input[type=date]:focus { border-color: #1d4ed8; }

/* Responsive BI */
@media (max-width: 900px) {
  .gr-bi-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 550px) {
  .gr-bi-kpis { grid-template-columns: 1fr; }
  .gr-bi-stab { font-size: .78rem; padding: 7px 10px; }
}
