.adm-toolbar-toggle { border-color: #e5c158; }
.adm-toolbar-toggle[hidden] { display: none; }
body.adm-on .adm-toolbar-toggle { background: #e5c158; color: #0b2240; }

.adm-views {
    position: fixed; inset: 0; z-index: 9200; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0, 0, 0, .6); color: #0b2240;
    font: 14px 'Helvetica Neue', Arial, sans-serif;
}
.adm-views[hidden] { display: none; }
.adm-views-card {
    width: min(1100px, 100%); max-height: min(90vh, 900px); overflow: auto;
    padding: 20px; border-radius: 8px; background: #fff;
}
.adm-views-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.adm-views-actions { display: flex; gap: 8px; }
.adm-views-header h2 { margin: 0 0 6px; font-size: 20px; }
.adm-views-header p { margin: 0 0 14px; color: #526075; }
.adm-views-close, .adm-views-more {
    padding: 8px 12px; border: 1px solid #0b2240; border-radius: 5px;
    background: #fff; color: #0b2240; font: inherit; cursor: pointer;
}
.adm-views input[type="search"] {
    width: 100%; margin: 8px 0; padding: 9px; border: 1px solid #99a; border-radius: 5px; font: inherit;
}
.adm-views-status { color: #526075; }
.adm-views-table-wrap { overflow-x: auto; }
.adm-views table { width: 100%; border-collapse: collapse; }
.adm-views th, .adm-views td { padding: 9px; border-bottom: 1px solid #d9e0e8; text-align: left; vertical-align: top; }
.adm-views th { position: sticky; top: 0; background: #f2f5f8; }
.adm-views td:last-child, .adm-views th:last-child { white-space: nowrap; }
.adm-views a { color: #0b4b83; overflow-wrap: anywhere; }
.adm-views-name {
    padding: 0; border: 0; background: none; color: #0b4b83; font: inherit; font-weight: 700;
    text-decoration: underline; cursor: pointer; text-align: left; overflow-wrap: anywhere;
}
.adm-views-name:hover { color: #0b2240; }
.adm-views > .adm-views-card > .adm-views-close { margin-bottom: 10px; }
.adm-views-more { margin-top: 12px; }
.adm-views-more:disabled { opacity: .6; cursor: wait; }

/* Signalements et synthèse RETEX */
.adm-fiches .adm-views-card { background: #0f1a18; color: #e4ebe4; border: 1px solid rgba(177, 201, 181, .25); }
.adm-fiches .adm-views-header {
    margin: 0 0 12px; padding: 14px 16px; border: 0; border-radius: 6px; text-align: left;
    background: #1d4a33; color: #ffffff;
}
.adm-fiches .adm-views-header h2 { margin: 0 0 6px; padding: 0; border: 0; color: #ffffff; font-size: 20px; text-transform: none; letter-spacing: 0; }
.adm-fiches .adm-views-header p { margin: 0; color: #e8f2ea; font-size: 14px; font-style: normal; opacity: 1; }
.adm-fiches .adm-views-status, .adm-fiches-discret { color: #c5d3c8; font-size: 13px; }
.adm-fiches .adm-views-close, .adm-fiches .adm-views-more { background: #1d3028; color: #e4ebe4; border-color: rgba(153, 195, 163, .45); }
.adm-fiches .adm-views-more { margin-top: 0; }
.adm-fiches-notifications-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.adm-fiches th { background: #1b2722; color: #f3f6ed; }
.adm-fiches th, .adm-fiches td { border-bottom-color: rgba(177, 201, 181, .2); }
.adm-fiches-filtre { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.adm-fiches-filtre select { padding: 7px; border-radius: 5px; border: 1px solid #99a; font: inherit; }
.adm-fiches-priorite { display: inline-block; margin-top: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.adm-fiches-priorite-info { color: #8fdca0; }
.adm-fiches-priorite-correction { color: #e5c158; }
.adm-fiches-priorite-bloquant { color: #ff8a80; }
.adm-fiches-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.adm-fiches-stat { padding: 14px; border: 1px solid rgba(177, 201, 181, .25); border-radius: 8px; break-inside: avoid; }
.adm-fiches-stat h3 { margin: 0 0 10px; font-size: 16px; color: #f3f6ed; }
.adm-fiches-stat-corps { display: flex; align-items: center; gap: 16px; }
.adm-pie { flex: 0 0 120px; width: 120px; height: 120px; border-radius: 50%; border: 2px solid #fff; }
.adm-fiches-legende { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.adm-fiches-pastille { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
.adm-fiches-commentaires { margin-top: 14px; }
.adm-fiches-commentaires blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid #e5c158; }
.adm-fiches-commentaires blockquote p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .adm-fiches-grille { grid-template-columns: 1fr; } }
@media print {
    body.adm-fiches-print > *:not(#adm-fiches) { display: none !important; }
    body.adm-fiches-print #adm-fiches { position: static; padding: 0; background: none; display: block; }
    body.adm-fiches-print #adm-fiches .adm-views-card {
        max-height: none; overflow: visible; background: #fff; color: #111; border: 0;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    body.adm-fiches-print #adm-fiches h2, body.adm-fiches-print #adm-fiches h3 { color: #111; }
    body.adm-fiches-print .adm-fiches-noprint { display: none !important; }
    body.adm-fiches-print .adm-fiches-discret, body.adm-fiches-print .adm-views-header p { color: #444; }
    body.adm-fiches-print .adm-fiches-stat { border-color: #bbb; }
    body.adm-fiches-print .adm-pie { border-color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.document-view-status {
    position: fixed; left: 12px; right: 12px; bottom: 58px; z-index: 9100; margin: 0 auto;
    max-width: 700px; padding: 12px 16px; border-radius: 6px;
    background: #fff4d6; color: #563d00; box-shadow: 0 2px 12px rgba(0, 0, 0, .2);
}
.document-view-status[hidden] { display: none; }

.adm-bar {
    position: sticky; top: 0; z-index: 5; display: none; flex-wrap: wrap; gap: 6px;
    padding: 8px; margin: 0 0 12px; background: #fff8dc; border: 2px solid #e5c158; border-radius: 6px;
    font: 13px 'Helvetica Neue', Arial, sans-serif;
}
body.adm-on .adm-bar { display: flex; }
.adm-bar button, .adm-row-tools button {
    border: 1px solid #0b2240; background: #fff; color: #0b2240; border-radius: 4px;
    padding: 4px 8px; font-size: 12px; cursor: pointer;
}
.adm-row-tools select {
    border: 1px solid #0b2240; background: #fff; color: #0b2240; border-radius: 4px;
    padding: 3px 4px; font-size: 12px; cursor: pointer;
}
.adm-bar button.adm-save { background: #0b2240; color: #e5c158; }
.adm-bar button.adm-danger, .adm-row-tools button.adm-danger { color: #b3261e; border-color: #b3261e; }
.adm-state { flex-basis: 100%; font-size: 12px; color: #444; }
.adm-state.err { color: #b3261e; font-weight: 600; }

.adm-row-tools { display: none; gap: 3px; margin-left: 6px; flex-wrap: wrap; }
body.adm-on .adm-row-tools { display: inline-flex; }
body.adm-on .mod-body [contenteditable="true"] { outline: 1px dashed rgba(11,34,64,.35); outline-offset: 2px; }
body.adm-on .mod-body a { pointer-events: none; }
body.adm-on .adm-row-tools, body.adm-on .adm-row-tools * { pointer-events: auto; }

#adm-dialog {
    position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.55); padding: 16px;
}
#adm-dialog[hidden] { display: none; }
#adm-dialog form {
    background: #fff; border-radius: 8px; padding: 18px; width: 100%; max-width: 420px;
    font: 14px 'Helvetica Neue', Arial, sans-serif; color: #0b2240;
}
#adm-dialog label { display: block; margin: 10px 0 4px; font-weight: 600; }
#adm-dialog input { width: 100%; padding: 8px; border: 1px solid #99a; border-radius: 4px; font-size: 14px; }
#adm-dialog .adm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#adm-dialog button { padding: 8px 14px; border-radius: 4px; border: 1px solid #0b2240; background: #fff; cursor: pointer; }
#adm-dialog button[type="submit"] { background: #0b2240; color: #e5c158; }

@media (max-width: 560px) {
    .adm-views { padding: 8px; }
    .adm-views-card { max-height: 94vh; padding: 14px; }
    .adm-views-header { flex-direction: column; }
    .adm-views-actions { align-self: flex-end; }
    .adm-views th, .adm-views td { padding: 7px; }
    .adm-views table.adm-views-candidates,
    .adm-views table.adm-views-candidates tbody { display: block; }
    .adm-views table.adm-views-candidates thead { display: none; }
    .adm-views table.adm-views-candidates tr {
        display: block; margin: 0 0 10px; padding: 4px 8px;
        border: 1px solid #d9e0e8; border-radius: 6px;
    }
    .adm-views table.adm-views-candidates td {
        display: flex; justify-content: space-between; gap: 12px;
        border-bottom: 1px solid #edf0f3; white-space: normal;
    }
    .adm-views table.adm-views-candidates td:last-child { border-bottom: 0; }
    .adm-views table.adm-views-candidates td::before {
        flex: 0 0 38%; color: #526075; font-weight: 600; content: attr(data-label);
    }
    .adm-views table.adm-views-candidates .adm-views-name {
        min-width: 0; overflow-wrap: anywhere; text-align: right;
    }
}
