/* frontend/pages/caja/caja.css */
/* =========================================================
   Rasta Pets – Caja
   Diseño Veterinario Minimalista / Soft UI
   ========================================================= */

:root {
  /* Fondos */
  --bg-body: #f6f9fc;
  --bg-card: #ffffff;
  --bg-soft: #f4fcfa;
  --bg-input: #f8fbfd;

  /* Textos */
  --text-main: #102a56;
  --text-secondary: #7b8ba8;
  --text-placeholder: #a6b3c9;

  /* Colores */
  --color-primary: #22c7a9;
  --color-primary-hover: #16a88e;
  --color-primary-soft: #e9fbf7;

  --color-blue: #2563eb;
  --color-blue-soft: #eff6ff;

  --color-green: #22c55e;
  --color-green-soft: #ecfdf5;

  --color-orange: #f59e0b;
  --color-orange-soft: #fffbeb;

  --color-purple: #8b5cf6;
  --color-purple-soft: #f3efff;

  --color-red: #ef4444;
  --color-red-soft: #fff1f2;

  /* Bordes */
  --border-soft: #e3eaf3;
  --border-light: #eef3f8;

  /* Sombras */
  --shadow-soft: 0 14px 35px rgba(16, 42, 86, 0.06);
  --shadow-hover: 0 20px 48px rgba(16, 42, 86, 0.10);
  --shadow-focus: 0 0 0 4px rgba(34, 199, 169, 0.16);
  --shadow-primary: 0 12px 26px rgba(34, 199, 169, 0.22);

  /* Radius */
  --radius-xl: 28px;
  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 12px;
  --radius-round: 999px;

  /* Tipografía */
  --font-family: "Inter", "DM Sans", system-ui, sans-serif;
}

/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ========================================= */
/* PAGE / LAYOUT GENERAL                     */
/* ========================================= */

.page.caja {
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  gap: 26px;

  padding: 28px 36px;

  background:
    radial-gradient(circle at top right, rgba(34, 199, 169, 0.10), transparent 32%),
    var(--bg-body);

  color: var(--text-main);
  font-family: var(--font-family);
}

.caja-layout {
  width: 100%;
  max-width: 1400px;

  display: flex;
  flex-direction: column;
  gap: 24px;

  margin: 0 auto;
  padding: 0;

  background: transparent;
  box-shadow: none;
}

/* ========================================= */
/* TOPBAR                                    */
/* ========================================= */

.caja-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  padding: 22px 26px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);
}

.caja-title {
  margin: 0;

  color: var(--text-main);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.caja-subtitle {
  margin: 7px 0 0;

  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.caja-topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Date Input */
.caja-date input[type="date"] {
  min-height: 42px;

  padding: 9px 15px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-round);

  font-family: inherit;
  font-size: 13px;
  font-weight: 700;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.caja-date input[type="date"]:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* Usuario */
.caja-user {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 6px 12px 6px 6px;

  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-round);
}

.caja-user__avatar {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    linear-gradient(135deg, var(--color-primary) 0%, #42d6bd 100%);

  color: #ffffff;

  border-radius: 50%;

  font-size: 12px;
  font-weight: 900;

  box-shadow: 0 8px 18px rgba(34, 199, 169, 0.20);
}

.caja-user__info {
  display: flex;
  flex-direction: column;
  gap: 2px;

  margin-right: 8px;

  color: var(--text-main);
  font-size: 12px;
  font-weight: 700;
}

.caja-user__rol {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
}

/* ========================================= */
/* MAIN GRID                                 */
/* ========================================= */

.caja-main {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.caja-main--full {
  grid-template-columns: 1fr;
}

/* ========================================= */
/* SIDEBAR CAJA                              */
/* ========================================= */

.caja-sidebar {
  max-height: calc(100vh - 150px);

  display: flex;
  flex-direction: column;
  gap: 20px;

  padding: 24px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);

  overflow-y: auto;
}

/* Filtros */
.caja-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 36px;

  padding: 8px 14px;

  background: var(--bg-input);
  color: var(--text-secondary);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-round);

  cursor: pointer;

  font-size: 12.5px;
  font-weight: 800;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.chip:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  border-color: rgba(34, 199, 169, 0.35);
}

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

/* Buscador */
.caja-busqueda input[type="search"] {
  width: 100%;
  min-height: 48px;

  padding: 12px 15px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);

  font-size: 13.5px;
  font-weight: 600;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.caja-busqueda input[type="search"]::placeholder {
  color: var(--text-placeholder);
}

.caja-busqueda input[type="search"]:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

/* KPIs */
.caja-resumen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 6px;
  margin-bottom: 12px;
  background: transparent;
  border-bottom: 1px solid var(--border-light);
}

.kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  position: relative;
}

/* Separadores verticales delgados entre columnas */
.kpi-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 15%;
  height: 70%;
  width: 1px;
  background-color: var(--border-soft);
}

.caja-resumen .kpi-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.caja-resumen .kpi-value {
  color: var(--text-main);
  font-size: 20px;
  font-weight: 700;
}

/* Lista ventas */
.caja-lista {
  max-height: 410px;

  margin-top: 4px;
  padding: 0;

  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-l);

  overflow-y: auto;
}

.caja-lista__empty {
  padding: 26px;

  color: var(--text-secondary);
  text-align: center;

  font-size: 13px;
  font-weight: 600;
}

/* Item venta */
.venta-item {
  padding: 16px;

  background: #ffffff;
  border-bottom: 1px solid var(--border-light);

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.venta-item:first-child {
  border-top-left-radius: var(--radius-l);
  border-top-right-radius: var(--radius-l);
}

.venta-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: var(--radius-l);
  border-bottom-right-radius: var(--radius-l);
}

.venta-item:hover {
  background: rgba(34, 199, 169, 0.045);
}

.venta-item--selected {
  background: var(--color-primary-soft);
  border-left: 4px solid var(--color-primary);
}

.venta-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-bottom: 8px;
}

.venta-item__nro {
  color: var(--color-primary-hover);
  font-size: 13px;
  font-weight: 900;
}

.venta-item__body {
  display: flex;
  justify-content: space-between;

  margin-bottom: 8px;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.venta-item__cliente {
  max-width: 140px;

  color: var(--text-main);
  text-align: right;

  font-weight: 700;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venta-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.venta-item__total {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 900;
}

/* ========================================= */
/* BADGES                                    */
/* ========================================= */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 5px 11px;

  border-radius: var(--radius-round);

  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.badge--pagado {
  background: var(--color-green-soft);
  color: var(--color-green);
}

.badge--pendiente {
  background: var(--color-orange-soft);
  color: var(--color-orange);
}

.badge--anulado {
  background: var(--color-red-soft);
  color: var(--color-red);
}

/* ========================================= */
/* PANEL DERECHO                             */
/* ========================================= */

.caja-detalle {
  max-height: calc(100vh - 170px);

  display: flex;
  flex-direction: column;
  gap: 24px;

  padding: 30px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);

  overflow-y: auto;
}

.detalle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;

  padding-bottom: 16px;

  border-bottom: 1px solid var(--border-light);
}

.detalle-title {
  margin: 0;

  color: var(--text-main);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.detalle-subtitle {
  margin: 5px 0 0;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.detalle-tags {
  display: flex;
  gap: 8px;
}

/* Cliente Box */
.detalle-cliente {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;

  padding: 18px 20px;

  background: var(--bg-soft);
  border: 1px solid rgba(34, 199, 169, 0.14);
  border-radius: var(--radius-l);
}

.detalle-label {
  margin-bottom: 4px;

  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.detalle-value {
  color: var(--text-main);
  font-size: 14px;
  font-weight: 800;
}

/* Tabla productos */
.detalle-table-wrap {
  overflow: hidden;

  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-l);
}

.detalle-table {
  width: 100%;

  border-collapse: separate;
  border-spacing: 0;

  font-size: 13.5px;
}

.detalle-table th {
  padding: 14px 16px;

  background: var(--color-primary-soft);
  color: var(--color-primary-hover);

  text-align: left;

  font-size: 12.5px;
  font-weight: 900;
  text-transform: uppercase;

  border-bottom: 1px solid rgba(34, 199, 169, 0.12);
}

.detalle-table td {
  padding: 13px 16px;

  color: var(--text-main);
  font-weight: 600;

  border-bottom: 1px solid var(--border-light);
}

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

.detalle-conceptos {
  display: grid;
  gap: 7px;

  margin-top: 10px;
}

.concepto-title {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.concepto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  padding: 10px 13px;

  background: #fbfefd;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-m);

  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}

.concepto-row:not(.concepto-row--main) {
  padding-left: 24px;
  color: var(--text-secondary);
}

.concepto-row strong {
  color: var(--text-main);
  white-space: nowrap;
}

/* Totales */
.detalle-totales {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;

  margin-top: 8px;
}

.detalle-totales__left {
  flex: 1;
}

.detalle-totales__right {
  min-width: 250px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  padding: 0;

  background: transparent;
  border: none;
  border-radius: 0;
}

.detalle-row {
  display: flex;
  justify-content: space-between;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.detalle-row--total {
  margin-top: 8px;
  padding-top: 10px;

  color: var(--color-primary-hover);

  border-top: 1px dashed rgba(34, 199, 169, 0.42);

  font-size: 17px;
  font-weight: 900;
}

.detalle-linea-extra {
  margin-top: 4px;

  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.detalle-extra-row td {
  background: #fbfefd;
  color: var(--text-secondary);

  font-size: 12px;
  font-weight: 600;

  padding-top: 8px;
  padding-bottom: 8px;
}

.detalle-extra-row td:first-child {
  padding-left: 36px;
}

/* ========================================= */
/* BLOQUE COBRO                              */
/* ========================================= */

.detalle-cobro {
  margin-top: 16px;
  padding-top: 16px;

  border-top: 1px solid var(--border-light);
}

.cobro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(250px, 1fr);
  gap: 24px;
}

.cobro-metodos {
  display: flex;
  flex-direction: column;
  gap: 16px;

  background: #ffffff;
}

/* Inputs cobro */
.field label {
  display: block;

  margin-bottom: 6px;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.field select,
.field input[type="number"],
.field input[type="text"] {
  width: 100%;
  min-height: 46px;

  padding: 11px 15px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);

  font-size: 13.5px;
  font-weight: 600;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field select:focus,
.field input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.field--inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cobro-pagos-lista {
  margin-top: 12px;
}

.cobro-pagos {
  display: flex;
  flex-direction: column;
  gap: 8px;

  list-style: none;
  margin: 0;
  padding: 0;
}

.cobro-pagos li {
  display: flex;
  justify-content: space-between;

  padding: 9px 13px;

  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-m);

  font-size: 13px;
  font-weight: 700;
}

/* Resumen de cobro */
.cobro-resumen {
  display: flex;
  flex-direction: column;
  gap: 12px;

  padding: 0;

  background: transparent;

  color: var(--text-main);

  border: none;
  border-radius: 0;

  box-shadow: none;
}

.cobro-resumen__title {
  margin: 0;

  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.cobro-resumen__row {
  display: flex;
  justify-content: space-between;

  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
}

.cobro-resumen__row strong {
  color: var(--text-main);
  font-size: 16px;
  font-weight: 900;
}

.cobro-resumen__row--pendiente strong {
  color: var(--color-orange);
}

/* Footer detalle */
.detalle-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;

  margin-top: 16px;
  padding-top: 16px;

  border-top: 1px solid var(--border-light);
}

/* ========================================= */
/* BOTONES                                   */
/* ========================================= */

.btn {
  min-height: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 11px 20px;

  border: 1px solid transparent;
  border-radius: var(--radius-m);

  cursor: pointer;

  font-size: 13.5px;
  font-weight: 800;
  text-decoration: none;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
}

.btn.primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-sec {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
}

.btn-sec:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  border-color: rgba(34, 199, 169, 0.32);
}

/* Botones topbar */
.caja-topbar__right .btn {
  min-height: 38px;

  padding: 8px 15px;

  background: var(--bg-input);
  color: var(--text-secondary);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-round);

  box-shadow: none;

  font-size: 13px;
  font-weight: 800;
}

.caja-topbar__right .btn:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  border-color: rgba(34, 199, 169, 0.32);
}

.caja-topbar__right .btn.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-primary);
}

/* ========================================= */
/* HISTORIAL PAGOS                           */
/* ========================================= */

#historialPagosSection {
  padding: 30px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);
}

/* ========================================= */
/* MODALES                                   */
/* ========================================= */

#cajaCierreModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999 !important;

  display: flex !important;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(16, 42, 86, 0.38);
  backdrop-filter: blur(6px);
}

#cajaCierreModal[hidden] {
  display: none !important;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: 0 40px 90px rgba(16, 42, 86, 0.18);

  animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 24px 32px;

  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  margin: 0;

  color: var(--text-main);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--bg-input);
  color: var(--text-secondary);

  border: 1px solid var(--border-soft);
  border-radius: 50%;

  cursor: pointer;

  font-size: 24px;
  line-height: 1;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.modal-close:hover {
  background: var(--color-red-soft);
  color: var(--color-red);
  transform: rotate(90deg);
  box-shadow: 0 10px 22px rgba(239, 68, 68, 0.14);
}

.modal-body {
  flex: 1;

  padding: 30px 32px;

  background:
    radial-gradient(circle at top right, rgba(34, 199, 169, 0.10), transparent 35%),
    var(--bg-body);

  overflow-y: auto;
}

.modal-body .field {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-bottom: 20px;
}

.modal-body .field label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.modal-body .field input,
.modal-body .field select {
  width: 100%;
  min-height: 48px;

  padding: 12px 15px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);

  font-size: 13.5px;
  font-weight: 600;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.modal-body .field input:focus,
.modal-body .field select:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;

  padding: 22px 32px;

  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

/* Cierre Modal */
.modal-cierre .resumen-cierre {
  margin-bottom: 24px;
  padding: 20px;

  background: var(--bg-soft);
  border: 1px solid rgba(34, 199, 169, 0.14);
  border-radius: var(--radius-l);
}

.modal-cierre .resumen-row {
  display: flex;
  justify-content: space-between;

  padding: 12px 0;

  color: var(--text-main);
  border-bottom: 1px solid var(--border-light);

  font-size: 14px;
  font-weight: 700;
}

.modal-cierre .resumen-row:last-child {
  margin-top: 8px;
  padding-top: 16px;

  color: var(--color-primary-hover);

  border-bottom: none;
  border-top: 2px solid rgba(34, 199, 169, 0.35);

  font-size: 16px;
  font-weight: 900;
}

.modal-cierre .metodos-pago {
  display: flex;
  flex-direction: column;
  gap: 12px;

  margin-top: 16px;
}

.modal-cierre .metodo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 12px 16px;

  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-m);
}

.modal-cierre .metodo-label {
  color: var(--text-main);
  font-size: 13px;
  font-weight: 800;
}

.modal-cierre .metodo-monto {
  color: var(--color-primary-hover);
  font-size: 14px;
  font-weight: 900;
}

/* Diferencia efectivo */
.diferencia-efectivo {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-top: 16px;
  padding: 16px 20px;

  background:
    linear-gradient(135deg, #e9fbf7 0%, #f3efff 100%);

  color: var(--text-main);

  border: 1px solid rgba(34, 199, 169, 0.18);
  border-radius: var(--radius-l);

  box-shadow: 0 12px 28px rgba(16, 42, 86, 0.05);
}

.diferencia-efectivo strong {
  color: var(--color-primary-hover);
  font-size: 18px;
  font-weight: 900;
}

/* ========================================= */
/* SWITCH                                    */
/* ========================================= */

.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;

  padding: 8px 0;

  cursor: pointer;
  user-select: none;
}

.switch-container input {
  display: none;
}

.switch-slider {
  position: relative;

  width: 50px;
  height: 28px;

  background-color: #dbe5f1;
  border-radius: var(--radius-round);

  box-shadow: inset 0 2px 4px rgba(16, 42, 86, 0.06);

  transition: background 0.25s ease;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;

  width: 20px;
  height: 20px;

  background-color: #ffffff;
  border-radius: 50%;

  box-shadow: 0 3px 8px rgba(16, 42, 86, 0.18);

  transition: transform 0.25s ease;
}

.switch-container input:checked+.switch-slider {
  background-color: var(--color-primary);
  box-shadow: 0 8px 18px rgba(34, 199, 169, 0.20);
}

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

.switch-label {
  color: var(--text-main);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.switch-container:hover .switch-slider {
  background-color: #cfd9e8;
}

.switch-container:hover input:checked+.switch-slider {
  background-color: var(--color-primary-hover);
}

/* ========================================= */
/* SCROLL / UTILIDADES                       */
/* ========================================= */

::-webkit-scrollbar,
.caja-sidebar::-webkit-scrollbar,
.caja-detalle::-webkit-scrollbar,
.caja-lista::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track,
.caja-sidebar::-webkit-scrollbar-track,
.caja-detalle::-webkit-scrollbar-track,
.caja-lista::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb,
.caja-sidebar::-webkit-scrollbar-thumb,
.caja-detalle::-webkit-scrollbar-thumb,
.caja-lista::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(123, 139, 168, 0.30);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover,
.caja-sidebar::-webkit-scrollbar-thumb:hover,
.caja-detalle::-webkit-scrollbar-thumb:hover,
.caja-lista::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 139, 168, 0.50);
}

.hidden {
  display: none !important;
}

/* ========================================= */
/* RESPONSIVE                                */
/* ========================================= */

@media (max-width: 1100px) {
  .caja-main {
    grid-template-columns: 1fr;
  }

  .caja-sidebar,
  .caja-detalle {
    max-height: none;
  }

  .cobro-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page.caja {
    padding: 22px 18px;
  }

  .caja-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .caja-title {
    font-size: 28px;
  }

  .caja-topbar__right {
    width: 100%;
    flex-wrap: wrap;
  }

  .caja-topbar__right .btn,
  .caja-date,
  .caja-date input[type="date"] {
    width: 100%;
  }

  .caja-user {
    width: 100%;
  }

  .caja-resumen {
    grid-template-columns: 1fr;
  }

  .detalle-header,
  .detalle-totales,
  .detalle-footer,
  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .detalle-cliente {
    grid-template-columns: 1fr;
  }

  .field--inline {
    grid-template-columns: 1fr;
  }

  .btn,
  .btn.primary,
  .btn-sec {
    width: 100%;
  }

  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-l);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (max-width: 480px) {
  .page.caja {
    padding: 18px 14px;
  }

  .caja-topbar,
  .caja-sidebar,
  .caja-detalle,
  #historialPagosSection {
    border-radius: 22px;
  }
}

/* ========================================= */
/* BLOCKER DE CAJA CERRADA                   */
/* ========================================= */
.caja-blocker-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  width: 100%;
  min-height: calc(100vh - 200px);
}

.caja-blocker-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow-hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  animation: modalSlideIn 0.35s ease;
}

.caja-blocker-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(34, 199, 169, 0.15);
}

.caja-blocker-icon i,
.caja-blocker-icon svg {
  width: 36px;
  height: 36px;
}

.caja-blocker-title {
  margin: 0;
  color: var(--text-main);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.caja-blocker-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.caja-blocker-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.btn-blocker-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 850;
  gap: 10px;
}