/* Sidebars are fixed overlays: their release scope must not occupy a flex column. */
:where(.carte-isolated, .attestations-page) > [data-ukb-interface="7166"],
:where(.carte-isolated, .attestations-page) > [data-ukb-interface="1536"],
:where(.carte-isolated, .attestations-page) > [data-ukb-interface="7440"],
:where(.carte-isolated, .attestations-page) > [data-ukb-interface="7254"] {
    display: contents !important;
}

@media screen {
    body .carte-isolated.admin-dashboard {
        flex-direction: column;
    }
    body .carte-isolated > .main-content,
    body .attestations-page > .main-content {
        min-width: 0;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    body .carte-isolated > .dashboard-footer {
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }
    body .carte-isolated .selected_st_card,
    body .carte-isolated .filter_st {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    body .carte-isolated .card-export-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
    }
    body .carte-isolated .card-export-actions button {
        min-height: 44px;
        background: #075985 !important;
        color: #fff !important;
        border: 1px solid #38bdf8 !important;
        padding: 8px 12px;
        cursor: pointer;
    }
    body .carte-isolated .card-export-actions button:disabled {
        opacity: 0.65;
        cursor: not-allowed;
    }
    body .carte-isolated .students-table-container select,
    body .carte-isolated .students-table-container .btn-secondary {
        background: #0b1322 !important;
        color: #f1f5f9 !important;
    }
    body .carte-isolated .students-table-container td {
        background: #0f172a !important;
        color: #f1f5f9 !important;
    }
    body .carte-isolated .students-table-container .table-active td {
        background: #164e63 !important;
    }
    body .carte-isolated .card-section {
        overflow-x: auto;
        justify-content: flex-start;
        max-width: 100%;
        padding: 8px 0;
    }
    body .carte-isolated .card-container {
        flex: 0 0 85mm;
        width: 85mm;
        height: 54mm;
        transform: none;
        margin: 0 auto;
    }
    @media (max-width: 991px) {
        body .carte-isolated .container-fluid > .row > .col-md-3,
        body .carte-isolated .container-fluid > .row > .col-md-9 {
            flex: 0 0 100% !important;
            max-width: 100% !important;
            min-width: 0 !important;
        }
    }
}

@media screen {
    :where(.attestations-page) .accessible-dialog-overlay { position: fixed; inset: 0; z-index: 22000; padding: 16px; display: flex; align-items: center; justify-content: center; background: rgba(5,12,25,.8); }
    :where(.attestations-page) .staff-dialog { box-sizing: border-box; max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff !important; color: #172033 !important; }
    :where(.attestations-page) .staff-dialog--notice { width: 100%; max-width: 440px; border-radius: 12px; padding: 24px; margin: 0 !important; font: 15px/1.5 system-ui,sans-serif; }
    :where(.attestations-page) .staff-dialog :is(h2,h3,h4,label,.popup-message,.date-preview,.duration-info) { color: #172033 !important; background: transparent !important; }
    :where(.attestations-page) .staff-dialog :is(input,select,textarea) { box-sizing: border-box; max-width: 100%; color: #172033 !important; background: #fff !important; border: 1px solid #64748b !important; min-height: 36px; }
    :where(.attestations-page) .staff-dialog button { min-width: 36px; min-height: 36px; color: #fff !important; background: #075985 !important; border: 1px solid #075985; }
    :where(.attestations-page) .staff-dialog :is(.cancel,.btn-secondary,.modal-close,.close-btn),:where(.attestations-page) .staff-dialog--notice button[data-modal-cancel] { background: #991b1b !important; border-color: #991b1b; color: #fff !important; }
    :where(.attestations-page) .staff-dialog.mention-popup button, :where(.attestations-page) .staff-dialog.mention-popup button * { color: #fff !important; }
    :where(.attestations-page) .staff-dialog button:disabled { opacity: 1; color: #475569 !important; background: #e2e8f0 !important; border-color: #94a3b8; cursor: not-allowed; }
    :where(.attestations-page) .staff-dialog :is(button,input,select,textarea,a,[tabindex]):focus-visible { outline: 3px solid #2563eb !important; outline-offset: 3px; }
    :where(.attestations-page) .staff-dialog .modal-header { background: #f1f5f9 !important; color: #172033 !important; }
    :where(.attestations-page) .staff-dialog .modal-header > svg { color: #172033 !important; }
    :where(.attestations-page) .staff-dialog .modal-history-header { background: #f1f5f9 !important; color: #172033 !important; }
    :where(.attestations-page) .staff-dialog .popup-actions { display: flex; flex-wrap: wrap; gap: 10px; }
    :where(.attestations-page) .staff-dialog--notice :is(.success-icon,.error-icon,.info-icon) { font-size: 32px; margin: 0 auto 12px; color: #075985; }
    :where(.attestations-page) .staff-dialog--advance > div { background: #f1f5f9 !important; }
    :where(.attestations-page) .staff-dialog--advance :is(div,p,span,strong,small) { color: #172033 !important; }
    :where(.attestations-page) .staff-dialog [role="alert"] { color: #991b1b !important; background: #fff1f2 !important; padding: 12px; }
    :where(.attestations-page) .staff-dialog :is(th) { color: #fff !important; background: #172033 !important; }
    :where(.attestations-page) .staff-dialog :is(td) { color: #172033 !important; background: #fff !important; }
    @media (max-width: 600px) {
        :where(.attestations-page) .staff-dialog { width: calc(100vw - 32px) !important; max-width: calc(100vw - 32px) !important; padding: 16px !important; margin: 0 !important; }
        :where(.attestations-page) .staff-dialog :is(.modal-actions,.date-input-group) { flex-wrap: wrap; }
    }
}
