/**
 * ==============================================================================
 * SISTEMA INTEGRAL DE CONTROL DE CONSUMO DE AGUA POTABLE - PWA
 * Archivo Maestro de Estilos: styles.css
 * Mobile-First & Arquitectura CSS Nativa de Alto Desempeño
 * Cero dependencias externas | Optimizado para operación bajo el sol en campo
 * ==============================================================================
 */

/* --------------------------------------------------------------------------
   1. VARIABLES DE DISEÑO & CONFIGURACIÓN BASE (:root)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta Temática Agua Potable Profesional - Hidro-Precisión Institucional */
  --primary: #0A3647;
  --primary-dark: #062330;
  --primary-light: #0E4F68;
  --secondary: #0284C7;
  --secondary-light: #38BDF8;
  --accent: #00B4D8;
  --accent-light: #E0F2FE;
  --accent-glow: rgba(0, 180, 216, 0.25);

  /* Superficies y Fondos */
  --bg-page: #F4F7FA;
  --bg-app: #F4F7FA;
  --bg-card: #FFFFFF;
  --bg-card-alt: #EDF2F7;
  --bg-input: #FFFFFF;
  --bg-input-disabled: #E2E8F0;

  /* Tipografía y Textos */
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-inverted: #FFFFFF;
  --text-on-accent: #062330;

  /* Bordes y Divisiones */
  --border: #CBD5E1;
  --border-focus: #00B4D8;
  --border-light: #E2E8F0;

  /* Estados y Semáforos Operativos (Alta Saturación para Luz Solar) */
  --success: #059669;
  --success-bg: #ECFDF5;
  --success-border: #A7F3D0;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --warning-border: #FDE68A;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --info: #0284C7;
  --info-bg: #F0F9FF;
  --info-border: #BAE6FD;

  /* Sombras Táctiles y Elevaciones */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-sheet: 0 -4px 20px rgba(0, 0, 0, 0.15);

  /* Radios de Curvatura Ergonómicos */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Familias Tipográficas */
  --font-base: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;

  /* Parámetros de Interfaz Táctil (Mínimo 48px según directriz de accesibilidad) */
  --touch-target-min: 48px;
  --header-height: 64px;
  --bottom-nav-height: 68px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease-in-out;
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. CONTROL DE ACCESO Y VISIBILIDAD POR ROLES EN <body>
   -------------------------------------------------------------------------- */
body.not-master .master-only,
body.not-master #master-gas-config-section,
body.not-master #master-tarifa-config-section,
body.not-master #admin-users-manager,
body.not-master #btn-open-settings {
  display: none !important;
}

body.role-cliente .admin-only,
body.role-cliente .master-only,
body.role-cliente .bottom-nav,
body.role-cliente .operador-view,
body.role-cliente .write-only,
body.role-cliente #btn-open-settings {
  display: none !important;
}

body:not(.role-cliente) .cliente-view {
  display: none !important;
}

body.mode-readonly .write-only {
  display: none !important;
}

body.no-almacen .almacen-only {
  display: none !important;
}

body.no-botiquin .botiquin-only {
  display: none !important;
}

body.no-ventas .ventas-only {
  display: none !important;
}

body.no-finanzas .finanzas-only {
  display: none !important;
}

body.no-operativo .operativo-only,
body.no-operativo .write-only {
  display: none !important;
}

/* Utilidad general de ocultamiento */
.is-hidden,
.legacy-compat-hidden,
[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   3. RESET MODERNO & REGLAS BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  height: 100%;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  height: 100%;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--secondary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   4. TIPOGRAFÍA Y JERARQUÍA
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p {
  margin-bottom: 0.5rem;
}

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-mono,
.mono { font-family: var(--font-mono); }

/* Tipografía numérica tabular de alta precisión */
.cost,
.kpi-num,
.kpi-val,
.kpi-big-value,
.stat-value,
.reading-input-curr,
.input-giant-reading,
.reading-input-prev,
.bar-val,
.total-giant-number,
.cobro-vuelto-display {
  font-variant-numeric: tabular-nums;
}

.cost {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--primary-dark);
}
.text-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* --------------------------------------------------------------------------
   5. APP SHELL: ENCABEZADO SUPERIOR FIJO (.app-header)
   -------------------------------------------------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-inverted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  z-index: 100;
  box-shadow: var(--shadow-md);
  gap: 0.5rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.brand-icon,
.header-logo-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.brand-icon {
  background: var(--accent-light);
  border-radius: var(--radius-md);
  padding: 6px;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.brand-titles,
.header-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-title,
.app-brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFFFFF;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.header-version {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.28);
  padding: 0.1rem 0.38rem;
  border-radius: 6px;
  letter-spacing: 0;
}

.brand-subtitle,
.company-subname {
  font-size: 0.72rem;
  color: var(--accent-light);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* Píldora de Sincronización en Vivo */
.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.35rem 0.7rem;
  min-height: 36px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.sync-status-pill:active {
  transform: scale(0.96);
}

.sync-status-pill .status-dot,
.sync-status-pill .sync-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
  flex-shrink: 0;
}

.sync-pill-text {
  line-height: 1;
}

.sync-pill-badge {
  background-color: var(--warning);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.08rem 0.38rem;
  border-radius: var(--radius-full);
  line-height: 1.1;
}

.sync-status-pill.offline {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(252, 165, 165, 0.45);
}
.sync-status-pill.offline .status-dot,
.sync-status-pill.offline .sync-pill-dot {
  background-color: #F87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.35);
}

.sync-status-pill.syncing {
  background: rgba(5, 191, 219, 0.25);
  border-color: rgba(5, 191, 219, 0.5);
}
.sync-status-pill.syncing .status-dot,
.sync-status-pill.syncing .sync-pill-dot {
  background-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(5, 191, 219, 0.35);
  animation: pulse-sync 1.2s infinite ease-in-out;
}

@keyframes pulse-sync {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

/* Badge de Usuario Activo en Cabecera */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.3rem 0.6rem;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: #FFFFFF;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.user-role-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.user-name-label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge .user-role {
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Botón Icono Circular en Header */
.btn-header-action,
.btn-icon-circle {
  width: 42px;
  height: 42px;
  min-height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 1.05rem;
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}

.btn-header-action:hover,
.btn-icon-circle:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-header-action:active,
.btn-icon-circle:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.94);
}

.btn-header-action svg,
.btn-icon-circle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 600px) {
  .app-header {
    padding: 0 0.65rem;
    gap: 0.35rem;
  }
  .header-brand {
    gap: 0.45rem;
  }
  .header-logo-svg {
    width: 30px;
    height: 30px;
  }
  .app-brand-name {
    font-size: 0.94rem;
  }
  .company-subname,
  .user-name-label {
    display: none !important;
  }
  .user-badge {
    padding: 0.25rem 0.45rem;
    min-width: 36px;
    justify-content: center;
  }
  .sync-status-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.66rem;
    gap: 0.28rem;
  }
  .header-actions {
    gap: 0.3rem;
  }
  .btn-icon-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   6. BANNER DE MODO SOLO LECTURA (.readonly-banner)
   -------------------------------------------------------------------------- */
.readonly-banner {
  display: none;
  background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
  text-align: center;
  letter-spacing: 0.01em;
}

body.mode-readonly .readonly-banner {
  display: flex;
}

.readonly-banner svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   7. CONTENEDOR PRINCIPAL (.app-main)
   -------------------------------------------------------------------------- */
.app-main {
  flex: 1;
  margin-top: var(--header-height);
  padding: 1rem 1rem calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px) + 1.5rem) 1rem;
  max-width: 1080px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

@media (max-width: 600px) {
  .app-main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Ajuste cuando el banner de solo lectura está activo */
body.mode-readonly .app-main {
  margin-top: calc(var(--header-height) + 2rem);
}

/* --------------------------------------------------------------------------
   8. PANELES / VISTAS (.view-panel)
   -------------------------------------------------------------------------- */
.view-panel {
  display: none;
  animation: fadeIn var(--transition-smooth);
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  margin-bottom: 1.15rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.view-title-group h2,
.view-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.15rem;
}

.view-title-group p,
.view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .view-header {
    flex-direction: column;
    align-items: stretch;
  }
  .view-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
  }
  .view-actions .btn,
  .view-header > .btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
  }
}

/* --------------------------------------------------------------------------
   9. COMPONENTES: BOTONES TÁCTILES ERGONÓMICOS (Min 48px Altura)
   -------------------------------------------------------------------------- */
.btn {
  min-height: var(--touch-target-min);
  min-width: var(--touch-target-min);
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  outline: none;
  cursor: pointer;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Variantes de Botones */
.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary-dark);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--primary-light);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #FFFFFF;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background-color: var(--secondary-light);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-on-accent);
  font-weight: 800;
}
.btn-accent:hover,
.btn-accent:focus-visible {
  background-color: #03a9c1;
}

.btn-success {
  background-color: var(--success);
  color: #FFFFFF;
}
.btn-success:hover,
.btn-success:focus-visible {
  background-color: #047857;
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}
.btn-danger:hover,
.btn-danger:focus-visible {
  background-color: #b91c1c;
}

.btn-warning {
  background-color: var(--warning);
  color: #FFFFFF;
}

.btn-dark {
  background-color: #1E293B;
  color: #FFFFFF;
  border-color: #334155;
}
.btn-dark:hover,
.btn-dark:focus-visible {
  background-color: #0F172A;
}

.btn-outline {
  background-color: #FFFFFF;
  color: var(--primary);
  border-color: var(--border);
  box-shadow: none;
}
.btn-outline:hover {
  background-color: var(--bg-card-alt);
  border-color: var(--primary);
}
.btn-outline:active {
  background-color: var(--accent-light);
  border-color: var(--primary);
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-outline-danger:active {
  background-color: var(--danger-bg);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  box-shadow: none;
}
.btn-ghost:active {
  background-color: var(--bg-card-alt);
  color: var(--text-main);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-lg {
  min-height: 54px;
  padding: 0.85rem 1.4rem;
  font-size: 1.05rem;
}

.btn-icon {
  padding: 0;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  border-radius: var(--radius-md);
}

.btn-file-label {
  cursor: pointer;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   10. TARJETAS & CONTENEDORES (.card)
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

@media (max-width: 600px) {
  .card {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
}

.card:hover {
  border-color: #94A3B8;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.5rem;
}

.card-title,
.card-inner-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.card-header .card-title {
  margin-bottom: 0;
}

.card-title svg {
  width: 20px;
  height: 20px;
  color: var(--secondary);
}

.card-body {
  position: relative;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  line-height: 1.45;
}

.form-card-sub {
  background-color: var(--bg-card-alt);
  border: 1.5px solid var(--secondary);
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

.form-card-sub h5 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 0.85rem;
}

/* --------------------------------------------------------------------------
   11. KPI DASHBOARD CARDS (.kpi-grid, .kpis-grid, .finanzas-kpis, .kpi-card)
   -------------------------------------------------------------------------- */
.kpi-grid,
.kpis-grid,
.finanzas-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 480px) {
  .kpi-grid,
  .kpis-grid,
  .finanzas-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 840px) {
  .kpis-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .kpi-grid,
  .finanzas-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.kpi-card.success {
  border-left: 5px solid var(--success);
  background-color: #F0FDF4;
  border-color: var(--success-border);
}

.kpi-card.danger {
  border-left: 5px solid var(--danger);
  background-color: #FEF2F2;
  border-color: var(--danger-border);
}

.kpi-card.warning {
  border-left: 5px solid var(--warning);
  background-color: #FFFBEB;
  border-color: var(--warning-border);
}

.kpi-card.info {
  border-left: 5px solid var(--secondary);
  background-color: #F0F9FF;
  border-color: var(--info-border);
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  width: 100%;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-light);
  color: var(--primary);
  font-size: 1.35rem;
  flex-shrink: 0;
}

.kpi-card.success .kpi-icon {
  background-color: #D1FAE5;
  color: var(--success);
}
.kpi-card.danger .kpi-icon {
  background-color: #FEE2E2;
  color: var(--danger);
}
.kpi-card.warning .kpi-icon {
  background-color: #FEF3C7;
  color: var(--warning);
}
.kpi-card.info .kpi-icon {
  background-color: #E0F2FE;
  color: var(--info);
}

.kpi-icon svg {
  width: 20px;
  height: 20px;
}

.kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.kpi-val,
.kpi-num {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-dark);
  font-family: var(--font-mono);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.25;
}

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   12. FORMULARIOS, UTILIDADES DE LAYOUT & CONTROLES DE ENTRADA ERGONÓMICOS
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.25rem;
}

@media (min-width: 600px) {
  .form-row {
    flex-direction: row;
    align-items: flex-start;
  }
}

.flex-1 {
  flex: 1;
  min-width: 0;
}

.form-group label,
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.38rem;
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.2rem;
}

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  min-height: var(--touch-target-min);
  padding: 0.7rem 0.95rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
  background-color: var(--bg-input-disabled);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-light);
}

.form-textarea,
textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-hint,
.help-text {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.32rem;
  line-height: 1.35;
}

.sub-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: normal;
}

.sub-val {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-actions-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 0.35rem;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.backup-buttons-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .form-actions-bar {
    flex-direction: column-reverse;
  }
  .form-actions-bar .btn {
    width: 100%;
  }
  .backup-buttons-row {
    flex-direction: column;
  }
  .backup-buttons-row .btn {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   13. FORMULARIO DE MEDICIÓN INDIVIDUAL DE CAMPO (#view-operacion-individual)
   -------------------------------------------------------------------------- */
.reading-form-box,
.form-card-reading {
  background: var(--bg-card);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .form-card-reading {
    padding: 1rem;
  }
}

/* Ficha Rápida del Medidor Seleccionado */
.selected-meter-card-preview {
  background-color: #F0F9FF;
  border: 1px solid var(--info-border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.15rem;
}

.preview-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 520px) {
  .preview-cols {
    flex-direction: column;
    gap: 0.65rem;
  }
  .preview-cols .text-right {
    text-align: left;
  }
}

/* Grilla de Comparación de Lectura Anterior vs Nueva */
.reading-form-grid,
.readings-comparison-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

@media (min-width: 600px) {
  .reading-form-grid,
  .readings-comparison-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.reading-input-box {
  background-color: var(--bg-page);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.reading-input-box.active-input {
  background-color: #F0F9FF;
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

/* Campo de Lectura Anterior (Bloqueado pero Legible) */
.reading-input-prev,
.input-readonly-reading {
  background-color: #E2E8F0 !important;
  color: #334155 !important;
  font-family: var(--font-mono);
  font-size: 1.45rem !important;
  font-weight: 800;
  text-align: right;
  letter-spacing: 0.04em;
  border: 2px dashed #94A3B8 !important;
  min-height: 54px;
}

/* Cabecera visual de odómetro mecánico */
.odometer-legend {
  display: inline-flex;
  align-items: stretch;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  user-select: none;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  margin-left: auto;
}

.odo-tag-m3 {
  background-color: #0F172A;
  color: #FFFFFF;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
}

.odo-tag-litros {
  background-color: #DC2626;
  color: #FFFFFF;
  padding: 0.22rem 0.65rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
}

/* Campo de Lectura Actual (Visor de medidor de alto contraste para campo) */
.reading-input-curr,
.input-giant-reading {
  font-family: var(--font-mono);
  font-size: 2rem !important;
  font-weight: 900 !important;
  font-variant-numeric: tabular-nums;
  text-align: right;
  letter-spacing: 0.06em;
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  border: 3px solid var(--primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.6rem 1rem !important;
  min-height: 58px !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.reading-input-curr:focus,
.input-giant-reading:focus {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25) !important;
  background-color: #F8FAFC !important;
}

/* Tarjeta de Cálculo Dinámico en Tiempo Real */
.live-calculation-card {
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 5px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calc-row + .calc-row {
  padding-top: 0.55rem;
  border-top: 1px dashed #86EFAC;
}

.calc-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: #166534;
}

.calc-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: #14532D;
}

.calc-value.cost {
  color: var(--primary-dark);
  font-size: 1.45rem;
}

.calc-alert-banner {
  margin-top: 0.5rem;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
  animation: shake 0.4s ease-in-out;
}

.calc-alert-banner.danger {
  background-color: var(--danger-bg);
  border: 1.5px solid var(--danger-border);
  color: var(--danger);
}

.calc-alert-banner.warning {
  background-color: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
  color: #B45309;
}

/* Caja legacy de Cálculo Dinámico */
.calc-live-box {
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 5px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  text-align: center;
}

.calc-live-box .calc-item {
  display: flex;
  flex-direction: column;
}

/* Alertas de Inconsistencia en Medición */
.consumption-alert {
  display: none;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  align-items: center;
  gap: 0.75rem;
  animation: shake 0.4s ease-in-out;
}

.consumption-alert.negative {
  display: flex;
  background-color: var(--danger-bg);
  border: 1.5px solid var(--danger-border);
  color: var(--danger);
}

.consumption-alert.high {
  display: flex;
  background-color: var(--warning-bg);
  border: 1.5px solid var(--warning-border);
  color: var(--warning);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* --------------------------------------------------------------------------
   14. SECCIÓN DE CAPTURA DE FOTO DEL MEDIDOR (.photo-capture-section)
   -------------------------------------------------------------------------- */
.photo-capture-box,
.photo-capture-section {
  background: var(--bg-page);
  border: 2px dashed var(--secondary);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.photo-section-title {
  display: block;
  font-size: 0.98rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}

.photo-section-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.95rem;
  line-height: 1.4;
}

.photo-controls-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.photo-controls-row #btn-trigger-camera {
  flex: 2;
  min-width: 220px;
}

.photo-controls-row #btn-trigger-gallery {
  flex: 1;
  min-width: 160px;
}

@media (max-width: 600px) {
  .photo-controls-row {
    flex-direction: column;
  }
  .photo-controls-row .btn {
    width: 100%;
    min-width: 0;
  }
}

.reading-photo-preview-container {
  margin-top: 1rem;
  background: #FFFFFF;
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.photo-meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.photo-size-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card-alt);
  color: var(--primary-dark);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.photo-quality-indicator {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--success);
}

.photo-frame-preview {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

#img-reading-preview {
  max-height: 260px;
  width: 100%;
  object-fit: contain;
  background: #0F172A;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.photo-frame-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .photo-frame-buttons {
    flex-direction: column;
  }
  .photo-frame-buttons .btn {
    width: 100%;
  }
}

/* Clases adicionales de vista previa fotográfica */
.photo-preview-container {
  display: none;
  position: relative;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border);
  background: #000000;
  max-height: 280px;
}

.photo-preview-container.active {
  display: block;
}

.photo-preview-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.photo-badge-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.photo-actions-row {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   15. MODAL VISOR DE FOTO HD A PANTALLA COMPLETA (#modal-photo-viewer)
   -------------------------------------------------------------------------- */
#modal-photo-viewer,
.modal-photo-fullscreen {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(2, 6, 23, 0.96);
  z-index: 1000;
  flex-direction: column;
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  backdrop-filter: blur(8px);
}

#modal-photo-viewer.active {
  display: flex !important;
}

.photo-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.photo-viewer-header,
.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  color: #FFFFFF;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  z-index: 10;
}

.photo-viewer-header h4 {
  color: #FFFFFF;
  font-size: 0.98rem;
  margin: 0;
}

.photo-viewer-header .sub-label {
  color: #94A3B8;
  font-size: 0.72rem;
  margin-top: 2px;
}

.viewer-zoom-controls,
.photo-viewer-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-zoom,
.photo-zoom-btn {
  min-width: 42px;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-zoom:active,
.photo-zoom-btn:active {
  background: var(--accent);
  color: var(--text-on-accent);
  transform: scale(0.94);
}

.zoom-level-text {
  min-width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #38BDF8;
}

.btn-close-viewer {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 50%;
  background: #DC2626;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.btn-close-viewer:active {
  transform: scale(0.93);
}

.photo-viewer-stage,
.photo-viewer-viewport {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  touch-action: pan-x pan-y pinch-zoom;
}

#viewer-zoom-img,
.photo-viewer-image {
  max-width: 96%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 0.2s ease;
  transform-origin: center center;
}

.photo-viewer-footer {
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px)) 1rem;
  text-align: center;
  color: #CBD5E1;
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.photo-viewer-footer p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   16. GRILLAS & TARJETAS DE MEDIDORES (.meter-card) E INSUMOS (.insumo-card)
   -------------------------------------------------------------------------- */
.meters-grid,
.insumos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 620px) {
  .meters-grid,
  .insumos-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.meter-card,
.insumo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.meter-card:hover,
.insumo-card:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.meter-card-header,
.insumo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.meter-code,
.meter-code-badge {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin-top: 0.35rem;
  margin-bottom: 0.1rem;
  letter-spacing: 0.02em;
}

.meter-serial {
  display: block;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.meter-card-body {
  flex: 1;
  margin-bottom: 0.9rem;
}

.meter-owner,
.meter-client-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.meter-address {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.meter-kpi-reading-row,
.meter-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
}

.reading-stat {
  display: flex;
  flex-direction: column;
}

.stat-label,
.meter-data-item .data-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: normal;
}

.stat-value,
.meter-data-item .data-val {
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.meter-card-actions,
.meter-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.meter-card-actions .btn {
  flex: 1;
  min-height: 44px;
}

.meter-card-actions .btn.btn-card-delete {
  flex: 0 0 auto;
  min-width: 44px;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

/* Tarjetas de Almacén de Insumos */
.insumo-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
}

.insumo-desc {
  font-size: 0.84rem;
  margin-bottom: 0.85rem;
  flex: 1;
}

.insumo-pricing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card-alt);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   17. VISTA ESPECIAL PARA CLIENTES / ABONADOS (#view-cliente)
   -------------------------------------------------------------------------- */
#view-cliente {
  animation: fadeIn var(--transition-smooth);
}

.cliente-meter-card {
  border-top: 4px solid var(--primary);
}

.meter-code-highlight {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin: 0.3rem 0 0.15rem 0;
}

.meter-address-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.meter-serial-info {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.9rem;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.25rem 0.65rem;
  font-size: 0.82rem;
  align-items: center;
}

.meter-serial-info .info-label {
  color: var(--text-muted);
  font-weight: 600;
}

.meter-serial-info .info-val {
  font-family: var(--font-mono);
  color: var(--primary-dark);
  text-align: right;
}

@media (max-width: 600px) {
  .cliente-meter-card .meter-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .meter-serial-info {
    width: 100%;
    margin-top: 0.4rem;
  }
}

/* Banner Principal de Consumo del Mes */
.cliente-kpi-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, #0F172A 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin: 1rem 0 1.35rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.15rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 680px) {
  .cliente-kpi-banner {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

.kpi-main-block {
  text-align: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

@media (min-width: 680px) {
  .kpi-main-block {
    text-align: left;
    padding-bottom: 0;
    padding-right: 1.25rem;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
  }
}

.kpi-banner-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.kpi-banner-title {
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #38BDF8;
  text-transform: uppercase;
  margin-bottom: 0;
}

.kpi-big-value {
  font-size: 2.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #FFFFFF;
  line-height: 1.05;
}

.kpi-big-value small {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.cliente-kpi-banner .kpi-subtext {
  color: #BAE6FD;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Barra de progreso de consumo mínimo */
.minimo-progress-box {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.minimo-progress-Header,
.minimo-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  color: #BAE6FD;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.minimo-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.minimo-progress-fill {
  height: 100%;
  width: 0%;
  background: #34D399;
  border-radius: var(--radius-full);
  transition: width 0.4s ease, background-color 0.3s ease;
}

.minimo-progress-fill.is-excedente {
  background: #F59E0B;
}

.kpi-secondary-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

@media (max-width: 400px) {
  .kpi-secondary-block {
    grid-template-columns: 1fr;
  }
}

.kpi-sub-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
}

.kpi-sub-item .sub-label {
  color: #CBD5E1;
  font-size: 0.68rem;
}

.kpi-sub-item .sub-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.98rem;
  font-weight: 800;
  color: #FFFFFF;
  margin-top: 0.15rem;
}

.kpi-sub-item.highlight-cost {
  background: rgba(5, 191, 219, 0.22);
  border-color: var(--accent);
}

.kpi-sub-item.highlight-cost .sub-value {
  color: #34D399;
  font-size: 1.1rem;
}

/* Evidencia Fotográfica del Cliente */
.cliente-photo-section {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.35rem;
}

.cliente-photo-preview-box {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #0F172A;
  border: 1px solid var(--border);
  text-align: center;
}

.cliente-meter-img {
  max-height: 300px;
  width: 100%;
  object-fit: contain;
  background: #0F172A;
  border-radius: 10px;
  cursor: zoom-in;
}

.photo-overlay-actions {
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  justify-content: center;
}

/* Gráfico de Barras de Consumo Mensual del Cliente */
.cliente-history-bars-section {
  margin-bottom: 1.35rem;
}

.consumption-bars-container {
  width: 100%;
}

.bars-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 180px;
  gap: 0.5rem;
  padding: 1rem 0.5rem 0.5rem;
  background: #F8FAFC;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-top: 0.75rem;
}

.bar-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.bar-track {
  width: 100%;
  max-width: 42px;
  height: 120px;
  background: #E2E8F0;
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}

.bar-val {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary-dark);
  margin-bottom: 4px;
  white-space: nowrap;
}

.bar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
  white-space: nowrap;
}

/* Resalte de barra excedente y mes actual */
.bar-fill.bar-excedente,
.bar-excedente .bar-fill,
.bar-excedente {
  background: linear-gradient(180deg, #F59E0B 0%, #D97706 100%) !important;
}

.bar-column.bar-current,
.bar-current {
  position: relative;
}

.bar-column.bar-current .bar-track,
.bar-current .bar-track {
  border: 2px solid var(--secondary);
  background: #E0F2FE;
}

.bar-column.bar-current .bar-label,
.bar-current .bar-label {
  color: var(--primary-dark);
  font-weight: 800;
  background: var(--accent-light);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.bar-column.bar-current .bar-val,
.bar-current .bar-val {
  color: var(--secondary);
  font-weight: 900;
}

.cliente-table-section h4 {
  margin-bottom: 0.75rem;
}

/* --------------------------------------------------------------------------
   18. BARRAS DE BÚSQUEDA, CHIPS DE FILTRO, RUTA LOTE & TABLAS
   -------------------------------------------------------------------------- */
.filter-bar,
.filter-toolbar {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  margin-bottom: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.search-input-wrapper,
.search-input-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  color: var(--text-muted);
}

.search-input-wrapper .form-control {
  padding-left: 2.6rem;
  padding-right: 2.5rem;
}

.btn-clear-search {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-chips {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  white-space: nowrap;
  min-height: 40px;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.83rem;
  font-weight: 700;
  background-color: var(--bg-card-alt);
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background-color: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

/* Ruta de Lectura en Lote (.batch-card) */
.batch-filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.batch-filter-row .form-group {
  margin-bottom: 0;
}

.batch-stats-box {
  background-color: var(--accent-light);
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  text-align: center;
  min-width: 140px;
}

.batch-stats-box strong {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-dark);
}

/* Tabla de Recorrido por Lote (.batch-table) y Diseño Mobile-First sin scroll horizontal */
.batch-table {
  width: 100%;
  border-collapse: collapse;
}

.batch-table .batch-ant,
.batch-table .batch-act {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .batch-table thead {
    display: none;
  }

  .batch-table,
  .batch-table tbody {
    display: block;
    width: 100%;
  }

  .batch-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    align-items: center;
  }

  .batch-table td {
    display: block;
    padding: 0.25rem 0.35rem;
    border: none;
  }

  .batch-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
  }

  .batch-table td:nth-child(1),
  .batch-table td:nth-child(2),
  .batch-table td:nth-child(3) {
    grid-column: 1 / -1;
  }

  .batch-table .batch-ant,
  .batch-table .batch-act {
    width: 100% !important;
    min-width: 0 !important;
  }

  .batch-table .btn-batch-photo {
    width: 100%;
    justify-content: center;
  }
}

/* Tablas Responsivas para Almacén, Finanzas e Historial */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.data-table th {
  background-color: var(--bg-card-alt);
  font-weight: 800;
  color: var(--primary-dark);
  text-transform: uppercase;
  font-size: 0.73rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background-color: #F8FAFC;
}

/* --------------------------------------------------------------------------
   19. BADGES & ETIQUETAS DE ESTADO (.badge)
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--accent-light);
  color: var(--primary-dark);
  border: 1px solid #7DD3FC;
}

.badge-secondary,
.badge-muted {
  background-color: var(--bg-card-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-success,
.badge-activo,
.badge-pagado {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning,
.badge-pendiente {
  background-color: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger,
.badge-suspendido,
.badge-fuga {
  background-color: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.badge-info {
  background-color: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* --------------------------------------------------------------------------
   20. MODALES & BOTTOM SHEETS (.modal-backdrop, .modal-sheet)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  overflow-y: auto;
}

.modal-backdrop.active {
  display: flex !important;
}

@media (min-width: 641px) {
  .modal-backdrop {
    padding: 1.5rem;
  }
}

.modal-sheet {
  background-color: var(--bg-card);
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: zoomModal 0.25s ease-out;
  overflow: hidden;
  margin: auto;
}

.modal-sheet.modal-lg {
  max-width: 880px;
  width: 95%;
}

.modal-sheet.modal-fullscreen {
  max-width: 96vw;
  width: 96vw;
  max-height: 94vh;
  height: 94vh;
}

/* Ergonomía Móvil estilo Bottom Sheet Nativo */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-sheet,
  .modal-sheet.modal-lg,
  .modal-sheet.modal-fullscreen {
    width: 100%;
    max-width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
    margin: 0;
    animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .modal-sheet.modal-fullscreen {
    height: 94dvh;
  }
  .modal-header {
    padding: 0.9rem 1rem;
  }
  .modal-body {
    padding: 1rem;
  }
  .modal-footer,
  .modal-sheet .form-actions-bar {
    padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom, 0px)) 1rem;
    flex-direction: column-reverse;
  }
  .modal-footer .btn,
  .modal-sheet .form-actions-bar .btn {
    width: 100%;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes zoomModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header,
.modal-sheet-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background-color: #FFFFFF;
  flex-shrink: 0;
  gap: 0.75rem;
}

.modal-header h3,
.modal-sheet-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
}

.modal-header .sub-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: none;
  font-weight: 500;
}

.btn-close-modal {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-close-modal:hover {
  background: #FEE2E2;
  color: #DC2626;
  border-color: #FCA5A5;
}

.modal-body,
.modal-sheet-body {
  padding: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-footer,
.modal-sheet-footer,
.modal-sheet .form-actions-bar {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  background-color: var(--bg-page);
  flex-shrink: 0;
  margin-top: 0;
}

/* Scroll y centrado para la vista previa de impresión (#print-preview-container) */
.print-preview-scroll-body {
  flex: 1 1 auto;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem;
  background-color: #FFFFFF;
  border-top: 4px solid #E2E8F0;
}

@media (max-width: 600px) {
  .print-preview-scroll-body,
  #print-preview-container {
    padding: 0.75rem !important;
  }
  .preview-header-actions .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    min-height: 40px;
  }
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* --------------------------------------------------------------------------
   21. BARRA DE NAVEGACIÓN INFERIOR MÓVIL (.bottom-nav)
   -------------------------------------------------------------------------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 0 0.25rem env(safe-area-inset-bottom, 0px) 0.25rem;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-sheet);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  min-height: var(--touch-target-min);
  padding: 0.25rem 0.15rem;
}

.nav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.nav-label {
  display: block;
  font-size: 0.68rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

@media (max-width: 380px) {
  .nav-label {
    font-size: 0.62rem;
  }
  .nav-icon {
    font-size: 1.15rem;
  }
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform var(--transition-fast);
}

.nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.nav-item.active .nav-icon,
.nav-item.active svg {
  transform: translateY(-2px);
  color: var(--secondary);
}

.nav-item:active {
  background-color: var(--accent-light);
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   22. LOGIN OVERLAY & ACCESO DUAL SIMPLIFICADO (#login-overlay)
   -------------------------------------------------------------------------- */
#login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  transition: opacity 0.2s ease;
}

#login-overlay.is-hidden,
#login-overlay:not(.active) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#login-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.login-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem auto;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  padding: 12px;
  color: var(--primary);
}

.login-logo-svg {
  display: block;
  margin: 0 auto 0.75rem auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.login-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.app-version-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background-color: var(--accent-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

/* Estado de Sincronización de Perfiles */
.login-sync-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--bg-card-alt);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
  width: 100%;
}

.login-sync-status .sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
  padding: 2px 4px;
}

/* Selector de Pestañas de Acceso Dual (Ergonomía Táctil 48px Mínimo) */
.login-tabs {
  display: flex;
  background-color: var(--bg-card-alt);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
  gap: 4px;
}

.login-tab-btn {
  flex: 1;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  text-align: center;
  line-height: 1.25;
}

.login-tab-btn:hover {
  color: var(--primary);
  background-color: rgba(255, 255, 255, 0.6);
}

.login-tab-btn.active {
  background-color: #FFFFFF;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(10, 77, 104, 0.12);
}

.tab-svg-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

/* Transición suave entre formularios de login */
.login-tab-content {
  animation: fadeInTab 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease;
}

@keyframes fadeInTab {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-form {
  text-align: left;
}

.login-form .form-group {
  margin-bottom: 1.15rem;
}

.login-form label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

/* Input Destacado para Código de Abonado / Medidor */
.form-control-lg {
  min-height: 52px;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  border: 2px solid var(--accent);
  border-radius: var(--radius-md);
  background-color: #F8FAFC;
  color: var(--primary-dark);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control-lg:focus {
  border-color: var(--primary);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.login-help-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.35;
  text-align: left;
}

/* Selector de demostración rápido discreto */
.login-demo-helper {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  text-align: left;
}

.login-demo-details {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.login-demo-details[open] {
  background-color: #FFFFFF;
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
}

.login-demo-details[open] .demo-buttons-grid {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
}

.login-demo-details summary.demo-helper-title,
.demo-helper-title {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  margin-bottom: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  outline: none;
}

.login-demo-details summary.demo-helper-title::-webkit-details-marker {
  display: none;
}

.login-demo-details summary.demo-helper-title::after {
  content: '▾';
  font-size: 0.85rem;
  transition: transform var(--transition-fast);
  color: var(--secondary);
}

.login-demo-details[open] summary.demo-helper-title::after {
  transform: rotate(180deg);
}

.demo-buttons-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-demo-tag {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.btn-demo-tag:hover {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary-dark);
}

.btn-demo-tag:active {
  transform: translateY(1px);
}

/* Switch de Modo Solo Lectura */
.readonly-switch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card-alt);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
}

.switch-label-group {
  text-align: left;
}

.switch-label-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.switch-label-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  border-radius: var(--radius-full);
  transition: 0.2s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--warning);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Secciones de Configuración y Tarifa por m³ */
.settings-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section .section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.35rem;
}

.settings-section .section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

#master-tarifa-config-section {
  background: var(--bg-card-alt);
  padding: 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-light);
}

/* --------------------------------------------------------------------------
   23. NOTIFICACIONES FLOTANTES (TOASTS)
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--primary-dark);
  color: #FFFFFF;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid var(--accent);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

@keyframes slideToast {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   24. CONTENEDOR DE IMPRESIÓN OFICIAL (#print-document-sheet)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   24. VENTANILLA DE COBRANZA AUTOMÁTICA MULTI-MEDICIÓN
   -------------------------------------------------------------------------- */
.cobro-abonado-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.abonado-cols {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.cobro-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cobro-select-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-light);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.cobro-select-all-btn input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.cobro-table tbody tr.row-selected {
  background-color: rgba(5, 191, 219, 0.08);
}

.check-medicion-cobro {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--success);
}

.cobro-total-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #0F172A 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-md);
}

.total-stats-col {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #94A3B8;
}

.total-stats-col strong {
  color: #F8FAFC;
}

.total-amount-col {
  text-align: right;
}

.total-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #38BDF8;
}

.total-giant-number {
  font-size: 2rem;
  font-family: var(--font-mono);
  font-weight: 900;
  color: #34D399;
}

.cobro-payment-controls-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.cobro-vuelto-display {
  background: var(--bg-page);
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  min-height: 52px;
}

.cobro-vuelto-display.vuelto-positive {
  color: #059669;
  border-color: #059669;
  background: #ECFDF5;
}

.cobro-vuelto-display.vuelto-falta {
  color: #DC2626;
  border-color: #DC2626;
  background: #FEF2F2;
}

#print-document-sheet {
  display: none;
}

/* --------------------------------------------------------------------------
   25. ESTILOS DE DOCUMENTO OFICIAL (.hs-*) EN VISTA PREVIA E IMPRESIÓN
   -------------------------------------------------------------------------- */
.hs-letterhead {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.hs-logo-col,
.hs-letterhead-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.hs-title-col {
  flex: 1;
  min-width: 0;
}

.hs-org-name,
.hs-company-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary-dark);
  text-transform: uppercase;
  margin: 0 0 0.15rem 0;
  letter-spacing: -0.01em;
}

.hs-doc-subtitle,
.hs-company-tagline {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 0.15rem 0;
  letter-spacing: 0.02em;
}

.hs-doc-banner {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hs-doc-banner h3,
.hs-doc-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-main);
  margin: 0;
}

.hs-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  background-color: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

@media (min-width: 560px) {
  .hs-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.hs-summary-grid p {
  margin-bottom: 0.3rem;
}

.hs-content-body {
  width: 100%;
  overflow-x: auto;
}

.hs-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.hs-report-table th,
.hs-report-table td {
  border: 1px solid #94A3B8;
  padding: 0.55rem 0.7rem;
  text-align: left;
}

.hs-report-table th {
  background-color: #E2E8F0;
  color: #0F172A;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hs-report-table tr:nth-child(even) td {
  background-color: #F8FAFC;
}

.hs-signatures {
  margin-top: 2.5rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.hs-sig-box,
.hs-sign-box {
  text-align: center;
  width: 240px;
  max-width: 100%;
}

.hs-sig-line,
.hs-sign-line {
  border-top: 1.5px solid #0F172A;
  margin-bottom: 0.4rem;
}

@media (max-width: 600px) {
  .hs-letterhead {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  .hs-org-name {
    font-size: 1.05rem;
  }
  .hs-doc-banner h3 {
    font-size: 0.88rem;
  }
  .hs-report-table {
    font-size: 0.78rem;
  }
  .hs-report-table th,
  .hs-report-table td {
    padding: 0.45rem 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   26. REGLAS COMPLETAS DE IMPRESIÓN OFICIAL (@media print)
   -------------------------------------------------------------------------- */
@media print {
  @page {
    size: auto;
    margin: 12mm 15mm;
  }

  /* Ocultar toda la interfaz de la PWA */
  html,
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .app-header,
  .app-main,
  .bottom-nav,
  .readonly-banner,
  .modal-backdrop,
  #login-overlay,
  .toast-container,
  .no-print {
    display: none !important;
  }

  /* Mostrar ÚNICAMENTE la hoja de documento oficial */
  #print-document-sheet {
    display: block !important;
    width: 100% !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    font-family: var(--font-base) !important;
    font-size: 11pt !important;
    line-height: 1.35 !important;
  }

  /* Membrete Oficial (.hs-letterhead) */
  .hs-letterhead {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12pt !important;
    border-bottom: 2.5pt solid #0A4D68 !important;
    padding-bottom: 8pt !important;
    margin-bottom: 12pt !important;
    text-align: left !important;
  }

  .hs-logo-col,
  .hs-letterhead-logo {
    display: flex !important;
    align-items: center !important;
    gap: 8pt !important;
  }

  .hs-logo-col svg,
  .hs-letterhead-logo svg {
    width: 48pt !important;
    height: 48pt !important;
    color: #0A4D68 !important;
  }

  .hs-title-col {
    flex: 1 !important;
  }

  .hs-org-name,
  .hs-company-name {
    font-size: 15pt !important;
    font-weight: 800 !important;
    color: #083344 !important;
    text-transform: uppercase !important;
    letter-spacing: -0.01em !important;
    margin: 0 !important;
  }

  .hs-doc-subtitle,
  .hs-company-tagline {
    font-size: 8.5pt !important;
    color: #475569 !important;
    margin: 0 !important;
  }

  .hs-letterhead-meta {
    text-align: right !important;
    font-size: 8pt !important;
    color: #334155 !important;
    border-left: 1pt solid #CBD5E1 !important;
    padding-left: 10pt !important;
  }

  /* Cintillo Oficial del Documento (.hs-doc-banner) */
  .hs-doc-banner {
    background-color: #F1F5F9 !important;
    border: 1pt solid #94A3B8 !important;
    padding: 6pt 10pt !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12pt !important;
    border-radius: 4pt !important;
  }

  .hs-doc-banner h3,
  .hs-doc-title {
    font-size: 11.5pt !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #0F172A !important;
    margin: 0 !important;
  }

  .hs-doc-folio {
    font-family: var(--font-mono) !important;
    font-size: 10pt !important;
    font-weight: 800 !important;
    color: #083344 !important;
  }

  /* Grilla de Resumen / Datos del Abonado (.hs-summary-grid) */
  .hs-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8pt !important;
    margin-bottom: 14pt !important;
    border: 1pt solid #CBD5E1 !important;
    border-radius: 4pt !important;
    padding: 8pt !important;
    page-break-inside: avoid !important;
  }

  .hs-summary-item {
    font-size: 9pt !important;
  }

  .hs-summary-label {
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    font-size: 7.5pt !important;
    display: block !important;
  }

  .hs-summary-value {
    font-weight: 700 !important;
    color: #0F172A !important;
    font-size: 10pt !important;
  }

  /* Tabla de Conceptos / Mediciones (.hs-report-table) */
  .hs-report-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 14pt !important;
    font-size: 9pt !important;
    page-break-inside: avoid !important;
  }

  .hs-report-table th,
  .hs-report-table td {
    border: 1pt solid #94A3B8 !important;
    padding: 5pt 7pt !important;
  }

  .hs-report-table th {
    background-color: #E2E8F0 !important;
    color: #0F172A !important;
    font-weight: 800 !important;
    text-align: left !important;
    text-transform: uppercase !important;
    font-size: 8pt !important;
  }

  .hs-report-table tr:nth-child(even) td {
    background-color: #F8FAFC !important;
  }

  .hs-report-table td.numeric {
    text-align: right !important;
    font-family: var(--font-mono) !important;
    font-weight: 700 !important;
  }

  /* Total Destacado en Recibo */
  .hs-total-row td {
    font-size: 11pt !important;
    font-weight: 900 !important;
    background-color: #E0F2FE !important;
    border-top: 2pt solid #0A4D68 !important;
  }

  /* Pie con Firma Oficial Centrada (.hs-signatures) */
  .hs-signatures {
    margin-top: 30pt !important;
    display: flex !important;
    justify-content: space-around !important;
    page-break-inside: avoid !important;
  }

  .hs-sig-box,
  .hs-sign-box {
    text-align: center !important;
    width: 200pt !important;
  }

  .hs-sig-line,
  .hs-sign-line {
    border-top: 1pt solid #000000 !important;
    margin-bottom: 4pt !important;
  }

  .hs-sign-name {
    font-weight: 700 !important;
    font-size: 8.5pt !important;
    text-transform: uppercase !important;
  }

  .hs-sign-role {
    font-size: 7.5pt !important;
    color: #475569 !important;
  }

  /* Pie de Página Institucional */
  .hs-print-footer {
    margin-top: 20pt !important;
    border-top: 0.5pt solid #CBD5E1 !important;
    padding-top: 6pt !important;
    display: flex !important;
    justify-content: space-between !important;
    font-size: 7pt !important;
    color: #64748B !important;
    page-break-inside: avoid !important;
  }
}

/* --------------------------------------------------------------------------
   29. SELECTORES COMPLEMENTARIOS Y LIMPIEZA DE BADGES DE HOSTING
   -------------------------------------------------------------------------- */
.role-guest {
  background-color: var(--bg-app);
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
}

.login-header {
  text-align: center;
  margin-bottom: 1.15rem;
}

.online .sync-pill-dot {
  background-color: var(--success);
}

.banner-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.banner-text {
  font-size: 0.85rem;
  line-height: 1.35;
}

.btn-save-reading {
  font-weight: 700;
}

.batch-table {
  width: 100%;
  border-collapse: collapse;
}

.cobro-mediciones-section {
  margin-bottom: 1.15rem;
}

.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
}

.print-document-sheet {
  display: none;
}

/* ==========================================================================
   29.5 BUSCADOR POR NOMBRES Y SUBVENTANA DE VERIFICACIÓN DE ABONADO AL MEDIR
   ========================================================================== */
.reading-search-box {
  background: linear-gradient(135deg, rgba(10, 77, 104, 0.08) 0%, rgba(5, 191, 219, 0.08) 100%);
  border: 2px solid rgba(5, 191, 219, 0.35);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.reading-unselected-guard {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(245, 158, 11, 0.12);
  border: 2px dashed #F59E0B;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.guard-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.guard-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.guard-text p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
}

.lectura-search-results {
  margin-top: 0.75rem;
  max-height: 290px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
}

.lectura-search-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.lectura-search-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lectura-search-item:hover,
.lectura-search-item.active {
  border-color: var(--primary);
  background: rgba(5, 191, 219, 0.08);
  transform: translateY(-1px);
}

.lectura-item-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.lectura-item-owner {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.lectura-item-address {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lectura-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lectura-item-code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
}

.lectura-item-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.verified-owner-banner {
  background: linear-gradient(135deg, #083344 0%, #0A4D68 100%);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 1.15rem;
  border: 2px solid #05BFDB;
  box-shadow: 0 8px 20px rgba(10, 77, 104, 0.22);
}

.verified-owner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.verified-badge {
  background: #10B981;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
}

.verified-owner-header .btn-outline {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.verified-owner-main {
  background: rgba(255, 255, 255, 0.12);
  border-left: 4px solid #05BFDB;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.85rem;
}

.verified-owner-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #BAE6FD;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.verified-owner-name {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
  color: #FFFFFF !important;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.verified-owner-details .sub-label {
  color: #BAE6FD !important;
}

.verified-owner-details .sub-val {
  color: #FFFFFF !important;
}

.confirm-abonado-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.confirm-abonado-code-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.confirm-abonado-hero-box {
  background: linear-gradient(135deg, #083344 0%, #0A4D68 100%);
  border: 3px solid #05BFDB;
  border-radius: 14px;
  padding: 1.35rem 1.15rem;
  text-align: center;
  color: #FFFFFF;
  margin-bottom: 0.85rem;
  box-shadow: 0 10px 25px rgba(8, 51, 68, 0.25);
}

.confirm-abonado-subtitle {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7DD3FC;
  margin-bottom: 0.45rem;
}

.confirm-abonado-fullname {
  font-size: 1.7rem;
  font-weight: 900;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
  text-transform: uppercase;
  word-break: break-word;
}

.confirm-abonado-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.9rem;
}

.confirm-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.confirm-abonado-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.batch-owner-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-main);
}

@media (max-width: 600px) {
  .confirm-abonado-meta-grid {
    grid-template-columns: 1fr;
  }
  .confirm-abonado-fullname {
    font-size: 1.4rem;
  }
  .confirm-abonado-footer button {
    width: 100%;
  }
}

/* ==========================================================================
   30. BLINDAJE TOTAL CONTRA ELEMENTOS EXTERNOS INYECTADOS (NETLIFY BADGE / SHADOW HOST)
   ========================================================================== */
a[href*="netlify.com"],
a[href*="netlify.app"],
a[href*="utm_source=netlify"],
a[href*="netlify-badge"],
div[class*="netlify"],
[class*="netlify"],
[id*="netlify"],
iframe[src*="netlify"],
[data-netlify-deploy-id],
html > *:not(head):not(body),
body > *:not(#login-overlay):not(#readonly-banner):not(.app-header):not(#app-header):not(#app-main):not(#bottom-nav):not(.modal-backdrop):not(#print-document-sheet):not(#toast-container):not(.legacy-compat-hidden):not(datalist):not(script):not(link):not(style):not(a[download]) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  position: fixed !important;
  top: -99999px !important;
  left: -99999px !important;
  z-index: -2147483647 !important;
  clip-path: inset(100%) !important;
  transform: scale(0) !important;
}

/* Supremacía de capa (z-index máximo de 32 bits) para pantalla de arranque, barra inferior y modales */
#bottom-nav,
.bottom-nav {
  z-index: 2147483646 !important;
}

.modal-backdrop {
  z-index: 2147483647 !important;
}

#toast-container,
.toast-container {
  z-index: 2147483647 !important;
}

#login-overlay,
.login-overlay {
  z-index: 2147483647 !important;
}

