:root { color-scheme: light; --green:#1a7f37; --orange:#b35c00; --red:#c92a2a; --bg:#f5f6f8; --card:#ffffff; --border:#d9dce1; --text:#1b1f24; }
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--bg); color: var(--text); }
header.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); }
header.topbar nav { display: flex; gap: 16px; align-items: center; }
a.logo { font-weight: 700; text-decoration: none; color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 24px; }
.button { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; cursor: pointer; font: inherit; }
.button.primary { background: #1c4ed8; color: #fff; border-color: #1c4ed8; }
.button.secondary { background: #eef0f3; }
.link-button { background: none; border: none; color: inherit; cursor: pointer; text-decoration: underline; padding: 0; font: inherit; }
form { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 12px 0; }
form.mp-checkbox, .mp-server-admin form { max-width: none; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-checkbox { flex-direction: row; align-items: center; gap: 6px; }
details.mp-badge-toggle { border: 1px solid var(--border); border-radius: 8px; margin: 8px 0; background: var(--card); }
details.mp-badge-toggle summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; list-style-position: outside; }
details.mp-badge-toggle summary::marker { color: #8a8f98; }
.mp-badge-state { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eef0f3; color: #555; }
.mp-badge-state-on { background: var(--green); color: #fff; }
.mp-badge-fields { padding: 4px 14px 14px 14px; border-top: 1px solid var(--border); }
.mp-subfield { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; margin-left: 22px; padding-top: 8px; }
.mp-subfield input { flex: 1; max-width: 320px; }
.mp-service-picker { margin-left: 22px; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.mp-subfield-label { font-size: 13px; font-weight: 600; }
.mp-service-check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; max-width: 420px; }
.mp-service-picker .notice { font-size: 13px; margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
input, select { padding: 8px; border-radius: 6px; border: 1px solid var(--border); font: inherit; }
.password-field { display: flex; align-items: stretch; gap: 6px; }
.password-field input { flex: 1; }
.password-toggle { display: flex; align-items: center; justify-content: center; width: 38px; border: 1px solid var(--border); border-radius: 6px; background: #eef0f3; cursor: pointer; padding: 0; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.password-toggle[aria-pressed="true"] svg { stroke: #1c4ed8; }
.auth-card { max-width: 420px; margin: 40px auto; background: var(--card); padding: 24px; border-radius: 10px; border: 1px solid var(--border); }
.success { color: var(--green); }
.error { color: var(--red); }
.notice { color: #555; font-size: 14px; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.mp-client { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.mp-server { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 12px 0; }
.mp-server.mp-disabled { opacity: .5; }
.mp-server-silent { border: 2px solid var(--red); }
.mp-agent-alert { background: var(--red); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; margin: 8px 0; }
/* Grille de largeur égale : tous les badges d'une même carte ont la même largeur. */
.mp-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin: 8px 0; align-items: start; }
.mp-badge { border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-width: 0; background: #fafbfc; }
.mp-badge h3 { margin: 0 0 8px; display: flex; justify-content: space-between; align-items: center; font-size: 15px; }
.mp-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #eee; }
.mp-level-green { border-color: var(--green); } .mp-level-green .mp-tag { background: var(--green); color: #fff; }
.mp-level-orange { border-color: var(--orange); } .mp-level-orange .mp-tag { background: var(--orange); color: #fff; }
.mp-level-red { border-color: var(--red); } .mp-level-red .mp-tag { background: var(--red); color: #fff; }
.mp-metrics, .mp-services { list-style: none; padding: 0; margin: 8px 0; }
.mp-metrics li { display: flex; justify-content: space-between; }
.mp-services li.mp-ok::before { content: "● "; color: var(--green); }
.mp-services li.mp-bad::before { content: "● "; color: var(--red); }
.mp-folder-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mp-folder { border-top: 1px solid var(--border); padding-top: 8px; }
.mp-folder:first-child { border-top: none; padding-top: 0; }
.mp-folder-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; word-break: break-all; }
.mp-gauge { display: flex; height: 8px; border-radius: 999px; background: #e6e8eb; overflow: hidden; margin: 6px 0; }
.mp-gauge-fill { height: 100%; flex-shrink: 0; }
.mp-gauge-fill.mp-gauge-green { background: var(--green); }
.mp-gauge-fill.mp-gauge-orange { background: var(--orange); }
.mp-gauge-fill.mp-gauge-red { background: var(--red); }
.mp-gauge-fill.mp-gauge-folder { background: #1c4ed8; }
.mp-gauge-fill.mp-gauge-other { background: #9aa1ab; }
.mp-tv .mp-gauge { background: #2a2f36; }
.mp-gauge-w0{width:0%}.mp-gauge-w5{width:5%}.mp-gauge-w10{width:10%}.mp-gauge-w15{width:15%}.mp-gauge-w20{width:20%}.mp-gauge-w25{width:25%}.mp-gauge-w30{width:30%}.mp-gauge-w35{width:35%}.mp-gauge-w40{width:40%}.mp-gauge-w45{width:45%}.mp-gauge-w50{width:50%}.mp-gauge-w55{width:55%}.mp-gauge-w60{width:60%}.mp-gauge-w65{width:65%}.mp-gauge-w70{width:70%}.mp-gauge-w75{width:75%}.mp-gauge-w80{width:80%}.mp-gauge-w85{width:85%}.mp-gauge-w90{width:90%}.mp-gauge-w95{width:95%}.mp-gauge-w100{width:100%}
.mp-gauge-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 0 0 6px; font-size: 11px; color: #555; }
.mp-gauge-legend li { display: flex; align-items: center; gap: 4px; }
.mp-swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; border: 1px solid var(--border); }
.mp-swatch-folder { background: #1c4ed8; border-color: #1c4ed8; }
.mp-swatch-other { background: #9aa1ab; border-color: #9aa1ab; }
.mp-swatch-free { background: #e6e8eb; }
.mp-tv .mp-gauge-legend { color: #b8bfc9; }
.mp-tv .mp-swatch-free { background: #2a2f36; }
.mp-token { background: #111; color: #0f0; padding: 12px; border-radius: 6px; overflow-wrap: anywhere; }
/* Un clic sélectionne toute la commande : il ne reste qu'à copier. */
.mp-command { white-space: pre-wrap; user-select: all; -webkit-user-select: all; cursor: text; }
.mp-enrolled { color: var(--green); font-size: 14px; margin: 0 0 8px; }
.mp-tv { background: #0b0d10; color: #fff; }
.mp-tv header { display: flex; justify-content: space-between; padding: 20px 32px; }
/* Une ligne par serveur, badges côte à côte : tient sur un écran HD pour un client type. */
.mp-tv-grid { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 0 32px 32px; }
.mp-tv-server { background: #171b20; border-radius: 10px; padding: 16px; }
.mp-tv .mp-badge { background: #12151a; color: #fff; }
.mp-tv-offline { margin: 0 32px 16px; }
/* Vue TV sur écran HD (1920×1080) : badge Messagerie compact — une ligne par boîte sur deux
   colonnes, les 8 plus remplies (tri décroissant côté serveur), sans textes d'aide. */
.mp-tv .mp-m365 .mp-metrics { display: flex; gap: 24px; margin: 0 0 6px; }
.mp-tv .mp-m365 .mp-metrics li { gap: 8px; }
.mp-tv .mp-m365 .mp-mailbox-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 24px; }
.mp-tv .mp-m365 .mp-folder { border-top: none; padding-top: 0; }
.mp-tv .mp-m365 .mp-folder-head { font-size: 12px; word-break: normal; }
.mp-tv .mp-m365 .mp-folder-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-tv .mp-m365 .mp-folder-head > span:last-child { flex-shrink: 0; white-space: nowrap; }
.mp-tv .mp-m365 .mp-folder-head small { display: none; }
.mp-tv .mp-m365 .mp-gauge { height: 4px; margin: 2px 0 0; }
.mp-tv .mp-m365 .notice { display: none; }
.mp-tv .mp-m365 > small { display: block; margin-top: 6px; font-size: 11px; color: #b8bfc9; }
/* Boîtes mail : badge pleine largeur, toutes les boîtes en colonnes (tableau de bord et TV). */
.mp-m365 { grid-column: 1 / -1; }
.mp-m365 .mp-mailbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 20px; }
.mp-m365 .mp-mailbox-list .mp-folder { border-top: none; padding-top: 0; }
/* Dossiers : espace disque commun affiché une seule fois sous la liste. */
.mp-disk-summary { border-top: 1px solid var(--border); padding-top: 8px; }
/* Pourcentages et valeurs alignés à droite d'une ligne : jamais coupés. */
.mp-folder-head > strong { white-space: nowrap; flex-shrink: 0; }
/* Vue TV : toute la largeur de l'écran (pas de colonne de lecture centrée). */
.mp-tv main.mp-tv-grid { max-width: none; margin: 0; }
/* Vue TV : badges étirés sur toute la ligne, en-tête et titres resserrés. */
.mp-tv .mp-badges { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.mp-tv header { padding: 12px 32px; align-items: center; }
.mp-tv header h1 { margin: 0; }
.mp-tv-server h2 { margin: 0 0 10px; }
/* Ligne d'avancement de sauvegarde : coupure entre les mots seulement. */
.mp-backup-progress .mp-folder-head { word-break: normal; }
/* Restauration sélective */
.mp-backup-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.mp-backup-actions form { margin: 0; }
.mp-restore-actions { display: flex; gap: 8px; margin: 8px 0 16px; }
.mp-restore-crumbs { margin: 12px 0 6px; font-size: 14px; }
.mp-restore-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mp-restore-table td, .mp-restore-table th { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.mp-restore-table td:first-child { width: 28px; }
.mp-restore-selection, .mp-restore-jobs { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mp-restore-job { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.mp-job-failed { border-color: var(--red, #c62828); }
.mp-job-success { border-color: var(--green, #2e7d32); }
/* L'attribut hidden l'emporte toujours (les boutons ont un display propre). */
[hidden] { display: none !important; }
/* Jauge d'attente animée (durée inconnue) : l'utilisateur voit que l'opération avance. */
.mp-busy { position: relative; height: 6px; margin: 8px 0 12px; border-radius: 999px; background: #e6e8eb; overflow: hidden; }
.mp-busy::before { content: ""; position: absolute; top: 0; left: -35%; width: 35%; height: 100%; border-radius: 999px; background: #1c4ed8; animation: mp-busy 1.3s ease-in-out infinite; }
@keyframes mp-busy { from { left: -35%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .mp-busy::before { animation: none; left: 0; width: 100%; opacity: .45; } }
.mp-restore-wait { color: #555; font-size: 13px; margin: 0; }
.mp-restore-warn { color: #b26a00; font-size: 14px; }
/* Restauration : icônes sobres, total de la sélection */
.mp-ico { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.mp-ico path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.mp-ico-dir { color: #a8740a; }
.mp-ico-file { color: #667085; }
.mp-entry { display: inline-flex; align-items: center; gap: 6px; }
.mp-restore-selection li { display: flex; align-items: center; gap: 6px; }
.mp-restore-total { font-weight: 600; margin: 4px 0 12px; }
/* Badge Sauvegarde : historique compact */
.mp-backup-history { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0 8px; }
.mp-backup-history th, .mp-backup-history td { text-align: left; padding: 2px 4px; border-bottom: 1px solid var(--border); }
.mp-backup-history td:nth-child(n+2), .mp-backup-history th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.mp-tv .mp-backup-history th, .mp-tv .mp-backup-history td { border-color: #2a2f36; }
/* Vue TV sur écran HD : santé et NAS empilés dans une colonne ; dossiers sur une ligne
   (sous-dossiers, fichiers, taille) pour que le serveur tienne avec la messagerie. */
.mp-tv-stack { display: grid; gap: 12px; align-content: start; min-width: 0; }
.mp-tv .mp-badge:not(.mp-m365) .mp-folder .mp-metrics, .mp-tv .mp-disk-summary { display: flex; flex-wrap: wrap; gap: 2px 20px; margin: 2px 0 0; }
.mp-tv .mp-badge:not(.mp-m365) .mp-folder .mp-metrics li, .mp-tv .mp-disk-summary li { justify-content: flex-start; gap: 6px; }
.mp-tv .mp-folder-list { margin: 0; }
.mp-tv .mp-badge:not(.mp-m365) .mp-folder { padding-top: 6px; margin-top: 6px; }
.mp-tv .mp-badge:not(.mp-m365) .mp-folder:first-child { margin-top: 0; }
