/* ===== RESET Y ESTILOS GLOBALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
}

body {
    background: #0b1a2a;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ===== LOGIN ===== */
.login-container {
    background: white;
    border-radius: 32px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 20, 40, 0.3);
    display: none;
    animation: fadeIn 0.3s ease;
}
.login-container.active {
    display: block;
}
.login-header {
    text-align: center;
    margin-bottom: 30px;
}
.login-header i {
    font-size: 3.5rem;
    color: #f39c12;
    margin-bottom: 10px;
}
.login-header h1 {
    color: #0b1a2a;
    font-size: 2rem;
    font-weight: 600;
}
.login-header p {
    color: #64748b;
    margin-top: 5px;
}

/* ===== APP PRINCIPAL ===== */
.pos-container {
    width: 100%;
    height: 100vh;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    display: none;
}
.pos-container.active {
    display: flex;
}

/* ===== BARRA SUPERIOR ===== */
.top-bar {
    background: #0f172a;
    color: white;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.caja-info {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.caja-estado {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    padding: 8px 18px;
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}
.estado-cerrada { color: #f87171; }
.estado-abierta { color: #4ade80; }
.caja-monto {
    font-size: 1.5rem;
    font-weight: 700;
    background: #1e293b;
    padding: 8px 22px;
    border-radius: 40px;
    letter-spacing: 1px;
}
.usuario-info {
    display: flex;
    align-items: center;
    gap: 4px;
}
.usuario-nombre {
    font-size: 1rem;
    padding: 8px 18px;
    background: #1e293b;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.user-role-badge {
    background: #2563eb;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.btn-caja {
    background: #22c55e;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-caja:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(34, 197, 94, 0.3);
}
.btn-caja.cerrar { background: #ef4444; }
.btn-caja.cerrar:hover { background: #dc2626; }
.btn-logout {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: #dc2626;
    transform: translateY(-2px);
}
.fecha-hora {
    font-size: 0.95rem;
    color: #94a3b8;
}

/* ===== PESTAÑAS ===== */
.nav-tabs {
    display: flex;
    background: white;
    padding: 5px 8px;
    gap: 3px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.nav-tab {
    font-size: 13.5px;
    padding: 5px 4px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.2s;
    background: #f8fafc;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.nav-tab:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.nav-tab.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: none;
    background: #f8fafc;
}
.main-content.active {
    display: block;
}

/* ===== VENTA ===== */
.venta-container {
    display: flex;
    height: 100%;
    gap: 24px;
}
.productos-panel {
    flex: 2;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}
.ticket-panel {
    flex: 1;
    background: white;
    border-radius: 28px;
    overflow: scroll;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}
.buscador-container {
    display: flex;
    gap: 10px;
    padding: 10px;
}
.buscador-input {
    flex: 1;
    padding: 16px 22px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.2s;
}
.buscador-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.btn-buscar {
    background: #2563eb;
    color: white;
    border: none;
    width: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-buscar:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}
.categorias-rapidas {
    padding: 0 20px 20px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}
.cat-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.cat-btn:hover {
    background: #e2e8f0;
}
.cat-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
.productos-grid {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.producto-card {
    background: white;
    border-radius: 20px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}
.producto-card:hover {
    transform: translateY(-5px);
    border-color: #2563eb;
    box-shadow: 0 12px 24px -8px rgba(37, 99, 235, 0.2);
}
.ticket-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}
.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}
.ticket-item button {
    background: #f1f5f9;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    font-size: 0.8rem;
    line-height: 1;
}
.ticket-item button:hover {
    background: #2563eb;
    color: white;
}
.ticket-item .cantidad {
    font-size: 0.9rem;
    margin: 0 4px;
}
.ticket-item .precio {
    font-weight: 600;
    color: #2563eb;
}
.acciones-pago {
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}
.btn-pago, .btn-cliente, .btn-cancelar, .btn-finalizar {
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-pago {
    background: #f1f5f9;
    color: #1e293b;
}
.btn-pago:hover {
    background: #e2e8f0;
}
.btn-cliente {
    background: #f59e0b;
    color: white;
}
.btn-cliente:hover {
    background: #d97706;
}
.btn-cancelar {
    background: #ef4444;
    color: white;
}
.btn-cancelar:hover {
    background: #dc2626;
}
.btn-finalizar {
    background: #22c55e;
    color: white;
    width: 100%;
}
.btn-finalizar:hover {
    background: #16a34a;
}
.vuelto-panel {
    padding: 20px;
    background: #1e293b;
    color: white;
    border-radius: 0 0 28px 28px;
}

/* ===== REPORTES ===== */
.reportes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.reporte-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
}
.reporte-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: #64748b;
}
.reporte-valor {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
}
.chart-container {
    height: 280px;
    margin: 20px 0;
}

/* ===== STOCK ===== */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.stock-filtros {
    display: flex;
    gap: 10px;
}
.stock-filtro {
    padding: 8px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-weight: 500;
}
.stock-filtro.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
.stock-table {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.stock-table th {
    background: #f8fafc;
    padding: 16px;
    font-weight: 600;
    color: #334155;
}
.stock-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
}
.stock-bajo {
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 600;
}
.btn-reponer {
    background: #22c55e;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-reponer:hover {
    background: #16a34a;
}

/* ===== USUARIOS, CLIENTES, PROVEEDORES, COMPRAS ===== */
.usuarios-grid, .clientes-grid, .proveedores-grid, .compras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.usuario-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.usuario-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
}
.usuario-card.superadmin { border-left: 5px solid #ef4444; }
.usuario-card.admin { border-left: 5px solid #f59e0b; }
.usuario-card.cajero { border-left: 5px solid #22c55e; }
.usuario-rol {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
}
.rol-superadmin { background: #ef4444; color: white; }
.rol-admin { background: #f59e0b; color: white; }
.rol-cajero { background: #22c55e; color: white; }

/* ===== IMPORTAR/EXPORTAR ===== */
.import-export-panel {
    background: white;
    border-radius: 28px;
    padding: 40px;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.file-input {
    display: none;
}
.btn-import, .btn-export {
    padding: 16px 36px;
    border-radius: 50px;
    cursor: pointer;
    display: inline-block;
    margin: 12px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
}
.btn-import {
    background: #f59e0b;
    color: white;
}
.btn-import:hover {
    background: #d97706;
    transform: translateY(-2px);
}
.btn-export {
    background: #22c55e;
    color: white;
}
.btn-export:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

/* ===== CIERRE DE CAJA ===== */
.cierre-caja-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}
.resumen-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.resumen-valor {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0f172a;
}
.btn-pdf {
    background: #ef4444;
    color: white;
    padding: 14px 28px;
    border-radius: 50px;
    cursor: pointer;
    display: inline-block;
    margin: 8px;
    border: none;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-pdf:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ===== MODALES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: white;
    border-radius: 36px;
    padding: 36px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: modalPop 0.3s ease;
}
@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.modal-header h3 {
    font-size: 1.6rem;
    color: #0f172a;
}
.modal-header button {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}
.modal-header button:hover {
    color: #ef4444;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    font-size: 1rem;
    transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    margin: 10px;
}
.btn-primary {
    background: #2563eb;
    color: white;
}
.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}
.btn-success {
    background: #22c55e;
    color: white;
}
.btn-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
}
.btn-danger {
    background: #ef4444;
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}
.btn-warning {
    background: #f59e0b;
    color: white;
}
.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}
.btn-secondary {
    background: #94a3b8;
    color: white;
}
.btn-secondary:hover {
    background: #64748b;
}
.btn-info {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-info:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.3);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 32px;
    border-radius: 60px;
    color: white;
    font-weight: 600;
    display: none;
    animation: slideIn 0.3s ease;
    z-index: 2100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    margin-left: 55%;
}
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== SCROLL PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ===== INSTALL PROMPT ===== */
.install-prompt {
    background: #2f6ed4;
    color: white;
    padding: 3px 5px;
    border-radius: 50px;
    display: none;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 3000;
    font-weight: 600;
}
.install-prompt button {
    background: white;
    color: #2f6ed4;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.install-prompt button:hover {
    transform: scale(1.05);
}

/* ============================================
   ESTILOS GTC - GESTIÓN TOTAL COMERCIAL
   ============================================ */

/* Logo y branding */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 15px 5px 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.logo-container:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #f39c12;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: #a0aec0;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Mejoras en la barra superior */
.top-bar {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 12px 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Botones con mejor estilo */
.btn-caja, .btn-logout {
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-caja {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-caja:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
}

.btn-caja.cerrar {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-caja.cerrar:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.btn-logout {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-logout:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 0 8px 20px rgba(71, 85, 105, 0.4);
}

/* Mejora en la caja-info */
.caja-info {
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.caja-estado {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 10px;
    border-radius: 40px;
    font-size: 0.65rem;
}

.caja-monto {
    background: #1e293b;
    padding: 6px 10px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Usuario-info mejorado */
.usuario-nombre {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.usuario-nombre i {
    font-size: 1.2rem;
    color: #94a3b8;
}

.user-role-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Fecha y hora */
.fecha-hora {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.9rem;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fecha-hora i {
    margin-right: 8px;
    color: #667eea;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 3rem;
    color: white;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-top: 5px;
}

/* Estilos para el buscador con sugerencias */
.sugerencias-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}

.sugerencia-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eef3f8;
    transition: background 0.2s;
}

.sugerencia-item:hover {
    background: #f0f7ff;
}

.sugerencia-item:last-child {
    border-bottom: none;
}

.sugerencia-info {
    flex: 1;
}

.sugerencia-nombre {
    font-weight: 600;
    color: #1e293b;
}

.sugerencia-detalle {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.sugerencia-precio {
    font-weight: 700;
    color: #2563eb;
    font-size: 1.1rem;
}

.sugerencia-stock {
    font-weight: 500;
}

.sugerencia-stock.bajo {
    color: #ef4444;
}

.sugerencia-stock.normal {
    color: #10b981;
}

.sugerencia-agregar {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sugerencia-agregar:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.sugerencia-agregar:active {
    transform: scale(0.95);
}

/* Resaltado de coincidencias */
.sugerencia-nombre .highlight {
    background: #fef9c3;
    font-weight: 700;
    padding: 0 2px;
    border-radius: 4px;
}

/* Splash Screen - Pantalla de carga inicial */
.splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

.splash-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.splash-logo {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 4.5rem;
    color: white;
    box-shadow: 0 10px 30px rgba(59,130,246,0.5);
}

.splash-title {
    font-size: 4.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(90deg, #e0f2fe, #ffffff);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
}

.splash-subtitle {
    font-size: 1.4rem;
    color: #94a3b8;
    margin: 10px 0 40px;
    font-weight: 400;
}

.splash-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255,255,255,0.2);
    border-top: 6px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal .btn-primary, .modal .btn-success, .modal .btn-info {
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.modal .btn-primary { background: #3498db; }
.modal .btn-success { background: #27ae60; }
.modal .btn-info { background: #8e44ad; }
.modal .btn:hover { transform: scale(1.05); }

.admin-table th, .admin-table td {
    padding: 8px;
    text-align: left;
}

.admin-table th {
    background-color: #f3f4f6;
    font-weight: 600;
}

.licencia-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-green { background-color: #10b981; color: white; }
.badge-blue { background-color: #3b82f6; color: white; }
.badge-purple { background-color: #8b5cf6; color: white; }
.badge-red { background-color: #ef4444; color: white; }
.badge-yellow { background-color: #f59e0b; color: white; }
.badge-gray { background-color: #6b7280; color: white; }

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}
.badge.green { background-color: #2ecc71; }
.badge.blue { background-color: #3498db; }
.badge.purple { background-color: #9b59b6; }
.badge.gold { background-color: #f1c40f; }
.badge.error { background-color: #e74c3c; }
.badge.orange { background-color: #ffa500; }

.profesionales-grid, .servicios-grid, .mascotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.profesional-card, .servicio-card, .mascota-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.profesional-card:hover, .servicio-card:hover, .mascota-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: flex-end;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background: #f0f0f0;
}

.btn-icon.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.btn-icon.warning:hover {
    background: #fef3c7;
    color: #d97706;
}

/* ============================================
   TOP-BAR CON SCROLL HORIZONTAL EN MÓVIL
   ============================================ */

@media (max-width: 768px) {
    
    /* Contenedor principal de top-bar con scroll */
    .top-bar {
        overflow-x: auto;
        overflow-y: visible;
        white-space: nowrap;
        display: block;
        padding: 10px 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    /* Los divs internos se comportan como inline-block */
    .top-bar > div {
        display: inline-block;
        vertical-align: middle;
        white-space: normal;
    }
    
    /* Primer div (logo + caja-info) */
    .top-bar > div:first-child {
        display: inline-flex;
        align-items: center;
        gap: 15px;
        margin-right: 20px;
    }
    
    /* Segundo div (usuario + acciones) */
    .top-bar > div:last-child {
        display: inline-flex;
        align-items: center;
        gap: 12px;
    }
    
    /* Logo más compacto */
    .logo-container {
        padding: 4px 10px 4px 4px;
        gap: 6px;
        flex-shrink: 0;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .logo-title {
        font-size: 1rem;
    }
    
    .logo-subtitle {
        display: none;
    }
    
    /* Caja info */
    .caja-info {
        gap: 8px;
        flex-shrink: 0;
    }
    
    .caja-estado {
        font-size: 0.65rem;
        padding: 4px 10px;
        gap: 4px;
    }
    
    .caja-monto {
        font-size: 0.85rem;
        padding: 4px 10px;
    }
    
    /* Usuario info */
    .usuario-info {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .usuario-nombre {
        font-size: 0.7rem;
        padding: 4px 10px;
        gap: 4px;
    }
    
    .usuario-nombre i {
        font-size: 0.8rem;
    }
    
    .user-role-badge {
        font-size: 0.55rem;
        padding: 2px 6px;
    }
    
    /* Botones */
    .btn-caja, .btn-logout {
        padding: 6px 12px;
        font-size: 0.7rem;
        flex-shrink: 0;
    }
    
    .btn-text {
        display: inline-block;
        font-size: 0.65rem;
    }
    
    /* Fecha/hora */
    .fecha-hora {
        font-size: 0.6rem;
        padding: 4px 8px;
        flex-shrink: 0;
    }
    
    /* Badge de licencia */
    .licencia-badge {
        font-size: 0.55rem;
        padding: 3px 8px;
        flex-shrink: 0;
    }
    
    /* Scrollbar personalizado para top-bar */
    .top-bar::-webkit-scrollbar {
        height: 3px;
    }
    
    .top-bar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }
    
    .top-bar::-webkit-scrollbar-thumb {
        background: #00c2ff;
        border-radius: 10px;
    }
    
    /* Indicador visual de scroll (opcional) */
    .top-bar {
        position: relative;
    }
    
    .top-bar::after {
        content: '⇢';
        position: sticky;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.6);
        padding: 2px 8px;
        border-radius: 20px;
        font-size: 0.7rem;
        color: #00c2ff;
        pointer-events: none;
        opacity: 0.8;
        z-index: 10;
    }
}

/* ============================================
   RESPONSIVE MÓVIL - VERSIÓN FINAL
   ============================================ */

@media (max-width: 768px) {
    
    /* === 1. BARRA SUPERIOR === */
    .top-bar {
        flex-direction: column;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .logo-title {
        font-size: 1.1rem;
    }
    
    .logo-icon {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .logo-subtitle {
        display: none;
    }
    
    .btn-caja, .btn-logout {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .btn-text {
        display: inline-block;
    }
    
    .caja-info {
        justify-content: space-between;
    }
    
    .caja-estado {
        font-size: 0.7rem;
        padding: 4px 12px;
    }
    
    .caja-monto {
        font-size: 0.9rem;
        padding: 4px 12px;
    }
    
    .usuario-info {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .usuario-nombre {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    .fecha-hora {
        font-size: 0.65rem;
        padding: 4px 10px;
    }
    
    /* === 2. PESTAÑAS CON SCROLL HORIZONTAL === */
    .nav-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        padding: 10px 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .nav-tab {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 0.7rem;
        padding: 6px 14px;
    }
    
    /* Indicador visual de scroll (opcional) */
    .nav-tabs::-webkit-scrollbar {
        height: 3px;
    }
    
    .nav-tabs::-webkit-scrollbar-track {
        background: #e2e8f0;
        border-radius: 10px;
    }
    
    .nav-tabs::-webkit-scrollbar-thumb {
        background: #2563eb;
        border-radius: 10px;
    }
    
    /* === 3. VENTA - PRODUCTOS ARRIBA, TICKET ABAJO === */
    .venta-container {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Productos panel - ocupa todo el ancho */
    .productos-panel {
        width: 100%;
        max-height: 40vh;
        border-radius: 20px;
    }
    
    /* Ticket panel - debajo de productos */
    .ticket-panel {
        width: 100%;
        max-height: 50vh;
        border-radius: 20px;
    }
    
    /* Grid de productos - 2 columnas en móvil */
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }
    
    .producto-card {
        padding: 12px 8px;
    }
    
    .producto-card h4 {
        font-size: 0.75rem;
    }
    
    .producto-card .precio {
        font-size: 0.85rem;
    }
    
    /* Buscador */
    .buscador-input {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .btn-buscar {
        width: 45px;
    }
    
    /* Categorías - scroll horizontal */
    .categorias-rapidas {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .cat-btn {
        display: inline-block;
        flex-shrink: 0;
    }
    
    /* === 4. BOTONES DE PAGO CON SCROLL HORIZONTAL === */
    .acciones-pago {
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 2px;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn-pago, .btn-cliente, .btn-cancelar, .btn-finalizar {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 10px 15px !important;
        font-size: 0.75rem;
    }
    
    /* Indicador visual de scroll para botones */
    .acciones-pago::-webkit-scrollbar {
        height: 3px;
    }
    
    .acciones-pago::-webkit-scrollbar-track {
        background: #e2e8f0;
        border-radius: 10px;
    }
    
    .acciones-pago::-webkit-scrollbar-thumb {
        background: #2563eb;
        border-radius: 10px;
    }
    
    /* Panel de vuelto */
    .vuelto-panel {
        margin-top: 8px;
    }
    
    .vuelto-panel h4 {
        font-size: 1rem;
    }
    
    .vuelto-panel input {
        font-size: 0.9rem;
        padding: 10px;
    }
    
    /* === 5. REPORTES === */
    .reportes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .reporte-card {
        padding: 14px;
    }
    
    .reporte-valor {
        font-size: 1.4rem;
    }
    
    .chart-container {
        height: 180px;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* === 6. STOCK === */
    .stock-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .stock-filtros {
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .stock-filtro {
        flex-shrink: 0;
        font-size: 0.7rem;
        padding: 5px 12px;
    }
    
    /* Scroll horizontal para tablas */
    .stock-table {
        overflow-x: auto;
    }
    
    .stock-table table {
        min-width: 550px;
    }
    
    .stock-table th, .stock-table td {
        padding: 8px 10px;
        font-size: 0.7rem;
    }
    
    /* === 7. CARDS (usuarios, clientes, proveedores) === */
    .usuarios-grid, .clientes-grid, .proveedores-grid, .compras-grid,
    .profesionales-grid, .servicios-grid, .mascotas-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .usuario-card, .cliente-card, .proveedor-card {
        padding: 14px;
    }
    
    .usuario-card h4, .cliente-card h4 {
        font-size: 0.9rem;
    }
    
    /* === 8. MODALES === */
    .modal-content {
        padding: 16px;
        width: 95%;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .form-group label {
        font-size: 0.7rem;
    }
    
    .form-group input, 
    .form-group select, 
    .form-group textarea {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .modal-footer .btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
    
    /* === 9. IMPORTAR/EXPORTAR === */
    .import-export-panel {
        padding: 20px;
    }
    
    .import-export-panel h2 {
        font-size: 1rem;
    }
    
    .btn-import, .btn-export {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    
    /* === 10. CIERRE DE CAJA === */
    .cierre-caja-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .resumen-card {
        padding: 12px;
    }
    
    .resumen-valor {
        font-size: 1.3rem;
    }
    
    /* Botones PDF en scroll horizontal */
    .cierre-caja-grid + div {
        overflow-x: auto;
        display: flex;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .btn-pdf {
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 0.7rem;
    }
    
    /* === 11. TOAST === */
    .toast {
        bottom: 15px;
        right: 15px;
        left: auto;
        padding: 8px 16px;
        font-size: 0.7rem;
        max-width: calc(100vw - 30px);
        white-space: normal;
        text-align: center;
    }
    
    /* === 12. SPLASH === */
    .splash-logo {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }
    
    .splash-title {
        font-size: 2rem;
    }
    
    .splash-subtitle {
        font-size: 0.8rem;
    }
    
    .loader {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    /* === 13. BADGES === */
    .badge {
        font-size: 0.6rem;
        padding: 2px 6px;
    }
}

/* === Tablets (pantallas entre 769px y 1024px) === */
@media (min-width: 769px) and (max-width: 1024px) {
    .productos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .reportes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .usuarios-grid, .clientes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Móviles muy pequeños (menos de 400px) === */
@media (max-width: 400px) {
    .btn-text {
        display: none;
    }
    
    .btn-caja, .btn-logout {
        padding: 6px 10px;
    }
    
    .caja-estado span:first-child {
        display: none;
    }
    
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .producto-card {
        padding: 8px 6px;
    }
}

/* Móviles muy pequeños (menos de 400px) */
@media (max-width: 400px) {
    .btn-text {
        display: none !important;
    }
    
    .btn-caja, .btn-logout {
        padding: 6px 10px;
        width: auto;
        justify-content: center;
    }
    
    .caja-estado span:last-child {
        display: none;
    }
    
    .caja-estado {
        padding: 4px 8px;
    }
    
    .usuario-nombre span:first-child {
        display: none;
    }
    
    .usuario-nombre {
        padding: 4px 8px;
    }
    
    /* Ocultar indicador de scroll en pantallas muy pequeñas para no saturar */
    .top-bar::after {
        display: none;
    }
}

/* Indicador de scroll para móvil */
@media (max-width: 768px) {
    .nav-tabs::after,
    .acciones-pago::after,
    .categorias-rapidas::after,
    .stock-filtros::after {
        content: '→';
        position: sticky;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: linear-gradient(90deg, transparent, #e2e8f0);
        padding: 4px 8px;
        font-size: 0.7rem;
        color: #2563eb;
        pointer-events: none;
        opacity: 0.7;
    }
}

/* Utilidades para móvil (opcional pero recomendado) */
.mobile-hidden {
    display: inline-block;
}


/* Prevenir overflow horizontal en todo el sitio */
body {
    overflow-x: hidden;
}

.pos-container {
    overflow-x: hidden;
}

.main-content {
    overflow-x: hidden;
}

/* Tablas con scroll horizontal en móvil */
@media (max-width: 768px) {
    .stock-table, .admin-table {
        overflow-x: auto;
        display: block;
    }
}