/* ══════════════════════════════════════════════
   VARIABLES DE TEMA — predeterminado (violeta)
   Compartidas por sidebar.css y land-header.php
══════════════════════════════════════════════ */
:root {
    /* Top bar y sidebar */
    --tema-primary: #667eea;
    --tema-primary-dark: #764ba2;
    --tema-sb-gradient: linear-gradient(160deg, #667eea 0%, #764ba2 100%);
    --tema-lh-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* Fondo general */
    --tema-bg: #f1f5f9;
    --tema-bg-content: #ffffff;
    --tema-text: #1e1b4b;
    --tema-text-muted: #6b7280;
    --tema-border: rgba(102, 126, 234, .15);
}

/* ========================================
   ESTILOS MODERNIZADOS PARA stilo.css
======================================== */

/* Reset básico */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #f1f5f9;
}

.app-content {
    margin-top :60px;
}

/* HEADER STYLES — usa variables del sidebar para sincronía perfecta */

/* Sidebar colapsado — vía clase en body */

/* Mobile */

/* Header content styles */
.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Botón hamburguesa - oculto por defecto en desktop */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

.welcome-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.welcome-text br {
    display: none;
}

.welcome-text small {
    margin-left: 8px;
}

.welcome-text b {
    color: white;
    font-weight: 600;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Theme selector - Modernizado */
#theme-selector {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
}

#theme-selector option {
    background: #667eea;
    color: white;
}

/* Logout link styles - Modernizado */
.logout-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Estado de caja */
.estado-caja {
    background: rgba(255, 255, 255, 0.356);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Sidebar colapsado */

/* Mobile */

/* Content sections - Modernizado */

.content-section h2 {
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

.content-section p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Responsive - Mejorado */
@media (max-width: 768px) {

    /* Mostrar botón hamburguesa en móvil */
    .menu-toggle {
        display: flex;
    }
}

/* Estilos para estado de caja */
.estado-caja {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 15px;
    backdrop-filter: blur(10px);
}

.caja-abierta {
    background: rgba(16, 185, 129, 0.493);
    color: #05e49d;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.caja-cerrada {
    background: rgba(239, 68, 68, 0.452);
    color: #DC2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sin-caja {
    background: rgba(107, 114, 128, 0.432);
    color: #6B7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Efectos hover para accesos rápidos */
.content-section a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.quick-access-card {
    display: block;
    padding: 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: #374151;
    text-align: center;
    transition: all 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.stat-card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.stat-card-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.stat-card-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

/* Responsive para las tarjetas */
@media (max-width: 768px) {

    .stats-grid,
    .quick-access-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Estilos adicionales para el dashboard */
.card-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.access-required {
    text-align: center;
}

.auth-buttons {
    margin-top: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-right: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary2 {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    margin-right: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background: transparent;
    color: #667eea;
    text-decoration: none;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* all imputtttttttttttttttttttt0000 */
.input1 {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.input1:focus {
    outline: none;
    border-color: #10B981;
}

.input2 {
    width: 100%;
    max-width: 300px;
    padding: 3px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.input2:focus {
    outline: none;
    border-color: #10B981;
}

/* ========================================
   ESTILOS PARA TABLAS MODERNAS
======================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table-modern thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table-modern thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.table-modern thead th:first-child {
    border-radius: 12px 0 0 0;
}

.table-modern thead th:last-child {
    border-radius: 0 12px 0 0;
}

.table-modern tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s ease;
}

.table-modern tbody tr:hover {
    background: #dde1f5;
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern tbody td {
    padding: 15px;
    color: #374151;
    font-size: 14px;
}

.btn-edit {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Responsive para tablas */
@media (max-width: 768px) {
    .table-modern {
        font-size: 12px;
    }

    .table-modern thead th,
    .table-modern tbody td {
        padding: 10px;
    }
}

/* ========================================
   ESTILOS PARA FORMULARIOS MODERNOS
======================================== */
.form-modern {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Alertas modernas */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid #F59E0B;
}

/* Responsive para formularios */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-modern {
        padding: 20px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   BUSCADOR DE PRODUCTOS
======================================== */
.search-container {
    position: relative;
    margin-bottom: 20px;
    max-width: 460px;
}

.buscador-input {
    width: 100%;
    padding: 12px 18px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #374151;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.buscador-input:focus {
    outline: none;
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.buscador-input::placeholder {
    color: #9ca3af;
}

.resultados-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 500;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
}

.resultado-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s ease;
}

.resultado-item:last-child {
    border-bottom: none;
}

.resultado-item:hover {
    background: #f0fdf4;
}

.resultado-item strong {
    flex: 1;
    color: #1f2937;
    font-size: 14px;
}

.resultado-codigo {
    font-size: 12px;
    color: #9ca3af;
    font-family: monospace;
}

.resultado-precio {
    font-size: 13px;
    font-weight: 600;
    color: #10B981;
}

.resultado-vacio {
    padding: 14px 16px;
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
}

/* ========================================
   MODAL
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 20px;
    font-weight: 700;
}

.modal-close {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #374151;
}

.modal-content label {
    display: block;
    margin-top: 14px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.modal-content input[type="text"],
.modal-content input[type="password"],
.modal-content input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    color: #374151;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus,
.modal-content input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.modal-content input[type="submit"] {
    margin-top: 22px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-content input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ========================================
   BOTONES EXTRA
======================================== */
.btn-actualizar {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-actualizar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-delete {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* ========================================
   VENDER.PHP — ESTILOS
======================================== */

/* Toolbar superior: buscador + cliente + método de pago */
.venta-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.venta-toolbar>* {
    flex: 1;
    min-width: 160px;
}

.venta-select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: white;
    color: #374151;
    transition: border-color 0.2s;
    cursor: pointer;
}

.venta-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Bloque estado de pago — solo visible con cliente */
#bloque-estado-pago {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

#bloque-estado-pago.visible {
    display: flex;
}

.estado-btn {
    flex: 1;
    min-width: 110px;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.estado-btn.activo-pagado {
    border-color: #10B981;
    background: #d1fae5;
    color: #065f46;
}

.estado-btn.activo-parcial {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #92400e;
}

.estado-btn.activo-nopagado {
    border-color: #ef4444;
    background: #fee2e2;
    color: #991b1b;
}

#campo-parcial {
    display: none;
    margin-bottom: 14px;
}

#campo-parcial label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    display: block;
    margin-bottom: 4px;
}

/* Tabla de productos seleccionados en venta */
#tabla-venta-wrapper {
    margin-top: 16px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#tabla-venta {
    width: 100%;
    border-collapse: collapse;
}

#tabla-venta thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#tabla-venta thead th {
    padding: 13px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

#tabla-venta thead th:first-child {
    border-radius: 12px 0 0 0;
}

#tabla-venta thead th:last-child {
    border-radius: 0 12px 0 0;
}

#tabla-venta tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.15s;
}

#tabla-venta tbody tr:last-child {
    border-bottom: none;
}

#tabla-venta tbody tr:hover {
    background: #f5f3ff;
}

#tabla-venta tbody td {
    padding: 12px 15px;
    font-size: 14px;
    color: #374151;
}

.cantidad-input-venta {
    width: 65px;
    padding: 6px 8px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    transition: border-color 0.2s;
}

.cantidad-input-venta:focus {
    outline: none;
    border-color: #667eea;
}

.subtotal-celda {
    font-weight: 600;
    color: #10B981;
}

.btn-quitar-venta {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-quitar-venta:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.4);
}

.vacio-tabla {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-style: italic;
}

/* Panel total fijo esquina inferior derecha */
#total-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: white;
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: right;
    min-width: 200px;
    z-index: 100;
}

#total-container .total-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}

#total-container .total-monto {
    font-size: 26px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

#total-container .total-monto span {
    color: #10B981;
}

#btn-vender {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

#btn-vender:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

#btn-vender:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#alerta-venta {
    display: none;
    margin-top: 12px;
}

/* Buscador de venta — sin max-width para que ocupe la celda */
.buscador-venta-wrap {
    position: relative;
    flex: 2;
    min-width: 220px;
}

.buscador-venta-wrap .buscador-input {
    max-width: 100%;
}

.buscador-venta-wrap .resultados-dropdown {
    right: 0;
}

@media (max-width: 768px) {
    .venta-toolbar {
        flex-direction: column;
    }

    .venta-toolbar>* {
        min-width: 100%;
    }

    #total-container {
        right: 10px;
        bottom: 10px;
        left: 10px;
        min-width: unset;
    }
}

/* ========================================
   CLIENTES — INDICADOR DE LÍMITE DE CUENTA
======================================== */

/* Barra de progreso de deuda */
.deuda-bar-wrap {
    width: 100%;
    background: #e5e7eb;
    border-radius: 20px;
    height: 8px;
    min-width: 80px;
    overflow: hidden;
}

.deuda-bar {
    height: 8px;
    border-radius: 20px;
    transition: width 0.4s ease;
}

/* Verde — menos del 25% del límite */
.deuda-verde {
    background: linear-gradient(90deg, #10B981, #059669);
}

/* Celeste — 25% a 50% */
.deuda-celeste {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
}

/* Amarillo — 50% a 70% */
.deuda-amarillo {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* Naranja — 70% a 90% */
.deuda-naranja {
    background: linear-gradient(90deg, #f97316, #ea580c);
}

/* Rojo — más del 90% */
.deuda-rojo {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* Badge de porcentaje */
.deuda-pct {
    font-size: 11px;
    font-weight: 700;
    margin-top: 3px;
    display: block;
}

.deuda-pct.verde {
    color: #059669;
}

.deuda-pct.celeste {
    color: #0891b2;
}

.deuda-pct.amarillo {
    color: #d97706;
}

.deuda-pct.naranja {
    color: #ea580c;
}

.deuda-pct.rojo {
    color: #dc2626;
}

/* Fila entera coloreada sutilmente según nivel */
#tbody-clientes tr.nivel-verde {
    border-left: 3px solid #10B981;
}

#tbody-clientes tr.nivel-celeste {
    border-left: 3px solid #06b6d4;
}

#tbody-clientes tr.nivel-amarillo {
    border-left: 3px solid #f59e0b;
}

#tbody-clientes tr.nivel-naranja {
    border-left: 3px solid #f97316;
}

#tbody-clientes tr.nivel-rojo {
    border-left: 3px solid #ef4444;
    background: #fff5f5;
}

/* ══════════════════════════════════════════════════════════
   INDEX.PHP — Landing (sin sesión) + Dashboard (con sesión)
   Movido desde index.php inline styles
══════════════════════════════════════════════════════════ */

/* ── Variables globales ── */
:root {
    --violeta: #667eea;
    --violeta-deep: #4f46e5;
    --violeta-dark: #3730a3;
    --violeta-glow: rgba(102, 126, 234, .35);
    --acento: #a78bfa;
    --oro: #fbbf24;
    --blanco: #f8f7ff;
    --texto: #1e1b4b;
    --gris: #6b7280;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
}

/* ── HEADER LANDING (sin sesión) ── */
.land-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 18px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 10, 40, .55);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    transition: background .3s;
}

.land-logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: white;
    letter-spacing: -.3px;
}

.land-logo span {
    color: var(--acento);
}

.land-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.land-nav a {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 8px;
    transition: all .2s;
}

.land-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, .1);
}

.land-nav .btn-cta {
    background: linear-gradient(135deg, var(--violeta), var(--violeta-deep));
    color: white !important;
    font-weight: 700;
    box-shadow: 0 4px 14px var(--violeta-glow);
}

.land-nav .btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--violeta-glow);
}

/* ── HERO ── */
.land-hero {
    min-height: 100vh;
    background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(102, 126, 234, .55) 0%, transparent 70%), radial-gradient(ellipse 50% 40% at 90% 60%, rgba(167, 139, 250, .3) 0%, transparent 60%), linear-gradient(160deg, #0f0a28 0%, #1a1040 40%, #0d0820 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
}

.land-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(167, 139, 250, .15);
    border: 1px solid rgba(167, 139, 250, .35);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--acento);
    margin-bottom: 28px;
    animation: fadeUp .6s ease both;
}

.hero-badge::before {
    content: '✦';
    font-size: 10px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(42px, 7vw, 80px);
    font-weight: 800;
    line-height: 1.05;
    color: white;
    margin: 0 0 24px;
    animation: fadeUp .7s .1s ease both;
}

.hero-title em {
    font-style: normal;
    background: linear-gradient(135deg, #a78bfa, #667eea, #f0abfc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: clamp(16px, 2.2vw, 19px);
    color: rgba(255, 255, 255, .82);
    max-width: 580px;
    line-height: 1.7;
    margin: 0 auto 40px;
    font-weight: 300;
    animation: fadeUp .7s .2s ease both;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp .7s .3s ease both;
}

.btn-hero-primary {
    padding: 16px 36px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--violeta), var(--violeta-deep));
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 28px var(--violeta-glow);
    transition: all .2s;
    display: inline-block;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px var(--violeta-glow);
}

.btn-hero-secondary {
    padding: 16px 32px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, .2);
    color: white;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, .07);
    transition: all .2s;
    display: inline-block;
}

.btn-hero-secondary:hover {
    border-color: rgba(255, 255, 255, .4);
    background: rgba(255, 255, 255, .12);
}

/* ── Promo pills ── */
.promo-strip {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 56px;
    animation: fadeUp .7s .4s ease both;
}

.promo-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    font-weight: 500;
}

.promo-pill .ic {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ── Secciones landing ── */
.land-section {
    padding: 96px 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--violeta);
    margin-bottom: 14px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    color: var(--texto);
    line-height: 1.15;
    margin: 0 0 16px;
}

.section-sub {
    font-size: 17px;
    color: var(--gris);
    max-width: 520px;
    line-height: 1.7;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 56px;
}

.feat-card {
    background: white;
    border: 1.5px solid #ede9fe;
    border-radius: 18px;
    padding: 28px 28px 32px;
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.feat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, .12);
}

.feat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--violeta), var(--acento));
}

.feat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
}

.feat-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--texto);
    margin: 0 0 10px;
}

.feat-desc {
    font-size: 14px;
    color: var(--gris);
    line-height: 1.65;
    margin: 0;
}

.land-dark {
    background: linear-gradient(160deg, #0f0a28 0%, #1a1040 100%);
    padding: 96px 24px;
}

.land-dark .section-title {
    color: white;
}

.land-dark .section-sub {
    color: rgba(255, 255, 255, .55);
}

.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 56px;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.numero-card {
    text-align: center;
    padding: 36px 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: rgba(255, 255, 255, .04);
    backdrop-filter: blur(8px);
}

.numero-big {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.numero-label {
    font-size: 14px;
    color: rgba(255, 255, 255, .5);
    font-weight: 400;
}

.land-promo {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 50%, #e0e7ff 100%);
    padding: 80px 24px;
}

.promo-box {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    padding: 48px 52px;
    box-shadow: 0 20px 60px rgba(102, 126, 234, .18);
    display: flex;
    gap: 40px;
    align-items: center;
    flex-wrap: wrap;
}

.promo-emoji {
    font-size: 72px;
    flex-shrink: 0;
}

.promo-content {
    flex: 1;
    min-width: 260px;
}

.promo-content h3 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--texto);
    margin: 0 0 12px;
}

.promo-content p {
    font-size: 15px;
    color: var(--gris);
    line-height: 1.7;
    margin: 0 0 20px;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--violeta), var(--violeta-deep));
    color: white;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 700;
}

.land-cta {
    background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(102, 126, 234, .2) 0%, transparent 70%), linear-gradient(160deg, #0f0a28, #1a1040);
    padding: 100px 24px;
    text-align: center;
}

.land-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 58px);
    font-weight: 800;
    color: white;
    margin: 0 0 20px;
    line-height: 1.1;
}

.land-cta h2 em {
    font-style: normal;
    background: linear-gradient(135deg, #a78bfa, #667eea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.land-cta p {
    font-size: 18px;
    color: rgba(255, 255, 255, .55);
    margin: 0 0 40px;
}

.land-footer {
    background: #080516;
    padding: 32px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .05);
}

.land-footer .logo {
    font-family: var(--font-display);
    font-weight: 800;
    color: rgba(255, 255, 255, .4);
    font-size: 16px;
}

.land-footer .logo span {
    color: rgba(167, 139, 250, .6);
}

.land-footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, .25);
    margin: 0;
}

/* ── Animaciones ── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── DASHBOARD (con sesión) ── */

.dash-welcome {
    background: linear-gradient(135deg, var(--violeta), var(--violeta-deep));
    border-radius: 18px;
    padding: 28px 32px;
    color: white;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.dash-welcome h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 4px;
}

.dash-welcome p {
    margin: 0;
    font-size: 14px;
    opacity: .75;
}

.dash-caja-badge {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    border: 1.5px solid rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .12);
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.dash-stat {
    background: white;
    border: 1.5px solid #ede9fe;
    border-radius: 14px;
    padding: 20px 22px;
}

.dash-stat .ds-label {
    font-size: 12px;
    color: var(--gris);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.dash-stat .ds-val {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--texto);
}

.dash-stat .ds-val.verde {
    color: #10B981;
}

.dash-stat .ds-val.rojo {
    color: #ef4444;
}

.dash-stat .ds-val.violeta {
    color: var(--violeta);
}

.dash-accesos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.dash-acceso {
    background: white;
    border: 1.5px solid #ede9fe;
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    text-decoration: none;
    transition: all .18s;
    display: block;
}

.dash-acceso:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, .14);
    border-color: #c4b5fd;
}

.dash-acceso .da-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.dash-acceso strong {
    display: block;
    font-size: 14px;
    color: var(--texto);
    font-weight: 700;
    margin-bottom: 3px;
}

.dash-acceso small {
    font-size: 12px;
    color: var(--gris);
}

.alerta-stock {
    background: #fef3c7;
    border: 1.5px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 13px;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Mobile */
@media (max-width: 640px) {
    .land-header {
        padding: 16px 20px;
    }

    .land-nav a:not(.btn-cta) {
        display: none;
    }

    .promo-box {
        padding: 32px 24px;
    }

    .land-footer {
        padding: 24px 20px;
    }

    .content-section {
        display: flex;
        flex-direction: column;
    }

    .dash-welcome {
        order: 2;
    }

    .alerta-stock {
        order: 1;
    }

    .dash-stats {
        order: 3;
    }

    .dash-accesos-wrap {
        order: 0;
    }


}

/* ══════════════════════════════════════════════
   CAJA.PHP — estilos globales
══════════════════════════════════════════════ */

/* ── Card estado caja ── */
.caja-estado-card {
    border-radius: 14px;
    padding: 22px 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.caja-estado-card.caja-abierta {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid #10B981;
}

.caja-estado-card.caja-cerrada {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border: 2px solid #ef4444;
}

.caja-icon {
    font-size: 36px;
    line-height: 1;
}

.caja-estado-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: #1f2937;
}

.caja-estado-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* ── Stats live ── */
.stats-live {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat-live {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.stat-live .num {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
}

.stat-live .desc {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.stat-live.verde .num {
    color: #10B981;
}

.stat-live.rojo .num {
    color: #ef4444;
}

.stat-live.naranja .num {
    color: #f97316;
}

/* ── Formularios de caja ── */
.form-caja {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 18px;
}

.form-caja h3 {
    margin: 0 0 16px;
    font-size: 15px;
    color: #374151;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 180px;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

/* ── Detalle cierre ── */
.detalle-cierre {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.detalle-cierre h4 {
    margin: 0 0 10px;
    font-size: 13px;
    color: #374151;
}

.detalle-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.detalle-row:last-child {
    border-bottom: none;
    font-weight: 800;
    font-size: 14px;
}

.detalle-row span:last-child {
    font-weight: 700;
    color: #1f2937;
}

/* ── Alertas de caja ── */
.alert-caja {
    padding: 11px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 14px;
}

.alert-caja.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-caja.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ══════════════════════════════════════════════
   SUSCRIPCIÓN — banners de aviso
══════════════════════════════════════════════ */
.sus-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.sus-banner.sus-vencida {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

.sus-banner.sus-aviso {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #fcd34d;
}

.sus-btn-renovar {
    padding: 6px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.sus-btn-renovar:hover {
    opacity: .88;
}