/* assets/css/style.css - Estilos modernos, responsivos y de alto rendimiento para CYNFER POS */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #0ea5e9;
    --elvia-color: #7c3aed;
    --elvia-light: #f5f3ff;
    --melissa-color: #0d9488;
    --melissa-light: #f0fdfa;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* NAVBAR SUPERIOR */
.navbar {
    background: #0f172a;
    color: #ffffff;
    padding: 0 18px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: nowrap;
    gap: 12px;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-hamburger {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-hamburger:hover {
    background: rgba(255, 255, 255, 0.22);
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    user-select: none;
}

#nav-tienda-logo {
    max-height: 36px;
    max-width: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: #ffffff;
    padding: 2px 4px;
}

.brand-badge {
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: white;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    overflow: visible;
}

.nav-tab,
.nav-dropdown-trigger {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 9px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.nav-tab:hover,
.nav-dropdown-trigger:hover {
    color: #f8fafc;
    background: rgba(255,255,255,0.08);
}

.nav-tab.active,
.nav-dropdown-trigger.active {
    color: #ffffff;
    background: #4f46e5;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.4);
}

.nav-tab .badge-shortcut {
    background: rgba(255,255,255,0.15);
    color: #e2e8f0;
    font-size: 0.62rem;
    padding: 1px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.nav-tab.active .badge-shortcut {
    background: rgba(255,255,255,0.25);
    color: #ffffff;
}

/* DROPDOWN DE MÁS MÓDULOS EN NAVBAR */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.75);
    min-width: 200px;
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 3px;
    z-index: 999999;
}

.nav-dropdown-menu.show {
    display: flex !important;
}

.nav-dropdown-item {
    background: transparent;
    border: none;
    color: #cbd5e1;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    width: 100%;
    white-space: nowrap;
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-dropdown-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

/* SELECTOR DE TIENDA */
.store-selector-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.nav-store-select {
    background: transparent;
    color: #f8fafc;
    border: none;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 2px 4px;
    outline: none;
    cursor: pointer;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-store-select option {
    background: #0f172a;
    color: #ffffff;
}

.bottom-nav {
    display: none;
}

.pos-floating-cart-btn {
    display: none;
}

.caja-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.08);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    padding: 4px 12px 4px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    white-space: nowrap;
}

.nav-user-badge:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar-circle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: white;
    font-weight: 800;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-info-text .user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #f8fafc;
}

.user-info-text .user-role-badge {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
}

.btn-user-logout {
    background: none;
    border: none;
    color: #fca5a5;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: transform 0.15s ease;
}

.btn-user-logout:hover {
    transform: scale(1.15);
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.online { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.status-dot.offline { background: #ef4444; }

/* CONTENEDOR PRINCIPAL */
.main-content {
    flex: 1;
    padding: 16px 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.view-section {
    display: none;
}
.view-section.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* LAYOUT POS DE DOS COLUMNAS */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 16px;
    height: calc(100vh - 92px);
}

/* CATÁLOGO Y BUSCADOR */
.catalog-panel {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-toolbar {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper input {
    width: 100%;
    height: 46px;
    padding: 0 45px 0 16px;
    font-size: 1.05rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--surface-alt);
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-input-wrapper .search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #cbd5e1;
    color: #475569;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-family: monospace;
}

.school-chips-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.school-chip {
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.school-chip:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.school-chip.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.school-chip.chip-bestseller {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
    font-weight: 700;
}

.school-chip.chip-bestseller:hover {
    background: #fde68a;
    color: #92400e;
}

.school-chip.chip-bestseller.active {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.partner-tag-pill {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* LISTA DE PRODUCTOS Y TALLAS */
.products-grid-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    align-content: start;
}

.product-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.product-card-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.25;
}

.product-school-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.socia-badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.socia-badge.elvia { background: var(--elvia-light); color: var(--elvia-color); border: 1px solid rgba(124, 58, 237, 0.2); }
.socia-badge.melissa { background: var(--melissa-light); color: var(--melissa-color); border: 1px solid rgba(13, 148, 136, 0.2); }
.socia-badge.general, .socia-badge.sin-asignar { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }

.variants-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.variant-btn {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    transition: all 0.12s ease;
}

.variant-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.variant-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.variant-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.variant-size {
    font-weight: 700;
    color: var(--text-main);
}

.variant-price {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.82rem;
}

.variant-stock-tag {
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-top: 2px;
}
.variant-stock-tag.in-stock { background: #dcfce7; color: #15803d; font-weight: bold; }
.variant-stock-tag.low-stock { background: #fef3c7; color: #b45309; font-weight: bold; }
.variant-stock-tag.out-of-stock { background: #fee2e2; color: #b91c1c; font-weight: bold; }

/* PANEL DE CARRITO (LADO DERECHO) */
.cart-panel {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-clear-btn {
    background: transparent;
    border: none;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.cart-clear-btn:hover { background: #fee2e2; }

/* DIVISIÓN DUAL EN VIVO EN EL CARRITO */
.cart-dual-preview {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    gap: 10px;
    font-size: 0.78rem;
}

.dual-chip {
    flex: 1;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}
.dual-chip.elvia { background: var(--elvia-light); color: var(--elvia-color); border: 1px solid rgba(124, 58, 237, 0.2); }
.dual-chip.melissa { background: var(--melissa-light); color: var(--melissa-color); border: 1px solid rgba(13, 148, 136, 0.2); }

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-name {
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.2;
}

.cart-item-school {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cart-item-row-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.qty-stepper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #ffffff;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    background: var(--surface-alt);
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-btn:hover { background: #cbd5e1; }

.qty-input {
    width: 32px;
    text-align: center;
    font-weight: bold;
    font-size: 0.88rem;
    border: none;
    outline: none;
}

.cart-item-price-subtotal {
    text-align: right;
}

.cart-item-subtotal {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}

.cart-item-unit-price {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cart-item-remove-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 6px;
}
.cart-item-remove-btn:hover { color: var(--danger); }

/* FOOTER Y TOTALES DEL CARRITO */
.cart-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-client-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cart-total-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.cart-total-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: #0f172a;
}

.cart-checkout-btn {
    width: 100%;
    height: 50px;
    background: #16a34a;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.cart-checkout-btn:hover:not(:disabled) {
    background: #15803d;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.cart-checkout-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    box-shadow: none;
    cursor: not-allowed;
}

/* BOTONES GENERALES */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text-main);
    border: 1px solid var(--border-dark);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}
.btn-secondary:hover { background: #e2e8f0; }

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}
.btn-success:hover { background: #15803d; }

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

/* TABLAS GENERALES */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

.data-table.table-compact th {
    padding: 8px 10px;
    font-size: 0.72rem;
}

.data-table.table-compact td {
    padding: 8px 10px;
    font-size: 0.84rem;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.modal-box.modal-xl {
    max-width: 1200px !important;
    width: 96vw !important;
    max-height: 92vh !important;
}

/* CARDS DE DASHBOARD Y CAJA */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-card-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: #0f172a;
}

.metric-card.elvia {
    border-left: 5px solid var(--elvia-color);
    background: linear-gradient(to right, #faf5ff, #ffffff);
}
.metric-card.melissa {
    border-left: 5px solid var(--melissa-color);
    background: linear-gradient(to right, #f0fdfa, #ffffff);
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.15s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
}
.modal-close-btn:hover { color: var(--danger); }

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* FORMULARIOS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* FILTROS Y BOTONES DE APARTADOS */
.ap-filter-tabs {
    display: flex;
    background: #e2e8f0;
    padding: 3px;
    border-radius: var(--radius-full);
    gap: 3px;
}

.ap-tab-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ap-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.5);
}

.ap-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.ap-tab-btn[data-estado="Activo"].active {
    color: #15803d;
}

.ap-tab-btn[data-estado="Vencido"].active {
    color: #b91c1c;
}

.ap-tab-btn[data-estado="Liquidado"].active {
    color: #4338ca;
}

.ap-tab-btn[data-estado="Cancelado"].active {
    color: #64748b;
}

/* BOTONES DE ACCIÓN EN TABLA DE APARTADOS */
.btn-ap-abonar {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
    transition: all 0.15s ease;
}
.btn-ap-abonar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(22, 163, 74, 0.35);
    background: linear-gradient(135deg, #15803d, #166534);
}
.btn-ap-abonar:active {
    transform: translateY(0);
}

.btn-ap-ticket {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.btn-ap-ticket:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-ap-pdf {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.btn-ap-pdf:hover {
    background: #fecaca;
    color: #991b1b;
    border-color: #f87171;
    transform: translateY(-1px);
}

.btn-ap-wa {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff !important;
    text-decoration: none;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
    transition: all 0.15s ease;
}
.btn-ap-wa:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #20bd5a, #0e7064);
}
.btn-ap-wa:active {
    transform: translateY(0);
}

.btn-ap-cancel {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}
.btn-ap-cancel:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* SEMÁFORO DE APARTADOS */
.badge-semaforo {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.2px;
}
.badge-semaforo.vigente { 
    background: #dcfce7; 
    color: #166534; 
    border: 1px solid #bbf7d0;
}
.badge-semaforo.urgente { 
    background: #fef3c7; 
    color: #92400e; 
    border: 1px solid #fde68a;
}
.badge-semaforo.vencido { 
    background: #fee2e2; 
    color: #991b1b; 
    border: 1px solid #fecaca;
}
.badge-semaforo.liquidado { 
    background: #e0e7ff; 
    color: #3730a3; 
    border: 1px solid #c7d2fe;
}
.badge-semaforo.cancelado { 
    background: #f1f5f9; 
    color: #94a3b8; 
    border: 1px solid #e2e8f0;
}

/* SOCIA BADGES */
.socia-badge, .badge-socia {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.socia-badge.elvia, .badge-socia.elvia {
    background: #f5f3ff;
    color: #7c3aed;
    border: 1px solid #ddd6fe;
}
.socia-badge.melissa, .badge-socia.melissa {
    background: #f0fdfa;
    color: #0d9488;
    border: 1px solid #99f6e4;
}

/* TOAST NOTIFICACIONES */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: #0f172a;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlideIn 0.2s ease;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #38bdf8; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* MINIATURAS E ICONOS DE PRODUCTOS */
.product-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.product-thumb-box {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    position: relative;
}

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

.product-table-thumb {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
}

/* ESTILOS DE DESCUENTO Y PROMOCIÓN */
.discount-chip {
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
}
.discount-chip:hover, .discount-chip.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4338ca;
}

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

/* ============================================================ */
/* ESTILOS DEL MÓDULO DE CAMBIOS Y DEVOLUCIONES */
/* ============================================================ */
.devoluciones-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
}

.subnav-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.subnav-tab {
    background: transparent;
    border: none;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.subnav-tab:hover {
    color: var(--primary);
    background: var(--surface-alt);
}

.subnav-tab.active {
    color: var(--primary);
    background: var(--surface);
    border-bottom: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.sale-selected-card {
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
    border: 2px solid #c7d2fe;
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.sale-selected-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.operation-mode-selector {
    display: flex;
    gap: 12px;
    margin: 15px 0;
}

.mode-option-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.mode-option-btn.active-cambio {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #3730a3;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.mode-option-btn.active-devolucion {
    border-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.stepper-input {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #ffffff;
}

.stepper-btn {
    background: #f1f5f9;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.15s ease;
}

.stepper-btn:hover {
    background: #e2e8f0;
}

.stepper-value {
    width: 36px;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    background: transparent;
}

.badge-reingreso {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-defecto {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.exchange-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ========================================================= */
/* BARRA SUPERIOR: SELECTOR DE TIENDA Y USUARIO ACTIVO       */
/* ========================================================= */
.store-select-dropdown {
    position: relative;
}

.store-badge-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.store-badge-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.store-dropdown-menu, .user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    min-width: 250px;
    z-index: 200;
    overflow: hidden;
}

.store-dropdown-header, .user-dropdown-header {
    background: #0f172a;
    padding: 10px 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.store-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #334155;
    transition: background 0.15s;
}

.store-dropdown-item:last-child {
    border-bottom: none;
}

.store-dropdown-item:hover, .store-dropdown-item.active {
    background: rgba(79, 70, 229, 0.2);
}

.store-item-info {
    cursor: pointer;
    flex: 1;
}

.store-item-info b {
    display: block;
    color: #f8fafc;
    font-size: 0.9rem;
}

.store-item-info small {
    color: #94a3b8;
    font-size: 0.75rem;
}

.btn-open-tab {
    background: #334155;
    border: none;
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-open-tab:hover {
    background: var(--primary);
    color: #fff;
}

.user-badge-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.user-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
}

.user-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #f8fafc;
}

.user-role {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
}

.user-dropdown-item {
    padding: 10px 14px;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #334155;
    transition: background 0.15s;
}

.user-dropdown-item:hover {
    background: #334155;
}

.user-dropdown-item.danger {
    color: #f87171;
}

/* ========================================================= */
/* BARRA MÓVIL INFERIOR (BOTTOM NAVIGATION)                  */
/* ========================================================= */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: #0f172a;
    border-top: 1px solid #334155;
    z-index: 99;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
}

.bottom-nav-items {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: space-around;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 600;
    gap: 3px;
    cursor: pointer;
    padding: 4px 0;
    transition: all 0.15s ease;
}

.bottom-nav-item .bnav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-item.active {
    color: #818cf8;
    font-weight: 800;
}

.bottom-nav-item.active .bnav-icon {
    transform: scale(1.15);
}


/* ========================================================= */
/* TARJETAS DE VENTAS POR ESCUELA                            */
/* ========================================================= */
.schools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.escuela-stat-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.commission-calculator-box {
    background: #ffffff;
    padding: 18px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.commission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.commission-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.commission-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.comm-stat-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

.comm-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.comm-val {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-main);
    margin-top: 2px;
}

.badge-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* HAMBURGER BUTTON & MOBILE DRAWER */
.btn-hamburger {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.btn-hamburger:hover {
    background: rgba(255, 255, 255, 0.22);
}

.mobile-nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.active {
    display: block;
    opacity: 1;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    background: #0f172a;
    color: #f8fafc;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

.mobile-nav-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.mobile-nav-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.mobile-nav-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mobile-nav-section-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.mobile-caja-status-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    color: #cbd5e1;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.mobile-nav-item.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.mobile-nav-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.pos-floating-cart-btn {
    position: fixed;
    bottom: 66px;
    left: 12px;
    right: 12px;
    height: 48px;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: #ffffff;
    padding: 0 16px;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    z-index: 850;
    display: none !important;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.15s ease;
}

@media (min-width: 993px) {
    .pos-floating-cart-btn {
        display: none !important;
    }
}

.pos-floating-cart-btn:active {
    transform: scale(0.98);
}

.pos-floating-cart-badge {
    background: #e11d48;
    color: white;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

/* ========================================================= */
/* MEDIA QUERIES RESPONSIVAS PARA ESCRITORIO MEDIANO Y MÓVIL */
/* ========================================================= */

@media (max-width: 1350px) and (min-width: 993px) {
    .navbar {
        padding: 0 10px;
        gap: 6px;
    }
    .brand-badge {
        display: none;
    }
    .nav-tabs {
        overflow: visible !important;
    }
    .nav-tab, .nav-dropdown-trigger {
        padding: 5px 7px;
        font-size: 0.78rem;
        gap: 3px;
    }
    .nav-tab .badge-shortcut {
        display: none;
    }
    .store-selector-wrapper {
        padding: 2px 5px;
    }
    .nav-store-select {
        font-size: 0.76rem;
        max-width: 120px;
    }
    .caja-status-indicator {
        font-size: 0.72rem;
        padding: 3px 6px;
        max-width: 160px;
    }
    .user-info-text .user-name {
        font-size: 0.74rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 992px) {
    body {
        padding-bottom: 74px;
    }

    .navbar {
        height: 54px;
        min-height: 54px;
        max-height: 54px;
        padding: 0 12px;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .btn-hamburger {
        display: flex !important;
    }

    .brand {
        font-size: 1.15rem;
    }

    .brand-badge {
        display: none !important;
    }

    /* Ocultar elementos densos en barra superior en modo móvil para no desbordar */
    .nav-tabs {
        display: none !important;
    }

    .navbar .store-selector-wrapper {
        display: none !important;
    }

    .navbar #nav-caja-status {
        display: none !important;
    }

    .navbar .user-info-text {
        display: none !important;
    }

    .navbar .btn-user-logout {
        display: none !important;
    }

    .navbar .nav-user-badge {
        padding: 2px;
        background: transparent;
        border: none;
    }

    /* BARRA INFERIOR MÓVIL */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 58px;
        background: #0f172a;
        border-top: 1px solid #1e293b;
        z-index: 900;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: #94a3b8;
        font-size: 0.68rem;
        font-weight: 600;
        padding: 5px 0;
        gap: 2px;
        cursor: pointer;
        transition: all 0.15s ease;
        text-decoration: none;
        user-select: none;
    }

    .bottom-nav-item:hover, .bottom-nav-item:active {
        color: #c7d2fe;
    }

    .bottom-nav-item.active {
        color: #818cf8;
        font-weight: 700;
    }

    .bottom-nav-icon {
        font-size: 1.2rem;
        line-height: 1;
    }

    /* BOTÓN FLOTANTE CARRITO EN POS */
    .pos-floating-cart-btn {
        display: none;
        position: fixed;
        bottom: 66px;
        left: 12px;
        right: 12px;
        height: 48px;
        background: linear-gradient(135deg, #4f46e5, #4338ca);
        color: #ffffff;
        border: none;
        border-radius: 12px;
        box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
        z-index: 850;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        font-weight: 800;
        font-size: 0.95rem;
        cursor: pointer;
        transition: transform 0.15s ease;
    }

    .pos-floating-cart-btn.is-visible {
        display: flex !important;
    }

    .pos-floating-cart-btn:active {
        transform: scale(0.98);
    }

    .pos-container {
        grid-template-columns: 1fr;
    }

    /* Panel de Carrito en Móvil */
    .pos-container .cart-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: 0;
        background: #ffffff;
        z-index: 9999;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 16px;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
    }

    .pos-container .cart-panel.mobile-open {
        transform: translateY(0);
    }

    .mobile-cart-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
    }

    .main-content {
        padding: 12px 10px 80px 10px !important;
    }

    .search-toolbar {
        margin-bottom: 12px;
    }

    .kpi-dual-grid {
        grid-template-columns: 1fr !important;
    }

    .reports-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .escuelas-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .table-responsive-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-content {
        margin: 10px;
        max-width: 100% !important;
        max-height: 90vh !important;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 10px !important;
    }
}

@media (max-width: 480px) {
    .reports-kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .modal-numpad {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .quick-cash-buttons {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 8px !important;
    }
}


