/* =====================================================
   LA PARRILLA MK - PANEL DE ADMINISTRACIÓN
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,500..800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Variables heredadas del main */
:root {
    --color-primary: #1848F0;      /* rojo marca (The Restaurant Supply) */
    --color-primary-dark: #1039C4;
    --color-primary-light: #FF3B52;
    --color-accent: #D8A830;        /* amarillo marca (mascota) */
    --color-accent-dark: #B8912A;
    --color-secondary: #141414;     /* negro marca */
    --color-success: #22C55E;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    --bg-primary: #F5F5F4;
    --bg-secondary: #FFFFFF;
    --bg-dark: #1F2937;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --border-color: #E5E7EB;
    --border-radius: 10px;
    --shadow-sm: 0 1px 3px rgba(17,24,39,0.06), 0 1px 2px rgba(17,24,39,0.04);
    --shadow-md: 0 8px 20px -6px rgba(17,24,39,0.14);
    --transition-fast: 150ms ease;
    --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    background-image: radial-gradient(55% 40% at 100% 0%, rgba(24, 72, 240,0.05), transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
}

/* =====================================================
   LAYOUT ADMIN
   ===================================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 232px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, #17202e 100%);
    color: white;
    padding: 1rem 0.9rem 1.4rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,0.06);
}

/* Scrollbar del sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.35rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.85rem;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, var(--color-primary), #f43f5e);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(24, 72, 240,0.35);
    flex: none;
}

.sidebar-logo h1 {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.15;
}

.sidebar-logo span {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    display: block;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 1px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.44rem 0.7rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: rgba(255,255,255,0.68);
    text-decoration: none;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(24, 72, 240,0.22), rgba(24, 72, 240,0.08));
    border-left-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav .nav-icon {
    font-size: 1rem;
    width: 1.3rem;
    text-align: center;
    flex: none;
}

.sidebar-section {
    margin-top: 0.9rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-section-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
    margin-bottom: 0.35rem;
    padding: 0 0.7rem;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 232px;
    min-height: 100vh;
}

/* Top Bar */
.admin-topbar {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    padding: 0.7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border-radius: 50px;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

/* Content Area — contenedor uniforme para TODAS las vistas */
.admin-content {
    padding: 1.4rem 1.9rem 2.5rem;
    max-width: 1360px;
    margin: 0 auto;
    width: 100%;
}

/* =====================================================
   CARDS Y PANELES
   ===================================================== */

.card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.card-header {
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.2rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

/* Tira compacta de estado del negocio */
.biz-strip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    margin-bottom: 0.9rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.biz-strip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
}
.biz-strip-dot.open { background: var(--color-success); box-shadow: 0 0 8px rgba(34,197,94,0.7); animation: bizPulse 2s infinite; }
.biz-strip-dot.closed { background: var(--color-danger); }
@keyframes bizPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.biz-strip-sub {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

/* Stats Cards (horizontales y compactas) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 0.7rem;
    margin-bottom: 1.1rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 0.7rem 0.95rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast), box-shadow 0.2s ease;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0;
    grid-row: 1 / 3;
}

.stat-card-icon.primary { background: rgba(24, 72, 240, 0.1); color: var(--color-primary); }
.stat-card-icon.success { background: rgba(34, 197, 94, 0.1); color: var(--color-success); }
.stat-card-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.stat-card-icon.info { background: rgba(59, 130, 246, 0.1); color: var(--color-info); }

.stat-card-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 0;
    grid-column: 2;
    align-self: end;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    grid-column: 2;
    align-self: start;
    line-height: 1.25;
}

/* =====================================================
   TABLAS
   ===================================================== */

.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.85);
    background: var(--bg-dark);
    border-bottom: 2px solid var(--color-primary);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.data-table th:first-child { border-top-left-radius: var(--border-radius); }
.data-table th:last-child { border-top-right-radius: var(--border-radius); }

.data-table tbody tr:nth-child(even) {
    background: rgba(243,244,246,0.55);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(24, 72, 240,0.06);
}

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

.data-table td small {
    font-size: 0.75rem;
}

.data-table .actions {
    display: flex;
    gap: 0.4rem;
}

/* =====================================================
   FORMULARIOS
   ===================================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-label .required {
    color: var(--color-danger);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(24, 72, 240, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Checkbox y Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--border-color);
    border-radius: 13px;
    position: relative;
    transition: all var(--transition-fast);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-success);
}

.toggle-switch input:checked + .toggle-slider::after {
    left: 25px;
}

/* =====================================================
   BOTONES
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow 0.2s ease, background var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(24, 72, 240,0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(24, 72, 240,0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 4px 12px rgba(34,197,94,0.28);
}

.btn-success:hover:not(:disabled) {
    background: #1ea04e;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239,68,68,0.26);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--color-warning);
    color: white;
    box-shadow: 0 4px 12px rgba(245,158,11,0.26);
}

.btn-info {
    background: var(--color-info);
    color: white;
    box-shadow: 0 4px 12px rgba(59,130,246,0.26);
}

.btn-sm {
    padding: 0.38rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 7px;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.btn-icon.sm {
    width: 28px;
    height: 28px;
}

/* Botones de acción por ícono (editar / borrar / QR / exportar) */
.btn-edit,
.btn-delete,
.btn-qr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.btn-edit {
    background: rgba(245,158,11,0.12);
    color: #B45309;
    border-color: rgba(245,158,11,0.3);
}
.btn-edit:hover { background: var(--color-warning); color: #fff; transform: translateY(-1px); }

.btn-delete {
    background: rgba(239,68,68,0.1);
    color: var(--color-danger);
    border-color: rgba(239,68,68,0.28);
}
.btn-delete:hover { background: var(--color-danger); color: #fff; transform: translateY(-1px); }

.btn-qr {
    background: rgba(59,130,246,0.1);
    color: var(--color-info);
    border-color: rgba(59,130,246,0.28);
}
.btn-qr:hover { background: var(--color-info); color: #fff; transform: translateY(-1px); }

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.1rem;
    background: var(--color-success);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.86rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34,197,94,0.28);
    transition: all var(--transition-fast);
}
.btn-export:hover { background: #1ea04e; transform: translateY(-1px); }

/* =====================================================
   BADGES
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: rgba(24, 72, 240, 0.1); color: var(--color-primary); }
.badge-success { background: rgba(34, 197, 94, 0.1); color: var(--color-success); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--color-info); }

/* Estados de pedido */
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #DBEAFE; color: #1E40AF; }
.badge-preparing { background: #FED7AA; color: #9A3412; }
.badge-ready { background: #BBF7D0; color: #166534; }
.badge-delivery { background: #E0E7FF; color: #3730A3; }
.badge-delivered { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }

/* =====================================================
   PEDIDOS - VISTA ESPECIAL
   ===================================================== */

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 0.8rem;
}

.order-card {
    --oc: #94A3B8;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--oc);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Color por estado del pedido */
.order-card.estado-pendiente  { --oc: #F59E0B; }
.order-card.estado-confirmado { --oc: #3B82F6; }
.order-card.estado-preparando { --oc: #1848F0; }
.order-card.estado-listo      { --oc: #22C55E; }
.order-card.estado-en_camino  { --oc: #7C5CFC; }
.order-card.estado-entregado  { --oc: #10B981; }
.order-card.estado-cancelado  { --oc: #EF4444; }

.order-card.estado-pendiente  .order-card-header { background: linear-gradient(90deg, rgba(245,158,11,0.14), var(--bg-primary)); }
.order-card.estado-confirmado .order-card-header { background: linear-gradient(90deg, rgba(59,130,246,0.13), var(--bg-primary)); }
.order-card.estado-preparando .order-card-header { background: linear-gradient(90deg, rgba(24, 72, 240,0.14), var(--bg-primary)); }
.order-card.estado-listo      .order-card-header { background: linear-gradient(90deg, rgba(34,197,94,0.14), var(--bg-primary)); }
.order-card.estado-en_camino  .order-card-header { background: linear-gradient(90deg, rgba(124,92,252,0.13), var(--bg-primary)); }
.order-card.estado-entregado  .order-card-header { background: linear-gradient(90deg, rgba(16,185,129,0.12), var(--bg-primary)); }
.order-card.estado-cancelado  .order-card-header { background: linear-gradient(90deg, rgba(239,68,68,0.12), var(--bg-primary)); }

.order-card .order-number { color: var(--oc); }

.order-card.estado-cancelado .order-card-body { opacity: 0.62; }
.order-card.estado-cancelado .order-total span:last-child { color: var(--text-muted); text-decoration: line-through; }

/* el avatar toma el color del estado */
.order-card .customer-avatar { background: var(--oc); }

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-card.new {
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: var(--shadow-sm); }
    50% { box-shadow: 0 0 0 3px rgba(24, 72, 240, 0.3); }
}

.order-card-header {
    padding: 0.5rem 0.85rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.order-number {
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-card-body {
    padding: 0.75rem 0.85rem;
    flex: 1;
}

.order-customer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-color);
}

.customer-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.82rem;
    flex: none;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.customer-info h4 {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0;
    line-height: 1.25;
}

.customer-info p {
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin: 0;
}

.order-items {
    margin-bottom: 1rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.order-item-qty {
    background: var(--bg-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    margin-right: 0.5rem;
}

.order-total {
    display: flex;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 0.98rem;
}

.order-total span:last-child {
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--color-primary);
}

.order-card-footer {
    padding: 0.55rem 0.85rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.45rem;
}

.order-card-footer .btn-icon {
    flex: 0 0 36px;
}

.order-card-footer .btn {
    padding: 0.42rem 0.55rem;
    font-size: 0.8rem;
    flex: 1;
}

/* =====================================================
   MODAL ADMIN
   ===================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-backdrop.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* =====================================================
   ALERTAS
   ===================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.alert-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-success .alert-icon {
    background: rgba(34, 197, 94, 0.2);
}

.alert-danger, .alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
    color: #991B1B;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-danger .alert-icon, .alert-error .alert-icon {
    background: rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-warning .alert-icon {
    background: rgba(245, 158, 11, 0.2);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: #1E40AF;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.alert-info .alert-icon {
    background: rgba(59, 130, 246, 0.2);
}

/* =====================================================
   HORARIOS
   ===================================================== */

.schedule-grid {
    display: grid;
    gap: 0.75rem;
}

.schedule-row {
    display: grid;
    grid-template-columns: 120px 1fr 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
}

.schedule-day {
    font-weight: 600;
}

/* =====================================================
   PRODUCTOS ADMIN
   ===================================================== */

.products-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-admin-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.product-admin-image {
    height: 150px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
}

.product-admin-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-admin-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.product-admin-body {
    padding: 1rem;
}

.product-admin-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.product-admin-category {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.product-admin-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-admin-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-secondary) 0%, #3D3D3D 100%);
    padding: 1.5rem;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    background: var(--color-primary);
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.login-logo h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.login-logo span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* =====================================================
   RESPONSIVE ADMIN
   ===================================================== */

@media (max-width: 1024px) {
    /* Mostrar mobile header en tablets */
    .mobile-header {
        display: block;
    }
    
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 150;
        padding-top: 1.5rem;
    }
    
    .admin-sidebar.active {
        left: 0;
    }
    
    /* Mostrar botón cerrar en sidebar */
    .sidebar-close {
        display: block;
    }
    
    /* Mostrar overlay */
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto;
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
        padding-top: 60px;
    }
    
    .admin-topbar {
        position: sticky;
        top: 60px;
        z-index: 50;
    }
}

@media (max-width: 768px) {
    .admin-content {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .orders-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .schedule-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
}

/* =====================================================
   SONIDO NOTIFICACIÓN
   ===================================================== */

.notification-sound {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.notification-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-btn.muted {
    background: var(--text-muted);
}

.notification-btn .pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--color-primary);
    animation: notification-pulse 1.5s ease-out infinite;
}

@keyframes notification-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* WhatsApp Button */
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #25D366;
    color: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.whatsapp-btn:hover {
    background: #20bd5a;
    transform: translateY(-2px);
}

/* =====================================================
   IMAGE UPLOAD
   ===================================================== */

.image-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.image-upload:hover {
    border-color: var(--color-primary);
}

.image-upload.dragover {
    border-color: var(--color-primary);
    background: rgba(24, 72, 240, 0.05);
}

.image-upload input {
    display: none;
}

.image-upload-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.image-upload-text {
    color: var(--text-secondary);
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: var(--border-radius);
    object-fit: cover;
    margin: 0 auto 1rem;
}

/* =====================================================
   TABS
   ===================================================== */

.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--color-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
}

.tab-content {
    display: none;
}

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

/* =====================================================
   ESTILOS RESPONSIVE PARA MÓVILES
   ===================================================== */

/* Botón cerrar sidebar (solo en móvil) */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-dark);
    z-index: 200;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 600;
}

.mobile-logo-icon {
    font-size: 1.5rem;
}

/* Hamburger menu button */
.mobile-menu-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Overlay para cerrar sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Media Query para tablets y móviles */
@media (max-width: 768px) {
    /* Mostrar mobile header */
    .mobile-header {
        display: block;
    }
    
    /* Mostrar botón cerrar en sidebar */
    .sidebar-close {
        display: block;
    }
    
    /* Sidebar como drawer lateral */
    .admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 150;
        padding-top: 1.5rem;
    }
    
    .admin-sidebar.active {
        left: 0;
    }
    
    /* Mostrar overlay */
    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }
    
    .sidebar-overlay.active {
        pointer-events: auto;
    }
    
    /* Ajustar main content */
    .admin-main {
        margin-left: 0;
        width: 100%;
        padding-top: 60px; /* Para el header fijo */
    }
    
    /* Ajustar topbar */
    .admin-topbar {
        position: sticky;
        top: 60px;
        z-index: 50;
    }
    
    /* Ajustar contenido */
    .admin-content {
        padding: 1rem;
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card-value {
        font-size: 1.25rem;
    }
    
    /* Product grid en admin */
    .products-admin-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Tablas responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    /* Modales más pequeños */
    .modal {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .modal-body {
        max-height: calc(90vh - 120px);
        overflow-y: auto;
    }
    
    /* Cards */
    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    /* Formularios */
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    /* Botones en topbar */
    .admin-topbar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem;
    }
    
    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .products-admin-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .modal-body {
        max-height: calc(100vh - 130px);
    }
}

/* =====================================================
   BUSCADOR DE PRODUCTOS
   ===================================================== */

.search-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

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

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: white;
    min-width: 180px;
}

/* =====================================================
   CATEGORÍA HEADERS EN LISTA DE PRODUCTOS
   ===================================================== */

.category-header {
    background: linear-gradient(135deg, var(--color-primary), #FF3B52);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-header:first-of-type {
    margin-top: 0;
}

.category-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.category-header .count {
    background: rgba(255,255,255,0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: auto;
}

/* =====================================================
   PRECIOS DE OPCIONES (producto-config-v2)
   ===================================================== */

.opciones-precios {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.opcion-precio-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.opcion-precio-nombre {
    flex: 1;
    min-width: 0;
}

.opcion-precio-nombre strong {
    display: block;
    margin-bottom: 0.15rem;
}

.opcion-precio-base {
    color: #666;
    font-size: 0.85rem;
}

.opcion-precio-input {
    width: 100px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    text-align: right;
}

.opcion-precio-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.opcion-precio-input.especial {
    border-color: var(--color-primary);
    background: #fff5f0;
}

/* No results message */
#no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

#no-results h3 {
    margin-bottom: 0.5rem;
}
