/* =========================================================================
   SISTEMA DE DISEÑO SSCOMPUTER - CSS PREMIUM & GLASSMORPHISM
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;900&display=swap');

:root {
    /* Paleta de Colores Curada (Modo Oscuro Elegante por defecto) */
    --bg-main: #0b0f19;
    --bg-card: rgba(20, 26, 45, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 229, 255, 0.3);
    
    --primary: #00d2ff;
    --primary-hover: #00a8cc;
    --primary-glow: rgba(0, 210, 255, 0.2);
    
    --secondary: #7000ff;
    --secondary-hover: #5200c4;
    
    --success: #00e676;
    --success-glow: rgba(0, 230, 118, 0.15);
    
    --warning: #ffd600;
    --warning-glow: rgba(255, 214, 0, 0.15);
    
    --danger: #ff1744;
    --danger-glow: rgba(255, 23, 68, 0.15);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    --gradient-title: linear-gradient(135deg, #ffffff 20%, var(--primary) 70%, var(--secondary));
    
    --glass-blur: blur(16px);
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Soporte para Modo Claro (Auto-detectable o configurable) */
[data-theme="light"] {
    --bg-main: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(112, 0, 255, 0.3);
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --shadow-premium: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --primary: #0088cc;
    --primary-hover: #006699;
}

/* 1. RESET Y ESTILOS GENERALES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 10% 10%, rgba(112, 0, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(0, 210, 255, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* 2. MAQUETACIÓN BASE SPA */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--text-main);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background: rgba(0, 210, 255, 0.05);
}

.btn-portal {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff !important;
    padding: 8px 18px !important;
    border-radius: 50px !important;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-portal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.4);
}

/* 3. ELEMENTOS DE DISEÑO COMUNES (GLASSMOPHISM CARDS) */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.05);
}

/* Botones Premium */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-main);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: var(--success);
    color: var(--bg-main);
}
.btn-success:hover {
    box-shadow: 0 4px 12px var(--success-glow);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    box-shadow: 0 4px 12px var(--danger-glow);
}

/* Formularios Premium */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* 4. LANDING PAGE DEL CLIENTE */
.hero {
    padding: 100px 0 60px 0;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    background: var(--gradient-title);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 35px;
}

/* Buscador de Estado de Orden */
.search-box-container {
    max-width: 600px;
    margin: 0 auto 80px auto;
}

.search-form {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 6px;
    gap: 8px;
    box-shadow: var(--shadow-premium);
}

.search-form input {
    background: transparent;
    border: none;
    flex: 1;
    padding: 0 20px;
    color: var(--text-main);
    font-size: 1rem;
}

.search-form input:focus {
    outline: none;
}

.search-form button {
    border-radius: 50px;
    padding: 12px 28px;
}

/* Grid de Servicios */
.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-title);
    border-radius: 2px;
    margin: 12px auto 0 auto;
}

.services-grid, .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.service-card {
    text-align: center;
}

.service-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.service-card h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

/* Contacto y FAQ */
.contact-faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 80px;
}

@media (max-width: 768px) {
    .contact-faq-grid {
        grid-template-columns: 1fr;
    }
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.contact-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    transform: translateX(5px);
}

.contact-btn i {
    font-size: 1.5rem;
}

.whatsapp-color { color: #25d366; }
.facebook-color { color: #1877f2; }
.instagram-color { color: #e1306c; }
.email-color { color: var(--primary); }

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
}

.faq-answer {
    color: var(--text-muted);
    padding-top: 10px;
    font-size: 0.95rem;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* 5. SECCIÓN DE CONSULTA DE CLIENTE (VISTA DE ESTADO) */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 40px auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 40px;
    width: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 80px;
    margin-bottom: 40px;
}

.timeline-dot {
    position: absolute;
    left: 28px;
    top: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50px;
    background: var(--bg-main);
    border: 4px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
    transition: var(--transition-smooth);
}

.timeline-item.active .timeline-dot {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.timeline-item.success .timeline-dot {
    border-color: var(--success);
    background: var(--success);
    box-shadow: 0 0 15px var(--success-glow);
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.timeline-content h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.budget-panel {
    background: rgba(0, 210, 255, 0.04);
    border: 1px dashed var(--primary);
    border-radius: 12px;
    padding: 25px;
    margin: 30px auto;
    max-width: 600px;
    text-align: center;
}

/* 6. ADMIN DASHBOARD & LAYOUT */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

@media (max-width: 992px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.sidebar {
    background: rgba(15, 22, 38, 0.95);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(0, 210, 255, 0.07);
    color: var(--primary);
}

.admin-main {
    padding: 40px;
    overflow-y: auto;
}

/* Tarjetas de Dashboard (KPI) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.kpi-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-info h3 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-top: 5px;
}

.kpi-icon {
    font-size: 2.2rem;
    opacity: 0.3;
}

/* Gráficos Estadísticos con SVG */
.chart-container {
    margin-top: 25px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 200px;
    padding: 10px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.chart-bar {
    width: 40px;
    border-radius: 4px 4px 0 0;
    min-height: 5px;
    transition: var(--transition-smooth);
    position: relative;
}

.chart-bar.ingreso {
    background: linear-gradient(to top, var(--primary), #00e676);
}

.chart-bar.gasto {
    background: linear-gradient(to top, var(--danger), #ff9100);
}

.chart-bar:hover::after {
    content: attr(data-value);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* 7. TABLAS DE ADMINISTRACIÓN */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    text-align: left;
}

.table-premium th {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table-premium td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

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

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

/* Badges de Estados */
.badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-diagnosticando { background: rgba(0, 210, 255, 0.15); color: var(--primary); }
.badge-aprobacion { background: rgba(255, 214, 0, 0.15); color: var(--warning); }
.badge-reparando { background: rgba(112, 0, 255, 0.15); color: #b388ff; }
.badge-listo { background: rgba(0, 230, 118, 0.15); color: var(--success); }
.badge-finalizado { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* 8. PUNTO DE VENTA (POS) Y INVENTARIO */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 30px;
}

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

.pos-catalog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.pos-item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.pos-item-card:hover {
    border-color: var(--primary);
    background: rgba(0, 210, 255, 0.03);
    transform: translateY(-2px);
}

.pos-item-card h4 {
    font-size: 0.95rem;
    margin: 8px 0;
}

.pos-item-price {
    font-weight: 700;
    color: var(--primary);
}

.pos-cart {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    position: sticky;
    top: 100px;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.cart-item-info {
    max-width: 70%;
}

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

/* Modales Premium */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #0f1626;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

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

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Signature Pad Drawing Area */
.signature-pad-container {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.signature-pad-canvas {
    width: 100%;
    height: 200px;
    display: block;
    cursor: crosshair;
    touch-action: none; /* Previene scroll táctil al firmar */
}

/* Lector de código de barras por cámara */
.camera-scanner-container {
    width: 100%;
    height: 280px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--primary);
}

.camera-scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-scanner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 50%;
    border: 2px dashed var(--primary);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.camera-scanner-laser {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--danger);
    top: 50%;
    animation: laser-animation 2s infinite ease-in-out;
}

@keyframes laser-animation {
    0% { top: 25%; }
    50% { top: 75%; }
    100% { top: 25%; }
}

/* =========================================================================
   REGLAS DE IMPRESIÓN (Optimización para tickets térmicos y A4)
   ========================================================================= */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12px !important;
        font-family: 'Courier New', Courier, monospace !important;
    }
    
    header, .sidebar, .btn, .modal, .no-print {
        display: none !important;
    }

    .print-ticket-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Ticket de 80mm y 60mm */
    .ticket-80, .ticket-60 {
        width: 100% !important;
        max-width: 80mm !important;
    }
    
    .ticket-60 {
        max-width: 60mm !important;
    }
}

/* =========================================================================
   SOPORTE PARA DISPOSITIVOS MÓVILES (RESPONSIVE VERTICAL Y HORIZONTAL)
   ========================================================================= */

/* 1. Asegurar que las imágenes nunca se desborden ni se sobremonten */
img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* 2. Media Query para Móviles / Tablets (Menor o igual a 768px) */
@media (max-width: 768px) {
    /* Encabezado y Navegación Pública */
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 5px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
        width: 100%;
    }
    
    .nav-links li {
        display: inline-block;
    }
    
    .nav-links a {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .btn-portal {
        padding: 6px 14px !important;
        font-size: 0.85rem !important;
    }

    /* Hero y Título Principal */
    .hero {
        padding: 50px 0 30px 0;
    }
    
    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    /* Grillas y Paneles */
    .services-grid, .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Formulario de Búsqueda */
    .search-box-container {
        padding: 0 10px;
    }
    
    .search-form {
        flex-direction: column;
        border-radius: 12px;
        padding: 10px;
        gap: 10px;
    }
    
    .search-form input {
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: center;
    }
    
    .search-form button {
        width: 100%;
        border-radius: 8px;
        padding: 12px;
    }

    /* Modales en Pantallas Pequeñas */
    .modal-content {
        width: 95%;
        padding: 20px 15px;
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
        font-size: 1.8rem;
        padding: 8px;
        z-index: 100;
    }

    /* Línea de Tiempo del Cliente */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 8px;
        width: 24px;
        height: 24px;
        top: 8px;
    }
    
    .timeline-item {
        padding-left: 45px;
        margin-bottom: 30px;
    }
    
    .timeline-content {
        padding: 15px;
    }

    /* Panel de Presupuesto */
    .budget-panel {
        padding: 15px;
    }
    
    .budget-panel div {
        font-size: 0.9rem;
    }
    
    .budget-panel strong {
        font-size: 1rem;
    }
}

/* 3. Media Query para Panel Administrativo y Sidebar (Menor o igual a 992px) */
@media (max-width: 992px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    /* Convertir barra lateral vertical en un menú compacto horizontal */
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 15px;
        gap: 15px;
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        background: rgba(15, 22, 38, 0.98);
        position: sticky;
        top: 0;
        z-index: 999;
    }

    .sidebar .logo {
        font-size: 1.2rem;
    }

    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        justify-content: center;
    }

    .sidebar-menu li {
        flex: 1;
        min-width: 110px;
    }

    .sidebar-menu a {
        padding: 8px 10px;
        font-size: 0.75rem;
        justify-content: center;
        gap: 6px;
        text-align: center;
    }

    .admin-main {
        padding: 20px 15px;
    }

    /* Grilla de KPIs en móvil */
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Caja registradora / POS en móvil */
    .pos-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pos-cart {
        height: auto;
        position: static;
        margin-top: 20px;
    }
}

/* 4. Soporte para Orientaciones de Celular (Vertical / Horizontal) */
@media (max-height: 500px) and (orientation: landscape) {
    /* Evitar desbordes de modales en modo apaisado/horizontal */
    .modal-content {
        max-height: 95vh;
        padding: 15px;
    }
    
    .modal-content h2 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
}
