/* ===== SISTEMA DE DISEÑO - INVENTARIO BALAM ===== */

/* Tokens CSS Globales */
:root {
  --bg: #0e1525;          /* fondo app */
  --surface: #111a2e;     /* tarjetas */
  --surface-2: #0b1220;   /* barras/headers */
  --text: #e6edf3;        /* texto principal */
  --muted: #9aa6b2;       /* texto secundario */
  --primary: #2ee4c6;     /* acento menta */
  --primary-600: #1ec4a8; /* hover */
  --warning: #ffa94d;     /* alertas suaves */
  --danger: #ff6b6b;      /* crítico */
  --success: #16db65;
  --border: #1f2a3c;
  --shadow: 0 6px 20px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 16px;
  --gap-lg: 24px;
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden; /* Prevenir scroll horizontal */
}

/* Tipografía */
.h1, .page-title { 
    font-weight: 700; 
    letter-spacing: .2px; 
    font-size: 22px;
}

.h2, .card-title { 
    font-weight: 600; 
    font-size: 18px;
}

small, .muted { 
    color: var(--muted); 
    font-size: 12px;
}

/* Header */
.header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    transition: all 0.3s ease;
}

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

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .2px;
}

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

.date, .time {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

/* Navigation */
.nav {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.nav-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--border);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0; /* Prevenir que se comprima */
}

.nav-btn:hover {
    background: rgba(46, 228, 198, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: #052a24;
    border-color: var(--primary);
    font-weight: 600;
}

.nav-btn i {
    font-size: 16px;
}

/* Main Content */
.main {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 24px;
    font-weight: 600;
}

.section-header h2 i {
    color: var(--primary);
    font-size: 28px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: #052a24;
}

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

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255,255,255,.05);
    border-color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: #052a24;
}

.btn-warning {
    background: var(--warning);
    color: #052a24;
}

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

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-lg);
    margin-bottom: 32px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,.4);
    border-color: var(--primary);
}

.stat-card.warning {
    border-color: var(--warning);
}

.stat-card.warning:hover {
    border-color: var(--warning);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(46, 228, 198, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--muted);
    font-size: 14px;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #0c1324;
    color: var(--text);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 228, 198, 0.1);
}

.search-input::placeholder {
    color: var(--muted);
}

/* Tables */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow-x: auto; /* Permitir scroll horizontal en tablas */
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ancho mínimo para evitar compresión excesiva */
}

.table th {
    background: var(--surface-2);
    color: var(--text);
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

.table tbody tr:nth-child(even) {
    background: rgba(255,255,255,.02);
}

.table tbody tr:hover {
    background: rgba(255,255,255,.04);
}

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

/* Responsive table actions */
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
    min-width: auto;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--gap-lg);
}

.menu-item {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-item:hover::before {
    opacity: 1;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,.4);
    border-color: var(--primary);
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.menu-item-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    max-width: 60ch;
}

.menu-item-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.menu-item-description {
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.menu-item-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ingredient-tag {
    background: rgba(46, 228, 198, 0.1);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.menu-item-actions {
    display: flex;
    gap: 12px;
}

.menu-item-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.menu-item-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.menu-item-toggle.active {
    background: var(--primary);
    color: #052a24;
    border-color: var(--primary);
}

/* Pedido Container */
.pedido-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gap-lg);
}

.pedido-form {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #0c1324;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 228, 198, 0.1);
}

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

.menu-selection h3 {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.menu-item-select {
    background: #0c1324;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.menu-item-select:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

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

.menu-item-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.menu-item-price {
    color: var(--primary);
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #052a24;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 600;
}

.quantity-btn:hover {
    background: var(--primary-600);
    transform: scale(1.05);
}

.quantity-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--text);
}

.pedido-resumen {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    height: fit-content;
    border: 1px solid var(--border);
}

.resumen-items {
    margin-bottom: 24px;
}

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

.resumen-item:last-child {
    border-bottom: none;
}

.pedido-total {
    border-top: 2px solid var(--primary);
    padding-top: 16px;
    margin-bottom: 24px;
}

.pedido-total h4 {
    font-size: 24px;
    color: var(--text);
    text-align: right;
    font-weight: 700;
}

/* Filters */
.filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.filter-buttons .btn:hover {
    transform: translateY(-1px);
}

.date-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filters .form-input {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px;
    background: #0c1324;
    color: var(--text);
}

/* Estadísticas del historial */
.stats-summary {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

/* Estados de pedidos */
.status-badge {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 6px 12px;
    border-radius: 9999px;
    height: 28px;
    display: inline-flex;
    align-items: center;
}

.status-badge.pendiente {
    background: rgba(255, 169, 77, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.status-badge.pagado {
    background: rgba(22, 219, 101, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-badge.cancelado {
    background: rgba(255, 107, 107, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-badge.entregado {
    background: rgba(46, 228, 198, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    padding: 20px 0;
}

.modal-content {
    background: var(--surface);
    margin: 20px auto;
    padding: 0;
    border-radius: var(--radius);
    width: 90%;
    max-width: 800px;
    min-height: fit-content;
    max-height: calc(100vh - 40px);
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease;
    display: flex;
    flex-direction: column;
}

.modal-content.large {
    max-width: 800px;
}

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

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

.modal-header h3 {
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.close {
    color: var(--muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--text);
    background: rgba(255,255,255,.05);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--surface);
    z-index: 10;
}

/* Estilos para Personalización de Ingredientes */
.personalizacion-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.personalizacion-section {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    margin-bottom: 16px;
}

.personalizacion-section:nth-child(3) {
    border: 2px solid var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

.personalizacion-section:nth-child(3) h4 {
    color: var(--warning);
}

.personalizacion-section h4 {
    margin: 0 0 12px 0;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-text {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.ingredientes-base-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ingrediente-base-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
}

.ingrediente-base-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.ingrediente-base-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingrediente-name {
    font-weight: 500;
    color: var(--text);
}

.ingrediente-cantidad {
    color: var(--text-secondary);
    font-size: 14px;
}

.ingredientes-extras-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ingrediente-extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--background);
}

.ingrediente-extra-item select,
.ingrediente-extra-item input {
    flex: 1;
    min-width: 0;
}

.quantity-controls-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
}

.quantity-btn-large {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantity-btn-large:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.quantity-display-large {
    font-size: 32px;
    font-weight: bold;
    color: var(--text);
    min-width: 60px;
    text-align: center;
}

/* Estilos para interfaz mixta */
.menu-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-personalizado {
    background: var(--warning);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

.resumen-item.personalizado {
    border-left: 3px solid var(--warning);
    background: rgba(255, 193, 7, 0.1);
}

.btn-small {
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
}

.pedido-stats {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: 8px;
}

.pedido-stats .stat-item {
    display: inline-block;
    background: var(--secondary);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    margin: 0 2px;
    font-size: 10px;
}

.pedido-stats .stat-personalizado {
    background: var(--warning);
}

.personalizacion-ayuda {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 10px 20px;
    font-size: 12px;
    color: var(--primary);
    text-align: center;
}

.personalizacion-ayuda i {
    margin-right: 6px;
    color: var(--primary);
}

.personalizacion-ayuda span {
    font-weight: 500;
    margin: 0 2px;
}

/* Mejoras en la personalización */
.modal-header {
    position: relative;
}

.precio-preview {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
}

.cantidad-section {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    border-radius: 12px;
    text-align: center;
}

.cantidad-section h4 {
    color: white;
    margin-bottom: 16px;
}

.ingrediente-base-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--background);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.ingrediente-base-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ingrediente-checkbox {
    position: relative;
}

.ingrediente-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    appearance: none;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--background);
    cursor: pointer;
    transition: all 0.3s ease;
}

.ingrediente-checkbox input[type="checkbox"]:checked {
    background: var(--success);
    border-color: var(--success);
}

.ingrediente-checkbox label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ingrediente-checkbox input[type="checkbox"]:checked + label {
    opacity: 1;
}

.ingrediente-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingrediente-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.ingrediente-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.ingrediente-status.incluido {
    background: var(--success-light);
    color: var(--success);
}

.ingrediente-status.excluido {
    background: var(--danger-light);
    color: var(--danger);
}

.ingrediente-extra-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--surface);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.ingrediente-extra-item:hover {
    border-color: var(--warning);
    border-style: solid;
}

.extra-select-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ingrediente-extra-select {
    max-height: 200px;
    overflow-y: auto;
}

/* Estilos específicos para el select de ingredientes extras */
.ingrediente-extra-select option {
    padding: 8px 12px;
    line-height: 1.4;
}

/* Para navegadores webkit */
.ingrediente-extra-select::-webkit-scrollbar {
    width: 8px;
}

.ingrediente-extra-select::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

.ingrediente-extra-select::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.ingrediente-extra-select::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.extra-cantidad-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.extra-cantidad-container label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 60px;
}

.extra-precio {
    color: var(--warning);
    font-weight: bold;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}

.preview-section {
    background: var(--surface);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.personalizacion-preview h5 {
    color: var(--primary);
    margin-bottom: 12px;
}

.personalizacion-preview ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.personalizacion-preview li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.personalizacion-preview .incluido {
    color: var(--success);
}

.personalizacion-preview .excluido {
    color: var(--danger);
}

.personalizacion-preview .extra {
    color: var(--warning);
    font-weight: 500;
}

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

.footer-price {
    font-size: 18px;
    color: var(--primary);
}

.footer-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Estilos para detalles del historial */
.items-detallados {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-detalle {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.item-principal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.precio-item {
    color: var(--text-secondary);
    font-weight: 500;
}

.personalizacion-detalle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
}

.personalizacion-detalle.excluidos {
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    color: #c92a2a;
}

.personalizacion-detalle.extras {
    background: rgba(81, 207, 102, 0.1);
    border-left: 3px solid #51cf66;
    color: #2b8a3e;
}

.precio-recalculado {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 193, 7, 0.1);
    border-radius: 4px;
    border-left: 3px solid var(--warning);
}

.precio-recalculado small {
    color: var(--warning);
    font-weight: 600;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #0c1324;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 228, 198, 0.1);
}

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

/* Ingredientes */
.ingredientes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ingrediente-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ingrediente-select {
    flex: 2;
}

.ingrediente-cantidad {
    flex: 1;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--primary);
}

.loading-spinner i {
    font-size: 48px;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

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

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: var(--success);
}

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

.toast.warning {
    background: var(--warning);
}

.toast.info {
    background: #3b82f6;
}

/* Reportes */
.reportes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--gap-lg);
}

.reporte-card {
    background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.reporte-card h3 {
    color: var(--text);
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.reporte-content {
    color: var(--muted);
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 1280px) {
    .header-content,
    .nav-container,
    .main {
        padding: 0 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 0 16px;
    }

    .nav-container {
        padding: 0 16px;
        gap: 6px;
    }

    .nav-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: auto;
    }

    .nav-btn span {
        display: none; /* Ocultar texto en móviles, solo iconos */
    }

    .main {
        padding: 0 16px;
        margin: 16px auto;
    }

    .section-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px 16px;
    }

    .section-header h2 {
        font-size: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .pedido-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
    }

    .filter-buttons .btn {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    .date-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .reportes-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
        max-height: calc(100vh - 20px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px 16px;
    }
    
    .precio-preview {
        position: static;
        transform: none;
        margin-top: 8px;
        text-align: center;
    }
    
    .footer-actions {
        flex-direction: column;
    }
    
    .footer-actions .btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .personalizacion-container {
        gap: 16px;
    }
    
    .quantity-controls-large {
        gap: 16px;
    }
    
    .ingrediente-extra-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .extra-select-container {
        width: 100%;
    }

    .ingrediente-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .ingrediente-select,
    .ingrediente-cantidad {
        flex: none;
    }

    .stats-summary {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    .dia-venta {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .producto-vendido {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .producto-stock-critico {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .producto-stock {
        align-items: center;
    }

    /* Mejorar navegación móvil */
    .nav {
        padding: 8px 0;
    }

    .nav-btn {
        padding: 12px 16px;
        border-radius: 8px;
    }

    /* Mejorar scroll horizontal en navegación */
    .nav-container {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        scroll-snap-align: start;
    }

    /* Indicador de scroll */
    .nav-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, var(--surface-2));
        pointer-events: none;
    }

    /* Mejorar botones de acción en tablas */
    .table-actions {
        flex-direction: column;
        gap: 4px;
    }

    .table-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Mejorar formularios móviles */
    .form-group {
        margin-bottom: 16px;
    }

    .form-input {
        padding: 14px 16px;
        font-size: 16px; /* Prevenir zoom en iOS */
    }

    /* Mejorar botones principales */
    .btn {
        padding: 14px 20px;
        font-size: 16px;
        width: 100%; /* Botones de ancho completo en móviles */
        justify-content: center;
    }

    .btn-small {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 18px;
    }

    .logo-img {
        width: 48px;
        height: 48px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .nav-btn i {
        font-size: 14px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .section-header h2 i {
        font-size: 20px;
    }

    .table {
        font-size: 13px;
        min-width: 500px;
    }

    .table th,
    .table td {
        padding: 12px 8px;
    }

    .table th {
        font-size: 12px;
    }

    .table td {
        font-size: 12px;
    }

    /* Ocultar columnas menos importantes en móviles */
    .table th:nth-child(4),
    .table td:nth-child(4) {
        display: none; /* Ocultar columna "Unidad" en inventario */
    }

    .table th:nth-child(6),
    .table td:nth-child(6) {
        display: none; /* Ocultar columna "Estado" en inventario */
    }

    /* Mejorar visualización de acciones */
    .table-actions {
        flex-direction: row;
        gap: 4px;
        justify-content: center;
    }

    .table-actions .btn {
        width: auto;
        padding: 8px 10px;
        font-size: 11px;
    }

    /* Mejorar modales en pantallas muy pequeñas */
    .modal-content {
        width: 98%;
        margin: 2% auto;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 12px;
    }

    /* Mejorar botones de filtro */
    .filter-buttons .btn {
        padding: 10px 12px;
        font-size: 12px;
    }

    /* Mejorar estadísticas */
    .stat-card {
        padding: 20px 16px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .stat-info h3 {
        font-size: 28px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus rings para accesibilidad */
.btn:focus,
.nav-btn:focus,
.form-input:focus,
.search-input:focus {
    outline: 2px solid #78ffe7;
    outline-offset: 2px;
}

/* Estilos adicionales para asegurar tema oscuro consistente */
select.form-input {
    background: #0c1324;
    color: var(--text);
    border: 1px solid var(--border);
}

select.form-input option {
    background: var(--surface);
    color: var(--text);
}

textarea.form-input {
    background: #0c1324;
    color: var(--text);
    border: 1px solid var(--border);
    resize: vertical;
}

/* Mejoras específicas para navegación móvil */
@media (max-width: 768px) {
    /* Hacer la navegación más táctil */
    .nav-btn {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
        touch-action: manipulation;
    }

    /* Mejorar scroll horizontal en navegación */
    .nav-container {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .nav-btn {
        scroll-snap-align: start;
    }

    /* Indicador de scroll */
    .nav-container::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to right, transparent, var(--surface-2));
        pointer-events: none;
    }
}

/* Mejoras para pantallas muy pequeñas */
@media (max-width: 360px) {
    .header-content {
        padding: 0 12px;
    }

    .nav-container {
        padding: 0 12px;
    }

    .main {
        padding: 0 12px;
    }

    .section-header {
        padding: 16px 12px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ===== STOCK CRÍTICO ===== */
.stock-critico-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.producto-stock-critico {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.producto-stock-critico:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.producto-stock-critico.agotado {
    border-color: var(--danger);
    background: rgba(255, 107, 107, 0.1);
}

.producto-stock-critico.stock-bajo {
    border-color: var(--warning);
    background: rgba(255, 169, 77, 0.1);
}

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

.producto-info .nombre {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.producto-info .estado {
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.producto-stock .cantidad {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.producto-stock .precio {
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

/* ===== FILTROS DE HISTORIAL ===== */
.historial-filtros {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.filtro-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
    min-width: fit-content;
}

.filtro-btn:hover {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

.filtro-btn.activo {
    background: var(--primary);
    color: var(--bg);
    border-color: var(--primary);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}

.toast-message {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    color: var(--text);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast-message.success {
    border-left: 4px solid var(--success);
}

.toast-message.error {
    border-left: 4px solid var(--danger);
}

.toast-message.warning {
    border-left: 4px solid var(--warning);
}

.toast-message.info {
    border-left: 4px solid var(--primary);
}

.toast-message i {
    font-size: 18px;
    flex-shrink: 0;
}

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

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

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

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

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

/* ===== RESPONSIVIDAD MÓVIL MEJORADA ===== */
@media (max-width: 768px) {
    .historial-filtros {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .filtro-btn {
        flex-shrink: 0;
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .producto-stock-critico {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .producto-stock {
        align-items: flex-start;
        width: 100%;
    }
    
    .toast {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast-message {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .historial-filtros {
        gap: 6px;
    }
    
    .filtro-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .producto-stock-critico {
        padding: 12px;
    }
    
    .producto-info .nombre {
        font-size: 14px;
    }
    
    .producto-stock .cantidad {
        font-size: 14px;
    }
}

/* ===== DROPDOWN PERSONALIZADO PARA INGREDIENTES EXTRAS ===== */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
}

.custom-select:hover {
    border-color: var(--primary);
    background: var(--surface-2);
}

.custom-select .selected-text {
    flex-grow: 1;
    color: var(--text);
}

.custom-select .dropdown-arrow {
    color: var(--muted);
    transition: transform 0.2s ease;
}

.custom-select:hover .dropdown-arrow {
    color: var(--primary);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow);
}

.custom-options.open {
    display: block;
}

.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: var(--primary);
    color: var(--bg);
}

.custom-option .precio-option {
    font-size: 12px;
    color: var(--warning);
    font-weight: 500;
}

.custom-option:hover .precio-option {
    color: var(--bg);
}

/* Scrollbar personalizado para dropdown */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: var(--surface-2);
}

.custom-options::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 3px;
}

.custom-options::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
/*nuevos*/
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    align-items: center;
    pointer-events: none; /* 🛡️ IMPORTANTE: Permite hacer clic a través del contenedor vacío */
}

.toast-message {
    background: var(--surface-2);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 24px;
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInUp 0.4s ease;
    min-width: 300px;
    font-weight: 500;
    font-size: 15px;
    pointer-events: auto; /* 🛡️ Permite interactuar con el mensaje */
}
/* Animación para que suba desde abajo */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}