@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg-body: #f8fafc; --bg-surface: #ffffff;
    --primary: #3b82f6; --primary-hover: #2563eb; --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --accent: #f59e0b; --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --success: #10b981; --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger: #ef4444; --text-main: #0f172a; --text-muted: #64748b; --border-light: #e2e8f0;
    --radius-md: 8px; --radius-lg: 14px; --radius-xl: 20px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); --shadow-floating: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* { -ms-overflow-style: none; scrollbar-width: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }

body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
.container-main { display: flex; height: 100vh; padding: 20px; gap: 20px; box-sizing: border-box; max-width: 1600px; margin: 0 auto; }
.columna { background: var(--bg-surface); border-radius: var(--radius-xl); padding: 25px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; border: 1px solid rgba(226, 232, 240, 0.8); }
.columna:first-child { flex: 2.2; } .columna:last-child { flex: 1.3; }

.app-header, .mesonero-header, .header-delivery { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-light); }
.logo-img, .brand-section img, .brand img { max-height: 50px !important; max-width: 250px !important; width: auto; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05)); border-radius: 8px; }
.brand-section, .brand { display: flex; align-items: center; gap: 15px; }
.info-text { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; line-height: 1.2; }
.action-section, .actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tasa-box { font-weight: 800; font-size: 0.85rem; color: var(--primary); }
.user-actions { display: flex; gap: 10px; align-items: center; }
.badge-rol { background: #f1f5f9; color: var(--text-main); padding: 6px 12px; border-radius: var(--radius-md); font-size: 0.85rem; font-weight: 700; border: 1px solid var(--border-light); }

.input-comanda, .form-group { width: 100%; padding: 14px 18px; border: 1px solid var(--border-light); border-radius: var(--radius-md); font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--text-main); background: #f8fafc; transition: all 0.3s ease; box-sizing: border-box; }
.input-comanda:focus, .form-group:focus { background: var(--bg-surface); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); outline: none; }
.fila-inputs { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; width: 100%; }
.grid-inputs-comanda { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-bottom: 15px; }

button { font-family: 'Inter', sans-serif; cursor: pointer; transition: all 0.2s ease; }
.boton-enviar, .btn-guardar { background: var(--primary-gradient); color: white; border: none; border-radius: var(--radius-md); padding: 16px 24px; font-size: 1.05rem; font-weight: 700; box-shadow: var(--shadow-md); width: 100%; }
.boton-enviar:hover, .btn-guardar:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.boton-enviar:active, .btn-guardar:active { transform: translateY(1px); }
.boton-imprimir { background: #e2e8f0; color: #334155; border: none; border-radius: var(--radius-md); padding: 14px 20px; font-weight: 700; box-shadow: var(--shadow-sm); }
.boton-imprimir:hover { background: #cbd5e1; }
.btn-header { background: #f1f5f9; border: 1px solid var(--border-light); color: #475569; padding: 8px 16px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.85rem; box-shadow: var(--shadow-sm); }
.btn-header:hover { background: var(--border-light); color: var(--text-main); }

.filtro-container { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 5px; margin-bottom: 20px; }
.filtro-categoria { background: white; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 10px 18px; font-size: 0.95rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; box-shadow: var(--shadow-sm); }
.filtro-categoria:hover { background: #f8fafc; color: var(--text-main); border-color: #cbd5e1; }
.filtro-categoria.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4); }
#menu-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; overflow-y: auto; padding-right: 5px; flex-grow: 1; }
.producto-card { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 15px; text-align: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: space-between; }
.producto-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #93c5fd; }
.producto-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 50%; margin: 0 auto 10px; box-shadow: var(--shadow-sm); }
.producto-card h4 { margin: 0 0 5px; font-size: 0.9rem; color: var(--text-main); line-height: 1.2; }
.producto-card p { margin: 0; color: var(--success); font-weight: 800; font-size: 1.1rem; }

.navbar { background: var(--bg-surface); padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-md); position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border-light); }
.navbar h2 { margin: 0; font-size: 1.4rem; color: var(--text-main); }
.btn-nav { padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; border: 1px solid var(--border-light); background: #f8fafc; color: var(--text-main); }
.btn-salir { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }
.btn-salir:hover { background: #ef4444; color: white; }

.dashboard-container { max-width: 1400px; margin: 30px auto; padding: 0 20px; }
.tabs-header { display: flex; gap: 8px; margin-bottom: 30px; background: #e2e8f0; padding: 8px; border-radius: 16px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05); overflow-x: auto; border: 1px solid #cbd5e1; }
.tab-btn { padding: 12px 22px; background: transparent; border: none; border-radius: 10px; font-weight: 600; color: #64748b; font-size: 0.95rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.tab-btn:hover:not(.active) { color: #0f172a; background: rgba(255, 255, 255, 0.5); }
.tab-btn.active { background: #ffffff; color: var(--primary); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04); font-weight: 800; transform: translateY(-1px); }

.card { background: var(--bg-surface); border-radius: var(--radius-lg); padding: 25px; box-shadow: var(--shadow-md); border: 1px solid var(--border-light); margin-bottom: 20px; }
.grid-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 10px; }
th { background: #f8fafc; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; padding: 14px 15px; text-align: left; border-bottom: 2px solid var(--border-light); }
td { padding: 16px 15px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
tr:hover td { background: #f8fafc; }

.img-preview { width: 50px; height: 50px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-sm); }
.btn-accion { width: 35px; height: 35px; border-radius: 8px; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; transition: 0.2s; box-shadow: var(--shadow-sm); }
.btn-editar { background: #fef3c7; color: #d97706; }
.btn-editar:hover { background: #fde68a; }
.btn-eliminar { background: #fee2e2; color: #ef4444; }
.btn-eliminar:hover { background: #fca5a5; }

@media (max-width: 900px) {
    .container-main { flex-direction: column; height: auto; padding: 10px; }
    .columna { height: auto; min-height: 500px; padding: 15px; }
    .grid-panel { grid-template-columns: 1fr; }
    .tabs-header { padding: 5px; }
    .tab-btn { padding: 10px 15px; font-size: 0.85rem; white-space: nowrap; }
}

@media (max-width: 600px) {
    .app-header, .mesonero-header, .header-delivery { flex-direction: column; gap: 12px; padding-bottom: 10px; margin-bottom: 15px; align-items: center !important; text-align: center; }
    .brand-section, .brand { flex-direction: column; text-align: center; gap: 5px; }
    .info-text { display: none; } 
    .action-section, .actions { align-items: center; width: 100%; }
    .user-actions { justify-content: center; width: 100%; }
    .grid-inputs-comanda { grid-template-columns: 2fr 1fr; gap: 10px; }
    .grid-inputs-comanda .input-comanda { padding: 12px 10px; font-size: 0.9rem; }
    .navbar { flex-direction: column; padding: 15px 10px; gap: 15px; text-align: center; }
    .navbar-btns { flex-wrap: wrap; justify-content: center; gap: 8px !important; width: 100%; }
    .btn-nav, .btn-header { padding: 10px 12px; font-size: 0.8rem; flex-grow: 1; text-align: center; }
    .navbar h2 { font-size: 1.2rem; }
    #total-texto { font-size: 2rem !important; }
    #menu-container { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .producto-card { padding: 10px; }
    .producto-card img { width: 55px; height: 55px; }
}

@media print {
    body > *:not(#recibo-impresion) { display: none !important; }
    #recibo-impresion { display: block !important; position: relative !important; width: 100% !important; margin: 0 !important; padding: 0 !important; background: white !important; color: black !important; }
    @page { margin: 0; }
}