:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1e40af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  --bg-main: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-sidebar: #94a3b8;
  --text-sidebar-active: #ffffff;
  
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Outfit', sans-serif;
  scrollbar-width: none; /* Firefox */
}

/* Chrome, Edge, Safari */
*::-webkit-scrollbar {
  display: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100%;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.screen.active {
  display: flex !important;
  opacity: 1;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 10;
}

/* Fallback para forzar ocultamiento si no es activo */
.screen:not(.active) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Loader */
#loading {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: white;
}
#loading.active {
  z-index: 9999;
}
.loader-content { text-align: center; }
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Login */
#login-screen {
  background: radial-gradient(circle at top left, #1e293b, #0f172a);
}
.login-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  color: white;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.login-header { text-align: center; margin-bottom: 30px; }
.logo-icon { font-size: 3rem; margin-bottom: 15px; }
.login-header h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 5px; }
.login-header p { color: #94a3b8; font-size: 0.95rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 0.9rem; font-weight: 500; color: #cbd5e1; }
.form-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}
.form-group input:focus { border-color: var(--primary); background: rgba(0,0,0,0.3); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); }

.btn-primary {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.error-msg { background: rgba(239, 68, 68, 0.1); color: #fca5a5; padding: 12px; border-radius: 10px; margin-top: 20px; font-size: 0.85rem; border: 1px solid rgba(239, 68, 68, 0.2); }
.hidden { display: none !important; }

/* Dashboard Layout */
.layout-admin {
  width: 100%;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  z-index: 100;
}
.sidebar-header { margin-bottom: 40px; padding-left: 10px; }
.logo-large { font-size: 1.5rem; font-weight: 800; color: white; letter-spacing: -0.5px; }

.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--text-sidebar);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-btn .icon { font-size: 1.2rem; filter: grayscale(1); transition: filter 0.2s; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.05); color: white; }
.nav-btn.active { background: var(--primary); color: white; }
.nav-btn.active .icon { filter: grayscale(0); }

.sidebar-footer {
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info { margin-bottom: 20px; padding-left: 10px; }
.user-info p { font-size: 0.85rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover { background: var(--danger); color: white; }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.main-header {
  padding: 24px 40px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.date-display { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }

.content-wrapper {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideIn 0.3s ease-out; }

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

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 30px;
}
.kpi-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--border);
}
.kpi-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.kpi-icon.blue { background: #eff6ff; }
.kpi-icon.green { background: #f0fdf4; }
.kpi-icon.orange { background: #fff7ed; }
.kpi-icon.purple { background: #faf5ff; }

.kpi-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.kpi-info h3 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }

/* Charts Row */
.charts-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
}
.chart-container {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.chart-container h3 { margin-bottom: 20px; font-size: 1.1rem; color: var(--text-main); }
canvas { width: 100% !important; height: 300px !important; }

/* Tables & Lists */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.table-container {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 16px 24px; text-align: left; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
td { padding: 16px 24px; font-size: 0.95rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover { background: #f8fafc; }

.badge {
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.paid { background: #dcfce7; color: #15803d; }
.badge.pending { background: #fef9c3; color: #854d0e; }

/* Buttons inside content */
.btn-primary.small { width: auto; padding: 8px 16px; font-size: 0.9rem; }

/* Inventory Filter Buttons */
.filter-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-btn:hover { background: #f1f5f9; color: var(--primary); }
.filter-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }


/* Category Chips */
.category-chip {
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid transparent;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.category-chip:hover {
    background: #e2e8f0;
    color: var(--primary);
}
.category-chip.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
}

/* Glassmorphism utility */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* Admin Dashboard Mobile */
  .layout-admin {
    flex-direction: column !important;
  }
  .sidebar { 
    width: 100% !important; 
    padding: 10px !important; 
    flex-direction: column; 
    height: auto;
  }
  .sidebar-header { margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
  .logo-large { font-size: 1.2rem; }
  .user-info { display: none; }
  .btn-logout { padding: 8px 12px; width: auto; font-size: 0.8rem; }
  
  .sidebar-nav { 
    flex-direction: row; 
    overflow-x: auto; 
    gap: 8px; 
    padding-bottom: 5px; 
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-btn { 
    white-space: nowrap; 
    padding: 10px 14px; 
    font-size: 0.9rem; 
    justify-content: center;
  }
  .nav-btn .icon { font-size: 1.2rem; margin: 0; }
  
  .main-content { overflow-y: auto; overflow-x: hidden; }
  .main-header { padding: 15px 20px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .main-header h1 { font-size: 1.3rem; }
  
  .content-wrapper { padding: 15px; }
  
  .kpi-grid { grid-template-columns: 1fr; gap: 15px; margin-bottom: 20px; }
  .kpi-card { padding: 15px; }
  .charts-row { grid-template-columns: 1fr; gap: 15px; }
  .chart-container { padding: 15px; }
  
  .content-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .table-container { overflow-x: auto; width: 100%; border-radius: 8px; }
  
  /* Tables specific shrinkage for mobile to avoid massive lateral scrolling */
  table { min-width: 320px; } /* Permitirle achicarse */
  th { padding: 8px 6px; font-size: 0.65rem; }
  td { padding: 8px 6px; font-size: 0.8rem; word-break: break-word; }
  .badge { padding: 3px 6px; font-size: 0.65rem; }
  .btn-primary.small { padding: 4px 8px; font-size: 0.75rem; width: 100%; }
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 30000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  background: white;
  width: 100%;
  max-width: 700px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.header-main h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.btn-close:hover { color: var(--danger); }

.modal-body { padding: 32px; }

/* Detail Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
}
.detail-item label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.detail-item p { font-size: 1rem; font-weight: 600; color: var(--text-main); }

/* Detail Table */
.detail-table-container {
  margin-bottom: 30px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.detail-table-container table { width: 100%; }
.detail-table-container th { background: white; border-bottom: 1px solid var(--border); }
.detail-table-container td { padding: 12px 24px; font-size: 0.9rem; }

.detail-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
}
.detail-footer .summary-row { display: flex; align-items: center; gap: 20px; }
.detail-footer .summary-row span:first-child { font-weight: 600; color: var(--text-muted); }
.detail-footer .summary-row .total { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

/* ================================================= */
/* === CASHIER POS SCREEN ========================== */
/* ================================================= */

.layout-cashier {
  display: flex;
  width: 100%;
  height: 100vh;
  background: #0f172a;
  overflow: hidden;
}

/* Left Products Panel */
.cashier-products-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f172a;
}

.cashier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}

.cashier-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cashier-title span { font-size: 1.5rem; }
.cashier-title h1 { font-size: 1.25rem; font-weight: 700; color: #f1f5f9; }

.cashier-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cashier-email { font-size: 0.85rem; color: #94a3b8; }
.btn-logout-cashier {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout-cashier:hover { background: var(--danger); color: white; }

/* Search Bar */
.products-search-bar {
  padding: 12px 24px 8px;
  background: #0f172a;
  flex-shrink: 0;
}
.products-search-bar input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}
.products-search-bar input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.products-search-bar input::placeholder { color: #64748b; }

/* Category Bar */
.products-category-bar {
  display: flex;
  gap: 8px;
  padding: 8px 24px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.products-category-bar::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cat-btn:hover { border-color: #6366f1; color: #a5b4fc; }
.cat-btn.active { background: #6366f1; border-color: #6366f1; color: white; }

/* Products Grid */
.products-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 12px 24px 24px;
  overflow-y: auto;
  align-content: start;
}
.products-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 1rem;
}

.product-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 16px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 6px;
  user-select: none;
}
.product-card:hover {
  border-color: #6366f1;
  background: #1e293b;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.2);
}
.product-card:active { transform: scale(0.97); }
.product-card-emoji { font-size: 2rem; }
.product-card-name { font-size: 0.85rem; font-weight: 600; color: #f1f5f9; line-height: 1.2; }
.product-card-price { font-size: 1rem; font-weight: 700; color: #6366f1; }
.product-card-stock { font-size: 0.75rem; color: #64748b; }

/* Weighted Products Styling */
.product-card.is-weighted {
    border-color: rgba(16, 185, 129, 0.3);
    position: relative;
    overflow: hidden;
}
.weight-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #10b981;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 8px;
    border-bottom-left-radius: 8px;
    letter-spacing: 0.05em;
    box-shadow: -2px 2px 5px rgba(0,0,0,0.1);
}
.product-card.is-weighted:hover {
    border-color: #10b981;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

/* Right Cart Panel */
.cashier-cart-panel {
  width: 360px;
  background: #1e293b;
  border-left: 1px solid #334155;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}
.cart-header h2 { font-size: 1.1rem; font-weight: 700; color: #f1f5f9; }
.btn-clear {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear:hover { border-color: #ef4444; color: #fca5a5; background: rgba(239,68,68,0.1); }

/* Cart Items */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #64748b;
  padding: 40px 20px;
  text-align: center;
}
.cart-empty span { font-size: 2.5rem; }
.cart-empty p { font-size: 0.9rem; }

.cart-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideIn 0.2s ease-out;
}
.cart-item-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.cart-item-name { font-size: 0.9rem; font-weight: 600; color: #f1f5f9; }
.cart-item-price { font-size: 0.8rem; color: #94a3b8; flex-shrink: 0; }
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-btn:hover { background: #6366f1; border-color: #6366f1; }
.qty-btn.remove:hover { background: #ef4444; border-color: #ef4444; }
.cart-item-qty { font-size: 0.95rem; font-weight: 700; color: #f1f5f9; min-width: 24px; text-align: center; }
.cart-item-subtotal { font-size: 0.9rem; font-weight: 700; color: #6366f1; text-align: right; }

/* Cart Footer */
.cart-footer {
  padding: 16px;
  border-top: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  background: #1e293b;
}

.cart-fiscal-selector label,
.cart-payment label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.fiscal-btns, .payment-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fiscal-btn, .payment-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.fiscal-btn:hover, .payment-btn:hover { border-color: #6366f1; color: #a5b4fc; }
.fiscal-btn.active, .payment-btn.active { background: #6366f1; border-color: #6366f1; color: white; }

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid #334155;
}
.cart-total-row span:first-child { font-size: 0.85rem; font-weight: 700; color: #64748b; letter-spacing: 0.08em; }
.cart-total-amount { font-size: 1.6rem; font-weight: 800; color: #f1f5f9; }

.btn-confirm-sale {
  width: 100%;
  padding: 15px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-confirm-sale:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(99,102,241,0.4); }
.btn-confirm-sale:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

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

/* ================================================= */
/* === MOBILE RESPONSIVE FIXES ===================== */
/* ================================================= */
@media (max-width: 768px) {
  /* Global */
  body { height: 100svh; } /* Utiliza svh para evitar la barra de naveación de iOS/Android */

  /* Cashier Fixes */
  .layout-cashier {
    flex-direction: column;
    height: 100svh;
  }
  .cashier-products-panel {
    flex: 1;
    height: 50%;
  }
  .cashier-cart-panel {
    width: 100%;
    flex: 1;
    height: 50%;
    border-left: none;
    border-top: 2px solid #334155;
  }
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    padding: 10px;
    gap: 8px;
  }
  .product-card { padding: 10px 8px; }
  .product-card-emoji { font-size: 1.5rem; }
  
  .cashier-header { padding: 10px 15px; }
  .cashier-title span { font-size: 1.2rem; }
  .cashier-title h1 { font-size: 1.1rem; }
  .cashier-actions { gap: 8px; }
  .btn-logout-cashier { padding: 6px 10px; font-size: 0.75rem; }
  
  .products-search-bar { padding: 10px 15px 4px; }
  .products-search-bar input { padding: 8px 14px; font-size: 0.9rem; }
  .products-category-bar { padding: 6px 15px; }
  .cat-btn { padding: 5px 12px; font-size: 0.8rem; }
  
  .cart-header { padding: 10px 15px; }
  .cart-footer { padding: 12px 15px; }
  .cart-items { padding: 8px 10px; }
  .cart-item { padding: 8px 10px; gap: 4px; }
  .cart-item-info { flex-direction: column; }
  .qty-btn { width: 24px; height: 24px; font-size: 0.8rem; }
  
  .cart-fiscal-selector label, .cart-payment label { margin-bottom: 4px; font-size: 0.7rem; }
  .fiscal-btns, .payment-btns { gap: 4px; }
  .fiscal-btn, .payment-btn { padding: 5px 8px; font-size: 0.75rem; flex: 1; text-align: center; }
  
  .cart-total-row { padding: 8px 4px; }
  .cart-total-amount { font-size: 1.3rem; }
  .btn-confirm-sale { padding: 12px; font-size: 0.95rem; }

}

.product-card.low-stock { border: 1.5px solid #ef4444 !important; background: rgba(239, 68, 68, 0.05) !important; }
.stock-warning { position: absolute; top: 10px; right: 10px; background: #ef4444; color: white; font-size: 0.6rem; font-weight: 800; padding: 2px 6px; border-radius: 4px; z-index: 2; }
