/* REGLAS EXCLUSIVAS PARA MÓVILES (OVERRIDE) */
@media (max-width: 991px) {
    body {
        background-image: linear-gradient(rgba(245, 247, 250, 0.4), rgba(245, 247, 250, 0.4)), url('../img/fondomovil.png');
        background-attachment: scroll;
        background-position: center center;
        background-size: cover;
        padding-bottom: 72px;
    }

    body.has-bottom-nav .footer-institucional {
        display: none !important;
    }

    .navbar-institucional .container {
        justify-content: center;
    }

    .navbar-brand {
        margin-right: 0 !important;
    }

    .navbar-brand .nav-logo {
        height: 38px;
    }

    .navbar-brand .nav-slogan {
        height: 30px;
    }

    /* ===== Barra inferior estilo Facebook ===== */
    .app-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1055;
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        height: 58px;
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: #fff;
        border-top: 1px solid #e4e6eb;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    }

    .bottom-nav-item,
    .bottom-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: #65676b;
        text-decoration: none;
        background: none;
        border: none;
        font-size: 0.68rem;
        font-weight: 600;
        padding: 6px 2px;
        position: relative;
        min-width: 0;
    }

    .bottom-nav-item i,
    .bottom-nav-btn i {
        font-size: 1.25rem;
        line-height: 1;
    }

    .bottom-nav-item.is-active,
    .bottom-nav-item.is-active i {
        color: var(--primary-color, #581845);
    }

    .bottom-nav-item .badge-alertas,
    .bottom-nav-btn .badge-alertas,
    .bottom-nav-item .badge-refrendos {
        position: absolute;
        top: 2px;
        right: calc(50% - 18px);
        font-size: 0.62rem;
        min-width: 16px;
        padding: 2px 4px;
    }

    .bottom-nav-label {
        font-size: 0.68rem;
        font-weight: 600;
    }

    /* Sheet de notificaciones estilo Facebook */
    .notif-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1068;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s;
        pointer-events: none;
    }

    .notif-sheet-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .notif-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 82vh;
        background: #fff;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
        z-index: 1070;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        pointer-events: none;
    }

    .notif-sheet.is-open {
        transform: translateY(0);
        pointer-events: auto;
    }

    .notif-sheet-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 16px 12px;
        border-bottom: 1px solid #e4e6eb;
        background: #fff;
        flex-shrink: 0;
    }

    .notif-sheet-header strong {
        font-size: 1.35rem;
        color: #050505;
        letter-spacing: -0.2px;
    }

    .notif-sheet .alertas-lista {
        overflow-y: auto;
        max-height: calc(82vh - 64px);
        padding-bottom: 78px;
        -webkit-overflow-scrolling: touch;
    }

    .notif-sheet .alertas-vacias {
        padding: 0 !important;
    }

    .bottom-nav-btn.btn-campana-alertas:active,
    .bottom-nav-btn.btn-campana-alertas:focus {
        background: transparent;
        color: inherit;
        outline: none;
        box-shadow: none;
        opacity: 1;
    }

    .campana-sheet-mode.is-open .bottom-nav-btn {
        color: #1877f2;
    }

    .mas-sheet-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1058;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s;
    }

    .mas-sheet-backdrop.is-open {
        opacity: 1;
        visibility: visible;
    }

    .mas-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1060;
        background: #fff;
        border-radius: 18px 18px 0 0;
        padding: 8px 0 70px;
        transform: translateY(110%);
        transition: transform 0.28s ease;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    }

    .mas-sheet.is-open {
        transform: translateY(0);
    }

    .mas-sheet-handle {
        width: 40px;
        height: 4px;
        border-radius: 4px;
        background: #ced4da;
        margin: 6px auto 10px;
    }

    .mas-sheet-link {
        display: flex;
        align-items: center;
        padding: 14px 20px;
        color: #212529;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
        font-weight: 500;
        font-family: inherit;
        font-size: inherit;
        background: none;
        border-left: none;
        border-right: none;
        border-top: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }

    /* Tesorería móvil: tarjetas en lugar de tablas anchas */
    .panel-tesoreria-mobile .table-responsive {
        border: 0;
        overflow: visible;
    }

    .panel-tesoreria-mobile table thead {
        display: none;
    }

    .panel-tesoreria-mobile table,
    .panel-tesoreria-mobile tbody,
    .panel-tesoreria-mobile tr,
    .panel-tesoreria-mobile td {
        display: block;
        width: 100%;
    }

    .panel-tesoreria-mobile tr {
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .panel-tesoreria-mobile td {
        border: none !important;
        padding: 8px 0 !important;
    }

    .panel-tesoreria-mobile td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #6c757d;
        margin-bottom: 4px;
    }

    .panel-tesoreria-mobile .teso-acciones .btn,
    .panel-tesoreria-mobile .captura-comprobante-form .btn {
        width: 100%;
        margin-bottom: 6px;
    }

    .panel-tesoreria-mobile .teso-acciones form {
        display: block;
        width: 100%;
    }

    .panel-tesoreria-mobile .card-header {
        font-size: 0.95rem;
    }

    .refrendo-upload-form input[type="file"] {
        max-width: 100% !important;
    }
}
