/* ===========================================================================
   Supervision Jordanne FM — feuille de style principale (Phase 1)
   Palette sobre, lisible, orientée salle de contrôle / NOC.
   =========================================================================== */

:root {
    --bg: #0f1115;
    --bg-elev: #161a21;
    --bg-elev-2: #1d222b;
    --border: #2a313d;
    --border-strong: #3a4150;
    --text: #e6e8ee;
    --text-muted: #8a92a3;
    --text-soft: #b4bac8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --info: #38bdf8;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 0.6em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 0.8em; }

code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }

/* ---------- Layout principal (sidebar + main) ---------- */

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-brand {
    padding: 0 1rem 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.sidebar-brand .brand-title { font-weight: 700; font-size: 1rem; }
.sidebar-brand .brand-sub { color: var(--text-muted); font-size: 0.8rem; }

.nav-item {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--text-soft);
    border-left: 3px solid transparent;
}
.nav-item:hover {
    background: var(--bg-elev-2);
    color: var(--text);
    text-decoration: none;
}
.nav-item.active {
    background: var(--bg-elev-2);
    color: var(--text);
    border-left-color: var(--primary);
}
.nav-sub {
    padding-left: 1.75rem;
    font-size: 0.9em;
}
.nav-disabled {
    color: var(--text-muted);
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}
.nav-section {
    padding: 0.75rem 1rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.sidebar-footer {
    margin-top: auto;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.main {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* Variante "auth" : pleine page, sans sidebar */
body.layout-auth .app-shell,
.layout-auth .app-shell {
    grid-template-columns: 1fr;
}
body.layout-auth .sidebar,
.layout-auth .sidebar { display: none; }
body.layout-auth .main,
.layout-auth .main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    min-height: 100vh;
}

/* Flash-stack : en auth, largeur calquée sur la carte (sinon flex étire trop) */
body.layout-auth .flash-stack,
.layout-auth .flash-stack {
    width: 100%;
    max-width: 420px;
}

/* ---------- User chip (sidebar footer) ---------- */

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.user-initials {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; }
.user-name { font-weight: 600; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- Cards ---------- */

.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1rem; }
.card-wide { grid-column: 1 / -1; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    background: var(--bg-elev-2);
    color: var(--text);
    transition: background 0.12s, border-color 0.12s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { background: var(--border); text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
    background: var(--bg-elev-2);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-secondary:hover { background: var(--border); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }

.btn-warning { background: var(--warning); border-color: var(--warning); color: #1a1202; }
.btn-warning:hover { filter: brightness(1.05); }

.btn-success { background: var(--success); border-color: var(--success); color: #05210e; }
.btn-success:hover { filter: brightness(1.05); }

.btn-block { display: flex; width: 100%; }

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.btn-xs { padding: 0.2rem 0.45rem; font-size: 0.75rem; }

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    padding: 0;
    cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }

/* ---------- Forms ---------- */

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; }

.form-control {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.form-inline-control {
    width: auto;
    display: inline-block;
    margin-right: 0.4rem;
}

.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.25rem; }

.form-check { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.form-check label { margin-bottom: 0; font-weight: 400; }

.form-section {
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}
.form-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    grid-column: 1 / -1;
}

.form-static { color: var(--text-soft); padding: 0.3rem 0; }

.inline-form { display: inline-block; margin: 0; }

.filters {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filters .form-group { margin-bottom: 0; }

/* ---------- Auth card ---------- */

.auth-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-md);
}
.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header h1 { margin-bottom: 0.3rem; }
.auth-logo {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 0.4rem;
}
.auth-footer {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- 2FA ---------- */

.code-input {
    letter-spacing: 0.5em;
    font-size: 1.4rem;
    text-align: center;
    font-family: var(--font-mono);
}

.qr-wrapper {
    display: flex;
    justify-content: center;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0 1rem;
}
.qr-wrapper img { display: block; max-width: 220px; height: auto; }

.secret-text {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.setup-2fa .steps {
    margin: 0 0 1.25rem;
    padding-left: 1.2rem;
}
.setup-2fa .steps li { margin-bottom: 0.3rem; }

.backup-codes {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 1rem;
    font-family: var(--font-mono);
    font-size: 1rem;
}
.backup-codes li {
    padding: 0.4rem 0.6rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    letter-spacing: 0.1em;
    text-align: center;
}

/* ---------- Tables ---------- */

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elev);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.table th, .table td {
    padding: 0.65rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th {
    background: var(--bg-elev-2);
    font-weight: 600;
    color: var(--text-soft);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-elev-2); }

.row-disabled { opacity: 0.55; }
.row-disabled td { font-style: italic; }

/* Permissions matrix (role × category × level) */

.table-perms {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0 1rem;
}
.table-perms th, .table-perms td {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    text-align: center;
}
.table-perms th:first-child,
.table-perms td:first-child {
    text-align: left;
    font-weight: 500;
}
.table-perms input[type="radio"] { margin: 0; }

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--bg-elev-2);
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
}
.badge-admin    { background: rgba(239, 68, 68, 0.15);  border-color: var(--danger);  color: #fda4af; }
.badge-operator { background: rgba(59, 130, 246, 0.15); border-color: var(--primary); color: #93c5fd; }
.badge-viewer   { background: rgba(34, 197, 94, 0.15);  border-color: var(--success); color: #86efac; }

.badge-enabled  { background: rgba(34, 197, 94, 0.15);  border-color: var(--success); color: #86efac; }
.badge-disabled { background: rgba(239, 68, 68, 0.15);  border-color: var(--danger);  color: #fda4af; }

/* ---------- Flash messages ---------- */

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elev);
}
.flash-error   { border-color: var(--danger);  background: rgba(239, 68, 68, 0.08);  color: #fecaca; }
.flash-warning { border-color: var(--warning); background: rgba(245, 158, 11, 0.08); color: #fcd34d; }
.flash-info    { border-color: var(--info);    background: rgba(56, 189, 248, 0.08); color: #bae6fd; }
.flash-success { border-color: var(--success); background: rgba(34, 197, 94, 0.08);  color: #bbf7d0; }

/* ---------- Alerts (inline) ---------- */

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--bg-elev-2);
    margin-bottom: 1rem;
}
.alert-info    { border-color: var(--info);    background: rgba(56, 189, 248, 0.07); }
.alert-warning { border-color: var(--warning); background: rgba(245, 158, 11, 0.07); }

/* ---------- Dashboard placeholder (Phase 1) ---------- */

.phase-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-elev);
}

/* ---------- Users list / profile misc ---------- */

.user-meta-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.3rem 1rem;
    margin: 0;
}
.user-meta-list dt { color: var(--text-muted); font-size: 0.85rem; }
.user-meta-list dd { margin: 0; }

/* Tableau de statut des notifications (fiche alerte) */
.notif-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.4rem;
}
.notif-table th,
.notif-table td {
    text-align: left;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
}
.notif-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.danger-zone {
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.05);
    margin-top: 1rem;
}
.danger-zone h3 { color: var(--danger); margin-top: 0; }

.empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ---------- Error pages ---------- */

.error-page {
    text-align: center;
    padding: 3rem 1rem;
}
.error-page h1 {
    font-size: 5rem;
    margin: 0 0 0.25em;
    color: var(--primary);
    font-weight: 700;
}
.error-page p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ---------- Utilities ---------- */

.hidden { display: none !important; }

@media print {
    .sidebar, .flash-stack, .actions, .btn { display: none !important; }
    .app-shell { grid-template-columns: 1fr; }
    body { background: #fff; color: #000; }
    .backup-codes li { border-color: #000; background: #fff; color: #000; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem;
    }
    .sidebar-footer { margin-top: 0; border-top: none; }
    .main { padding: 1rem; }
}

/* ---------- Phase 2 : sources / plugins ---------- */

.grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
}
@media (max-width: 1100px) {
    .grid-2col { grid-template-columns: 1fr; }
}

.tag {
    display: inline-block;
    background: rgba(120, 160, 220, 0.12);
    border: 1px solid rgba(120, 160, 220, 0.3);
    color: #a9c2e6;
    padding: 0.1rem 0.45rem;
    border-radius: 0.6rem;
    font-size: 0.78rem;
    margin: 0 0.15rem 0.15rem 0;
}

.badge-athena   { background: #2b4a7a; color: #dce7f7; }
.badge-studio   { background: #4a2b6b; color: #e3d4f1; }
.badge-infra    { background: #2b6b4a; color: #d4f1e3; }
.badge-podcast  { background: #6b4a2b; color: #f1e3d4; }
.badge-stream   { background: #6b2b4a; color: #f1d4e3; }
.badge-database { background: #2b5a6b; color: #d4ebf1; }
.badge-error    { background: #6b2b2b; color: #f1d4d4; }

/* Phase 4 — badges de sévérité alertes et badges de statut */
.badge-info     { background: #2b5a6b; color: #d4ebf1; }
.badge-warning  { background: #6b5a2b; color: #f1ead4; }
.badge-critical { background: #8a1f1f; color: #ffd4d4; }
.badge-success  { background: #1f5a38; color: #d4f1e3; }

.card-success { border-left: 3px solid #34d399; }
.card-error   { border-left: 3px solid #f87171; }
.card-muted   { border-left: 3px solid #556; opacity: 0.92; }

/* Phase 3 — tuiles d'état et chips UP/DOWN du dashboard */
.card-status h3 { margin-top: 0; }
.status-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    font-size: 1.05rem;
}
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.status-chip.status-up      { background: #10331f; color: #a7e8c4; border-color: #1f5a38; }
.status-chip.status-down    { background: #3a1414; color: #f5b4b4; border-color: #6b2b2b; }
.status-chip.status-unknown { background: #2a2f3a; color: #c8cfde; border-color: #3a404f; }

.table-compact th,
.table-compact td {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.code-block {
    background: #0e141b;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.75rem;
    overflow-x: auto;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: #d6e1ec;
    white-space: pre;
}

/* Phase 4 — tuiles de sévérité sur /alerts */
.severity-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.severity-tiles .tile {
    flex: 1;
    min-width: 180px;
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    background: #151a22;
}
.severity-tiles .tile-count {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.severity-tiles .tile-label {
    margin-top: 0.3rem;
    font-size: 0.9rem;
    color: #8a95a6;
}
.severity-tiles .tile-critical { border-left: 3px solid #f87171; }
.severity-tiles .tile-warning  { border-left: 3px solid #fbbf24; }
.severity-tiles .tile-info     { border-left: 3px solid #60a5fa; }

.danger-zone {
    margin-top: 2rem;
    border-left: 3px solid #f87171;
}

/* ----------------------------------------------------------------------
 * Phase 5 — Graphiques historiques + vue NOC
 * ---------------------------------------------------------------------- */

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.chart-controls select {
    background: #151a22;
    color: var(--text, #eaeaea);
    border: 1px solid var(--border, #2a3340);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
}
.chart-ranges {
    display: inline-flex;
    gap: 0.25rem;
}
.chart-ranges .btn.active {
    background: #2b4a6f;
    border-color: #4a8fcf;
    color: #fff;
}
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}
.chart-container canvas {
    max-width: 100%;
    height: 100% !important;
}

/* ----------------------------------------------------------------------
 * Vue NOC (plein écran, sidebar masquée)
 * ---------------------------------------------------------------------- */

body.layout-noc .main {
    padding: 0;
    max-width: none;
}
body.layout-noc .app-shell {
    display: block;
}

.noc-wrap {
    padding: 1rem 1.2rem;
    min-height: 100vh;
    background: #0a0d12;
    color: #e2e8f0;
}
.noc-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #1e2836;
    margin-bottom: 1rem;
}
.noc-header h1 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: 0.05em;
}
.noc-header-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.noc-clock {
    font-family: ui-monospace, monospace;
    font-size: 1.3rem;
    font-weight: 600;
    color: #5ab4ff;
}

.noc-totals {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.8rem;
    background: #111827;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 600;
}
.noc-total {
    font-size: 1rem;
}
.noc-total-up       { color: #34d399; }
.noc-total-down     { color: #f87171; }
.noc-total-unknown  { color: #9ca3af; }
.noc-total-critical { color: #f87171; }
.noc-total-warning  { color: #fbbf24; }
.noc-total-info     { color: #60a5fa; }

.noc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.9rem;
}
.noc-tile {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
}
.noc-tile-ok       { border-left: 4px solid #34d399; }
.noc-tile-warning  { border-left: 4px solid #fbbf24; }
.noc-tile-critical { border-left: 4px solid #f87171; animation: noc-pulse 2s infinite; }
.noc-tile-empty    { border-left: 4px solid #374151; opacity: 0.6; }

@keyframes noc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.4); }
    50%      { box-shadow: 0 0 10px 2px rgba(248, 113, 113, 0.2); }
}

.noc-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
}
.noc-tile-title {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 1rem;
}
.noc-tile-count {
    color: #9ca3af;
    font-size: 0.85rem;
}
.noc-tile-counters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.noc-chip {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    background: #0f172a;
}
.noc-chip-up      { color: #34d399; }
.noc-chip-down    { color: #f87171; font-weight: 700; }
.noc-chip-unknown { color: #9ca3af; }

.noc-tile-alerts {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.noc-tile-alerts .badge-critical,
.noc-tile-alerts .badge-warning,
.noc-tile-alerts .badge-info {
    font-size: 0.8rem;
}
.noc-tile-sources {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    flex: 1;
}
.noc-tile-sources li {
    padding: 0.15rem 0;
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    border-top: 1px solid #1f2937;
}
.noc-tile-sources li:first-child { border-top: none; }
.noc-tile-sources a {
    color: inherit;
    text-decoration: none;
}
.noc-tile-sources a:hover { color: #5ab4ff; }
.noc-src-down a { color: #f87171; font-weight: 600; }
.noc-src-unknown a { color: #9ca3af; }

.noc-alerts {
    margin-top: 1.2rem;
    background: #111827;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid #1f2937;
}
.noc-alerts h2 {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
}
.noc-alert-critical { background: rgba(248, 113, 113, 0.08); }
.noc-alert-warning  { background: rgba(251, 191, 36, 0.06); }
.noc-alert-info     { background: rgba(96, 165, 250, 0.05); }

.noc-footer {
    margin-top: 0.8rem;
    text-align: right;
    font-size: 0.8rem;
}

.table-compact {
    width: 100%;
    border-collapse: collapse;
}
.table-compact th,
.table-compact td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #1f2937;
    font-size: 0.85rem;
    text-align: left;
}
.table-compact th {
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.03em;
}

/* ------------------------------------------------------------------
   Lecteur audio global (barre flottante fixe en bas)
   ------------------------------------------------------------------ */
.audio-player-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-elev);
    border-top: 1px solid var(--border, #2a313c);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}
.audio-player-bar[hidden] { display: none; }

.audio-player-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 0 1 320px;
}
.audio-player-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.audio-player-title {
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player-el {
    flex: 1 1 auto;
    min-width: 200px;
    height: 36px;
    /* Thème sombre pour les controls natifs (support variable selon navigateur) */
    color-scheme: dark;
}

.audio-player-close {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border, #2a313c);
    color: #cbd5e1;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}
.audio-player-close:hover {
    background: var(--bg-elev-2);
}

/* Petit décalage du contenu principal quand le player est actif
   — évite que le dernier contenu soit masqué par la barre. */
body:has(.audio-player-bar:not([hidden])) .main {
    padding-bottom: 80px;
}

/* Bouton "▶ Écouter" compact dans les tableaux */
.btn-listen {
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    line-height: 1;
}
