/* ==========================================================================
   EL TÍO PEPE FOOD TRUCK - SISTEMA DE DISEÑO POS & COCINA (V1.2)
   ========================================================================== */

:root {
  /* Paleta Oficial El Tío Pepe */
  --brand-yellow: #FFD000;
  --brand-yellow-hover: #E5BB00;
  --brand-yellow-light: rgba(255, 208, 0, 0.18);
  --brand-yellow-glow: rgba(255, 208, 0, 0.4);
  --brand-black: #0E1015;
  
  /* Superficies y Fondos Oscuros */
  --bg-app: #08090C;
  --bg-surface: #12141B;
  --bg-surface-elevated: #1A1D27;
  --bg-surface-hover: #242836;
  --border-subtle: #272C3B;
  --border-focus: #FFD000;

  /* Colores de Estado Semánticos */
  --status-nuevo: #F59E0B;
  --status-nuevo-bg: rgba(245, 158, 11, 0.18);
  --status-prep: #3B82F6;
  --status-prep-bg: rgba(59, 130, 246, 0.18);
  --status-listo: #10B981;
  --status-listo-bg: rgba(16, 185, 129, 0.18);
  --status-entregado: #64748B;
  --status-entregado-bg: rgba(100, 116, 139, 0.18);
  --status-danger: #EF4444;
  --status-danger-bg: rgba(239, 68, 68, 0.18);

  /* Métodos de Pago */
  --pay-yape: #742284;
  --pay-plin: #00B4D8;
  --pay-cash: #10B981;
  --pay-card: #3B82F6;

  /* Tipografía y Textos */
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0E1015;

  /* Bordes, Sombras y Transiciones */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input, textarea, select {
  user-select: text;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP HEADER & NAVBAR
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 16, 21, 0.98);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--brand-yellow);
  box-shadow: 0 0 10px rgba(255, 208, 0, 0.4);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--brand-yellow);
  line-height: 1.1;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Navegación por Pestañas / Roles */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  background: var(--brand-yellow);
  color: var(--brand-black);
  box-shadow: 0 2px 10px rgba(255, 208, 0, 0.35);
}

.tab-badge {
  background: var(--status-danger);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

.nav-tab.active .tab-badge {
  background: var(--brand-black);
  color: var(--brand-yellow);
}

/* Acciones en Header */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.action-btn {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  min-height: 38px;
}

.action-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--brand-yellow);
}

.action-btn.active {
  background: var(--brand-yellow-light);
  border-color: var(--brand-yellow);
  color: var(--brand-yellow);
}

.action-btn.locked {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--status-nuevo);
  color: var(--status-nuevo);
}

/* Badge de Sincronización Cloud En Vivo */
.sync-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  transition: var(--transition-fast);
  min-height: 38px;
}

.sync-status-badge:hover {
  border-color: var(--brand-yellow);
}

.sync-status-badge.connected {
  background: rgba(16, 185, 129, 0.18);
  border-color: var(--status-listo);
  color: #34D399;
}

.sync-status-badge.connecting {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--status-nuevo);
  color: #FBBF24;
}

.sync-status-badge.disconnected {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--status-danger);
  color: #F87171;
}

.sync-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: syncPulse 1.8s infinite alternate;
}

@keyframes syncPulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* ==========================================================================
   VISTA 1: POS - TOMA DE PEDIDOS (FILA / CAJERO)
   ========================================================================== */

.pos-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - 62px);
  height: calc(100dvh - 62px);
  overflow: hidden;
}

@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 1fr 340px;
  }
}

@media (max-width: 768px) {
  .pos-container {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
}

.pos-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  padding: 14px 18px;
  gap: 12px;
}

/* Barra de Cliente y Orden */
.customer-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.customer-input-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.customer-icon {
  position: absolute;
  left: 14px;
  color: var(--brand-yellow);
  font-size: 1.1rem;
}

.customer-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 42px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition-fast);
}

.customer-input:focus {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 2px var(--brand-yellow-light);
}

.customer-input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.order-type-pills {
  display: flex;
  gap: 6px;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
}

.type-pill {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.type-pill.active {
  background: var(--brand-yellow);
  color: var(--brand-black);
}

/* Categorías Horizontales */
.categories-bar-wrapper {
  display: flex;
  width: 100%;
  flex-shrink: 0;
  overflow-x: auto;
  padding: 4px 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.categories-bar-wrapper::-webkit-scrollbar {
  display: none;
}

.categories-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
}

.cat-pill {
  padding: 9px 18px;
  background: #1B1E29;
  border: 1.5px solid #2E3547;
  border-radius: var(--radius-full);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cat-pill:hover {
  background: #252A3B;
  border-color: var(--brand-yellow);
}

.cat-pill.active {
  background: var(--brand-yellow) !important;
  color: var(--brand-black) !important;
  border-color: var(--brand-yellow) !important;
  box-shadow: 0 3px 12px rgba(255, 208, 0, 0.4);
}

/* Barra de Búsqueda Rápida */
.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  flex-shrink: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
}

.search-input {
  padding-left: 40px !important;
  height: 42px !important;
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

/* Cuadrícula de Productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-yellow);
  box-shadow: var(--shadow-md);
}

.product-card:active {
  transform: scale(0.98);
}

.product-card.out-of-stock {
  opacity: 0.55;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.product-img-wrap {
  width: 100%;
  height: 140px;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface-elevated);
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

.popular-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brand-yellow);
  color: var(--brand-black);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.stock-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--status-danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.product-content {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  gap: 8px;
}

.product-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.product-price {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--brand-yellow);
}

.add-btn-action {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--brand-yellow);
  background: rgba(255, 208, 0, 0.15);
  color: var(--brand-yellow);
  transition: var(--transition-fast);
}

.product-card:hover .add-btn-action {
  background: var(--brand-yellow);
  color: var(--brand-black);
}

/* ==========================================================================
   PANEL LATERAL: CARRITO / PEDIDO ACTUAL
   ========================================================================== */

.cart-sidebar {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.cart-title {
  font-size: 1.05rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-count {
  background: var(--brand-yellow-light);
  color: var(--brand-yellow);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.clear-cart-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.clear-cart-btn:hover {
  color: var(--status-danger);
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
  padding: 20px;
}

.empty-cart-icon {
  font-size: 3rem;
  opacity: 0.4;
}

.cart-item-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.cart-item-price {
  font-weight: 900;
  color: var(--brand-yellow);
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Modificadores en Carrito */
.cart-mod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.mod-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.mod-tag.tag-crema {
  background: rgba(255, 208, 0, 0.18);
  color: #FFE066;
}

.mod-tag.tag-extra {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
}

.mod-tag.tag-note {
  background: rgba(59, 130, 246, 0.18);
  color: #60A5FA;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.qty-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 800;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.qty-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--brand-yellow);
}

.qty-number {
  font-weight: 800;
  font-size: 0.9rem;
  min-width: 18px;
  text-align: center;
}

.remove-item-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
}

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

/* Footer de Carrito y Botón de Cobro */
.cart-footer {
  padding: 14px 18px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.cart-total-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cart-total-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand-yellow);
  letter-spacing: -0.02em;
}

.checkout-btn {
  width: 100%;
  padding: 15px;
  background: var(--brand-yellow);
  color: var(--brand-black);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(255, 208, 0, 0.35);
  transition: var(--transition-fast);
}

.checkout-btn:hover {
  background: var(--brand-yellow-hover);
  transform: translateY(-2px);
}

.checkout-btn:active {
  transform: scale(0.98);
}

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

/* ==========================================================================
   VISTA 2: COCINA / KDS (KITCHEN DISPLAY SYSTEM)
   ========================================================================== */

.kitchen-container {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 62px);
  min-height: calc(100dvh - 62px);
  padding: 16px 20px;
  gap: 16px;
}

/* Barra de Resumen en Cocina */
.kitchen-summary-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 900;
}

.badge-nuevo {
  background: var(--status-nuevo-bg);
  color: var(--status-nuevo);
  border: 1px solid var(--status-nuevo);
}

.badge-prep {
  background: var(--status-prep-bg);
  color: var(--status-prep);
  border: 1px solid var(--status-prep);
}

.badge-listo {
  background: var(--status-listo-bg);
  color: var(--status-listo);
  border: 1px solid var(--status-listo);
}

.kitchen-filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-surface-elevated);
  padding: 4px;
  border-radius: var(--radius-md);
}

.k-filter-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.k-filter-btn.active {
  background: var(--brand-yellow);
  color: var(--brand-black);
}

/* Cuadrícula de Tickets de Cocina */
.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}

.ticket-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  position: relative;
}

/* Colores de Estado del Ticket */
.ticket-card.ticket-nuevo {
  border-color: var(--status-nuevo);
  animation: ticketPulse 2.5s infinite alternate;
}

.ticket-card.ticket-preparando {
  border-color: var(--status-prep);
}

.ticket-card.ticket-listo {
  border-color: var(--status-listo);
}

.ticket-card.ticket-entregado {
  border-color: var(--status-entregado);
  opacity: 0.6;
}

@keyframes ticketPulse {
  0% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
  100% { box-shadow: 0 0 24px rgba(245, 158, 11, 0.45); }
}

/* Header del Ticket */
.ticket-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.ticket-nuevo .ticket-header {
  background: var(--status-nuevo-bg);
}

.ticket-preparando .ticket-header {
  background: var(--status-prep-bg);
}

.ticket-listo .ticket-header {
  background: var(--status-listo-bg);
}

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

.ticket-number {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.ticket-type-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.3);
}

.ticket-timer {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticket-timer.urgent {
  background: var(--status-danger);
  color: white;
  animation: blinkUrgent 1s infinite alternate;
}

@keyframes blinkUrgent {
  0% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Nombre del Cliente en Ticket */
.ticket-customer-row {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.ticket-customer-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-yellow);
}

.ticket-pay-status {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.pay-cobrado {
  background: var(--status-listo-bg);
  color: var(--status-listo);
  border: 1px solid var(--status-listo);
}

.pay-pendiente {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger);
}

/* Lista de Platos en Ticket */
.ticket-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.ticket-item {
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ticket-item-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ticket-item-qty {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--brand-yellow);
  background: var(--brand-yellow-light);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ticket-item-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Modificadores en Cocina */
.ticket-item-mods {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kds-cremas-box {
  background: rgba(255, 208, 0, 0.12);
  border-left: 3px solid var(--brand-yellow);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #FFE066;
}

.kds-extras-box {
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid var(--status-listo);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #6EE7B7;
}

.kds-note-box {
  background: rgba(239, 68, 68, 0.18);
  border-left: 3px solid var(--status-danger);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.84rem;
  font-weight: 800;
  color: #FCA5A5;
}

.ticket-note-general {
  background: rgba(59, 130, 246, 0.18);
  border: 1px dashed var(--status-prep);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #93C5FD;
}

/* Footer y Botones de Acción de Cocina */
.ticket-actions {
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

.kds-action-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.btn-start-prep {
  background: var(--status-prep);
  color: white;
}

.btn-start-prep:hover {
  background: #2563EB;
}

.btn-mark-ready {
  background: var(--status-listo);
  color: white;
}

.btn-mark-ready:hover {
  background: #059669;
}

.btn-deliver {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-deliver:hover {
  background: var(--status-entregado);
  color: white;
}

/* ==========================================================================
   VISTA 3: ADMINISTRADOR DE MENÚ Y STOCK
   ========================================================================== */

.admin-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--brand-yellow);
}

.admin-table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  background: var(--bg-surface-elevated);
  padding: 14px 16px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

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

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.dish-thumb-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dish-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.dish-thumb-info {
  display: flex;
  flex-direction: column;
}

.dish-name-cell {
  font-weight: 700;
  color: var(--text-primary);
}

.dish-cat-cell {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Switch Toggle de Stock */
.stock-toggle-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.stock-toggle-btn.in-stock {
  background: var(--status-listo-bg);
  color: var(--status-listo);
  border: 1px solid var(--status-listo);
}

.stock-toggle-btn.out-stock {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid var(--status-danger);
}

/* ==========================================================================
   VISTA 4: REPORTES Y CAJA DEL EVENTO
   ========================================================================== */

.reports-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reports-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.metric-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand-yellow);
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Desglose de Métodos de Pago */
.payments-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.pay-card {
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-subtle);
}

.pay-card.card-yape { background: rgba(116, 34, 132, 0.2); border-color: var(--pay-yape); }
.pay-card.card-plin { background: rgba(0, 180, 216, 0.2); border-color: var(--pay-plin); }
.pay-card.card-cash { background: rgba(16, 185, 129, 0.2); border-color: var(--pay-cash); }
.pay-card.card-pos { background: rgba(59, 130, 246, 0.2); border-color: var(--pay-card); }

.pay-card-title {
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pay-card-amount {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
}

/* ==========================================================================
   MODALES (PERSONALIZACIÓN, COBRO, ÉXITO)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close-btn {
  background: var(--bg-surface-elevated);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  padding: 16px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
}

/* Modificadores en Modal de Personalización */
.section-subtitle {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--brand-yellow);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cremas-quick-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preset-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--brand-yellow);
  color: var(--text-primary);
}

.preset-btn.active {
  background: var(--brand-yellow-light);
  border-color: var(--brand-yellow);
  color: var(--brand-yellow);
}

.cremas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.crema-chip {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.crema-chip:hover {
  background: var(--bg-surface-hover);
}

.crema-chip.selected {
  background: rgba(255, 208, 0, 0.15);
  border-color: var(--brand-yellow);
  color: var(--brand-yellow);
}

.crema-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

/* Extras Checkboxes */
.extras-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}

.extra-row:hover {
  background: var(--bg-surface-hover);
}

.extra-row.selected {
  border-color: var(--status-listo);
  background: rgba(16, 185, 129, 0.1);
}

.extra-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

.extra-price {
  font-weight: 800;
  color: var(--status-listo);
  font-size: 0.9rem;
}

/* Modal de Cobro */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pay-method-btn {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.pay-method-btn:hover {
  background: var(--bg-surface-hover);
}

.pay-method-btn.selected {
  border-color: var(--brand-yellow);
  background: var(--brand-yellow-light);
  color: var(--brand-yellow);
}

.quick-cash-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.cash-pill {
  padding: 8px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cash-pill:hover {
  border-color: var(--status-listo);
  background: rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   SISTEMA DE TOASTS
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  animation: toastSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-success { border-color: var(--status-listo); border-left-width: 4px; }
.toast-warning { border-color: var(--status-nuevo); border-left-width: 4px; }
.toast-alert { border-color: var(--brand-yellow); border-left-width: 4px; }

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

.toast-fade-out {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
