/* Socle visuel commun aux pages MVC historiques (Bootstrap 3 / SB Admin 2). */
:root {
    --ui-primary: #3c8dbc;
    --ui-primary-dark: #367fa9;
    --ui-primary-soft: #eef7fc;
    --ui-border: #d9dee5;
    --ui-muted: #6b7280;
    --ui-surface: #fff;
    --ui-surface-soft: #f7f8fa;
    --ui-radius: 5px;
}

/* En-tête commun des écrans du module Examens. La page des contraintes possède
   déjà sa variante enrichie (onglets et actions), dont ce composant reprend le langage visuel. */
.exam-shared-page-header {
    position: sticky;
    top: 45px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 54px;
    margin: 0 -15px 18px;
    padding: 9px 12px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .08);
}

.exam-shared-page-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
}

.exam-shared-page-icon {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #fff;
    background: var(--ui-primary);
    border-radius: 4px;
    font-size: 16px;
}

.exam-shared-page-heading {
    min-width: 0;
}

.exam-shared-page-heading h1 {
    max-width: 720px;
    margin: 0;
    overflow: hidden;
    color: #333;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-shared-page-heading > span {
    display: block;
    margin-top: 2px;
    color: #777;
    font-size: 11px;
    line-height: 1.2;
}

.exam-shared-centre-filter {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 3px 6px;
    background: #f5f5f5;
    border: 1px solid var(--ui-border);
    border-radius: 4px;
}

.exam-shared-centre-filter[hidden] {
    display: none !important;
}

.exam-shared-centre-filter > label {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    color: #777;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .4px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.exam-shared-centre-filter > label i {
    color: var(--ui-primary);
    font-size: 14px;
}

.exam-shared-centre-control {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 190px;
}

.exam-shared-centre-control .exam-shared-centre-select,
.exam-shared-centre-control .exam-shared-centre-select2 {
    width: 220px !important;
    max-width: 32vw;
    margin: 0 !important;
}

.exam-shared-centre-control .exam-shared-centre-select.form-control {
    height: 28px;
    padding: 3px 24px 3px 8px;
    font-size: 12px;
}

.exam-shared-centre-control .exam-shared-centre-action {
    flex: 0 0 auto;
    min-height: 28px;
    margin: 0;
    padding: 4px 8px;
    font-size: 12px;
    white-space: nowrap;
}

.exam-legacy-header-hidden,
.exam-relocated-control-hidden {
    display: none !important;
}

@media (max-width: 767px) {
    .exam-shared-page-header {
        position: relative;
        top: auto;
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 12px;
    }

    .exam-shared-centre-filter {
        justify-content: space-between;
    }

    .exam-shared-centre-control,
    .exam-shared-centre-control .exam-shared-centre-select,
    .exam-shared-centre-control .exam-shared-centre-select2 {
        width: 100% !important;
        max-width: none;
    }

    .exam-shared-centre-control {
        flex-wrap: wrap;
    }
}

/* En-têtes et surfaces des pages */
h3.page-header.page-header-resize {
    min-height: 42px;
    margin: 24px 0 18px;
    padding: 0 0 10px;
    color: var(--ui-primary) !important;
    border-bottom: 1px solid var(--ui-primary) !important;
    font-size: 22px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

h3.page-header.page-header-resize > a,
h3.page-header.page-header-resize > span:not(.label):not(.badge) {
    color: inherit;
}

.panel,
.well,
.widget-body {
    border-color: var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.panel-default > .panel-heading {
    color: #333;
    background: var(--ui-surface-soft);
    border-color: var(--ui-border);
    font-weight: 600;
}

.table-responsive,
.dataTables_wrapper {
    margin-bottom: 16px;
}

.table-bordered {
    border-color: var(--ui-border);
}

.table > thead > tr > th {
    color: #333;
    background: var(--ui-surface-soft);
    vertical-align: middle;
}

.form-control {
    border-color: #c8ced6;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, .04);
}

.form-control:focus {
    border-color: #66afe9;
    box-shadow: 0 0 0 2px rgba(60, 141, 188, .13);
}

.btn {
    border-radius: 4px;
}

.btn-secondary {
    color: #fff;
    background: #6c757d;
    border-color: #626b73;
}

.btn-secondary:hover,
.btn-secondary:focus {
    color: #fff;
    background: #5a6268;
    border-color: #545b62;
}

/* Modales Bootstrap standardisées. Les modales métier avec leurs propres classes
   gardent la priorité grâce à leurs sélecteurs plus spécifiques. */
.modal-content {
    background: var(--ui-surface);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 8px 28px rgba(28, 39, 49, .28);
}

.modal-content .modal-header {
    min-height: 55px;
    padding: 16px 20px;
    color: #fff;
    background: var(--ui-primary);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
}

.modal-content .modal-header.modal-header-danger {
    background: #d9534f;
    border-bottom-color: #d43f3a;
}

.modal-content .modal-header.modal-header-warning {
    background: #f0ad4e;
    border-bottom-color: #eea236;
}

.modal-content .modal-header .modal-title,
.modal-content .modal-header [class*="modal-title"] {
    margin: 0;
    padding-right: 34px;
    color: #fff !important;
    font-size: 18px;
    font-weight: 600;
    line-height: 23px;
}

.modal-content .modal-header .close {
    position: relative;
    z-index: 1;
    margin-top: -3px;
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    text-shadow: none;
    opacity: .82;
}

.modal-content .modal-header .close:hover,
.modal-content .modal-header .close:focus {
    color: #fff;
    opacity: 1;
    outline: 2px solid rgba(255, 255, 255, .45);
    outline-offset: 2px;
}

.modal-content .modal-body {
    padding: 20px;
    color: #333;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    color: #3f4650;
    font-weight: 600;
}

.modal-content .modal-footer,
.modal-body > form > .modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 12px 20px;
    background: var(--ui-surface-soft);
    border-top: 1px solid var(--ui-border);
    border-radius: 0 0 7px 7px;
}

/* Plusieurs anciennes vues ajoutent inutilement une grille entre modal-content
   et les trois sections de la modale. On neutralise ses marges sans modifier le HTML. */
.modal-content > .row {
    margin-right: 0;
    margin-left: 0;
}

.modal-content > .row > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
}

.modal-footer.btn-full-right {
    padding-right: 20px;
}

.modal-footer .btn + .btn {
    margin-left: 0;
}

.modal-footer .btn {
    min-width: 92px;
}

.modal-footer .btn .fa,
.modal-footer .btn .glyphicon {
    margin-right: 4px;
}

.modal-backdrop.in {
    opacity: .55;
}

/* Variantes de confirmation déjà utilisées dans les écrans de surveillance. */
#modal-confirm-email .modal-content .modal-header {
    background: #f0ad4e;
    border-bottom-color: #eea236;
}

#modal-confirm-salles .modal-body p,
#modal-confirm-email .modal-body p {
    margin: 10px 0;
    line-height: 1.6;
}

.modal-body .radio label {
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
}

.modal-body .radio input[type="radio"] {
    margin-right: 8px;
}

.modal-body #div-autre-post {
    margin-top: 15px;
    padding: 15px;
    background: var(--ui-surface-soft);
    border-left: 3px solid var(--ui-primary);
    border-radius: 4px;
}

@media (max-width: 767px) {
    h3.page-header.page-header-resize {
        margin-top: 18px;
        font-size: 19px;
    }

    .modal-dialog,
    .modal-dialog.modal-lg {
        width: auto;
        margin: 10px;
    }

    .modal-content .modal-header,
    .modal-content .modal-body,
    .modal-content .modal-footer,
    .modal-body > form > .modal-footer {
        padding-right: 15px;
        padding-left: 15px;
    }

    .modal-footer .btn {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.fade .modal-dialog,
    .btn,
    .form-control {
        transition: none !important;
    }
}
