:root {
    --red: #D81F26;
    --red-dark: #A3161C;
    --navy: #1F3358;
    --navy-light: #3A5A8F;
    --bg: #f4f6fa;
    --panel: #ffffff;
    --border: #dfe4ee;
    --text: #1c2432;
    --muted: #64708a;
    --green: #1e9e56;
    --green-bg: #e8f6ee;
    --amber: #c98a00;
    --amber-bg: #fff6e5;
    --danger: #c0392b;
    --danger-bg: #fdecea;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--navy-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---- En-tête (logo rouge, identique à la charte "infrastructure") ---- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: #fff;
    border-bottom: 3px solid var(--red);
    padding: 18px 20px;
}
.brand-mark {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-style: italic;
    color: var(--red);
    font-size: 26px;
}
.brand-sub {
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
    margin-left: 8px;
    font-style: normal;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
}
.topbar-right a { color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.topbar-right .role-tag {
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

/* ---- Bandeau d'état global ---- */
.global-banner {
    margin: 22px 0;
    padding: 18px 24px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fafbfd;
}
.global-banner .headline {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.global-banner .subline { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.global-banner .timestamp { color: var(--muted); font-size: 12px; margin-top: 4px; }

.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.dot.operational { background: var(--green); }
.dot.degraded { background: var(--amber); }
.dot.down { background: var(--danger); }
.dot.unknown, .dot.unconfigured { background: #b7c0cf; }

.global-banner.operational { background: var(--green-bg); border-color: #b9e3c9; }
.global-banner.degraded { background: var(--amber-bg); border-color: #f0dca0; }
.global-banner.down { background: var(--danger-bg); border-color: #f0c2bd; }

/* ---- Panneaux ---- */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}
.panel-title {
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 18px;
}
.panel-body { padding: 4px 18px 18px; }

/* ---- Liste des services ---- */
.service-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-name { font-weight: 700; flex: 1; }
.service-latency { color: var(--muted); font-size: 12px; margin-right: 10px; }
.pill {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.pill.operational { background: var(--green-bg); color: var(--green); border-color: #b9e3c9; }
.pill.degraded { background: var(--amber-bg); color: var(--amber); border-color: #f0dca0; }
.pill.down { background: var(--danger-bg); color: var(--danger); border-color: #f0c2bd; }
.pill.unknown, .pill.unconfigured { background: #eef1f6; color: var(--muted); border-color: var(--border); }

/* ---- Frise de disponibilité ---- */
.avail-title { color: var(--navy); font-weight: 700; font-size: 17px; border-bottom: 2px solid var(--red); padding-bottom: 8px; margin: 30px 0 14px; }
.avail-figure { font-size: 14px; margin-bottom: 12px; }
.avail-figure b { font-size: 16px; }
.avail-bar { display: flex; gap: 3px; margin-bottom: 10px; }
.avail-cell { flex: 1; height: 28px; border-radius: 3px; background: #e5e9f0; }
.avail-cell.operational { background: var(--green); }
.avail-cell.degraded { background: var(--amber); }
.avail-cell.down { background: var(--danger); }
.avail-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.avail-legend span { display: inline-flex; align-items: center; gap: 6px; }
.avail-legend .dot { width: 9px; height: 9px; }

/* ---- Espace de fichiers ---- */
.category-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.category-tab {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    border: 1px solid transparent;
}
.category-tab:hover { text-decoration: none; background: #e3e8f1; }
.category-tab.active { background: var(--navy); color: #fff; }
.category-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef1f6;
    color: var(--muted);
    margin-left: 8px;
}
.tag-private { background: var(--danger-bg); color: var(--danger); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

.file-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: none; }
.file-icon { font-size: 22px; width: 30px; text-align: center; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 700; word-break: break-word; }
.file-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn {
    display: inline-block;
    background: var(--navy);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}
.btn:hover { background: var(--navy-light); text-decoration: none; color: #fff; }
.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #a5382c; }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--red-dark); }

.upload-box { background: #fafbfd; border: 1px dashed var(--border); border-radius: 10px; padding: 18px; margin-top: 6px; }
.upload-box select, .upload-box input[type=file] {
    font-family: inherit; font-size: 13.5px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.visibility-choice { margin: 12px 0; font-size: 13.5px; }
.visibility-choice label { margin-right: 18px; }

.empty-note { color: var(--muted); font-size: 13.5px; padding: 10px 0; }
.alert-box { padding: 12px 16px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert-box.success { background: var(--green-bg); color: var(--green); border: 1px solid #b9e3c9; }
.alert-box.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c2bd; }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 30px; }

/* ---- Annonces de maintenance ---- */
.announcement-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid;
}
.announcement-card.info { background: #eef3fb; border-color: #c7d7f0; }
.announcement-card.warning { background: var(--amber-bg); border-color: #f0dca0; }
.announcement-icon { font-size: 20px; flex-shrink: 0; }
.announcement-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.announcement-message { font-size: 13.5px; margin-top: 6px; line-height: 1.5; }
.announcement-window { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---- Historique des incidents ---- */
.incident-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.incident-row:last-child { border-bottom: none; }
.incident-info { flex: 1; min-width: 0; }
.incident-service { font-weight: 700; font-size: 13.5px; }
.incident-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

@media (max-width: 640px) {
    .file-row { flex-wrap: wrap; }
    .avail-bar { overflow-x: auto; }
    .incident-row { flex-wrap: wrap; }
}
