/* ── HAMBURGER BUTTON ── */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: #15181b;
    color: white;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ── OVERLAY ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {

    /* Mostrar botón hamburguesa */
    .hamburger-btn {
        display: flex !important;
    }

    /* ── SCROLL ── */
    html, body {
        overflow: auto !important;
        height: auto !important;
    }

    /* ── LAYOUT PRINCIPAL ── */
    .app-layout {
        height: auto !important;
        min-height: 100vh;
        flex-direction: column;
        overflow: visible !important;
    }

    /* ── SIDEBAR COMO DRAWER ── */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        min-width: 260px !important;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 600 !important;
        overflow-y: auto !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }

    /* ── ÁREA DE CONTENIDO ── */
    .content-area {
        width: 100% !important;
        flex: 1;
        display: flex !important;
        flex-direction: column !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    /* ── TOPBAR ── */
    .content-topbar {
        padding-left: 64px !important;
        padding-right: 12px !important;
        height: auto !important;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .topbar-sub { display: none !important; }

    /* ── CONTENT BODY ── */
    .content-body {
        overflow: auto !important;
        position: relative !important;
        height: auto !important;
        flex: 1;
    }

    /* ── PANELES ── */
    .panel {
        position: relative !important;
        height: auto !important;
        min-height: calc(100vh - 56px);
        display: none;
    }
    .panel.active {
        display: flex !important;
        flex-direction: column !important;
    }

    /* ── PANEL SCROLL ── */
    .panel-scroll {
        overflow-y: auto !important;
        height: auto !important;
        flex: 1;
        padding: 12px !important;
    }

    /* ── IFRAMES ── */
    #panel-iframe {
        height: auto !important;
        min-height: calc(100vh - 56px);
    }
    #panel-iframe iframe,
    .panel iframe {
        width: 100% !important;
        height: calc(100vh - 56px) !important;
        min-height: 500px;
    }

    /* ── GRIDS FIJOS A RESPONSIVOS ── */
    .informe-grid,
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── TABLAS ── */
    .table-responsive,
    .table-scroll,
    .table-container {
        overflow-x: auto !important;
        display: block !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
    }

    /* ── INPUTS CON ANCHO FIJO ── */
    input[style*="width:"],
    input[style*="width: "],
    select[style*="width:"],
    select[style*="width: "] {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ── BOOTSTRAP GRID OVERRIDES ── */
    .row { margin-left: 0 !important; margin-right: 0 !important; }
    [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Columnas xl que saltan breakpoints */
    .col-xl-4, .col-xl-8, .col-xl-7, .col-xl-5 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* ── CARDS Y PANELES CON PADDING EXCESIVO ── */
    .p-4 { padding: 12px !important; }
    .p-3 { padding: 10px !important; }
    .px-4 { padding-left: 12px !important; padding-right: 12px !important; }

    /* ── MODALES ── */
    .modal-dialog {
        margin: 8px !important;
        max-width: calc(100% - 16px) !important;
    }

    /* ── BOTONES ── */
    .btn-group, .d-flex.gap-2 {
        flex-wrap: wrap !important;
    }
    .multi-sel-btn {
        max-width: 100% !important;
    }

    /* ── STAT CARDS ── */
    .stat-card, .dash-card {
        padding: 12px !important;
    }
}
