/* finanzas.css - DISEÑO PREMIUM ERP DASHBOARD */

.finanzas-main-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-bottom: 40px;
}

/* CABECERA Y BOTONES NUEVOS */
.finanzas-super-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.top-finanzas-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-top-fin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 💎 BOTONES SUPERIORES (Inventario, Nómina, Auditoría) */
.fz-btn-inventario {
    background: #ebf5fb;
    color: #3498db;
    border: 1px solid #d6eaf8;
    -webkit-tap-highlight-color: transparent;
}

.fz-btn-nomina {
    background: #f0f0ff;
    color: #7b61ff;
    border: 1px solid #e9e2ff;
    -webkit-tap-highlight-color: transparent;
}

.fz-btn-auditoria {
    background: #fdf0f5;
    color: #e84393;
    border: 1px solid #fadbd8;
    -webkit-tap-highlight-color: transparent;
}

/* ⚡ FIX: El color de fondo relleno solo se activa con el ratón (PC) */
@media (hover: hover) and (pointer: fine) {
    .fz-btn-inventario:hover {
        background: #3498db;
        color: white;
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    }

    .fz-btn-nomina:hover {
        background: #7b61ff;
        color: white;
        box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
    }

    .fz-btn-auditoria:hover {
        background: #e84393;
        color: white;
        box-shadow: 0 4px 12px rgba(232, 67, 147, 0.3);
    }
}

/* ⚡ REACCIÓN TÁCTIL (Móvil): Solo se hunde y vuelve de inmediato */
.btn-top-fin:active {
    transform: scale(0.94);
    transition: none !important;
}

body.dark-theme .fz-btn-inventario {
    background: #132738;
    border-color: #1a3c5a;
    color: #3498db;
}

body.dark-theme .fz-btn-nomina {
    background: #2a1f3d;
    border-color: #3b2b5a;
    color: #b39ddb;
}

body.dark-theme .fz-btn-auditoria {
    background: #2f1b25;
    border-color: #4a2538;
    color: #ff8ab3;
}

/* PANEL MAESTRO BLANCO */
/* 💎 PANEL MAESTRO (Diseño Premium, Clean y Futurista) */
.finanzas-master-panel {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
    overflow: visible !important;
    /* ⚡ FIX CRÍTICO: Evita que los menús desplegables se recorten */
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

body.dark-theme .finanzas-master-panel {
    background: #12131c;
    border-color: #2a2b3d;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.finanzas-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
    border-radius: 20px 20px 0 0;
    /* ⚡ Mantiene las esquinas redondeadas al quitar overflow hidden */
}

body.dark-theme .finanzas-panel-header {
    border-color: #2a2b3d;
}

.f-panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.f-panel-title .green-icon {
    background: #2ecc71;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.f-panel-title h3 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

/* 💎 MINI BOTONES DE ACCIÓN (Rojo y Amarillo) */
.tiny-icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}


.yellow-tiny {
    background: #fef9e7;
    color: #f39c12;
    border-color: #fdebd0;
}

/* ⚡ FIX: Hover protegido solo para PC */
@media (hover: hover) and (pointer: fine) {

    .yellow-tiny:hover {
        background: #f39c12;
        color: white;
    }
}

/* ⚡ REACCIÓN TÁCTIL (Móvil): Efecto click ultra rápido */
.tiny-icon-btn:active {
    transform: scale(0.85);
    transition: none !important;
}

body.dark-theme .yellow-tiny {
    background: #2b2011;
    border-color: #47351c;
}

.f-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 💎 ESTILO BASE UNIFICADO PARA BOTONES (MORADO, VERDE, ROJO) */
.btn-outline-purple {
    background: transparent !important;
    color: #7b61ff !important;
    border: 1px solid #7b61ff !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline-green {
    background: transparent !important;
    color: #2ecc71 !important;
    border: 1px solid #2ecc71 !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.btn-outline-red {
    background: transparent !important;
    color: #e74c3c !important;
    border: 1px solid #e74c3c !important;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ⚡ HOVER EXCLUSIVO PARA PC (El color sólido solo aparece con un ratón real) */
@media (hover: hover) and (pointer: fine) {
    .btn-outline-purple:hover:not(.active) {
        background: rgba(123, 97, 255, 0.08) !important;
        box-shadow: 0 4px 15px rgba(123, 97, 255, 0.15) !important;
    }

    .btn-outline-green:hover {
        background: #2ecc71 !important;
        color: white !important;
        box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3) !important;
    }

    .btn-outline-red:hover {
        background: #e74c3c !important;
        color: white !important;
        box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3) !important;
    }
}

/* ⚡ INTERRUPTOR: ESTILO DE ACTIVACIÓN PERMANENTE PARA "RANGO CUSTOM" */
.btn-outline-purple.active {
    color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.1) !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
    box-shadow: inset 1px 3px 5px rgba(255, 255, 255, 0.9), inset -2px -4px 6px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(46, 204, 113, 0.15) !important;
    transform: scale(1.02);
    animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: none !important;
}

.btn-outline-purple.active svg {
    color: #2ecc71 !important;
}

@keyframes bubblePop {
    0% {
        transform: scale(0.9);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.02);
        opacity: 1;
    }
}

/* ⚡ REACCIÓN TÁCTIL FÍSICA PARA LOS BOTONES SIMPLES (Verde y Rojo no se quedan pegados) */
.btn-outline-green:active {
    background: rgba(46, 204, 113, 0.15) !important;
    transform: scale(0.95);
    transition: none !important;
}

.btn-outline-red:active {
    background: rgba(231, 76, 60, 0.15) !important;
    transform: scale(0.95);
    transition: none !important;
}

/* Desvanecimiento de la burbuja del carrusel cuando Rango Custom está activo */
#finanzas-time-filters.custom-active .drop-selector {
    opacity: 0 !important;
    transform: scale(0.7) !important;
    transition: all 0.25s ease-in-out !important;
}


.finanzas-panel-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* CONTROLES TOP Y PÍLDORAS (VERSIÓN PC) */
.finanzas-top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.finanzas-filters-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.finanzas-filters-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ⚡ FIX: Separa los botones en PC */

/* Píldoras Gota Agua */
.finanzas-pills.drop-container {
    width: auto;
    max-width: 100%;
}

.finanzas-pills .pill.active {
    color: #2ecc71 !important;
}

.finanzas-pills .drop-selector {
    background: rgba(46, 204, 113, 0.1) !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
    box-shadow: inset 1px 3px 5px rgba(255, 255, 255, 0.9), inset -2px -4px 6px rgba(0, 0, 0, 0.05), 0 4px 10px rgba(46, 204, 113, 0.15) !important;
}

body.dark-theme .finanzas-pills .drop-selector {
    background: rgba(46, 204, 113, 0.2) !important;
    border-color: rgba(46, 204, 113, 0.4) !important;
}

/* Caja de Fechas Personalizadas */
#finanzas-custom-dates {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    border: 1px solid var(--primary-pink);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(255, 71, 133, 0.08);
    margin-bottom: 10px;
}

#finanzas-custom-dates.hidden {
    display: none !important;
}

#finanzas-custom-dates span {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary-pink);
}

#finanzas-custom-dates span:nth-of-type(2) {
    color: var(--text-muted);
}

.fz-date-input {
    position: relative;
    padding: 10px 15px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
}

.fz-date-input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    color: transparent;
    background: transparent;
    cursor: pointer;
}

/* Navegador de Fecha Central */
.finanzas-date-navigator {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.02);
}

#fz-current-date-display {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
}

body.dark-theme .finanzas-date-navigator {
    background: #181924;
    border-color: #2a2b3d;
}

/* 💎 KPIs Grid (Diseño Limpio, Elegante y Ligero) */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px 25px;
    text-align: left;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.015);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.kpi-card label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.kpi-card h3 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -1px;
    margin: 0;
    color: var(--text-main);
}

/* Sin rayas, solo color en el número principal */
.card-green h3 {
    color: #2ecc71;
}

.card-red h3 {
    color: #e74c3c;
}

.card-blue h3 {
    color: #3498db;
}

/* ⚡ SUAVIZADO TIPOGRÁFICO GENERAL (Adiós al texto "reteñido") */
.f-panel-title h3 {
    font-weight: 600 !important;
}

.btn-top-fin {
    font-weight: 600 !important;
}

#fz-current-date-display {
    font-weight: 600 !important;
    letter-spacing: 0.5px;
}

.desglose-header h3 {
    font-weight: 600 !important;
}

.stellar-table th {
    font-weight: 500 !important;
}

.tbl-client {
    font-weight: 500 !important;
}

.tbl-amount {
    font-weight: 600 !important;
}

.bz-header h4 {
    font-weight: 500 !important;
}

.bz-row-main strong {
    font-weight: 600 !important;
}

.finanzas-pills .pill {
    font-weight: 500 !important;
}

.finanzas-pills .pill.active {
    font-weight: 600 !important;
}

/* Bizum Cards */
.bizum-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.bz-card {
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 25px;
    transition: 0.2s;
}

.bz-card:hover {
    border-color: #d6eaf8;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.1);
    background: var(--card-bg);
}

.bz-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.bz-header svg {
    color: #3498db;
}

.bz-header h4 {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 800;
    flex: 1;
}

.bz-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.bz-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.bz-row strong {
    color: #3498db;
    font-size: 0.9rem;
}

.bz-row-main {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 15px;
}

.bz-row-main strong {
    color: #2ecc71;
    font-size: 1.1rem;
}

/* Gráficos */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.chart-box {
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 25px;
    transition: 0.2s;
}

.chart-box:hover {
    background: var(--card-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.chart-header h4 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
}

.chart-container {
    height: 280px;
    width: 100%;
    position: relative;
}

/* Desglose / Tabla */
.desglose-section {
    margin-top: 10px;
}

.desglose-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.desglose-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.text-purple {
    color: #8e44ad;
}

.text-pink {
    color: var(--primary-pink);
}

.text-green {
    color: #2ecc71;
}

.desglose-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 25px;
}

.desglose-body {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.desglose-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
    flex-shrink: 0;
}

/* 💎 MINI KPIs (Modernos sin bordes fuertes) */
.mini-kpi-card {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

.mini-kpi-card.outline-green {
    border: 1px solid rgba(46, 204, 113, 0.3);
    background: #f9fdfa;
}

.mini-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05), inset 0 2px 10px rgba(255, 255, 255, 0.5);
}

body.dark-theme .mini-kpi-card {
    box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.02);
}

body.dark-theme .mini-kpi-card.outline-green {
    background: #141c18;
    border-color: rgba(46, 204, 113, 0.2);
}

.mini-kpi-card label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 10px;
}

.mini-kpi-card h3 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
}

.desglose-table-wrapper {
    flex: 1;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.stellar-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.stellar-table th {
    text-align: left;
    padding: 18px 25px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.stellar-table td {
    padding: 18px 25px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

.stellar-table tr:last-child td {
    border-bottom: none;
}

.stellar-table tbody tr:hover {
    background: #fafafa;
}

/* Badges Tabla */
.tbl-date {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-color);
}

.tbl-client {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    display: block;
    margin-bottom: 6px;
}

.tbl-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #8e44ad;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.5px;
}

.tbl-spec {
    background: #eaf5fc;
    color: #3498db;
    border: 1px solid #d6eaf8;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tbl-method {
    background: #eafaf1;
    color: #2ecc71;
    border: 1px solid #d5f5e3;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tbl-method.bizum {
    background: #ebf5fb;
    color: #3498db;
    border-color: #d6eaf8;
}

.tbl-method.mixto {
    background: #fdf0f5;
    color: var(--primary-pink);
    border-color: #fadbd8;
}

.tbl-amount {
    font-weight: 900;
    font-size: 1.1rem;
    color: #2ecc71;
    text-align: right;
    display: block;
}

/* ========================================================= */
/* 💎 ESTILO PREMIUM PARA FILTROS DE DESGLOSE (FINANZAS)     */
/* ========================================================= */
.desglose-filters .custom-dropdown .dropdown-selected {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    transition: all 0.25s ease;
    height: auto;
    min-height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.desglose-filters .custom-dropdown:hover .dropdown-selected {
    border-color: var(--primary-pink);
    box-shadow: 0 4px 12px rgba(255, 71, 133, 0.08);
}

.desglose-filters .custom-dropdown.open .dropdown-selected {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 71, 133, 0.15);
}

.desglose-filters .custom-dropdown .dropdown-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    margin-top: 2px;
    max-height: 260px;
    overflow-y: auto;
    z-index: 999999 !important;
}

.desglose-filters .custom-dropdown .dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.desglose-filters .custom-dropdown .dropdown-options::-webkit-scrollbar-track {
    background: transparent;
}

.desglose-filters .custom-dropdown .dropdown-options::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.desglose-filters .custom-dropdown .dropdown-item {
    padding: 12px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.desglose-filters .custom-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

.desglose-filters .custom-dropdown .dropdown-item:hover {
    background: rgba(255, 71, 133, 0.06);
    color: var(--primary-pink);
    padding-left: 24px;
}

body.dark-theme .kpi-card,
body.dark-theme .bz-card,
body.dark-theme .chart-box,
body.dark-theme .mini-kpi-card,
body.dark-theme .desglose-table-wrapper {
    background: #12131c;
    border-color: #2a2b3d;
}

body.dark-theme .stellar-table th {
    background: #181924;
    border-color: #2a2b3d;
}

body.dark-theme .stellar-table td {
    border-color: #2a2b3d;
}

body.dark-theme .stellar-table tbody tr:hover {
    background: #181924;
}

body.dark-theme .tbl-date {
    background: #181924;
    border-color: #2a2b3d;
    color: #e2e8f0;
}

body.dark-theme .fz-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ========================================= */
/* 📱 ADAPTACIÓN MÓVIL ULTRA-PREMIUM Y SCROLL NATIVO */
/* ========================================= */
@media (max-width: 900px) {

    /* ⚡ FIX 1: Desbloqueo absoluto del Scroll Vertical y Bloqueo Horizontal Táctil */
    #view-finanzas.active {
        display: block !important;
        height: 100% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        /* BLINDAJE CONTRA SCROLL HORIZONTAL */
        padding: 15px !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .finanzas-main-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        /* Reducimos gap en móvil */
        height: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .finanzas-super-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .finanzas-super-header>div:first-child {
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .top-finanzas-btns {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        box-sizing: border-box !important;
    }

    .btn-top-fin {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 5px !important;
        font-size: 0.7rem !important;
        box-sizing: border-box !important;
    }

    /* ⚡ FIX 2: Evita desbordamiento horizontal forzando dimensiones */
    .finanzas-master-panel {
        border-radius: 16px !important;
        /* Bordes menos agresivos en móvil */
        border: 1px solid var(--border-color);
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        /* OCULTAMOS EL DESBORDE DE MENÚS EN MÓVIL POR SEGURIDAD */
    }

    .finanzas-panel-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        padding: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .f-panel-title {
        justify-content: space-between !important;
        width: 100% !important;
    }

    .f-panel-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-outline-green,
    .btn-outline-red {
        justify-content: center !important;
        padding: 12px !important;
        font-size: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .finanzas-panel-body {
        padding: 15px !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .finanzas-top-controls {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .finanzas-filters-left {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #finanzas-time-filters.drop-container {
        width: 100% !important;
        display: flex !important;
        padding: 4px !important;
        justify-content: space-between !important;
        box-sizing: border-box !important;
    }

    #finanzas-time-filters .pill {
        flex: 1 !important;
        padding: 10px 0 !important;
        font-size: 0.7rem !important;
        text-align: center !important;
    }

    .finanzas-filters-right {
        width: 100% !important;
        display: flex !important;
        gap: 10px !important;
        box-sizing: border-box !important;
    }

    .finanzas-filters-right button {
        flex: 1 !important;
        padding: 12px 8px !important;
        font-size: 0.7rem !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }

    #finanzas-custom-dates {
        flex-direction: column !important;
        width: 100% !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    .finanzas-date-navigator {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* GRILLAS ADAPTATIVAS (Para que ninguna rompa el ancho) */
    .kpi-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .kpi-card {
        padding: 15px 10px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    .kpi-card h3 {
        font-size: 1.3rem !important;
        letter-spacing: -0.5px !important;
    }

    .kpi-card label {
        font-size: 0.55rem !important;
        margin-bottom: 5px !important;
    }

    .kpi-card.card-blue {
        grid-column: span 2 !important;
        padding: 20px 15px !important;
    }

    .kpi-card.card-blue h3 {
        font-size: 1.8rem !important;
    }

    .bizum-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .bz-card {
        padding: 15px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .chart-box {
        padding: 15px !important;
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .chart-container {
        height: 220px !important;
        width: 100% !important;
    }

    /* FILTROS DESGLOSE ADAPTADOS A COLUMNA ÚNICA */
    .desglose-filters {
        display: flex !important;
        flex-direction: column !important;
        /* Obliga a los filtros a apilarse verticalmente */
        gap: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .desglose-filters .form-group {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .desglose-body {
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .desglose-sidebar {
        width: 100% !important;
        flex-direction: row !important;
        gap: 12px !important;
        box-sizing: border-box !important;
    }

    .mini-kpi-card {
        flex: 1 !important;
        padding: 15px 10px !important;
        box-sizing: border-box !important;
    }

    .mini-kpi-card h3 {
        font-size: 1.4rem !important;
    }

    /* ⚡ FIX 3: Habilita Scroll Horizontal SOLO en la tabla, protegiendo al contenedor principal */
    .desglose-table-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        /* Limita el ancho de la tabla a la pantalla */
        overflow-x: auto !important;
        /* El scroll horizontal ocurre aquí, no en el body */
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    .stellar-table {
        min-width: 600px !important;
    }

    .stellar-table th {
        padding: 12px 10px !important;
        font-size: 0.6rem !important;
    }

    .stellar-table td {
        padding: 12px 10px !important;
        font-size: 0.75rem !important;
    }

    /* ⚡ EL FIX MÁGICO: Evita que el contenedor de opciones de los selectores desborde */
    .custom-dropdown .dropdown-options {
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 400px) {
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .kpi-card.card-blue {
        grid-column: span 1 !important;
    }

    .desglose-sidebar {
        flex-direction: column !important;
    }
}

/* ========================================= */
/* 🚀 UNIFICACIÓN FUTURISTA DE TODAS LAS TARJETAS (FINANZAS) */
/* ========================================= */
/* Aniquila las rayas gruesas superiores y aplica diseño "Glassmorphism" Premium a todos los bloques */
.kpi-card,
.bz-card,
.chart-box,
.mini-kpi-card,
.desglose-table-wrapper {
    background: var(--card-bg) !important;
    border-radius: 20px !important;
    border: 1px solid var(--border-color) !important;
    border-top: 1px solid var(--border-color) !important;
    /* 🚫 Bloqueo absoluto contra rayas de color viejas */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02), inset 0 2px 10px rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Efecto de levitación magnética al pasar el ratón (PC) */
@media (hover: hover) and (pointer: fine) {

    .kpi-card:hover,
    .bz-card:hover,
    .chart-box:hover,
    .mini-kpi-card:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05), inset 0 2px 10px rgba(255, 255, 255, 0.9) !important;
        border-color: rgba(255, 71, 133, 0.2) !important;
        /* Reflejo sutil del rosa Stellar */
        border-top-color: rgba(255, 71, 133, 0.2) !important;
    }
}

/* 💎 Variación sutil y Premium para las tarjetas de Ingresos (Verde pastel de cristal) */
.mini-kpi-card.outline-green {
    background: rgba(46, 204, 113, 0.02) !important;
    border-color: rgba(46, 204, 113, 0.2) !important;
    border-top-color: rgba(46, 204, 113, 0.2) !important;
}

@media (hover: hover) and (pointer: fine) {
    .mini-kpi-card.outline-green:hover {
        border-color: rgba(46, 204, 113, 0.4) !important;
        border-top-color: rgba(46, 204, 113, 0.4) !important;
        box-shadow: 0 15px 40px rgba(46, 204, 113, 0.08), inset 0 2px 10px rgba(255, 255, 255, 0.9) !important;
    }
}

/* 🌙 MODO OSCURO FUTURISTA */
body.dark-theme .kpi-card,
body.dark-theme .bz-card,
body.dark-theme .chart-box,
body.dark-theme .mini-kpi-card,
body.dark-theme .desglose-table-wrapper {
    background: #12131c !important;
    border-color: #2a2b3d !important;
    border-top-color: #2a2b3d !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 2px 10px rgba(255, 255, 255, 0.02) !important;
}

@media (hover: hover) and (pointer: fine) {

    body.dark-theme .kpi-card:hover,
    body.dark-theme .bz-card:hover,
    body.dark-theme .chart-box:hover,
    body.dark-theme .mini-kpi-card:hover {
        border-color: #3b3d54 !important;
        border-top-color: #3b3d54 !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), inset 0 2px 10px rgba(255, 255, 255, 0.05) !important;
    }
}

body.dark-theme .mini-kpi-card.outline-green {
    background: rgba(46, 204, 113, 0.05) !important;
    border-color: rgba(46, 204, 113, 0.15) !important;
    border-top-color: rgba(46, 204, 113, 0.15) !important;
}

/* ========================================= */
/* 🔍 MODAL DETALLES KPI (FINANZAS)         */
/* ========================================= */
.kpi-card {
    cursor: pointer;
}

.kpi-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease;
}

.kpi-detail-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.04);
}

body.dark-theme .kpi-detail-row {
    background: #181924;
    border-color: #2a2b3d;
}

.kpi-detail-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-detail-concept {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-detail-method {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.kpi-detail-amount {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.amount-in {
    color: #2ecc71;
}

.amount-out {
    color: #e74c3c;
}

.kpi-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-pink);
    margin: 30px 0 12px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-section-title:first-child {
    margin-top: 0;
}

/* ========================================= */
/* 🎨 ESTILOS PREMIUM PARA MENÚS DESPLEGABLES*/
/* ========================================= */

.custom-dropdown {
    position: relative;
    user-select: none;
}

/* El botón principal */
.custom-dropdown .dropdown-selected {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s ease;
    font-weight: 700;
}

/* Efecto al pasar el ratón por el botón principal */
.custom-dropdown .dropdown-selected:hover {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
    /* Cambia el color rgba si tu pink es distinto */
}

/* La flechita */
.custom-dropdown .dropdown-selected span {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

/* Cuando el menú está abierto */
.custom-dropdown.open .dropdown-selected {
    border-color: var(--primary-pink);
}

.custom-dropdown.open .dropdown-selected span {
    transform: rotate(180deg);
    /* Gira la flecha hacia arriba */
}

/* El contenedor de las opciones (Caja oculta) */
.custom-dropdown .dropdown-options {
    position: absolute;
    top: calc(100% + 8px);
    /* Separación del botón */
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;

    /* Animación de entrada inicial oculta */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Efecto de rebote */
}

/* Muestra la caja de opciones al añadir la clase .open */
.custom-dropdown.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Cada opción individual */
.custom-dropdown .dropdown-item {
    padding: 12px 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease, padding-left 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.custom-dropdown .dropdown-item:last-child {
    border-bottom: none;
}

/* Efecto hover en las opciones de la lista */
.custom-dropdown .dropdown-item:hover {
    background: var(--bg-color);
    color: var(--primary-pink);
    padding-left: 20px;
    /* Desplazamiento elegante hacia la derecha */
}



/* ========================================= */
/* 💎 DISEÑO PREMUM & RESPONSIVO (FINANZAS)  */
/* ========================================= */

/* Contenedor general de filtros */
.kpi-filter-bar {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.filter-label {
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 🚀 TRIPLE SWITCH MEJORADO (FLUIDO) */
.triple-switch {
    display: flex;
    position: relative;
    align-items: center;
    background: var(--card-bg);
    border-radius: 30px;
    padding: 4px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    width: 270px;
    height: 38px;
    user-select: none;
}

.ts-option {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    letter-spacing: 0.3px;
}

.ts-option.active {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ts-bubble {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(33.33% - 4px);
    border-radius: 25px;
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), background 0.35s ease;
}

/* Estados de posición de la burbuja */
.triple-switch[data-pos="0"] .ts-bubble {
    transform: translateX(0);
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 3px 8px rgba(46, 204, 113, 0.25);
}

.triple-switch[data-pos="1"] .ts-bubble {
    transform: translateX(100%);
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    box-shadow: 0 3px 8px rgba(155, 89, 182, 0.25);
}

.triple-switch[data-pos="2"] .ts-bubble {
    transform: translateX(200%);
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 3px 8px rgba(52, 152, 219, 0.25);
}

/* 💎 TEXTURAS DROPDOWN PREMIUM */
.premium-dd .dropdown-selected {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    height: 38px;
    padding: 0 14px;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.premium-dd.open .dropdown-selected {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.premium-dd .dropdown-options {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    margin-top: 6px;
    position: absolute;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.premium-dd.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ========================================= */
/* 📱 REGLAS RESPONSIVAS PARA MÓVILES (MÁX 480px) */
/* ========================================= */
@media (max-width: 480px) {

    /* La barra de filtros pasa a modo vertical ordenado */
    .kpi-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 15px;
    }

    .filter-group {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* El triple switch se expande ocupando todo el ancho de la pantalla táctil */
    .triple-switch {
        width: 100% !important;
    }

    /* Ajustes para el modal en pantallas pequeñas */
    .custom-modal-box {
        width: 100% !important;
        height: 100vh !important;
        border-radius: 0px !important;
        /* Pantalla completa en móviles */
    }

    /* Adaptar las filas de transacciones para que no colapsen los textos */
    .kpi-detail-row {
        padding: 14px 15px !important;
    }

    .kpi-detail-concept {
        font-size: 0.85rem !important;
    }

    .kpi-detail-amount {
        font-size: 1rem !important;
    }

    /* Pequeño reajuste para las cajas de KPIs principales de finanzas */
    .kpi-card {
        padding: 18px 18px !important;
    }

    .kpi-card h3 {
        font-size: 1.8rem !important;
    }
}



/* ========================================== */
/* 📱 RESPONSIVE MÓVIL BOTONES SUPERIORES     */
/* ========================================== */
@media (max-width: 600px) {
    .top-finanzas-btns {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 15px;
    }

    .btn-top-fin {
        width: 100%;
        justify-content: center;
        padding: 12px 10px;
    }
}

/* ========================================== */
/* 🟡 MODAL DINERO EN HOLD                    */
/* ========================================== */

#modal-hold-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    padding: 16px;
    box-sizing: border-box;
}

#modal-hold-overlay.hidden {
    display: none !important;
}

.hold-box-active {
    background: linear-gradient(135deg, #fef9e7 0%, #fcf3cf 100%);
    border: 2px solid #f39c12;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.15);
}

body.dark-theme .hold-box-active {
    background: linear-gradient(135deg, #2b2011 0%, #3d2d14 100%);
    border-color: #d68910;
}

.hold-amount-display {
    font-size: 2.2rem;
    font-weight: 900;
    color: #d68910;
    margin: 5px 0;
}

.hold-info-txt {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Acordeón de historial */
.hold-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.hold-history-header:hover {
    border-color: #f39c12;
}

.hold-history-content {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: var(--card-bg);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    max-height: 260px;
    opacity: 1;
}

.hold-history-content.collapsed {
    max-height: 0;
    opacity: 0;
    border: none;
}

/* Tabla con cabecera fija y bordes limpios */
.hold-table-wrapper {
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
    border-radius: 0 0 12px 12px;
    -webkit-overflow-scrolling: touch;
}

.hold-table-wrapper table {
    width: 100%;
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0;
}

.hold-table-wrapper th {
    position: sticky !important;
    top: 0 !important;
    background: var(--bg-color) !important;
    z-index: 10 !important;
    padding: 10px 12px !important;
    font-size: 0.7rem !important;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.hold-table-wrapper th:first-child {
    border-top-left-radius: 8px;
}

.hold-table-wrapper th:last-child {
    border-top-right-radius: 8px;
}

body.dark-theme .hold-table-wrapper th {
    background: #181924 !important;
}

.hold-table-wrapper td {
    padding: 10px 12px !important;
    font-size: 0.75rem !important;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

/* 📱 ADAPTACIÓN MÓVIL BLINDADA (SIN ESPACIOS VACÍOS) */
@media (max-width: 600px) {
    #modal-hold-overlay {
        padding: 15px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #modal-hold-overlay .custom-modal-box {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        /* ⚡ FIX CRÍTICO: Anula el 100vh que creaba el espacio en blanco enorme */
        min-height: 0 !important;
        max-height: 85vh !important;
        border-radius: 20px !important;
        padding: 20px 16px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    #modal-hold-overlay h3 {
        font-size: 1rem !important;
    }

    #modal-hold-overlay p {
        font-size: 0.65rem !important;
    }

    .hold-input-group {
        flex-direction: column !important;
        gap: 10px !important;
    }

    #hold-input-amount,
    #btn-crear-hold {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    #btn-crear-hold {
        padding: 12px !important;
    }

    .hold-amount-display {
        font-size: 1.8rem !important;
    }

    .hold-table-wrapper {
        max-height: 160px !important;
    }

    .hold-table-wrapper th,
    .hold-table-wrapper td {
        padding: 8px 6px !important;
        font-size: 0.68rem !important;
    }
}

/* ========================================================= */
/* 💎 MODALES INGRESOS/EGRESOS (BOTONES CENTRADOS Y BIZUM)    */
/* ========================================================= */

#ingreso-metodo-group .method-btn.active {
    background: #eafaf1 !important;
    color: #2ecc71 !important;
    border-color: #2ecc71 !important;
}

#egreso-metodo-group .method-btn.active {
    background: #fdf0f0 !important;
    color: #e74c3c !important;
    border-color: #e74c3c !important;
}

#dd-ingreso-bizum .dropdown-selected,
#dd-egreso-bizum .dropdown-selected {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#dd-ingreso-bizum .dropdown-selected span,
#dd-egreso-bizum .dropdown-selected span {
    font-size: 0.9rem !important;
    color: var(--text-main) !important;
    transform: none !important;
}

#dd-ingreso-bizum.open .dropdown-selected,
#dd-egreso-bizum.open .dropdown-selected {
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15);
}

#dd-ingreso-bizum .dropdown-options,
#dd-egreso-bizum .dropdown-options {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999999 !important;
}

#ingreso-bizum-group,
#egreso-bizum-group {
    background: rgba(52, 152, 219, 0.04);
    border: 1px dashed rgba(52, 152, 219, 0.3);
    padding: 14px;
    border-radius: 14px;
    animation: fadeInBizum 0.2s ease forwards;
}

#ingreso-bizum-group.hidden,
#egreso-bizum-group.hidden {
    display: none !important;
}

@keyframes fadeInBizum {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 📱 FORZAR MENÚ COMPACTO Y FLOTANTE EN MÓVIL (CORREGIDO) */
@media (max-width: 900px) {

    /* ⚡ FIX CRÍTICO: Solo aplica flex si NO tiene la clase hidden */
    #modal-ingreso-overlay:not(.hidden),
    #modal-egreso-overlay:not(.hidden) {
        padding: 16px !important;
        align-items: center !important;
        justify-content: center !important;
        display: flex !important;
    }

    #modal-ingreso-overlay .custom-modal-box,
    #modal-egreso-overlay .custom-modal-box {
        position: relative !important;
        bottom: auto !important;
        top: auto !important;
        width: 92% !important;
        max-width: 350px !important;
        height: auto !important;
        max-height: 85vh !important;
        border-radius: 20px !important;
        margin: auto !important;
        padding: 22px 18px !important;
        box-sizing: border-box !important;
        overflow-y: visible !important;
        animation: popInModalMobile 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3) !important;
    }

    /* ⚡ FIX TÁCTIL: Botón X más grande para dedos en pantallas móviles */
    #btn-close-ingreso,
    #btn-close-egreso {
        width: 38px !important;
        height: 38px !important;
        top: 12px !important;
        right: 12px !important;
        background: var(--bg-color) !important;
        z-index: 999999 !important;
        -webkit-tap-highlight-color: transparent;
    }

    @keyframes popInModalMobile {
        from {
            opacity: 0;
            transform: scale(0.9);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    #modal-ingreso-overlay .custom-input,
    #modal-egreso-overlay .custom-input {
        padding: 12px 14px !important;
        font-size: 0.88rem !important;
    }

    #btn-save-ingreso,
    #btn-save-egreso {
        padding: 13px !important;
        font-size: 0.92rem !important;
        margin-top: 12px !important;
    }

    #dd-ingreso-bizum .dropdown-options,
    #dd-egreso-bizum .dropdown-options {
        max-height: 160px !important;
        overflow-y: auto !important;
        width: 100% !important;
    }
}