/**
 * NEUXA — estilos responsive globales (PC, tablet, celular).
 */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* Tablas y paneles anchos */
.table-responsive,
.tabla-scroll,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Touch targets mínimos */
@media (max-width: 768px) {
    button, .btn, .btn-og, .btn-navy, .btn-outline, .sidebar-item, .garaje-tab, a.btn-portal {
        min-height: 40px;
    }
}

/* ── Documentos: sidebar móvil ── */
@media (max-width: 900px) {
    body.docs-app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }
    body.docs-app .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        z-index: 5000;
        width: min(260px, 88vw);
        transition: left 0.28s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    body.docs-app .sidebar.open {
        left: 0;
    }
    body.docs-app .docs-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(10, 35, 66, 0.45);
        z-index: 4999;
    }
    body.docs-app .sidebar.open ~ .docs-sidebar-overlay,
    body.docs-app .docs-sidebar-overlay.open {
        display: block;
    }
    body.docs-app .main {
        width: 100%;
        min-height: 100vh;
    }
    body.docs-app .topbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    body.docs-app .topbar h2 {
        font-size: 0.95rem;
    }
    body.docs-app .topbar .breadcrumb {
        display: none;
    }
    body.docs-app .content {
        padding: 14px 12px;
    }
    body.docs-app .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    body.docs-app .recursos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    body.docs-app .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    body.docs-app .filter-bar select,
    body.docs-app .filter-bar input {
        min-width: 0;
        width: 100%;
    }
    body.docs-app .gtabs {
        width: 100%;
        flex-wrap: wrap;
        overflow-x: auto;
    }
    body.docs-app .modal-card {
        width: 96%;
        max-height: 92vh;
    }
    body.docs-app .alerta-grupo-unidades {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    body.docs-app .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }
    body.docs-app .kpi-value {
        font-size: 1.5rem;
    }
}

/* ── Login ── */
@media (max-width: 768px) {
    .login-wrap, .login-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
    }
}

/* ── Inicio ── */
@media (max-width: 768px) {
    .site-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .header-nav {
        width: 100%;
        justify-content: center;
    }
    .btn-portal {
        flex: 1 1 calc(50% - 6px);
        justify-content: center;
        font-size: 0.62rem;
        padding: 8px 10px;
    }
    .hero h1 {
        font-size: 2rem !important;
        letter-spacing: 2px !important;
    }
    .modules-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 380px) {
    .btn-portal {
        flex: 1 1 100%;
    }
}

/* ── Combustible ── */
@media (max-width: 992px) {
    .main-nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
    }
    .kpi-row, .kpi-grid-comb {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .charts-row {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 576px) {
    .kpi-row, .kpi-grid-comb {
        grid-template-columns: 1fr !important;
    }
    .comb-topbar {
        flex-wrap: wrap;
    }
}

/* ── Reporte mensual ── */
@media (max-width: 768px) {
    .topbar {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px !important;
    }
    .topbar h1 {
        font-size: 0.95rem !important;
        flex: 1 1 100%;
    }
    .filtros-card {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .filtros-card > div[style*="margin-left: auto"] {
        margin-left: 0 !important;
        flex-wrap: wrap;
    }
}

/* ── Garaje: overlay sidebar móvil ── */
@media (max-width: 900px) {
    .garaje-sidebar.open::after {
        content: "";
        position: fixed;
        inset: 0;
        left: 240px;
        background: rgba(10, 35, 66, 0.45);
        z-index: -1;
        pointer-events: none;
    }
}

/* ── Invitado: banner fijo arriba (no rompe layouts flex) ── */
:root {
    --neuxa-invitado-banner-h: 36px;
}

.neuxa-invitado-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 10050;
    background: linear-gradient(90deg, #0a2342, #1e3a5f);
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    padding: 8px 14px;
    letter-spacing: 0.3px;
    line-height: 1.35;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

body.is-invitado {
    padding-top: var(--neuxa-invitado-banner-h) !important;
}

body.is-invitado .neuxa-invitado-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--neuxa-invitado-banner-h);
}

/* Documentos: sidebar y main bajo el banner */
body.is-invitado.docs-app .sidebar {
    height: calc(100vh - var(--neuxa-invitado-banner-h));
    max-height: calc(100vh - var(--neuxa-invitado-banner-h));
}

@media (max-width: 900px) {
    body.is-invitado.docs-app .sidebar {
        top: var(--neuxa-invitado-banner-h);
        height: calc(100vh - var(--neuxa-invitado-banner-h));
    }
}

/* Garaje */
body.is-invitado .garaje-sidebar {
    height: calc(100vh - var(--neuxa-invitado-banner-h));
    max-height: calc(100vh - var(--neuxa-invitado-banner-h));
}

@media (max-width: 900px) {
    body.is-invitado .garaje-sidebar {
        top: var(--neuxa-invitado-banner-h);
        height: calc(100vh - var(--neuxa-invitado-banner-h));
    }
}

/* Inicio: header fijo debajo del banner */
body.is-invitado .site-header {
    top: var(--neuxa-invitado-banner-h);
}

body.is-invitado .write-action {
    display: none !important;
}
