/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* Layout Dimensions */
  --sidebar-width: 260px;
  --header-height: 60px;

  /* Colors */
  --bg: #f8fafc;        /* Fondo base más limpio */
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;

  /* Brand Colors */
  --primary: #f88414;
  --primary-700: #8e361c;
  --primary-100: #ffedd5;

  /* Status Colors */
  --ok: #16a34a;
  --info: #2563eb;
  --danger: #dc2626;
  --warning: #f59e0b;

  /* Effects */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, monospace; }

/* Custom Scrollbars (Webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

input {
  text-transform: capitalize;
}

/* =========================================
   2. APP SHELL & LAYOUT SYSTEM
   ========================================= */

/* El contenedor principal que sostiene Sidebar + Contenido */
.app-shell {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* === SIDEBAR (Barra Lateral) === */
.sidebar {
  width: var(--sidebar-width);
  background: #140f27;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

/* Marca en el sidebar */
.brand { display: flex; align-items: center; gap: 12px; }
.brand__logo { height: 48px; width: auto; object-fit: contain; }
.brand__stack { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand__name { font-size: 16px; font-weight: 800; color: wheat; letter-spacing: -0.3px; }
.sidebar__close { display: none; color: var(--muted); }

.logobar {
    background: #E8E8E8;
    border-radius: 50%; /* Hace el círculo */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Sombra suave y borde blanco translúcido para efecto "flotado" */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 4px solid rgba(232, 232, 232, 0.6); 
    margin: 0 auto 16px; /* Centrado y margen inferior */
}

/* Navegación */
.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: wheat;
  font-weight: 800;
  margin: 20px 12px 8px;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #CCDAF0;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav__link i {
  width: 20px;
  text-align: center;
  font-size: 16px;
  color: #94a3b8;
  transition: color 0.2s;
}

.nav__link:hover {
  background: var(--primary-100);
  color: var(--primary-700);
}
.nav__link:hover i { color: var(--primary); }

/* Usuario al pie del sidebar */
.sidebar__footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
  border-color: var(--border);
}

.userbox:hover {
  box-shadow: 5px 7px var(--muted);
  transition: 1s;
}

.avatar-circle {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  margin-bottom:30px;
}

.userbox__meta { flex: 1; overflow: hidden; }
.userbox__name { 
  font-weight: 700; font-size: 13px; color: #334155; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.userbox__surname { 
  font-weight: 700; font-size: 13px; color: #C2C0C0; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

.userbox__logout {
  color: var(--muted);
  padding: 6px;
  border-radius: 8px;
  transition: all 0.2s;
}
.userbox__logout:hover { background: #fee2e2; color: var(--danger); }


/* === CONTENT AREA (Derecha) === */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  /* Fondo degradado sutil solo en el área de contenido */
  background: linear-gradient(135deg, #f6f8fc 0%, #f1f5f9 100%); 
}

/* Header Móvil (Solo visible < 1024px) */
.mobile-header {
  display: none; /* Oculto en desktop */
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 10px 16px;
;
  position: sticky;
  top: 0;
  z-index: 40;
}
.mobile-header__title { font-weight: 800; color: var(--primary); font-size: 18px; }

/* Contenedores interiores */
.container-fluid {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.main {
  padding: 24px 0 40px;
  flex: 1; /* Empuja el footer hacia abajo */
}

.footer {
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}

/* Overlay oscuro para sidebar móvil */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 45;
  opacity: 0; visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-active { opacity: 1; visibility: visible; }


/* =========================================
   3. COMPONENTS
   ========================================= */

/* --- Status Pills --- */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 40px; border-radius: 99px;
  font-weight: 700; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  text-align: center;
}
.status-pill--open { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0;   text-align: center; }
.status-pill--closed { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca;   }

/* --- Flash Messages --- */
.flash { padding: 20px 0 0; }
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  margin-bottom: 12px; background: #fff;
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.alert__text { font-weight: 600; font-size: 14px; }
.alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert--danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert--info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.card-head { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card-head--split { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.card-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); }
.card-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; }

/* --- Page Headers --- */


.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px; 
}
.page-title { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-weight: 500; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer;
  transition: all 0.2s; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 5px rgba(248, 132, 20, 0.3); }
.btn-primary:hover { background: var(--primary-700); }

.btn-secondary { background: #fff; border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: #f8fafc; border-color: #cbd5e1; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.9); }

.icon-btn {
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.icon-btn:hover { background: #f1f5f9; }

/* --- Forms --- */
.form { padding: 20px; }
.field { margin-bottom: 16px; }
.label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: #475569; }
.input, .select, .textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 500; outline: none; transition: all 0.2s;
}
.input:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(248, 132, 20, 0.15);
}
.input--money { font-size: 18px; font-weight: 700; padding-left: 28px; }
.inplogin {
  text-transform: none;width: 100%; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 500; outline: none; transition: all 0.2s;
}
/* --- Tables --- */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 700px; }
.table th {
  background: #f8fafc; text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 500; vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover { background: #fdfdfd; }

.badge {
  display: inline-flex; padding: 4px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.3px;
}
.badge--role { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; margin-top: 10px;}
.badge--ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; margin-top: 10px;}
.badge--bad { background: #f7dcdc; color: red; border: 1px solid #f7bbbb; margin-top: 10px;}


/* --- Stats Grid --- */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 30px;
}
.stat {
  background: #fff; padding: 20px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.stat__label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.stat__value { margin-top: 8px; font-size: 26px; font-weight: 900; color: var(--text); }
.stat--brand { background: linear-gradient(to bottom right, #ffffff, #fff7ed); border-color: #fed7aa; }


/* =========================================
   4. MODULE SPECIFIC: CAJA / VENTAS
   ========================================= */

/* Caja Grid Layout */
.cash-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.cash-panel { padding: 20px; }
.cash-balance {
  margin-top: 16px; background: #fffbeb; border: 1px solid #fcd34d;
  padding: 16px; border-radius: 12px;
}
.cash-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e2e8f0; font-weight: 600; }

/* Ventas / Choices */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.choice {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  cursor: pointer; transition: all 0.2s; background: #fff; text-align: center;
}
.choice:hover { border-color: var(--primary); background: #fff7ed; }
.choice:has(input:checked) {
  border-color: var(--primary); background: var(--primary); color: #fff;
  box-shadow: 0 4px 10px rgba(248, 132, 20, 0.3);
}
.choice:has(input:checked) i { color: #fff; }
.choice__body { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; }
.choice__body i { font-size: 24px; color: var(--primary); transition: color 0.2s; }


/* =========================================
   5. UTILS & ANIMATIONS
   ========================================= */

/* Toast Notifications */
.toast-container {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: #fff; padding: 12px 20px; border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 14px;
  border-left: 4px solid var(--primary);
  animation: slideDown 0.3s ease-out forwards;
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* Login / Auth Wrapper */

.auth-wrapper {
  width: 100%;
  min-height: 100vh; /* Asegura que cubra toda la pantalla */
  display: flex;
  align-items: center;
  justify-content: center;
  /* Fondo degradado cálido */
  background: linear-gradient(135deg, #E2E2E2 0%, #FEF2E6 50%, #FDDABA 100%);
  padding: 20px; /* Espacio para que no pegue a los bordes en cel */
}

/* Contenedor interno que agrupa logo + tarjeta */
.auth {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px; /* Espacio entre el logo/título y la tarjeta */
    width: 100%;
    max-width: 420px; /* Ancho máximo del bloque completo */
}

.auth__brand {
    text-align: center;
}

/* --- CORRECCIÓN DEL LOGO --- */
.auth__logo {
    width: 100px;
    height: 100px;
    background: #ffffff;
    border-radius: 50%; /* Hace el círculo */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Sombra suave y borde blanco translúcido para efecto "flotado" */
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 4px solid rgba(255,255,255,0.6);
    margin: 0 auto 16px; /* Centrado y margen inferior */
}
.auth__logo img {
    width: 68px;
    height: 68px;
    object-fit: contain;
}
/* --------------------------- */

.auth__title {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: var(--text);
}

.auth__subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-weight: 600;
    font-size: 15px;
}

/* La tarjeta del formulario */
.auth .card {
  width: 100%;
  margin: 0;
  border: none;
  /* Sombra más pronunciada para la tarjeta de login */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.auth .form {
    padding: 32px; /* Más espacio interno en el formulario */
}

/* Ajuste para el "hint" inferior */
.hint {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.hint i { color: var(--primary); }

.container-auth-alert {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 20px;
}
.flash--auth {
    position: absolute;
    top: 20px;
    width: 100%;
    z-index: 50;
}

/* =========================================
   6. RESPONSIVE DESIGN (BREAKPOINTS)
   ========================================= */

/* Tablet & Mobile (Menos de 1024px) */
@media (max-width: 1024px) {
  .mobile-header { display: flex; }
  
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    transform: translateX(-100%); /* Escondido a la izquierda */
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar__close { display: inline-flex; } /* Botón X visible */
  
  .container-fluid { width: calc(100% - 32px); }
  .cash-layout { grid-template-columns: 1fr; }
}

/* Mobile Small (Menos de 600px) */
@media (max-width: 600px) {
  .card-head--split { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hide-mobile { display: none; }
}

/* =========================================
   PATCH: AUTH LAYOUT FIX
   ========================================= */
.auth-inner {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.auth-container {
    width: 100%;
    display: flex;
    justify-content: center;
}


/* =========================================
   7. DASHBOARD & ADMIN (DISEÑO MEJORADO)
   ========================================= */

/* --- Contenedor de Gráficas --- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.chart-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
  position: relative;
  height: 320px; /* Altura fija para uniformidad */
}
.chart-container h3 {
  margin: 0 0 16px; font-size: 15px; font-weight: 800; color: #475569;
}

/* --- Barra de Filtros (Ventas) --- */
.filters-bar {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  align-items: center;
}
.filter-group {
  display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px;
}
.filter-group label {
  font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase;
}
.filter-input {
  padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 13px; outline: none; background: #fff; width: 100%; transition: all 0.2s;
}
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(248,132,20,0.1); }



/* --- Buscador Mejorado (Staff & General) --- */
.search-wrapper {
  display: flex; align-items: center;
  background: #fff;
  border: 1px solid #b1b2b3;
  border-radius: 10px;
  padding: 4px 22px;
  width: 100%; max-width: 300px;
  transition: all 0.2s;
  margin-right: 202px;
}
.search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(248,132,20,0.1);
}
.search-wrapper i { color: #94a3b8; font-size: 14px; margin-right: 8px; }
.search-input-clean {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 14px; padding: 6px 0; color: #0f172a;
}
.search-input-clean::placeholder { color: #cbd5e1; }

/* --- User Cell (Avatar) --- */
.usercell { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.usercell__meta { display: flex; flex-direction: column; line-height: 1.2; }
.usercell__name { font-weight: 700; color: #334155; font-size: 13px; }
.usercell__user { font-size: 11px; color: #94a3b8; font-family: ui-monospace, monospace; }

/* --- Tabs --- */
.tabs { display: inline-flex; gap: 4px; background: #e2e8f0; padding: 4px; border-radius: 10px; margin: 0; }
.tab {
  background: transparent; border: none; padding: 6px 16px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: #64748b; cursor: pointer; transition: all 0.2s;
}
.tab:hover { color: #334155; }
.tab.is-active { background: #fff; color: var(--primary-700); font-weight: 700; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* --- Table Clean Layout --- */
.table--clean td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.table--clean tr:last-child td { border-bottom: 0; }
.table--clean th { background: #fff; border-bottom: 2px solid #f1f5f9; text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; color: #94a3b8; }

/* --- Utilidades --- */
.toolbar-layout { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.text-right { text-align: right; }
.badge-ghost { background: #f1f5f9; color: #475569; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }

/* --- Actions Buttons (Iconos Modernos) --- */
.actions { 
  display: flex; 
  gap: 8px; /* Un poco más de espacio */
  justify-content: flex-start;
}

.icon-action {
  width: 34px; 
  height: 34px; 
  border-radius: 10px; /* Más redondeado */
  border: 1px solid transparent; 
  background: #f1f5f9; /* Fondo gris muy suave por defecto */
  display: flex; 
  align-items: center; 
  justify-content: center;
  cursor: pointer; 
  color: #64748b; 
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
}

/* =========================================
   9. HELPERS DASHBOARD (Limpieza HTML)
   ========================================= */
/* Reemplaza style="grid-column: span 2;" */
.stat--wide { grid-column: span 2; }

/* Reemplaza el flexbox del desglose de dinero */
.stat__row { 
  display: flex; 
  justify-content: space-around; 
  height: 100%; 
  align-items: center; 
}

.stat__col { text-align: center; }

.stat__val-sm { font-size: 16px; font-weight: 800; }
.text-ok { color: #16a34a; }
.text-info { color: #3b82f6; }
.text-warn { color: #f59e0b; }

.stat__divider { width: 1px; height: 24px; background: #e2e8f0; }

.chart-area { height: 240px; width: 100%; position: relative; }
.chart-area--center { display: flex; justify-content: center; }

.toolbar-group { display: flex; gap: 10px; align-items: center; }

.badge--sm { font-size: 10px; padding: 2px 6px; }

.icon-action:hover {
  transform: translateY(-2px); /* Efecto elevación sutil */
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* Colores específicos por acción */
/* Editar (Azul) */
.btn-editar:hover { background: #eff6ff; color: #3b82f6; border-color: #bfdbfe; }

/* Password (Naranja/Ámbar) */
.btn-reset:hover { background: #fffbeb; color: #f59e0b; border-color: #fde68a; }

/* Desactivar (Rojo) */
.icon-action--danger { background: #fee2e2; color: #ef4444; border-color: #fecaca; }
.icon-action--danger:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* Activar (Verde) */
.icon-action--ok { background: #dcfce7; color: #22c55e; border-color: #bbf7d0; }
.icon-action--ok:hover { background: #f0fdf4; color: #16a34a; border-color: #86efac; }

/* =========================================
   8. POS / CAPTURA DE VENTAS
   ========================================= */

/* Layout Principal: 2 Columnas (Formulario Grande | Historial Pequeño) */
.pos-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr; /* Relación de tamaño */
  gap: 20px;
  align-items: start;
}

/* Botones Grandes de Selección (Radio Buttons) */
.choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); /* Responsivo */
  gap: 12px;
}

.choice-card {
  position: relative;
  cursor: pointer;
}

.choice-card input {
  position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0;
}

.choice-card__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.choice-card__content i { font-size: 24px; color: #94a3b8; transition: color 0.2s; }
.choice-card__content span { font-size: 13px; font-weight: 700; color: #64748b; }

/* Estado Hover */
.choice-card:hover .choice-card__content {
  border-color: var(--primary);
  background: #fff7ed;
}
.choice-card:hover .choice-card__content i { color: var(--primary); }

/* Estado Seleccionado (Checked) */
.choice-card input:checked ~ .choice-card__content {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(248, 132, 20, 0.3);
  transform: translateY(-2px);
}
.choice-card input:checked ~ .choice-card__content i,
.choice-card input:checked ~ .choice-card__content span {
  color: #fff;
}

/* Lista de Historial (Estilo Ticket) */
.receipt-list {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px; /* Espacio para scrollbar */
}

.receipt-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px;
  border-bottom: 1px dashed #e2e8f0;
  background: #fff;
  transition: background 0.2s;
}
.receipt-item:last-child { border-bottom: none; }
.receipt-item:hover { background: #f8fafc; }

.receipt-info { display: flex; flex-direction: column; }
.receipt-folio { font-weight: 800; color: #334155; font-size: 14px; }
.receipt-time { font-size: 11px; color: #94a3b8; font-weight: 600; }

.receipt-amount { text-align: right; }
.receipt-total { font-weight: 800; color: #16a34a; font-size: 15px; }
.receipt-type { font-size: 10px; text-transform: uppercase; font-weight: 700; color: #64748b; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-top: 2px;}

/* Input gigante para el dinero */
.input--huge {
  font-size: 24px; font-weight: 800; padding: 12px 16px; height: auto;
}

/* Responsive Móvil */
@media (max-width: 900px) {
  .pos-grid { grid-template-columns: 1fr; } /* Una sola columna */
  .receipt-list { max-height: 300px; } /* Menos alto en móvil */
}

/* --- Ajustes para el Header del Sidebar y Estado Centrado --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1; /* Ocupa el espacio disponible */
}

.brand__stack {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Forzar centrado del pill de estado */
.status-pill {
    margin-top: 7px;
    display: inline-flex;
    justify-content: center;
    width: fit-content;

}

/* --- Ajustes Responsive para que el botón de cerrar funcione --- */
.sidebar__close {
    display: none; /* Oculto en escritorio */
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
}

@media (max-width: 1024px) {
    /* Mostrar Header Movil */
    .mobile-header {
        display: flex;
    }

    /* Ocultar Sidebar por defecto */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%); /* Escondido a la izquierda */
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 500; /* Z-Index alto para estar sobre todo */
    }

    /* Clase para abrir Sidebar */
    .sidebar.is-open {
        transform: translateX(0); /* Traer a pantalla */
    }
    
    /* Mostrar botón cerrar en móvil */
    .sidebar__close {
        display: block; 
    }

    /* Asegurar que el overlay esté debajo del sidebar pero sobre el contenido */
    .sidebar-overlay {
        z-index: 490; 
    }
}

/* =========================================
   11. CAJA V3 (PANEL CONTROL)
   ========================================= */

/* Layout de 2 columnas asimétricas */
.caja-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Tarjeta de Estado (Derecha) */
.status-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.status-row:last-child { border-bottom: none; }
.status-label { font-weight: 600; color: #64748b; font-size: 14px; }
.status-badge { 
  font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; 
}
.badge-gray { background: #f1f5f9; color: #94a3b8; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Zona Admin (Peligro) */
.admin-zone {
  margin-top: 24px;
  border: 1px dashed #fca5a5;
  background: #fef2f2;
  border-radius: 12px;
  padding: 16px;
}
.admin-title {
  font-size: 12px; font-weight: 800; color: #b91c1c; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

/* Tabla de Cortes del Día */
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; color: #94a3b8; font-weight: 600; padding-bottom: 8px; font-size: 11px; }
.mini-table td { padding: 8px 0; border-bottom: 1px solid #f1f5f9; color: #334155; font-weight: 600; }

@media (max-width: 800px) {
  .caja-layout { grid-template-columns: 1fr; }
  .caja-layout > div:nth-child(1) { order: 2; } /* Mueve estado arriba en móvil si quieres, o abajo */
}

/* =========================================
   CORRECCIONES VISUALES (GASTOS & CAJA)
   ========================================= */

/* --- 1. Input de Dinero con Símbolo Perfecto --- */
.money-input {
  position: relative; /* Necesario para posicionar el signo */
  width: 100%;
}

.money-input__sign {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%); /* Centrado vertical exacto */
  font-weight: 800;
  font-size: 16px;
  color: #64748b; /* Color por defecto */
  pointer-events: none; /* Para que el click pase al input */
  z-index: 10;
}

/* El input debe tener espacio a la izquierda para que no encime el signo */
.input--money {
  padding-left: 30px !important; 
  font-weight: 700;
  font-size: 16px;
  color: #334155;
}

/* --- 2. Tabla y Contenedor Responsive --- */
.table-wrap {
  width: 100%;
  overflow-x: auto; /* Scroll horizontal suave si no cabe */
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}

.table--clean {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap; /* Evita que el texto se rompa feo */
}

.table--clean th {
  padding: 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  border-bottom: 2px solid #f1f5f9;
}

.table--clean td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  color: #334155;
}

/* Estado Vacío Centrado */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed #e2e8f0;
  border-radius: 12px;
  margin-top: 10px;
  background: #f8fafc;
}

/* --- 3. Ajuste del Layout para que la tabla quepa mejor --- */
.caja-layout {
  display: grid;
  /* Cambiamos a 1fr 1fr para dar más espacio a la tabla, 
     o si prefieres formulario chico: 350px 1fr */
  grid-template-columns: 380px 1fr; 
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .caja-layout {
    grid-template-columns: 1fr; /* En tablets/móvil, una sola columna */
  }
}
/* =========================================
   MODALES - SISTEMA CORREGIDO V2
   ========================================= */

/* Overlay oscuro de fondo */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 999; /* Debajo de los modales pero sobre todo lo demás */
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: pointer; /* Indica que es clickeable */
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Contenedor del modal */
.modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000; /* Encima del overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none; /* Permite hacer click a través del wrapper */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* El diálogo del modal en sí */
.modal__dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
  pointer-events: auto; /* Restaura los clicks dentro del diálogo */
  animation: modalSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Cabecera del modal */
.modal__head {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal__head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal__head h3 i {
  color: var(--primary);
}

/* Contenido del formulario en modal */
.form--modal {
  padding: 24px;
}

/* Botón de cerrar (X) */
.modal__head .icon-btn {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .modal__dialog {
    width: 100% !important;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    max-height: 100vh;
  }
  
  .modal-wrapper {
    padding: 0;
  }
}

/* Toast Mejorado */
.toast-container {
  position: fixed;
  top: 80px; /* Debajo del header */
  right: 20px;
  z-index: 2000; /* Encima de todo incluyendo modales */
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none; /* No bloquea clicks */
}

.toast {
  background: white;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  border-left: 4px solid var(--primary);
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto; /* Restaura clicks en el toast */
}

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

.toast.success i {
  color: var(--ok);
}

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

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

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

.toast.info i {
  color: var(--info);
}

.toast i {
  font-size: 18px;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Asegurar que el input de money dentro del modal se vea bien */
.modal__dialog .money-input {
  position: relative;
  width: 100%;
}

.modal__dialog .money-input__sign {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  font-size: 18px;
  color: var(--primary);
  pointer-events: none;
  z-index: 10;
}

.modal__dialog .input--money {
  padding-left: 38px !important;
  font-weight: 800;
  font-size: 18px;
  color: #0f172a;
}

/* Hint dentro del modal */
.modal__dialog .hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

.modal__dialog .hint i {
  color: var(--primary);
  font-size: 14px;
}

/* Badge dentro del modal */
.modal__dialog .badge-ghost {
  background: #f1f5f9;
  color: #475569;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* Divisor visual */
.modal__dialog .divider {
  height: 1px;
  background: #e2e8f0;
  margin: 16px 0;
}

/* Scrollbar dentro del modal */
.modal__dialog::-webkit-scrollbar {
  width: 6px;
}

.modal__dialog::-webkit-scrollbar-track {
  background: #f8fafc;
}

.modal__dialog::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.modal__dialog::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* =========================================
   13. LISTA DE GASTOS (DISEÑO TARJETA)
   ========================================= */

/* Contenedor principal */
.movements-list {
  display: flex;
  flex-direction: column;
}

/* Fila individual (Tarjeta) */
.movement-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  transition: background 0.2s;
}
.movement-item:last-child { border-bottom: none; }
.movement-item:hover { background: #f8fafc; }

/* Sección Izquierda: Info (Flexible) */
.movement-info {
  flex: 1; 
  min-width: 0; /* Vital para que el texto largo se corte */
  margin-right: 15px;
}

.movement-concept {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sección Derecha: Monto y Acciones (Fijo) */
.movement-actions {
  flex-shrink: 0; /* Vital para que no se aplaste */
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.movement-amount {
  font-size: 15px;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: -0.5px;
}

/* Botón eliminar pequeño */
.btn-icon-sm {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1;
  border-radius: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
}
.btn-icon-sm:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Estados de Carga y Error (Para usar en JS) */
.state-box-loading {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
}
.state-box-error {
  text-align: center;
  padding: 20px;
  color: #ef4444;
}
.card-body-clean {
    padding-top: 0;
}

/* =========================================
   13. LISTA DE GASTOS (FLEXIBLE)
   ========================================= */

.movements-list {
  display: flex;
  flex-direction: column;
}

.movement-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  gap: 15px; /* Espacio entre columnas */
}
.movement-item:hover { background: #f8fafc; }

/* 1. EL MONTO (Dinero) */
.movement-amount-box {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 15px;
  color: #ef4444;
  letter-spacing: -0.5px;
  min-width: 70px; /* Ancho fijo para que se alineen bien */
  text-align: right;
}

/* 2. LA INFO (Concepto + Hora) */
.movement-info {
  flex: 1; /* Ocupa el espacio sobrante */
  min-width: 0; /* Permite cortar texto largo */
  display: flex;
  flex-direction: column;
}

.movement-concept {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
  line-height: 1.3;
  /* Cortar texto largo */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movement-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 3. EL BOTÓN (Acción) */
.movement-action-box {
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon-sm:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #ef4444;
}

/* --- MODO ESCRITORIO (Normal) --- */
@media (min-width: 769px) {
  /* En PC: Concepto a la izquierda, Monto a la derecha */
  .movement-info { order: 1; }
  .movement-amount-box { order: 2; text-align: right; margin-left: auto; }
  .movement-action-box { order: 3; }
}

/* --- MODO MÓVIL (Tu requerimiento) --- */
@media (max-width: 768px) {
  /* En Móvil: Monto a la izquierda (donde iría la hora), Concepto al centro */
  .movement-amount-box { 
      order: 1; 
      text-align: left; /* Alineado a la izq */
      min-width: auto; /* Ancho automático */
      font-size: 16px; /* Un poco más grande */
  }
  .movement-info { order: 2; }
  .movement-action-box { order: 3; }
  
  /* Ajuste visual */
  .movement-item { padding: 12px 15px; }
}

.crear {
  padding-left: 40px;
  padding-right: 40px;
}

.venta-check{
  border: 4px solid red;
  border-radius: 20px;
}

/* =========================================
   14. RELOJ SIDEBAR
   ========================================= */

.sidebar-clock {
  padding: 15px 20px;
  text-align: center;
  margin-top: auto; /* Empuja hacia abajo si hay espacio flex */
  border-top: 1px solid rgba(255, 255, 255, 0.1); /* Separador sutil */
  background: rgba(0, 0, 0, 0.02);
}

.clock-time {
  font-size: 26px;
  font-weight: 800;
  color: #334155;
  line-height: 1;
  font-variant-numeric: tabular-nums; /* Evita que el ancho cambie al cambiar números */
  letter-spacing: -1px;
}

.clock-date {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 6px;
  text-transform: capitalize;
}

/* Ajuste para modo oscuro o si tu sidebar tiene fondo oscuro,
   ajusta estos colores según tu tema actual */

   /* =========================
   REPORTES (UI)
========================= */

.reportes-page .card { overflow: hidden;
  padding: 20px;
}

.reportes-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.reportes-toolbar .toolbar-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.reportes-toolbar .toolbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.toolbar-divider{
  width:1px;
  height:34px;
  background:#e2e8f0;
  margin:0 6px;
}

.filtro-btn.is-active{
  background:var(--primary) !important;
  color:#fff !important;
  border-color:var(--muted) !important;
}

.month-picker{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border:1px solid #e2e8f0;
  border-radius:12px;
  background:#f8fafc;
}


.month-label{
  font-size:12px;
  color:#64748b;
  display:flex;
  align-items:center;
  gap:6px;
  margin-right:2px;
  white-space:nowrap;
}

.month-select{
  min-width: 180px;
  height: 46px;
  border-radius: 10px;
}

.reportes-range{
  margin-top:10px;
  margin-right: 20px;
  color:#64748b;
  font-size:13px;
  display:flex;
  align-items:center;
  gap:10px;
}

/* Tabs */
.reportes-tabs{
  display:flex;
  gap:10px;
  padding:12px 12px 0 12px;
  border-bottom:1px solid #e2e8f0;
  background:#fff;
}

.reportes-tabs .tab{
  border:none;
  background:transparent;
  padding:10px 12px;
  border-radius:12px 12px 0 0;
  cursor:pointer;
  color:#475569;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:8px;
}

.reportes-tabs .tab.is-active{
  background:var(--primary);
  color:#fff;
}

.loading{
  padding:26px;
  text-align:center;
  color:#64748b;
}

.empty{
  padding:26px;
  text-align:center;
  color:#64748b;
}

.money-cell{
  font-weight:700;
}

.money-cell.danger{
  color:#ef4444;
}

.small-muted{
  font-size:12px;
  color:#64748b;
}

.table td, .table th{
  vertical-align: top;
}


/* =========================================
   ESTILOS ADICIONALES - CAJA Y VENTAS V2
   Agregar al final de tu archivo styles.css
   ========================================= */

/* =========================================
   1. PREVIEW DE CORTE - SECCIONES
   ========================================= */

.preview-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.preview-section--highlight {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fed7aa;
}

.preview-section__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-section__title i {
  color: var(--primary);
}

.preview-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}

.preview-row span:first-child {
  color: #64748b;
  font-weight: 600;
}

.preview-row .mono {
  font-weight: 700;
  color: #0f172a;
}

.preview-esperado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 12px;
}

.preview-esperado span:first-child {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-esperado span:last-child {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

/* =========================================
   2. RESUMEN DE TURNO (SIDEBAR)
   ========================================= */

.turno-resumen {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 2px dashed #e2e8f0;
}

.resumen-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.resumen-title i {
  color: var(--primary);
}

.resumen-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: #475569;
}

.resumen-row span:first-child {
  font-weight: 600;
}

.resumen-row .mono {
  font-weight: 700;
}

.resumen-row--total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  font-weight: 800;
}

/* =========================================
   3. ADMIN INFO BOX
   ========================================= */

.admin-info-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

/* =========================================
   4. INPUT CON ERROR
   ========================================= */

.input--error {
  border-color: var(--danger) !important;
  background: #fef2f2 !important;
}

.input--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

/* =========================================
   5. RECEIPT LIST - PROPINA Y TIPOS
   ========================================= */

.receipt-propina {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--primary);
  background: #fff7ed;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  font-weight: 700;
}

.receipt-type--efectivo {
  background: #dcfce7;
  color: #166534;
}

.receipt-type--tarjeta {
  background: #dbeafe;
  color: #1e40af;
}

.receipt-type--transferencia {
  background: #fae8ff;
  color: #86198f;
}

/* =========================================
   6. EMPTY STATE MEJORADO
   ========================================= */

.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
  background: #fafafa;
  border-radius: 12px;
  margin: 16px;
}

.empty-icon-circle {
  width: 64px;
  height: 64px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-icon {
  font-size: 28px;
  color: #94a3b8;
}

.empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #475569;
}

.empty-desc {
  margin: 6px 0 0;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* =========================================
   7. STATE BOXES (LOADING/ERROR)
   ========================================= */

.state-box-loading {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.state-box-loading i {
  margin-right: 8px;
}

.state-box-error {
  text-align: center;
  padding: 40px 20px;
  color: #ef4444;
  font-size: 14px;
  background: #fef2f2;
  border-radius: 12px;
  margin: 16px;
}

.state-box-error i {
  margin-right: 8px;
}

/* =========================================
   8. REPORTES PAGE
   ========================================= */

.reportes-page .card {
  overflow: hidden;
}

.reportes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.reportes-toolbar .toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reportes-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-divider {
  width: 1px;
  height: 34px;
  background: #e2e8f0;
  margin: 0 6px;
}

.filtro-btn.is-active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.month-label {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 4px;
  white-space: nowrap;
  font-weight: 600;
}

.month-select {
  min-width: 140px;
  height: 42px;
  border-radius: 8px;
  font-size: 13px;
}

.reportes-range {
  color: #64748b;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
}

/* =========================================
   9. TABLA RESPONSIVE MEJORADA
   ========================================= */

.table--clean {
  font-size: 13px;
}

.table--clean th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 10;
  font-size: 10px;
  padding: 10px 12px;
  white-space: nowrap;
}

.table--clean td {
  padding: 10px 12px;
  white-space: nowrap;
}

.table--clean .money-cell {
  font-weight: 600;
}

.table--clean .money-cell.danger {
  color: #ef4444;
}

/* =========================================
   10. LOADING Y EMPTY EN TABLAS
   ========================================= */

.table .loading,
.table .empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.table .loading i {
  margin-right: 8px;
  color: var(--primary);
}

/* =========================================
   11. STATS GRID MEJORADO
   ========================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 20px;
}

.stat {
  background: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.stat__label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat__value {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
}

/* =========================================
   12. ALERTAS MEJORADAS
   ========================================= */

.alert--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.alert--warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* =========================================
   13. FORM ACTIONS
   ========================================= */

.form-actions {
  margin-top: 20px;
}

.form-actions--spread {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* =========================================
   14. RESPONSIVE FIXES
   ========================================= */

@media (max-width: 768px) {
  .preview-section {
    padding: 12px;
  }
  
  .preview-row {
    font-size: 13px;
  }
  
  .preview-esperado span:last-child {
    font-size: 18px;
  }
  
  .reportes-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .reportes-toolbar .toolbar-left,
  .reportes-toolbar .toolbar-right {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .toolbar-divider {
    display: none;
  }
  
  .month-picker {
    width: 100%;
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
  }
  
  .stat {
    padding: 12px;
  }
  
  .stat__value {
    font-size: 18px;
  }
  
  .table-wrap {
    margin: 0 -12px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .pos-grid {
    grid-template-columns: 1fr;
  }
  
  .caja-layout {
    grid-template-columns: 1fr;
  }
  
  .form-actions--spread {
    flex-direction: column;
  }
  
  .form-actions--spread .btn {
    width: 100%;
  }
}

/* =========================================
   15. BOTÓN PEQUEÑO PARA ELIMINAR
   ========================================= */

.btn-eliminar-gasto {
  background: transparent;
  border: 1px solid transparent;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-eliminar-gasto:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #ef4444;
}

/* =========================================
   16. DÍA COMPLETADO
   ========================================= */

#viewDiaCompletado {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

/* =========================================
   17. SCROLL SUAVE EN TABLA
   ========================================= */

.table-wrap {
  max-height: 500px;
  overflow-y: auto;
}

.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* Estilos adicionales para Pago Mixto */

/* Label pequeño para campos mixto */
.label-sm {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #78350f;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Choices grid con 4 columnas para incluir Mixto */
.choices-grid {
  display: grid;
  gap: 12px;
}

/* Input readonly mejorado */
.input--readonly {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #e2e8f0;
  color: #475569;
  font-weight: 700;
  cursor: not-allowed;
  user-select: none;
  padding-right: 40px;
}

.input--readonly:focus {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.2);
  outline: none;
}

/* Campo de input con error */
.input--error {
  border-color: var(--danger) !important;
  background: #fef2f2;
  color: var(--danger);
}

.input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensaje de error */
.error {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  pointer-events: auto;
  animation: toastSlide 0.3s ease-out;
  border-left: 4px solid #94a3b8;
}

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

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

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

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

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

.toast.info i {
  color: var(--info);
}

.toast i {
  font-size: 18px;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hint text */
.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.hint i {
  font-size: 11px;
}

/* Money input enhancements */
.money-input {
  position: relative;
  display: flex;
  align-items: center;
}

.money-input__sign {
  position: absolute;
  left: 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  pointer-events: none;
  z-index: 1;
}

.input--money {
  padding-left: 32px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
}

/* Mejora visual para campos mono */
.mono {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 1px;
}

.input--upper {
  text-transform: uppercase;
}

/* Loading state para botón */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:disabled i.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Mejora para el grid de choices */
.choice-card {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-card__content {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  background: white;
}

.choice-card__content i {
  font-size: 24px;
  color: #94a3b8;
  transition: all 0.2s ease;
}

.choice-card__content span {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  transition: all 0.2s ease;
}

.choice-card:hover .choice-card__content {
  border-color: var(--primary);
  background: #fff7ed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(248, 132, 20, 0.1);
}

.choice-card input[type="radio"]:checked + .choice-card__content {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.choice-card input[type="radio"]:checked + .choice-card__content i,
.choice-card input[type="radio"]:checked + .choice-card__content span {
  color: white;
}

/* Receipt list styles */
.receipt-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  max-height: 500px;
  overflow-y: auto;
}

.receipt-item {
  background: white;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.receipt-item:hover {
  background: #f8fafc;
}

.receipt-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.receipt-folio {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.receipt-time {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.receipt-amount {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.receipt-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.receipt-type {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.receipt-type--efectivo {
  background: #dcfce7;
  color: #15803d;
}

.receipt-type--tarjeta {
  background: #dbeafe;
  color: #1e40af;
}

.receipt-type--transferencia {
  background: #fef3c7;
  color: #a16207;
}

.receipt-type--mixto {
  background: linear-gradient(135deg, #dbeafe 0%, #fef3c7 100%);
  color: #78350f;
  font-weight: 700;
}

.receipt-propina {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Scrollbar personalizado */
.receipt-list::-webkit-scrollbar {
  width: 6px;
}

.receipt-list::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.receipt-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.receipt-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive para grid de pagos */
@media (max-width: 768px) {
  .choices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .choices-grid {
    grid-template-columns: 1fr;
  }
}

