/* ==========================================================================
   SISTEMA DE CONTROL DE FLUJO DE EFECTIVO - LA SALSA DE AJO C.A.
   Estilos Globales y Diseño del Sistema
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Paleta Corporativa "La Salsa de Ajo C.A." */
  --primary: #f59e0b;        /* Amarillo cálido / Mostaza */
  --primary-hover: #d97706;  /* Amarillo oscuro */
  --primary-light: #fef3c7;  /* Amarillo suave / crema */
  --primary-glow: rgba(245, 158, 11, 0.25);
  
  --secondary: #0f172a;      /* Carbón grafito oscuro */
  --secondary-light: #1e293b;/* Carbón medio */
  --secondary-hover: #334155;
  
  --accent-gold: #fbbf24;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --info: #3b82f6;
  --info-light: #dbeafe;
  
  /* Fondos y Superficies */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* Textos */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverted: #ffffff;
  
  /* Sombras y Elevaciones */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.06);
  
  /* Dimensiones */
  --sidebar-width: 270px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Estructura Principal */
#app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   BARRA LATERAL (SIDEBAR)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--secondary);
  color: var(--text-inverted);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, transparent 100%);
}

.logo-container {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
  border: 2px solid var(--accent-gold);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 4px);
}

.brand-text h1 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-text .badge-brand {
  font-size: 10px;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-block;
  margin-top: 2px;
}

.brand-text .location-tag {
  display: block;
  font-size: 9.5px;
  color: var(--text-muted);
}

.nav-menu {
  list-style: none;
  padding: 16px 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.nav-item .badge-count {
  margin-left: auto;
  background: rgba(0, 0, 0, 0.25);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.academic-badge {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 11.5px;
}

.academic-badge .title {
  color: var(--accent-gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.academic-badge .desc {
  color: #cbd5e1;
  font-size: 10.5px;
  line-height: 1.3;
}

/* ==========================================================================
   CONTENIDO PRINCIPAL & ENCABEZADO
   ========================================================================== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.top-header {
  height: var(--header-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.exchange-rate-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  color: #92400e;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--success-light);
  color: #065f46;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-lock {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--secondary-light);
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-lock:hover {
  background: var(--danger);
  transform: translateY(-1px);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-gold) 100%);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-info {
  line-height: 1.2;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   VISTAS Y CONTENEDORES (VIEWS)
   ========================================================================== */
.content-area {
  padding: 28px;
  flex-grow: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

/* Tarjetas y Paneles */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Métricas del Dashboard */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.metric-card.success::before { background: var(--success); }
.metric-card.danger::before { background: var(--danger); }
.metric-card.info::before { background: var(--info); }
.metric-card.warning::before { background: var(--warning); }

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-card.success .metric-icon { background: var(--success-light); color: var(--success); }
.metric-card.danger .metric-icon { background: var(--danger-light); color: var(--danger); }
.metric-card.info .metric-icon { background: var(--info-light); color: var(--info); }
.metric-card.warning .metric-icon { background: var(--primary-light); color: var(--primary-hover); }

.metric-data {
  flex-grow: 1;
}

.metric-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
  margin-top: 2px;
  font-family: 'Outfit', sans-serif;
}

.metric-subtext {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Gráficos Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.chart-container {
  position: relative;
  height: 290px;
  width: 100%;
}

/* ==========================================================================
   MÓDULO PUNTO DE VENTA (POS / FACTURACIÓN)
   ========================================================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

.pos-catalog {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.catalog-search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-group {
  position: relative;
  flex-grow: 1;
}

.search-input-group svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.search-input-group input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  background: var(--bg-subtle);
}

.search-input-group input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.chip-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.chip-btn.active {
  background: var(--primary);
  color: #0f172a;
  border-color: var(--primary);
}

.products-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.pos-product-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  background: #ffffff;
}

.pos-product-category {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-hover);
  letter-spacing: 0.5px;
}

.pos-product-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--secondary);
  margin: 4px 0 8px 0;
  line-height: 1.3;
}

.pos-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.pos-product-price {
  font-size: 15px;
  font-weight: 800;
  color: #047857;
}

.pos-product-stock {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.pos-product-stock.low-stock {
  color: var(--danger);
}

/* Panel del Carrito */
.pos-cart-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.cart-items-list {
  flex-grow: 1;
  max-height: 300px;
  overflow-y: auto;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  text-align: center;
}

.cart-empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  opacity: 0.4;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.cart-item-info .name {
  font-weight: 600;
  color: var(--secondary);
}

.cart-item-info .unit-price {
  font-size: 11px;
  color: var(--text-muted);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
}

.qty-btn {
  background: none;
  border: none;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-weight: 700;
  color: var(--secondary);
}

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

.qty-val {
  font-weight: 700;
  min-width: 20px;
  text-align: center;
  font-size: 12px;
}

.cart-item-subtotal {
  font-weight: 700;
  color: var(--secondary);
  font-size: 13.5px;
}

.btn-remove-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-remove-item:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Totales y Pago */
.cart-summary {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: auto;
  border: 1px solid var(--border-color);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.summary-line.total-line {
  font-size: 19px;
  font-weight: 800;
  color: var(--secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
  margin-top: 8px;
}

.total-bs {
  font-size: 13px;
  color: #047857;
  font-weight: 700;
  text-align: right;
  margin-top: 2px;
}

.payment-method-select {
  margin: 14px 0;
}

.payment-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.payment-opt-btn {
  padding: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.payment-opt-btn.active {
  background: var(--secondary);
  color: #ffffff;
  border-color: var(--secondary);
}

.btn-checkout {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #0f172a;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-checkout:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   TABLAS Y LISTADOS (INVENTARIO, GASTOS, CIERRES)
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: var(--bg-subtle);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(245, 158, 11, 0.03);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--primary-light); color: #92400e; }
.badge-info { background: var(--info-light); color: #1e40af; }
.badge-secondary { background: #e2e8f0; color: #334155; }

/* Botones Globales */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #0f172a;
}

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

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-outline {
  border-color: var(--border-color);
  background: #ffffff;
  color: var(--secondary);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--secondary);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.action-buttons {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   MODALES Y POPUPS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  transform: scale(0.95) translateY(10px);
  transition: var(--transition);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.btn-close-modal:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-subtle);
}

/* Formularios */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  outline: none;
  transition: var(--transition);
}

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

/* ==========================================================================
   PANTALLA DE BLOQUEO DE SEGURIDAD
   ========================================================================== */
#lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.lock-card {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lock-logo {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: #ffffff;
  padding: 4px;
  border: 3px solid var(--primary);
  box-shadow: 0 0 25px var(--primary-glow);
}

.lock-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.lock-card h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 4px;
}

.lock-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: var(--transition);
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}

.numpad-btn {
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.numpad-btn:hover {
  background: var(--primary);
  color: #0f172a;
  transform: scale(1.05);
}

/* ==========================================================================
   TICKET DE VENTA IMPRIMIBLE
   ========================================================================== */
.ticket-wrapper {
  background: #ffffff;
  color: #000000;
  font-family: 'JetBrains Mono', monospace;
  padding: 20px;
  max-width: 340px;
  margin: 0 auto;
  border: 1px dashed #cbd5e1;
  font-size: 12px;
}

.ticket-header {
  text-align: center;
  margin-bottom: 12px;
}

.ticket-header h4 {
  font-size: 14px;
  font-weight: 800;
}

.ticket-divider {
  border-top: 1px dashed #000000;
  margin: 8px 0;
}

.ticket-items {
  width: 100%;
  margin: 8px 0;
}

.ticket-items td {
  padding: 2px 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--secondary);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 4px solid var(--primary);
  animation: slideInRight 0.3s ease;
}

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

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

/* Responsive adjustments */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

/* Impresión */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-ticket, #printable-ticket * {
    visibility: visible;
  }
  #printable-ticket {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}
