/* ==========================================================================
   1. VARIABLES GLOBALES (Sidebar Negro Real & Contenido Claro)
   ========================================================================== */
:root {
  /* Dimensiones del Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 64px;
  --header-height: 56px;
  --footer-height: 38px;

  /* SIDEBAR ULTRA DARK (Negro Carbon & Grises) */
  --sidebar-bg-start: #000000;
  --sidebar-bg-end: #09090b;
  --sidebar-border: rgba(255, 255, 255, 0.1);
  --sidebar-text-main: #ffffff;
  --sidebar-text-muted: #a1a1aa;
  --sidebar-text-light: #71717a;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
  --sidebar-active-bg: rgba(59, 130, 246, 0.15);
  --sidebar-accent: #38bdf8;

  /* CONTENIDO PRINCIPAL CLARO (Clean Light SaaS) */
  --bg-main: #f8fafc;           /* Fondo gris muy claro e impecable */
  --bg-surface: #ffffff;        /* Tarjetas, modales y contenedor de tablas */
  --bg-surface-hover: #f1f5f9;  /* Filas hover */
  --bg-input: #f8fafc;          /* Entradas de texto / Buscadores */

  /* Bordes & Separadores del Contenido */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  /* Textos del Contenido */
  --text-main: #0f172a;         /* Oscuro principal */
  --text-muted: #475569;        /* Gris medio */
  --text-light: #94a3b8;        /* Gris claro/Placeholder */

  /* Acento Primario */
  --primary: #2563eb;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --primary-hover: #1d4ed8;

  /* Tipografía */
  --font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 13px;
  --font-size-sm: 11.5px;
  --font-size-xs: 10px;
  --font-size-icon: 18px;

  /* Sombras y Transiciones */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   2. RESET Y ESTRUCTURA DE PANTALLA
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-main);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.layout-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ==========================================================================
   3. SIDEBAR REALMENTE NEGRO (Dark Pitch)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), width var(--transition);
  z-index: 100;
  flex-shrink: 0;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--sidebar-border);
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.brand-logo {
  min-width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  color: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.brand-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.company-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--sidebar-text-main);
  line-height: 1.2;
}

.company-sub {
  font-size: var(--font-size-xs);
  color: var(--sidebar-text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--sidebar-text-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 10px 6px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  color: var(--sidebar-text-muted);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 3px;
  transition: var(--transition);
  height: 38px;
}

.nav-item i {
  font-size: var(--font-size-icon);
  min-width: 20px;
  text-align: center;
  color: var(--sidebar-text-light);
  transition: var(--transition);
}

.nav-text {
  font-size: 12.5px;
  font-weight: 500;
}

.nav-item:hover {
  background-color: var(--sidebar-hover-bg);
  color: var(--sidebar-text-main);
}

.nav-item:hover i {
  color: var(--sidebar-accent);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-main);
  font-weight: 600;
  border-left: 3px solid var(--sidebar-accent);
}

.nav-item.active i {
  color: var(--sidebar-accent);
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 14px;
  border-top: 1px solid var(--sidebar-border);
  background-color: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}

.user-avatar {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-text-main);
}

.user-role {
  font-size: 10px;
  color: var(--sidebar-text-muted);
}

.logout-btn {
  color: var(--sidebar-text-muted);
  font-size: 16px;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}

.logout-btn:hover {
  color: #f87171;
  background-color: rgba(248, 113, 113, 0.15);
}

/* Sidebar Contraído */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .brand-info,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-details,
.sidebar.collapsed .logout-btn {
  display: none;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 6px 0;
  border-left: none;
}

/* ==========================================================================
   4. ÁREA PRINCIPAL Y NAVBAR (Contenido Claro Limpio)
   ========================================================================== */
.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background-color: var(--bg-main);
}

.header {
  height: var(--header-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: var(--transition);
}

.toggle-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
  width: 220px;
  transition: var(--transition);
}

.search-box:focus-within {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  width: 260px;
}

.search-box i { color: var(--text-light); font-size: 15px; }
.search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 12px;
  color: var(--text-main);
  width: 100%;
}

.action-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  position: relative;
  transition: var(--transition);
}

.action-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.action-btn .badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background-color: #ef4444;
  border-radius: 50%;
}

/* ==========================================================================
   5. WORKSPACE & TABLAS CLARAS
   ========================================================================== */
.content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.table-search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  gap: 8px;
  width: 280px;
  transition: var(--transition);
}

.table-search-box:focus-within {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.table-search-box input {
  border: none;
  background: none;
  outline: none;
  font-size: 12px;
  color: var(--text-main);
  width: 100%;
}

.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

table.data-table th, table.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

table.data-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.6px;
}

table.data-table tbody tr {
  transition: var(--transition);
}

table.data-table tbody tr:hover {
  background-color: var(--bg-surface-hover);
}

/* Badges Claros */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
}

.badge-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.badge-danger  { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* Botones de Acción */
.btn-action {
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-action:hover {
  color: var(--primary);
  background-color: #eff6ff;
  border-color: rgba(37, 99, 235, 0.2);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover { background: #e2e8f0; }

/* ==========================================================================
   6. MODALES Y PAGINACIÓN CLAROS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 { font-size: 15px; font-weight: 700; color: var(--text-main); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group-full { grid-column: span 2; }

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pagination-controls { display: flex; align-items: center; gap: 4px; }

.btn-page {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: var(--transition);
}

.btn-page:hover:not(:disabled), .btn-page.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

.footer {
  height: var(--footer-height);
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   7. TRANSFORMACIÓN A APP NATIVA EN MÓVILES
   ========================================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
}

@media (max-width: 768px) {
  /* Sidebar Drawer */
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 260px !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open { left: 0; }
  .sidebar-overlay.active { display: block; }

  .search-box { width: 120px; }
  .search-box:focus-within { width: 150px; }

  .content { padding: 12px; }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .table-search-box { width: 100% !important; }
  .table-toolbar .btn-primary { width: 100%; justify-content: center; padding: 10px; }

  /* -----------------------------------------------------------------------
     TRANSFORMACIÓN DE TABLA A CARDS (Ajuste Perfecto al Móvil)
     ----------------------------------------------------------------------- */
  .table-container {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  table.data-table, 
  table.data-table tbody, 
  table.data-table tr, 
  table.data-table td {
    display: block;
    width: 100% !important;
  }

  table.data-table thead {
    display: none;
  }

  /* Tarjeta Móvil Clara */
  table.data-table tbody tr {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }

  table.data-table td {
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
    white-space: normal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
  }

  table.data-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
    gap: 6px;
  }

  /* Labels en Tarjeta */
/* Labels en Tarjeta para Alumnos (4 Columnas) */
table.data-table td:nth-child(1)::before { content: "Alumno:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(2)::before { content: "Plan / Pago:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(3)::before { content: "Vencimiento:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(4)::before { content: "Acciones:"; font-weight: 600; color: var(--text-muted); }

  .form-grid { grid-template-columns: 1fr; }
  .form-group-full { grid-column: span 1; }
  .modal-card { border-radius: 16px; }

  .pagination-container {
    flex-direction: column;
    gap: 10px;
    border-radius: 12px;
    border-top: 1px solid var(--border-color);
  }
}

/* ==========================================================================
   FIX PARA MODALES EXTERNOS (SweetAlert2) Y DESGLOSE DE PAGOS
   ========================================================================== */

/* Bloquea el colapso y movimiento del Sidebar al abrir modales de SweetAlert2 */
body.swal2-shown {
  padding-right: 0 !important;
  overflow: hidden !important;
}

body.swal2-shown .layout-wrapper {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
}

body.swal2-shown .sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  flex-shrink: 0 !important;
  display: flex !important;
}

/* Formato de desglose de pagos por filas dentro de la celda */
.payment-breakdown {
  font-size: 11px;
  line-height: 1.45;
}

.payment-breakdown span {
  display: block;
  white-space: nowrap;
}

/* Modal Ticket Térmico */
.ticket-box {
  width: 280px;
  padding: 12px;
  background: #ffffff;
  border: 1px dashed #000000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #000000;
  margin: 0 auto;
}


/*PARA MI SELECTOR DE BUSQUEDA Y NO APAREZCA TODO AMONTONADO*/
    .select-search-wrapper {
      position: relative;
      width: 100%;
    }
    .select-search-input {
      width: 100%;
      padding: 8px 30px 8px 12px;
      border: 1px solid var(--border-color, #cbd5e1);
      border-radius: 6px;
      background: var(--bg-surface, #fff);
      cursor: pointer;
    }
    .select-search-arrow {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
      color: var(--text-muted, #64748b);
    }
    .select-dropdown-list {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: #ffffff;
      border: 1px solid var(--border-color, #cbd5e1);
      border-radius: 8px;
      max-height: 220px;
      overflow-y: auto;
      z-index: 9999;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      display: none;
    }
    .select-dropdown-item {
      padding: 10px 12px;
      cursor: pointer;
      font-size: 13px;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .select-dropdown-item:hover {
      background-color: #f8fafc;
      color: var(--primary, #0284c7);
    }
    .select-dropdown-item:last-child {
      border-bottom: none;
    }
    
    
    /* ==========================================================================
   ESTILOS EXCLUSIVOS - PUNTO DE VENTA (POS)
   ========================================================================== */

.pos-header-margin {
  margin-bottom: 8px;
}

.pos-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 120px);
}

@media (max-width: 768px) {
  .pos-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.pos-column {
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.pos-column-right {
  justify-content: space-between;
}

.pos-search-box {
  width: 100%;
  margin-bottom: 10px;
}

.pos-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.pos-card-item {
  background: var(--bg-main, #f8fafc);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.pos-card-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary, #0284c7);
}

.pos-card-title {
  font-size: 12px;
  display: block;
}

.pos-card-badge {
  font-size: 9px;
  margin-top: 2px;
  text-transform: uppercase;
}

.pos-card-price {
  font-size: 11px;
  color: var(--primary, #0284c7);
  font-weight: 700;
  display: block;
  margin-top: 4px;
}

.pos-card-stock {
  font-size: 9.5px;
  color: var(--text-muted, #64748b);
  font-weight: 600;
}

.pos-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pos-table-wrapper {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 8px;
}

.pos-total-box {
  background: var(--bg-main, #f8fafc);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 18px;
}

.pos-total-amount {
  color: var(--primary, #0284c7);
}

.pos-btn-cobrar {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  justify-content: center;
}

.pos-stock-banner {
  background: #e0f2fe;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-stock-label {
  font-size: 12px;
  color: #0369a1;
  font-weight: 600;
}

.pos-stock-badge {
  font-size: 13px;
}

.pos-subtotal-live {
  margin-top: 12px;
  text-align: right;
  font-size: 14px;
  font-weight: 700;
}

.pos-subtotal-amount {
  color: var(--primary, #0284c7);
}

.pos-pay-banner {
  text-align: center;
  background: var(--bg-main, #f8fafc);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.pos-pay-label {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.pos-pay-amount {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary, #0284c7);
}

.pos-vuelto-input {
  background: #d1fae5 !important;
  color: #047857 !important;
  font-weight: 700 !important;
  font-size: 16px !important;
}

.pos-hidden {
  display: none !important;
}

.modal-close-icon {
  cursor: pointer;
}

.btn-danger-action {
  color: #ef4444;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted, #64748b);
}

/* TICKET IMPRESIÓN */
.pos-ticket-modal-card {
  max-width: 340px;
}

.ticket-box {
  width: 280px;
  padding: 12px;
  background: #ffffff;
  border: 1px dashed #000000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #000000;
  margin: 0 auto;
}

.ticket-header-title {
  text-align: center;
  font-weight: bold;
}

.ticket-header-sub {
  text-align: center;
  font-size: 9px;
}

.ticket-total-row {
  font-weight: bold;
  text-align: right;
}

.ticket-right {
  text-align: right;
}

.ticket-footer-text {
  text-align: center;
}

.ticket-footer-center {
  justify-content: center;
  gap: 10px;
}


/* ==========================================================================
   MÓDULO DE CRÉDITO POS
   ========================================================================== */

.pos-debt-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
  text-align: center;
}

.pos-debt-label {
  font-size: 11px;
  color: #991b1b;
  font-weight: 700;
}

.pos-debt-amount {
  font-size: 20px;
  font-weight: 700;
  color: #dc2626;
}

.pos-empty-stock {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted, #64748b);
  padding: 20px;
  font-size: 13px;
}


   /* Estilos para el Switch compacto de visibilidad */
    .permiso-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 6px 8px;
      border-bottom: 1px dashed var(--border-color, #e2e8f0);
    }
    .permiso-row:hover {
      background-color: rgba(0, 0, 0, 0.02);
    }
    .permiso-left {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .switch-visibilidad {
      position: relative;
      display: inline-block;
      width: 32px;
      height: 18px;
    }
    .switch-visibilidad input {
      opacity: 0;
      width: 0;
      height: 0;
    }
    .slider-switch {
      position: absolute;
      cursor: pointer;
      top: 0; left: 0; right: 0; bottom: 0;
      background-color: #cbd5e1;
      transition: .3s;
      border-radius: 18px;
    }
    .slider-switch:before {
      position: absolute;
      content: "";
      height: 12px;
      width: 12px;
      left: 3px;
      bottom: 3px;
      background-color: white;
      transition: .3s;
      border-radius: 50%;
    }
    input:checked + .slider-switch {
      background-color: var(--primary, #2563eb);
    }
    input:checked + .slider-switch:before {
      transform: translateX(14px);
    }
    .switch-label {
      font-size: 10px;
      color: var(--text-muted);
      margin-left: 5px;
      user-select: none;
    }
    

    /* Estilos del Contenedor de Pestañas (Tabs) */
    .tabs-navigation {
      display: flex;
      gap: 8px;
      border-bottom: 2px solid var(--border-color, #e2e8f0);
      margin-bottom: 16px;
      overflow-x: auto;
      padding-bottom: 2px;
    }

    .tab-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text-muted, #64748b);
      background: transparent;
      border: none;
      border-bottom: 3px solid transparent;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
    }

    .tab-btn:hover {
      color: var(--primary-color, #2563eb);
      background: var(--bg-hover, #f8fafc);
      border-radius: 6px 6px 0 0;
    }

    .tab-btn.active {
      color: var(--primary-color, #2563eb);
      border-bottom-color: var(--primary-color, #2563eb);
    }

    .tab-badge {
      background: #e2e8f0;
      color: #475569;
      font-size: 12px;
      padding: 2px 8px;
      border-radius: 12px;
      font-weight: bold;
    }

    .tab-btn.active .tab-badge {
      background: var(--primary-color, #2563eb);
      color: #ffffff;
    }
  
  /* --- COMPONENTE KPI Y FILTRO MENSUAL --- */
.stats-card-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background-color: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--primary-light, #eff6ff);
  color: var(--primary-color, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.kpi-details {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  line-height: 1.2;
}

.kpi-subtitle {
  font-size: 13px;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.month-filter-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.month-filter-form .filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-filter-form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.select-control {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #cbd5e1);
  background-color: #ffffff;
  font-size: 14px;
  color: var(--text-color, #0f172a);
}

/* --- CLASES DE UTILIDAD GENERAL --- */
.hidden-element { display: none !important; }
.modal-hidden { display: none !important; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted, #64748b); }
.text-danger { color: #ef4444; }
.text-success { color: #10b981; }
.bold { font-weight: bold; }
.nowrap { white-space: nowrap; }
.nowrap-bold { white-space: nowrap; font-weight: bold; }

.table-full { width: 100%; }
.select-full { width: 100%; padding: 10px; border-radius: 6px; border: 1px solid var(--border-color, #cbd5e1); }
.search-box-wide { width: 100%; max-width: 400px; }

.icon-warning { color: #f59e0b; }
.icon-danger { color: #ef4444; }
.icon-success { color: #10b981; }
.icon-primary { color: #2563eb; }
.icon-blue { color: #3b82f6; }
.icon-purple { color: #8b5cf6; }
.icon-edit { color: #f59e0b; }
.icon-close { cursor: pointer; }
.icon-whatsapp { color: #25D366; font-size: 18px; vertical-align: middle; }

.btn-danger-action { color: #ef4444; }
.btn-flex-center { display: inline-flex; align-items: center; gap: 6px; }

.btn-success {
  background-color: #10b981;
  border-color: #10b981;
  color: #ffffff;
}
.btn-success:hover {
  background-color: #059669;
}

.input-readonly { background-color: #f1f5f9; }
.input-danger { background-color: #fef2f2; color: #ef4444; }

.badge-sm { font-size: 11px; }
.badge-neutral { background-color: #e2e8f0; color: #475569; }

.link-whatsapp { text-decoration: none; color: inherit; }
.link-block { display: inline-block; text-decoration: none; }

.modal-card-sm { max-width: 450px; }
.modal-card-md { max-width: 650px; }
.modal-card-lg { max-width: 900px; }
.modal-scrollable { max-height: 90vh; overflow-y: auto; }
.modal-body-padding { padding: 15px; }

.printable-area { padding: 10px; }
.pdf-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--primary-color, #2563eb);
  padding-bottom: 8px;
}
.pdf-alumno-title { margin: 0; color: var(--primary-color, #2563eb); }
.pdf-alumno-subtitle { margin: 4px 0 0 0; color: var(--text-muted, #64748b); font-size: 14px; font-weight: 500; }

.chart-wrapper-card {
  margin-bottom: 20px;
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
  height: 320px;
}

.section-label-highlight {
  font-weight: bold;
  color: var(--primary-color, #2563eb);
  margin-bottom: 8px;
  display: block;
}

.text-muted-sm { color: var(--text-muted, #64748b); font-size: 12px; }
.text-primary-sm { color: var(--primary-color, #2563eb); font-weight: 600; font-size: 12px; }
.label-bold-sm { font-weight: bold; font-size: 13px; }
.label-bold-block { font-weight: bold; font-size: 13px; display: block; margin-bottom: 6px; }

.cell-padding-lg { padding: 20px; }
.mt-xs { margin-top: 8px; }
.mb-sm { margin-bottom: 8px; }
.font-md { font-size: 18px; }
.font-lg { font-size: 20px; }
.table-footer-row { font-weight: bold; background-color: #f8fafc; }

/* RETÍCULA DE KPIS EJECUTIVOS */
.kpis-wrapper-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.kpi-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-bg-blue { background-color: #eff6ff; color: #2563eb; }
.icon-bg-green { background-color: #ecfdf5; color: #10b981; }
.icon-bg-orange { background-color: #fff7ed; color: #f97316; }
.icon-bg-purple { background-color: #f3e8ff; color: #8b5cf6; }

.kpi-details { display: flex; flex-direction: column; }
.kpi-title { font-size: 12px; font-weight: 600; color: #64748b; text-transform: uppercase; }
.kpi-value { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.kpi-subtitle { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* Labels en Tarjeta Móvil para Productos (5 Columnas) */
table.data-table td:nth-child(1)::before { content: "Producto:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(2)::before { content: "Categoría:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(3)::before { content: "Precios:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(4)::before { content: "Inventario:"; font-weight: 600; color: var(--text-muted); }
table.data-table td:nth-child(5)::before { content: "Acciones:"; font-weight: 600; color: var(--text-muted); }