/* =========================================================================
   WINOSOFT SUPERVISOR — styles applicatifs (au-dessus de Bootstrap 5.3)
   Mobile-first · thèmes clair / sombre via [data-bs-theme]
   ========================================================================= */

:root {
    --ws-navy: #0b1530;
    --ws-navy-2: #111d3f;
    --ws-navy-3: #1a2a55;
    --ws-electric: #2563eb;
    --ws-electric-2: #3b82f6;
    --ws-sidebar-w: 264px;
    --ws-topbar-h: 64px;
    --ws-bottom-h: 64px;
    --ws-radius: 14px;

    --bs-primary: #2563eb;
    --bs-primary-rgb: 37, 99, 235;
    --bs-link-color: #2563eb;
    --bs-link-color-rgb: 37, 99, 235;
    --bs-link-hover-color: #1d4ed8;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-bs-theme="light"] {
    --ws-bg: #f3f6fb;
    --ws-card: #ffffff;
    --ws-border: #e3e8f2;
    --ws-muted-tile: #eef3ff;
}

[data-bs-theme="dark"] {
    --ws-bg: #070d1f;
    --ws-card: #0f1830;
    --ws-border: #1e2b4d;
    --ws-muted-tile: #16244a;
    --bs-body-bg: #070d1f;
    --bs-link-color: #60a5fa;
    --bs-link-color-rgb: 96, 165, 250;
    --bs-link-hover-color: #93c5fd;
    --bs-border-color: #1e2b4d;
}

.btn-primary {
    --bs-btn-bg: var(--ws-electric);
    --bs-btn-border-color: var(--ws-electric);
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1e40af;
    --bs-btn-active-border-color: #1e40af;
}
.btn-outline-primary {
    --bs-btn-color: var(--ws-electric);
    --bs-btn-border-color: var(--ws-electric);
    --bs-btn-hover-bg: var(--ws-electric);
    --bs-btn-hover-border-color: var(--ws-electric);
    --bs-btn-active-bg: var(--ws-electric);
    --bs-btn-active-border-color: var(--ws-electric);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #60a5fa; --bs-btn-border-color: #3b82f6; }

body.ws-app { background: var(--ws-bg); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.ws-sidebar {
    background: var(--ws-navy);
    color: #c7d2fe;
    width: var(--ws-sidebar-w);
    display: flex;
    flex-direction: column;
    --bs-offcanvas-width: var(--ws-sidebar-w);
    --bs-offcanvas-bg: var(--ws-navy);
}
.ws-brand {
    display: flex; align-items: center; justify-content: space-between;
    height: var(--ws-topbar-h); padding: 0 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.ws-logo {
    width: 36px; height: 36px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--ws-electric), #60a5fa);
    color: #fff; font-size: 1.15rem;
}
.ws-logo-lg { width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px; }
.ws-brand-text { display: flex; flex-direction: column; line-height: 1.05; color: #fff; }
.ws-brand-text strong { letter-spacing: .06em; font-size: .95rem; }
.ws-brand-text small { letter-spacing: .32em; font-size: .62rem; color: #93c5fd; }

.ws-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1rem; scrollbar-width: thin; }
.ws-nav-section {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    color: #6b7db3; padding: 1rem .7rem .35rem;
}
.ws-nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .7rem; border-radius: 9px;
    color: #c7d2fe; text-decoration: none; font-size: .92rem;
    min-height: 40px;
}
.ws-nav-link i { font-size: 1.05rem; opacity: .85; }
.ws-nav-link:hover { background: var(--ws-navy-2); color: #fff; }
.ws-nav-link.active { background: var(--ws-electric); color: #fff; box-shadow: 0 6px 16px -8px rgba(37, 99, 235, .8); }
.ws-nav-link.active i { opacity: 1; }
.ws-soon {
    margin-left: auto; font-size: .62rem; font-weight: 600;
    padding: .1rem .38rem; border-radius: 6px;
    background: rgba(147, 197, 253, .12); color: #93c5fd;
}
.ws-nav-link.active .ws-soon { background: rgba(255, 255, 255, .2); color: #fff; }
.ws-sidebar-foot { padding: .75rem 1.2rem; font-size: .72rem; color: #4b5d93; border-top: 1px solid rgba(255, 255, 255, .06); }

@media (min-width: 992px) {
    /* Bootstrap force un fond transparent sur .offcanvas-lg en grand écran */
    .ws-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1030; background-color: var(--ws-navy) !important; }
    .ws-sidebar .offcanvas-body, .ws-sidebar { visibility: visible; }
    .ws-main { margin-left: var(--ws-sidebar-w); }
}

/* ---------- Topbar ---------- */
.ws-main { min-height: 100vh; display: flex; flex-direction: column; }
.ws-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .5rem;
    height: var(--ws-topbar-h); padding: 0 .75rem;
    padding-top: env(safe-area-inset-top);
    background: color-mix(in srgb, var(--ws-bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ws-border);
}
.ws-topbar-title { min-width: 0; }
.ws-topbar-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 992px) { .ws-topbar { padding: 0 1.5rem; } }

.btn-icon {
    width: 42px; height: 42px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 0; color: var(--bs-body-color);
}
.btn-icon:hover { background: var(--ws-muted-tile); }
.ws-avatar { background: var(--ws-electric); color: #fff; font-weight: 600; border-radius: 50%; width: 38px; height: 38px; }
.ws-avatar:hover { background: #1d4ed8; color: #fff; }
.ws-dot {
    position: absolute; top: 4px; right: 2px;
    min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
    background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.ws-net-status { font-size: .8rem; color: #b45309; background: #fef3c7; padding: .2rem .55rem; border-radius: 8px; }

[data-bs-theme="dark"] .ws-theme-dark-icon,
[data-bs-theme="light"] .ws-theme-light-icon { display: none; }

/* ---------- Bandeau démo ---------- */
.ws-demo-banner {
    background: repeating-linear-gradient(-45deg, #f59e0b, #f59e0b 12px, #fbbf24 12px, #fbbf24 24px);
    color: #3b2400; font-size: .85rem; text-align: center;
    padding: .4rem .75rem;
}
.ws-demo-banner a { color: #3b2400; font-weight: 600; margin-left: .35rem; }

/* ---------- Contenu ---------- */
.ws-content {
    flex: 1; padding: 1rem .75rem calc(var(--ws-bottom-h) + 1.25rem + env(safe-area-inset-bottom));
    width: 100%; max-width: 1600px;
}
@media (min-width: 992px) { .ws-content { padding: 1.5rem; } }

.ws-card {
    background: var(--ws-card);
    border: 1px solid var(--ws-border);
    border-radius: var(--ws-radius);
    box-shadow: 0 1px 2px rgba(11, 21, 48, .04);
}
.ws-card-footer { background: transparent; border-top: 1px solid var(--ws-border); padding: .9rem 1rem; }
.ws-card-title { font-weight: 600; margin-bottom: .9rem; }
.ws-card-link { transition: transform .12s ease, border-color .12s ease; }
.ws-card-link:hover { border-color: var(--ws-electric); transform: translateY(-1px); }
.ws-icon-tile {
    flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ws-muted-tile); color: var(--ws-electric); font-size: 1.25rem;
}
[data-bs-theme="dark"] .ws-icon-tile { color: #60a5fa; }
.ws-status-chip { display: inline-block; padding: .1rem .5rem; border-radius: 6px; background: var(--ws-muted-tile); color: var(--bs-body-color); }

/* ---------- KPI ---------- */
.ws-kpi-label { font-size: .8rem; color: var(--bs-secondary-color); font-weight: 500; }
.ws-kpi-icon { color: var(--ws-electric); font-size: 1.1rem; }
[data-bs-theme="dark"] .ws-kpi-icon { color: #60a5fa; }
.ws-kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin-top: .35rem; line-height: 1.15; }
.ws-kpi-sub { font-size: .78rem; color: var(--bs-secondary-color); }
@media (min-width: 576px) { .ws-kpi-value { font-size: 1.9rem; } }
[data-kpi="load"] .ws-kpi-value { font-size: 1.15rem; white-space: nowrap; }
@media (min-width: 576px) { [data-kpi="load"] .ws-kpi-value { font-size: 1.55rem; } }
.ws-progress { height: 6px; background: var(--ws-muted-tile); }
.ws-progress .progress-bar { background: var(--ws-electric); transition: width .6s ease; }
.ws-progress .progress-bar.ws-warn { background: #f59e0b; }
.ws-progress .progress-bar.ws-crit { background: #dc2626; }

.ws-chart { position: relative; height: 220px; }
.ws-chart-lg { height: 260px; }

.ws-mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 768px) { .ws-mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .ws-mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ws-mini {
    display: flex; gap: .65rem; align-items: center;
    padding: .6rem .7rem; border-radius: 10px; background: var(--ws-muted-tile);
}
.ws-mini > i { color: var(--ws-electric); font-size: 1.1rem; }
[data-bs-theme="dark"] .ws-mini > i { color: #60a5fa; }
.ws-mini-label { font-size: .72rem; color: var(--bs-secondary-color); }
.ws-mini-value { font-weight: 600; font-size: .95rem; }

.ws-service { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; padding: .25rem .6rem; border-radius: 20px; border: 1px solid var(--ws-border); }
.ws-service::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #16a34a; }
.ws-service.down::before { background: #dc2626; }

.ws-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.ws-live-dot.on { background: #16a34a; box-shadow: 0 0 0 0 rgba(22, 163, 74, .6); animation: ws-pulse 2s infinite; }
.ws-live-dot.demo { background: #f59e0b; }
.ws-live-dot.off { background: #dc2626; }
@keyframes ws-pulse { 70% { box-shadow: 0 0 0 7px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@media (prefers-reduced-motion: reduce) { .ws-live-dot.on { animation: none; } }

.ws-period .btn { min-width: 46px; }

/* ---------- Alertes ---------- */
.ws-recent li { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--ws-border); }
.ws-recent li:last-child { border-bottom: 0; }
.ws-prio-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: .4rem; flex-shrink: 0; }
.ws-prio-critical { --ws-prio: #dc2626; }
.ws-prio-high { --ws-prio: #f59e0b; }
.ws-prio-medium { --ws-prio: #0ea5e9; }
.ws-prio-low { --ws-prio: #64748b; }
.ws-prio-dot { background: var(--ws-prio); }
.ws-alert-icon {
    flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ws-prio); background: color-mix(in srgb, var(--ws-prio) 14%, transparent);
}
.ws-alert-list .list-group-item { background: transparent; padding: .9rem 1rem; }
.min-w-0 { min-width: 0; }

/* ---------- Formulaires ---------- */
.ws-switch-list { display: grid; gap: .25rem; }
.ws-switch { padding: .75rem .9rem .75rem 4rem; border: 1px solid var(--ws-border); border-radius: 10px; margin: 0; }
.ws-switch .form-check-input { margin-left: -3.1rem; margin-top: .15em; width: 2.4em; height: 1.3em; cursor: pointer; }
.ws-switch .form-check-label { font-weight: 500; cursor: pointer; }
.ws-switch .form-text { margin-top: .15rem; }
.form-control, .form-select { min-height: 44px; }
.form-control-sm, .form-select-sm { min-height: auto; }
.form-check-input:checked { background-color: var(--ws-electric); border-color: var(--ws-electric); }
.ws-otp { letter-spacing: .35em; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.ws-pre { background: var(--ws-muted-tile); padding: .6rem .75rem; border-radius: 8px; font-size: .78rem; white-space: pre-wrap; }
.ws-secret code { font-size: 1rem; letter-spacing: .05em; }
.ws-qr svg { width: 210px; height: 210px; max-width: 100%; border-radius: 10px; border: 1px solid var(--ws-border); }
.ws-steps { padding-left: 1.2rem; }
.ws-steps li { margin-bottom: .6rem; }
.ws-dl { display: grid; grid-template-columns: max-content 1fr; gap: .55rem 1rem; font-size: .9rem; }
.ws-dl dt { color: var(--bs-secondary-color); font-weight: 500; }
.ws-dl dd { margin: 0; }

/* ---------- Tableaux : cartes sur mobile ---------- */
.table { --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: .75rem 1rem; border-color: var(--ws-border); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); font-weight: 600; }
.ws-row-warn > td { background: color-mix(in srgb, #f59e0b 6%, transparent); }
.ws-details { max-width: 420px; word-break: break-word; }
@media (max-width: 767.98px) {
    .ws-table-cards thead { display: none; }
    .ws-table-cards tr { display: block; border-bottom: 1px solid var(--ws-border); padding: .5rem 0; }
    .ws-table-cards td {
        display: grid; grid-template-columns: minmax(96px, auto) 1fr; column-gap: 1rem;
        border: 0 !important; padding: .3rem 1rem !important; text-align: right;
    }
    .ws-table-cards td > * { grid-column: 2; justify-self: end; max-width: 100%; }
    .ws-table-cards td[data-label]::before {
        content: attr(data-label); grid-column: 1; grid-row: 1 / span 4;
        font-weight: 600; color: var(--bs-secondary-color); text-align: left; font-size: .8rem;
    }
    .ws-table-cards td:not([data-label]) { display: flex; justify-content: flex-end; gap: .35rem; }
    .ws-details { max-width: 60%; }
}

/* ---------- États vides ---------- */
.ws-empty { text-align: center; padding: 3rem 1.5rem; }
.ws-empty > i { font-size: 2.6rem; color: var(--ws-electric); opacity: .8; display: block; margin-bottom: .8rem; }

/* ---------- Barre de navigation basse (mobile) ---------- */
.ws-bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025;
    display: flex; height: calc(var(--ws-bottom-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--ws-card); border-top: 1px solid var(--ws-border);
    box-shadow: 0 -4px 18px rgba(11, 21, 48, .06);
}
.ws-bottom-nav a, .ws-bottom-nav button {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
    color: var(--bs-secondary-color); text-decoration: none; font-size: .68rem;
    background: none; border: 0;
}
.ws-bottom-nav i { font-size: 1.3rem; }
.ws-bottom-nav .active { color: var(--ws-electric); }
[data-bs-theme="dark"] .ws-bottom-nav .active { color: #60a5fa; }
.ws-bottom-nav em {
    position: absolute; top: 6px; left: calc(50% + 6px);
    font-style: normal; font-size: .6rem; font-weight: 700;
    background: #dc2626; color: #fff; border-radius: 8px; padding: 0 .3rem;
}

/* ---------- Connexion ---------- */
body.ws-auth {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
    background: radial-gradient(1200px 600px at 10% -10%, #1e3a8a 0%, transparent 60%), var(--ws-navy);
}
.ws-auth-card {
    width: 100%; max-width: 420px;
    background: var(--ws-card); border-radius: 18px; padding: 2rem 1.5rem;
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .55);
}
@media (min-width: 576px) { .ws-auth-card { padding: 2.5rem 2.25rem; } }
.ws-auth-brand { letter-spacing: .12em; font-size: .95rem; }
.ws-auth-brand strong { color: var(--ws-electric); }
[data-bs-theme="dark"] .ws-auth-brand strong { color: #60a5fa; }

/* ---------- Usage (barres dans les tableaux) ---------- */
.ws-usage { min-width: 140px; }
@media (max-width: 767.98px) { .ws-usage { min-width: 0; width: 60%; } }

/* MySQL : requêtes normalisées */
.ws-sql { max-width: 46rem; white-space: normal; }
.min-w-0 { min-width: 0; }

/* Ressources : barres empilées et cœurs */
.ws-progress-lg { height: 12px; border-radius: 6px; }
.ws-cores { display: flex; gap: 4px; align-items: flex-end; flex-wrap: wrap; }
.ws-core { width: 22px; height: 64px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.ws-core-bar { width: 100%; background: var(--ws-electric); border-radius: 3px 3px 0 0; margin-bottom: 16px; }
.ws-core-bar.ws-warn { background: #f59e0b; }
.ws-core-bar.ws-crit { background: #dc2626; }
.ws-core span { position: absolute; bottom: 0; font-size: .65rem; color: var(--bs-secondary-color); }
.ws-core::before { content: ""; position: absolute; top: 0; bottom: 16px; left: 0; right: 0; background: var(--ws-muted-tile); border-radius: 3px; z-index: -1; }
.ws-core { z-index: 0; }

/* Terminal sécurisé */
.ws-terminal { background: #0b1530; color: #d1e3ff; font-size: .8rem; padding: 1rem; border-radius: 0 0 .75rem .75rem; max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- Tableau de bord : synthèse ---------- */
.ws-sum { border-left: 4px solid var(--ws-border); }
.ws-sum-ok { border-left-color: #16a34a; }
.ws-sum-warning { border-left-color: #f59e0b; }
.ws-sum-critical { border-left-color: #dc2626; }
.ws-sum-none { border-left-color: #94a3b8; }
.ws-sum-icon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--ws-muted-tile); color: var(--ws-electric); }
.ws-sum-ok .ws-sum-icon { color: #16a34a; } .ws-sum-warning .ws-sum-icon { color: #d97706; } .ws-sum-critical .ws-sum-icon { color: #dc2626; }
.ws-sum-value { font-size: 1.3rem; font-weight: 700; color: var(--bs-body-color); margin: .35rem 0 .2rem; font-variant-numeric: tabular-nums; }
.ws-sum-critical .ws-sum-value { color: #dc2626; }
.ws-sum-line { font-size: .78rem; color: var(--bs-secondary-color); line-height: 1.35; }

/* ---------- Mur de supervision ---------- */
.ws-wall {
    --ww-card: rgba(15, 26, 58, .92); --ww-line: rgba(59, 130, 246, .2); --ww-muted: #94a3b8;
    background: radial-gradient(1200px 500px at 10% -10%, rgba(37, 99, 235, .22), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(34, 211, 238, .12), transparent 60%), #050a18;
    color: #e2e8f0; border-radius: 18px; padding: 14px; position: relative;
}
.ws-wall a { color: #93c5fd; }
.ws-wall-bar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 12px; }
.ws-wall-brand { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.ws-wall-title { font-weight: 700; letter-spacing: .3px; }
.ws-wall-badge { font-size: .72rem; padding: .2rem .55rem; border-radius: 999px; background: rgba(34, 211, 238, .12); color: #67e8f9; border: 1px solid rgba(34, 211, 238, .35); }
.ws-wall-status { font-size: .8rem; color: var(--ww-muted); }
.ws-wall-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.ws-wall-clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.05rem; color: #cbd5e1; letter-spacing: .5px; }
.ws-wall-alert { background: rgba(220, 38, 38, .15); border: 1px solid rgba(239, 68, 68, .5); color: #fecaca; border-radius: 10px; padding: .55rem .8rem; font-size: .85rem; margin-bottom: 12px; }
.ws-wall-hint { margin-top: 12px; font-size: .85rem; color: var(--ww-muted); }

.ws-wall-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 992px) { .ws-wall-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(440px, auto); } }

.ws-wcard {
    background: linear-gradient(160deg, rgba(23, 37, 84, .75), var(--ww-card) 55%);
    border: 1px solid var(--ww-line); border-radius: 16px; padding: 16px; position: relative; overflow: hidden;
    display: flex; flex-direction: column; min-height: 0; box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .8);
}
/* Reflet lumineux qui balaie le haut de la carte : indique visuellement que le mur est vivant */
.ws-wcard::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, .9), transparent); background-size: 40% 100%; background-repeat: no-repeat;
    animation: ws-sweep 4s linear infinite;
}
@keyframes ws-sweep { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.ws-wcard.is-down { border-color: rgba(239, 68, 68, .7); animation: ws-alarm 1.6s ease-in-out infinite; }
.ws-wcard.is-down::before { background-image: linear-gradient(90deg, transparent, rgba(239, 68, 68, .95), transparent); }
@keyframes ws-alarm { 50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, .35), 0 0 40px -6px rgba(239, 68, 68, .6); } }

.ws-wcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: 10px; }
.ws-wcard-kicker { font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; color: #60a5fa; font-weight: 600; }
.ws-wcard-name { font-size: 1.25rem; font-weight: 700; color: #f8fafc !important; text-decoration: none; }
.ws-wcard-name:hover { text-decoration: underline; }
.ws-wcard-sub { font-size: .78rem; color: var(--ww-muted); min-height: 1.1em; }
.ws-wcard-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ws-wcard-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ww-muted); border: 2px dashed rgba(148, 163, 184, .25); border-radius: 12px; min-height: 260px; }
.ws-wcard-empty i { font-size: 2.2rem; margin-bottom: .4rem; opacity: .7; }

.ws-state { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.ws-state-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.ws-state-ok { color: #4ade80; background: rgba(22, 163, 74, .14); border: 1px solid rgba(74, 222, 128, .35); }
.ws-state-ok .ws-state-dot { animation: ws-glow 1.8s infinite; box-shadow: 0 0 0 0 rgba(74, 222, 128, .7); }
.ws-state-warn { color: #fbbf24; background: rgba(245, 158, 11, .14); border: 1px solid rgba(251, 191, 36, .35); }
.ws-state-down { color: #f87171; background: rgba(220, 38, 38, .18); border: 1px solid rgba(248, 113, 113, .5); animation: ws-blink 1s steps(2, start) infinite; }
.ws-state-pending { color: #94a3b8; background: rgba(148, 163, 184, .12); border: 1px solid rgba(148, 163, 184, .3); }
@keyframes ws-glow { 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }
@keyframes ws-blink { 50% { opacity: .55; } }

.ws-gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.ws-gauge { position: relative; text-align: center; --g: #3b82f6; }
.ws-gauge.is-warn { --g: #f59e0b; } .ws-gauge.is-crit { --g: #ef4444; }
.ws-gauge svg { width: 100%; max-width: 128px; transform: rotate(-90deg); display: block; margin: 0 auto; }
.ws-gauge-track { fill: none; stroke: rgba(148, 163, 184, .14); stroke-width: 10; }
.ws-gauge-arc { fill: none; stroke: var(--g); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray 1s cubic-bezier(.22, 1, .36, 1), stroke .4s; filter: drop-shadow(0 0 6px var(--g)); }
.ws-gauge-center { position: absolute; left: 50%; top: 0; width: min(100%, 128px); aspect-ratio: 1; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ws-gauge-value { font-size: clamp(1.1rem, 2.1vw, 1.65rem); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ws-gauge-value small { font-size: .55em; margin-left: 1px; color: var(--ww-muted); }
.ws-gauge-label { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--ww-muted); margin-top: 3px; }
.ws-gauge-sub { font-size: .72rem; color: var(--ww-muted); margin-top: 4px; }

.ws-wchart { position: relative; flex: 1; min-height: 140px; }
.ws-wchart-site { min-height: 120px; }
.ws-wstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(148, 163, 184, .12); }
.ws-wstats-4 { grid-template-columns: repeat(4, 1fr); }
.ws-wstats > div { min-width: 0; }
.ws-wstats span { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .6px; color: var(--ww-muted); }
.ws-wstats strong { display: block; font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #f1f5f9; }
.ws-wstats strong.text-warning { color: #fbbf24 !important; } .ws-wstats strong.text-danger { color: #f87171 !important; }

.ws-site-main { display: flex; flex-direction: column; margin-bottom: 4px; }
.ws-bignum { font-size: clamp(2.2rem, 4.2vw, 3.4rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #f8fafc, #93c5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ws-bignum small { font-size: .38em; margin-left: 4px; -webkit-text-fill-color: #94a3b8; }
.ws-bignum-label { font-size: .75rem; color: var(--ww-muted); text-transform: uppercase; letter-spacing: .6px; }
.ws-trend { margin-left: .4rem; text-transform: none; letter-spacing: 0; font-weight: 600; }
.ws-trend.is-up { color: #f87171; } .ws-trend.is-down { color: #4ade80; }

.ws-beats { display: flex; gap: 3px; height: 22px; margin-top: 8px; }
.ws-beat { flex: 1; border-radius: 3px; background: #475569; min-width: 3px; }
.ws-beat-ok { background: linear-gradient(180deg, #4ade80, #16a34a); }
.ws-beat-warn { background: linear-gradient(180deg, #fbbf24, #d97706); }
.ws-beat-down { background: linear-gradient(180deg, #f87171, #dc2626); }
.ws-beat.is-new { animation: ws-pop .8s cubic-bezier(.22, 1, .36, 1); }
@keyframes ws-pop { from { transform: scaleY(.1); opacity: 0; filter: brightness(2); } to { transform: none; opacity: 1; } }

/* Plein écran : la grille occupe tout l'écran, 2 × 2 */
.ws-wall.is-fs { border-radius: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 12px 14px; overflow: hidden; }
.ws-wall.is-fs .ws-wall-grid { flex: 1; min-height: 0; }
@media (min-width: 992px) { .ws-wall.is-fs .ws-wall-grid { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: auto; } }
@media (max-width: 991.98px) { .ws-wall.is-fs { overflow-y: auto; } .ws-wall.is-fs .ws-wall-grid { flex: none; } }
.ws-wall.is-fs .ws-wall-hide-fs { display: none !important; }
.ws-wall.is-fs-css { position: fixed; inset: 0; z-index: 2000; }
body.ws-noscroll { overflow: hidden; }
@media (min-width: 1600px) { .ws-wall.is-fs .ws-wcard-name { font-size: 1.6rem; } .ws-wall.is-fs .ws-wstats strong { font-size: 1.1rem; } }
@media (max-width: 575.98px) { .ws-wstats-4 { grid-template-columns: repeat(2, 1fr); } .ws-wcard { padding: 12px; } }
@media (prefers-reduced-motion: reduce) {
    .ws-wcard::before, .ws-wcard.is-down, .ws-state-down, .ws-state-ok .ws-state-dot, .ws-beat.is-new { animation: none; }
    .ws-gauge-arc { transition: none; }
}
.ws-bignum.is-empty { font-size: 2rem; opacity: .55; }
.ws-wall.is-fs .ws-gauge svg { max-width: min(128px, 11vh); }
.ws-wall.is-fs .ws-gauge-center { width: min(100%, 128px, 11vh); }
.ws-wall.is-fs .ws-gauge-value { font-size: clamp(1rem, 2.4vh, 1.65rem); }
.ws-wall.is-fs .ws-gauge-sub { margin-top: 2px; }
@media (min-width: 992px) { .ws-wall.is-fs .ws-wcard-server .ws-wstats { grid-template-columns: repeat(6, 1fr); } }
.ws-wall.is-fs .ws-wchart { min-height: 70px; }
.ws-wall.is-fs .ws-wcard-head { margin-bottom: 6px; }
.ws-wcard-head { flex-wrap: wrap; }
.ws-wcard-head > .min-w-0 { flex: 1 1 180px; }

/* Bandeau défilant du mur */
.ws-ticker {
    position: relative; overflow: hidden; margin-bottom: 12px; border-radius: 10px;
    background: linear-gradient(90deg, rgba(37, 99, 235, .18), rgba(15, 26, 58, .9) 30%, rgba(15, 26, 58, .9) 70%, rgba(34, 211, 238, .14));
    border: 1px solid rgba(59, 130, 246, .25);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.ws-ticker-track { display: flex; width: max-content; animation: ws-marquee var(--ww-dur, 60s) linear infinite; will-change: transform; }
.ws-ticker:hover .ws-ticker-track { animation-play-state: paused; }
.ws-ticker-group { display: flex; flex-shrink: 0; }
@keyframes ws-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ws-tick { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.1rem; white-space: nowrap; font-size: .9rem; position: relative; }
.ws-tick + .ws-tick::before, .ws-ticker-group + .ws-ticker-group .ws-tick:first-child::before {
    content: ""; position: absolute; left: -2px; top: 50%; width: 4px; height: 4px; border-radius: 50%; background: rgba(148, 163, 184, .5); transform: translateY(-50%);
}
.ws-tick i { color: #60a5fa; }
.ws-tick-label { color: #94a3b8; }
.ws-tick-value { color: #f1f5f9; font-variant-numeric: tabular-nums; }
.ws-tick-ok .ws-tick-value { color: #4ade80; }
.ws-tick-warning .ws-tick-value { color: #fbbf24; }
.ws-tick-critical .ws-tick-value { color: #f87171; }
.ws-tick-critical i { color: #f87171; animation: ws-blink 1s steps(2, start) infinite; }
.ws-wall.is-fs .ws-ticker { margin-bottom: 10px; flex-shrink: 0; }
@media (min-width: 1600px) { .ws-wall.is-fs .ws-tick { font-size: 1.05rem; } }
@media (prefers-reduced-motion: reduce) {
    .ws-ticker-track { animation: none; }
    .ws-ticker { overflow-x: auto; }
    .ws-ticker-group[aria-hidden="true"] { display: none; }
}
.ws-wlegend { position: absolute; top: 0; right: 4px; z-index: 1; display: flex; gap: .7rem; font-size: .7rem; color: #cbd5e1; pointer-events: none; }
.ws-wlegend span::before { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.ws-wlegend-cpu::before { background: #3b82f6; } .ws-wlegend-ram::before { background: #22d3ee; }
.ws-wall.is-fs .ws-gauge svg { max-width: min(128px, 9.5vh); }
.ws-wall.is-fs .ws-gauge-center { width: min(100%, 128px, 9.5vh); }
.ws-wall.is-fs .ws-gauge-label { font-size: .6rem; margin-top: 1px; }
.ws-wall.is-fs .ws-gauges { margin-bottom: 4px; }
.ws-wall.is-fs .ws-wstats { margin-top: 6px; padding-top: 6px; }
.ws-alert-done { opacity: .72; }
.ws-server-switch { display: flex; align-items: center; gap: .35rem; }
.ws-server-switch i { color: var(--ws-electric); }
.ws-server-switch .form-select { max-width: 260px; }
@media (max-width: 575.98px) { .ws-server-switch i { display: none; } .ws-server-switch .form-select { max-width: 130px; } }
