/**
 * ShapeUp Studios - Status Page Styles
 * Version: 6.2 REACTOR CORE - 3 rings intro, logo image, no-data bars
 */

/* ============================================================
   VARIABILI
   ============================================================ */
:root {
    --brand-color: #F15A24;
    --brand-glow: rgba(241, 90, 36, 0.4);
    --brand-tint: rgba(241, 90, 36, 0.08);

    --bg-primary: #000000;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #141414;
    --bg-overlay: rgba(20, 20, 20, 0.6);

    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --text-dim: #2a2a2a;

    --border-color: #1f1f1f;
    --border-strong: #2a2a2a;
    --border-dashed: rgba(255, 255, 255, 0.06);

    --status-operational: #249b56;
    --status-operational-glow: rgba(36, 155, 86, 0.45);
    --status-operational-tint: rgba(36, 155, 86, 0.08);
    --status-degraded: #f59e0b;
    --status-degraded-glow: rgba(245, 158, 11, 0.45);
    --status-degraded-tint: rgba(245, 158, 11, 0.08);
    --status-down: #dc2626;
    --status-down-glow: rgba(220, 38, 38, 0.45);
    --status-down-tint: rgba(220, 38, 38, 0.06);
    --status-unknown: #888888;
    --status-unknown-glow: rgba(136, 136, 136, 0.3);

    /* Colore delle linee della griglia di sfondo (cambia con il tema) */
    --grid-line: rgba(255, 255, 255, 0.025);

    --accent-primary: var(--brand-color);
    --accent-success: var(--status-operational);
    --accent-error: var(--status-down);
    --accent-warning: var(--status-degraded);
    --accent-info: var(--brand-color);
    --accent-green: var(--status-operational);
    --accent-red: var(--status-down);
    --accent-yellow: var(--status-degraded);
    --accent-blue: var(--brand-color);

    --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;
    --sp-4: 1rem;     --sp-5: 1.25rem;  --sp-6: 1.5rem;
    --sp-8: 2rem;     --sp-10: 2.5rem;  --sp-12: 3rem;
    --sp-16: 4rem;    --sp-20: 5rem;

    --font-display: 'Unbounded', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 100px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafafa;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.7);
    --text-primary: #0a0a0a;
    --text-secondary: #5a5a5a;
    --text-muted: #999999;
    --text-dim: #d4d4d4;
    --border-color: #e5e5e5;
    --border-strong: #d4d4d4;
    --border-dashed: rgba(0, 0, 0, 0.06);
    --brand-tint: rgba(241, 90, 36, 0.04);
    --grid-line: rgba(0, 0, 0, 0.04);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; background: #000; }

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, var(--brand-tint) 0%, transparent 70%),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 100% 100%, 44px 44px, 44px 44px;
    background-attachment: fixed;
}

::selection { background: var(--brand-color); color: var(--bg-primary); }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--sp-8);
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.0s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 1.0s;
}

body.intro-done .container {
    opacity: 1;
    visibility: visible;
    transition: opacity 1.0s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

/* ============================================================
   SPLASH CINEMATIC INTRO - replica del reactor principale
   ============================================================ */
#splash {
    position: fixed;
    inset: 0;
    background-color: #000;
    background-image:
        radial-gradient(ellipse 60% 50% at 50% 50%, rgba(241,90,36,0.06) 0%, transparent 60%),
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 100% 100%, 44px 44px, 44px 44px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--sp-10);
    transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1),
                filter  1.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center center;
    will-change: opacity, filter, transform;
}

#splash.splash-exit {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(22px);
    pointer-events: none;
}

.splash-reactor-wrap {
    position: relative;
    width: 420px;
    height: 420px;
    max-width: 90vw;
    max-height: 90vw;
}

@media (max-width: 600px) {
    .splash-reactor-wrap { width: 320px; height: 320px; }
}

.splash-reactor-wrap svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Tracce dashed (raggi 190, 160, 130 come reactor principale) */
.splash-track {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 3 6;
    opacity: 0;
    animation: trackAppear 0.4s ease-out forwards;
}
.splash-track.t1 { animation-delay: 0.1s; }
.splash-track.t2 { animation-delay: 0.8s; }
.splash-track.t3 { animation-delay: 2.4s; }

@keyframes trackAppear { to { opacity: 1; } }

/* Step 1: anello esterno ARANCIO - archi spezzati come reactor principale */
.splash-ring-outer {
    fill: none;
    stroke: #F15A24;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 80 460;
    stroke-dashoffset: 540;
    filter: drop-shadow(0 0 8px rgba(241, 90, 36, 0.55));
    opacity: 0;
    animation: splashSegmentReveal 1.0s cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}

/* Wrapper che ruota lentamente, come reactor-ring-outer */
.splash-ring-outer-spin {
    transform-origin: 200px 200px;
    animation: splashSpinSlow 16s linear 1.2s infinite;
}

/* Step 2: anello mediano ROSSO - archi spezzati */
.splash-ring-mid {
    fill: none;
    stroke: #dc2626;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 100 380;
    stroke-dashoffset: 480;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.55));
    opacity: 0;
    animation: splashSegmentReveal 1.0s cubic-bezier(0.65, 0, 0.35, 1) 1.3s forwards;
}

/* Wrapper che ruota in senso opposto */
.splash-ring-mid-spin {
    transform-origin: 200px 200px;
    animation: splashSpinReverse 12s linear 2.2s infinite;
}

@keyframes splashSegmentReveal {
    from { opacity: 0; stroke-dashoffset: 540; }
    to   { opacity: 1; stroke-dashoffset: 0; }
}

@keyframes splashSpinSlow {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

@keyframes splashSpinReverse {
    from { transform: rotate(360deg); }
    to   { transform: rotate(0); }
}

/* Step 3: cerchio statico interno (raggio 130) - sottile, fade-in */
.splash-ring-static {
    fill: none;
    stroke: var(--border-strong);
    stroke-width: 1;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 2.4s forwards;
}

@keyframes fadeIn { to { opacity: 1; } }

/* Step 4: markers cardinali, 1 verde + 3 rossi (come reactor in error) */
.splash-marker {
    transform-origin: center;
    transform: scale(0);
    opacity: 0;
    filter: drop-shadow(0 0 6px currentColor);
}
.splash-marker.m1 { fill: #249b56; animation: markerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 2.6s forwards; }
.splash-marker.m2 { fill: #dc2626; animation: markerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 2.8s forwards; }
.splash-marker.m3 { fill: #dc2626; animation: markerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 3.0s forwards; }
.splash-marker.m4 { fill: #dc2626; animation: markerPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 3.2s forwards; }

@keyframes markerPop { to { transform: scale(1); opacity: 1; } }

/* Step 5: nucleo centrale - bordo verde + glow */
.splash-core-glow {
    transform-origin: center;
    transform: scale(0);
    opacity: 0;
    animation: coreExplode 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 3.4s forwards,
               corePulse 3s ease-in-out 4.1s infinite;
}

.splash-core-bg,
.splash-core-border {
    transform-origin: center;
    transform: scale(0);
    opacity: 0;
    animation: coreExplode 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 3.6s forwards;
}

@keyframes coreExplode { to { transform: scale(1); opacity: 1; } }
@keyframes corePulse {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}

/* Step 6: readout dentro nucleo con testo scansione */
.splash-loading-readout {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 4.0s forwards;
}

/* ============================================================
   EFFETTI EXTRA SPLASH (1000x piu' figo)
   ============================================================ */

/* HUD corner brackets attorno al reactor */
.splash-hud-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 0 solid #F15A24;
    box-shadow: 0 0 10px rgba(241, 90, 36, 0.5);
    opacity: 0;
    animation: hudCornerIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.splash-hud-corner.tl { top: -18px; left: -18px; border-top-width: 2px; border-left-width: 2px; animation-delay: 0.05s; }
.splash-hud-corner.tr { top: -18px; right: -18px; border-top-width: 2px; border-right-width: 2px; animation-delay: 0.15s; }
.splash-hud-corner.bl { bottom: -18px; left: -18px; border-bottom-width: 2px; border-left-width: 2px; animation-delay: 0.25s; }
.splash-hud-corner.br { bottom: -18px; right: -18px; border-bottom-width: 2px; border-right-width: 2px; animation-delay: 0.35s; }

@keyframes hudCornerIn {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}

/* Sweep laser sul perimetro esterno (raggio 205) */
.splash-sweep-spin {
    transform-origin: 200px 200px;
    opacity: 0;
    animation: sweepFadeIn 0.5s ease-out 1.8s forwards,
               sweepRotate 1.5s linear 1.8s infinite;
}

.splash-sweep {
    fill: none;
    stroke: #F15A24;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 18 1270;
    filter: drop-shadow(0 0 8px #F15A24) drop-shadow(0 0 16px rgba(241, 90, 36, 0.6));
}

@keyframes sweepFadeIn { to { opacity: 1; } }
@keyframes sweepRotate {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

/* Ripple shockwaves dal nucleo quando si accende */
.splash-ripple {
    fill: none;
    stroke: #249b56;
    stroke-width: 2;
    transform-origin: center;
    transform: scale(1);
    opacity: 0;
    filter: drop-shadow(0 0 6px rgba(36, 155, 86, 0.5));
}
.splash-ripple.r1 { animation: rippleOut 2.0s ease-out 3.4s forwards; }
.splash-ripple.r2 { animation: rippleOut 2.0s ease-out 3.7s forwards; }
.splash-ripple.r3 { animation: rippleOut 2.0s ease-out 4.0s forwards; }

@keyframes rippleOut {
    0%   { transform: scale(1);   opacity: 0.85; stroke-width: 3; }
    100% { transform: scale(2.6); opacity: 0;    stroke-width: 0.4; }
}

/* Sequence counter in alto a destra dello splash */
.splash-sequence {
    position: absolute;
    top: 28px;
    right: 32px;
    font-family: var(--font-mono);
    text-align: right;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
}

.splash-seq-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.splash-seq-value {
    font-size: 0.95rem;
    color: var(--brand-color);
    font-weight: 700;
    letter-spacing: 0.15em;
    text-shadow: 0 0 6px rgba(241, 90, 36, 0.5);
}

/* Coordinate decorative in basso a sinistra */
.splash-coords {
    position: absolute;
    bottom: 32px;
    left: 32px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.8;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
}

.splash-coords .coord-row span {
    color: var(--brand-color);
    margin-right: 6px;
    font-weight: 700;
}

/* Console log sotto al reactor */
.splash-console {
    width: 100%;
    max-width: 360px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.7;
    min-height: 95px;
    text-align: left;
    padding: 0 var(--sp-3);
    margin-top: var(--sp-2);
}

/* Outer dotted orbit (raggio 245, fuori dal reactor) */
.splash-outer-orbit-spin {
    transform-origin: 200px 200px;
    opacity: 0;
    animation: outerOrbitFadeIn 0.6s ease-out 0.5s forwards,
               outerOrbitRotate 35s linear 0.5s infinite;
}
.splash-outer-orbit {
    fill: none;
    stroke: var(--brand-color);
    stroke-width: 1;
    stroke-dasharray: 4 14;
    opacity: 0.4;
}
@keyframes outerOrbitFadeIn { to { opacity: 1; } }
@keyframes outerOrbitRotate {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

/* Data dots che lampeggiano random sui cerchi */
.splash-data-dot {
    opacity: 0;
    filter: drop-shadow(0 0 3px currentColor);
    animation: dataDotBlink 2.4s ease-in-out infinite;
}
.splash-data-dot.d1 { animation-delay: 0.0s; }
.splash-data-dot.d2 { animation-delay: 0.3s; }
.splash-data-dot.d3 { animation-delay: 0.7s; }
.splash-data-dot.d4 { animation-delay: 1.0s; }
.splash-data-dot.d5 { animation-delay: 1.3s; }
.splash-data-dot.d6 { animation-delay: 1.6s; }
.splash-data-dot.d7 { animation-delay: 1.9s; }
.splash-data-dot.d8 { animation-delay: 2.1s; }

@keyframes dataDotBlink {
    0%, 100% { opacity: 0; transform: scale(0.6); }
    20%      { opacity: 0.9; transform: scale(1); }
    40%      { opacity: 0.3; transform: scale(0.8); }
    60%      { opacity: 0.7; transform: scale(1); }
    80%      { opacity: 0.1; transform: scale(0.7); }
}

/* HUD System nominal (in alto a sinistra) */
.splash-system {
    position: absolute;
    top: 28px;
    left: 32px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.6s forwards;
}

.sys-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-operational);
    box-shadow: 0 0 8px var(--status-operational), 0 0 14px rgba(36,155,86,0.6);
    animation: sysLedBlink 1.4s ease-in-out infinite;
}

@keyframes sysLedBlink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

.sys-text { color: var(--text-primary); font-weight: 700; }

/* HUD Telemetry (in basso a destra) - valori live */
.splash-telemetry {
    position: absolute;
    bottom: 32px;
    right: 32px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-align: right;
    line-height: 1.9;
    opacity: 0;
    animation: fadeIn 0.5s ease-out 0.9s forwards;
    min-width: 165px;
}

.tele-row {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    align-items: baseline;
}

.tele-label {
    color: var(--text-muted);
    font-weight: 600;
}

.tele-value {
    color: var(--text-primary);
    font-weight: 700;
    min-width: 72px;
    text-align: right;
}

.tele-value.live-good {
    color: var(--status-operational);
    text-shadow: 0 0 6px rgba(36,155,86,0.5);
}

@media (max-width: 600px) {
    .splash-telemetry, .splash-system { font-size: 0.55rem; }
    .splash-system   { top: 16px; left: 16px; }
    .splash-telemetry { bottom: 16px; right: 16px; min-width: 130px; }
}

/* ============================================================
   EXPIRY TAB (SSL/Domain/DNS badges)
   ============================================================ */
.expiry-table th {
    text-align: left;
}

.expiry-table td {
    vertical-align: top;
    padding: var(--sp-4) var(--sp-4);
}

.expiry-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid;
    line-height: 1.3;
}

.expiry-badge.expiry-good {
    color: var(--status-operational);
    border-color: var(--status-operational);
    background: var(--status-operational-tint);
}

.expiry-badge.expiry-warn {
    color: var(--status-degraded);
    border-color: var(--status-degraded);
    background: var(--status-degraded-tint);
    animation: badgeWarnPulse 2s ease-in-out infinite;
}

.expiry-badge.expiry-critical {
    color: var(--status-down);
    border-color: var(--status-down);
    background: var(--status-down-tint);
    animation: badgeCriticalPulse 1.2s ease-in-out infinite;
    text-shadow: 0 0 6px var(--status-down-glow);
}

.expiry-badge.expiry-unknown {
    color: var(--text-muted);
    border-color: var(--text-muted);
    background: rgba(136,136,136,0.06);
}

@keyframes badgeWarnPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.65; }
}

@keyframes badgeCriticalPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.7; transform: scale(1.04); }
}

/* ============================================================
   FINE EFFETTI EXTRA
   ============================================================ */

.console-line {
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.console-line.is-typed {
    opacity: 1;
    transform: translateX(0);
}

.console-line .arrow {
    color: var(--brand-color);
    font-weight: 700;
    margin-right: 6px;
}

.console-line .ok {
    color: var(--status-operational);
    margin-left: 6px;
    font-weight: 700;
}

.console-line .pending {
    color: var(--status-degraded);
    margin-left: 6px;
    font-weight: 700;
    animation: blinkSlow 1s steps(2) infinite;
}

@keyframes blinkSlow { 50% { opacity: 0.3; } }

@media (max-width: 600px) {
    .splash-sequence, .splash-coords { font-size: 0.55rem; }
    .splash-sequence { top: 16px; right: 16px; }
    .splash-coords   { bottom: 16px; left: 16px; }
    .splash-hud-corner { width: 20px; height: 20px; }
    .splash-console { font-size: 0.6rem; max-width: 280px; }
}

.splash-loading-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: var(--sp-3);
}

.splash-loading-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: opacity 0.25s ease;
    text-align: center;
    max-width: 220px;
    line-height: 1.1;
}

.splash-loading-dots {
    margin-top: var(--sp-3);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.4em;
    color: var(--brand-color);
}

.splash-loading-dots::after {
    content: '. . .';
    animation: dotsBlink 1.2s steps(4, end) infinite;
}

@keyframes dotsBlink {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '. .'; }
    75%  { content: '. . .'; }
    100% { content: ''; }
}

@media (max-width: 600px) {
    .splash-loading-text { font-size: 0.85rem; max-width: 160px; }
    .splash-loading-label { font-size: 0.55rem; }
}

/* Step 7: logo immagine + subtitle sotto il reactor */
.splash-textblock {
    text-align: center;
    opacity: 0;
    transform: translateY(15px);
    animation: textRise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 4.2s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-5);
    margin-top: var(--sp-3);
}

.splash-logo-img {
    height: 44px;
    width: auto;
    display: block;
    max-width: 70vw;
}

@media (max-width: 480px) {
    .splash-logo-img { height: 30px; }
}

.splash-subtitle {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    opacity: 0;
    animation: textFade 0.5s ease-out 4.6s forwards;
    position: relative;
    padding-top: var(--sp-3);
}

.splash-subtitle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand-color), transparent);
    box-shadow: 0 0 6px rgba(241, 90, 36, 0.5);
}

@keyframes textRise { to { opacity: 1; transform: translateY(0); } }
@keyframes textFade { to { opacity: 1; } }

@media (max-width: 480px) {
    .splash-subtitle { font-size: 0.55rem; letter-spacing: 0.25em; }
}

/* ============================================================
   HEADER - logo immagine
   ============================================================ */
header {
    padding: var(--sp-8) 0 var(--sp-6);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    position: relative;
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.6s ease 0.1s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

body.intro-done header { opacity: 1; transform: translateY(0); }

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--brand-color);
    box-shadow: 0 0 12px var(--brand-glow);
}

.header-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.brand-logo {
    height: 38px;
    width: auto;
    display: block;
    max-width: 60vw;
}

.logo-divider {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.lang-switcher {
    display: flex;
    gap: var(--sp-1);
    background: var(--bg-secondary);
    padding: var(--sp-1);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    align-items: center;
}

.lang-btn {
    padding: var(--sp-2) var(--sp-3);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.lang-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.lang-btn.active { background: var(--brand-color); color: var(--bg-primary); font-weight: 700; }

.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: var(--sp-3);
    padding-left: var(--sp-3);
    border-left: 1px solid var(--border-color);
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

.toggle-switch::before {
    content: '🌙';
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    font-size: 0.85rem;
    transition: all var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .toggle-switch { background: var(--brand-color); }
[data-theme="light"] .toggle-switch::before { content: '☀️'; left: auto; right: 5px; }
[data-theme="light"] .toggle-switch::after { left: calc(100% - 22px); }

/* ============================================================
   REACTOR HERO
   ============================================================ */
.status-hero {
    padding: var(--sp-12) 0 var(--sp-10);
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.3s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

body.intro-done .status-hero { opacity: 1; transform: translateY(0); }

.reactor-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 480px;
    margin: 0 auto var(--sp-6);
}

@media (max-width: 600px) {
    .reactor-container { max-width: 320px; height: 320px; }
}

.reactor-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.reactor-svg .ring-track {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 3 6;
}

.reactor-svg .ring-arc-brand {
    fill: none;
    stroke: var(--brand-color);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 80 460;
    filter: drop-shadow(0 0 6px var(--brand-glow));
}

.reactor-svg .ring-arc-status {
    fill: none;
    stroke: var(--status-color, var(--status-operational));
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 400 130;
    opacity: 0.8;
    filter: drop-shadow(0 0 6px var(--status-color-glow, var(--status-operational-glow)));
}

.reactor-svg .ring-static { fill: none; stroke: var(--border-strong); stroke-width: 1; }

.reactor-svg .reactor-markers circle { fill: var(--text-secondary); }
.reactor-svg .reactor-markers .marker-up { fill: var(--status-operational); }
.reactor-svg .reactor-markers .marker-warn { fill: var(--status-degraded); }
.reactor-svg .reactor-markers .marker-down { fill: var(--status-down); }

.reactor-svg .reactor-core-bg { fill: var(--bg-primary); }

.reactor-svg .reactor-core-border {
    fill: none;
    stroke: var(--status-color, var(--status-operational));
    stroke-width: 2;
    filter: drop-shadow(0 0 10px var(--status-color-glow, var(--status-operational-glow)));
}

.reactor-ring-outer {
    transform-origin: 200px 200px;
    animation: reactorSpinSlow 60s linear infinite;
}

.reactor-ring-mid {
    transform-origin: 200px 200px;
    animation: reactorSpinReverse 45s linear infinite;
}

@keyframes reactorSpinSlow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes reactorSpinReverse { from { transform: rotate(360deg); } to { transform: rotate(0); } }

.reactor-core-glow { animation: reactorPulse 3.2s ease-in-out infinite; }
@keyframes reactorPulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

.reactor-readout {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.readout-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.25em;
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
}

.readout-value {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 900;
    color: var(--status-color, var(--status-operational));
    line-height: 1;
    letter-spacing: -0.04em;
    text-shadow: 0 0 30px var(--status-color-glow, var(--status-operational-glow));
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.readout-value span.unit { font-size: 1.75rem; opacity: 0.6; }
.readout-value.no-data { color: var(--text-secondary); text-shadow: none; }

/* Placeholder smussato per "nessun dato" */
.bar-placeholder {
    display: inline-block;
    width: 80px;
    height: 14px;
    border-radius: 7px;
    background: var(--text-muted);
    opacity: 0.45;
    vertical-align: middle;
    animation: barPulse 2.5s ease-in-out infinite;
}

.bar-placeholder-sm {
    width: 36px;
    height: 5px;
    border-radius: 3px;
    opacity: 0.35;
}

@keyframes barPulse {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.7; }
}

.readout-state {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    margin-top: var(--sp-3);
    text-transform: uppercase;
    font-weight: 600;
}

@media (max-width: 600px) {
    .readout-value { font-size: 2.75rem; min-height: 2.75rem; }
    .readout-value span.unit { font-size: 1.25rem; }
    .bar-placeholder { width: 55px; height: 10px; }
}

.reactor-side-stat {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    font-family: var(--font-mono);
}

.reactor-side-left { left: -20px; }
.reactor-side-right { right: -20px; }

@media (max-width: 800px) {
    .reactor-side-left { left: 0; }
    .reactor-side-right { right: 0; }
}

@media (max-width: 600px) { .reactor-side-stat { display: none; } }

.side-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--sp-1);
}

.side-value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.side-value.critical {
    color: var(--status-down);
    text-shadow: 0 0 12px var(--status-down-glow);
}

.hero-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-2);
    text-transform: uppercase;
}

.hero-title em {
    font-style: normal;
    color: var(--status-color, var(--status-operational));
    text-shadow: 0 0 20px var(--status-color-glow, var(--status-operational-glow));
}

.hero-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

@media (max-width: 600px) { .hero-title { font-size: 1.5rem; } }

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-6);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    margin-top: var(--sp-4);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-operational);
    box-shadow: 0 0 12px var(--status-operational-glow);
    animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.operational { background: var(--status-operational); box-shadow: 0 0 12px var(--status-operational-glow); }
.status-dot.warning     { background: var(--status-degraded);    box-shadow: 0 0 12px var(--status-degraded-glow); }
.status-dot.error       { background: var(--status-down);        box-shadow: 0 0 12px var(--status-down-glow); }

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.2); }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ============================================================
   SERVICES GRID - 3 colonne, stagger reveal
   ============================================================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
    padding: var(--sp-8) 0 var(--sp-12);
}

@media (max-width: 900px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .services-grid { grid-template-columns: 1fr; }
}

.service-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--status-operational);
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
                border-color var(--transition),
                box-shadow var(--transition);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(25px);
}

.service-card.is-revealed { opacity: 1; transform: translateY(0); }

.service-card.is-warning  { border-top-color: var(--status-degraded); }
.service-card.is-error    { border-top-color: var(--status-down); }
.service-card.is-unknown  { border-top-color: var(--status-unknown); }

.service-card:hover {
    border-color: var(--brand-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(241, 90, 36, 0.15);
}

.service-card.is-error:hover {
    border-color: var(--status-down);
    box-shadow: 0 8px 32px var(--status-down-glow);
}

.service-card.is-warning:hover {
    border-color: var(--status-degraded);
    box-shadow: 0 8px 32px var(--status-degraded-glow);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.service-header > div:first-child { min-width: 0; flex: 1; }

.service-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--sp-1);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    letter-spacing: -0.01em;
}

.service-url {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.service-status {
    padding: var(--sp-1) var(--sp-3);
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
}

.service-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
}

.service-card.is-error .service-status::before {
    animation: dotPulse 1s ease-in-out infinite;
}

.service-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
    padding-top: var(--sp-4);
    border-top: 1px dashed var(--border-color);
}

.metric { text-align: center; min-width: 0; }

.metric-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--sp-1);
    letter-spacing: -0.01em;
    min-height: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: var(--font-mono);
    font-weight: 600;
}

/* ============================================================
   SECTION HEADER + MAINTENANCE + HISTORY
   ============================================================ */
.section-header {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--sp-6);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.section-header::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--brand-color);
    box-shadow: 0 0 8px var(--brand-glow);
}

.section-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-strong), transparent);
}

.maintenance-section,
.history-section {
    margin: var(--sp-16) 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.maintenance-section.is-revealed,
.history-section.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.maintenance-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--brand-color);
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    margin-bottom: var(--sp-4);
    transition: all var(--transition);
}

.maintenance-card:hover { border-color: var(--brand-color); }

.maintenance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    margin-bottom: var(--sp-3);
    flex-wrap: wrap;
}

.maintenance-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.maintenance-date {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.maintenance-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

.history-timeline {
    position: relative;
    padding-left: var(--sp-8);
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-strong);
}

.history-item {
    position: relative;
    margin-bottom: var(--sp-6);
    padding: var(--sp-4) var(--sp-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.history-item:hover { border-color: var(--border-strong); }

.history-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--sp-8) - 5px);
    top: var(--sp-5);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--brand-color);
    box-shadow: 0 0 0 3px var(--bg-primary), 0 0 10px var(--brand-glow);
}

.history-item.incident::before    { background: var(--status-down);        box-shadow: 0 0 0 3px var(--bg-primary), 0 0 10px var(--status-down-glow); }
.history-item.operational::before { background: var(--status-operational); box-shadow: 0 0 0 3px var(--bg-primary), 0 0 10px var(--status-operational-glow); }
.history-item.maintenance::before { background: var(--status-degraded);    box-shadow: 0 0 0 3px var(--bg-primary), 0 0 10px var(--status-degraded-glow); }

.history-date {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-bottom: var(--sp-2);
    font-family: var(--font-mono);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 600;
}

.history-item.incident .history-date    { color: var(--status-down); }
.history-item.operational .history-date { color: var(--status-operational); }
.history-item.maintenance .history-date { color: var(--status-degraded); }

.history-title {
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: var(--sp-2);
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.history-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    margin-top: var(--sp-20);
    padding: var(--sp-8) 0 var(--sp-6);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.6s ease;
}

footer.is-revealed { opacity: 1; }

.last-updated { display: inline-block; margin-top: var(--sp-3); }

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    margin-top: var(--sp-4);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-decoration: none;
    transition: all var(--transition);
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.admin-link:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-color);
    color: var(--brand-color);
}

/* ============================================================
   ADMIN - login + dashboard, ora con logo immagine
   ============================================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-8);
}

.login-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--sp-12);
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--brand-color);
    box-shadow: 0 0 12px var(--brand-glow);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-8);
}

.login-logo .brand-logo { height: 42px; }

.login-logo .logo-divider {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
}

.form-group { margin-bottom: var(--sp-5); }

label {
    display: block;
    margin-bottom: var(--sp-2);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: var(--sp-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    transition: all var(--transition);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

textarea { min-height: 120px; resize: vertical; font-family: var(--font-display); }

.btn {
    padding: var(--sp-3) var(--sp-5);
    background: var(--brand-color);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 24px var(--brand-glow); }
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { border-color: var(--brand-color); box-shadow: 0 4px 16px var(--brand-tint); }

.btn-small { padding: var(--sp-2) var(--sp-3); font-size: 0.75rem; width: auto; }

.btn-danger { background: var(--status-down); color: #ffffff; }
.btn-danger:hover { box-shadow: 0 6px 24px var(--status-down-glow); }

.error {
    background: var(--status-down-tint);
    border: 1px solid var(--status-down);
    color: var(--status-down);
    padding: var(--sp-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.success-message {
    background: var(--status-operational-tint);
    border: 1px solid var(--status-operational);
    color: var(--status-operational);
    padding: var(--sp-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.admin-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--sp-5) var(--sp-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-6);
    flex-wrap: wrap;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.admin-logo .brand-logo { height: 30px; }

.admin-logo .logo-divider {
    font-size: 0.7rem;
    letter-spacing: 0.25em;
}

.header-actions { display: flex; gap: var(--sp-4); align-items: center; }

.view-site {
    color: var(--brand-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    letter-spacing: 0.05em;
}

.view-site:hover { text-decoration: underline; }

.tabs {
    display: flex;
    gap: var(--sp-2);
    margin-bottom: var(--sp-8);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tab {
    padding: var(--sp-3) var(--sp-5);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--brand-color); border-bottom-color: var(--brand-color); }

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--sp-6);
    margin-bottom: var(--sp-5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border-color);
    gap: var(--sp-4);
    flex-wrap: wrap;
    align-items: center;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

th {
    text-align: left;
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-mono);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: var(--sp-4);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-display);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-tertiary); }

.status-badge {
    display: inline-block;
    padding: var(--sp-1) var(--sp-3);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.status-active {
    background: var(--status-operational-tint);
    color: var(--status-operational);
    border: 1px solid var(--status-operational);
}

.status-inactive {
    background: rgba(136, 136, 136, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
}

/* ============================================================
   WORKSPACE SWITCHER (header admin) + POWERED BY (footer pubblico)
   ============================================================ */
.workspace-switcher {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    position: relative;
}

.ws-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
}

.ws-dropdown { position: relative; }

.ws-current {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--transition);
}

.ws-current:hover { border-color: var(--brand-color); }

.ws-current.ws-fixed { cursor: default; }
.ws-current.ws-fixed:hover { border-color: var(--border-color); }

.ws-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
    flex-shrink: 0;
}

.ws-caret {
    color: var(--text-muted);
    margin-left: var(--sp-2);
    font-size: 0.7rem;
    transition: transform var(--transition);
}

.ws-menu.open ~ .ws-current .ws-caret,
.ws-dropdown:has(.ws-menu.open) .ws-caret { transform: rotate(180deg); }

.ws-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    padding: var(--sp-2);
    display: none;
    z-index: 500;
}

.ws-menu.open { display: block; }

.ws-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 0.85rem;
    transition: background var(--transition);
}

.ws-item:hover { background: var(--bg-tertiary); }
.ws-item.active { background: var(--brand-tint); font-weight: 700; }

.ws-item-name { flex: 1; }

.ws-item-slug {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.ws-menu-footer {
    margin-top: var(--sp-2);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border-color);
}

.ws-manage {
    display: block;
    padding: var(--sp-2) var(--sp-3);
    color: var(--brand-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ws-manage:hover { background: var(--brand-tint); border-radius: var(--radius-sm); }

/* Powered by ShapeUp nel footer pubblico dei tenant non-root */
.powered-by {
    margin-top: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.powered-by a {
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
}

.powered-by a:hover { text-decoration: underline; }

/* ============================================================
   ADMIN MISSION CONTROL OVERVIEW
   ============================================================ */
.admin-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    margin-bottom: var(--sp-8);
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--sp-5);
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-color);
    box-shadow: 0 0 10px var(--brand-glow);
}

.stat-card.stat-status::before { background: var(--status-color, var(--status-operational)); box-shadow: 0 0 10px var(--status-color, var(--status-operational)); }
.stat-card.stat-incidents::before { background: var(--status-down); box-shadow: 0 0 10px var(--status-down-glow); }
.stat-card.stat-maint::before { background: var(--status-degraded); box-shadow: 0 0 10px var(--status-degraded-glow); }

.stat-card:hover {
    border-color: var(--brand-color);
    transform: translateY(-2px);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: var(--sp-3);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: var(--sp-2);
}

.stat-value.critical {
    color: var(--status-down);
    text-shadow: 0 0 16px var(--status-down-glow);
    animation: criticalPulse 2s ease-in-out infinite;
}

@keyframes criticalPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

.stat-value-sm {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-color);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: var(--sp-2);
}

.stat-value-sm.muted { color: var(--text-muted); }

.stat-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--sp-2);
}

.stat-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: ledBlink 1.5s ease-in-out infinite;
}

@keyframes ledBlink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.stat-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.meta-good  { color: var(--status-operational); font-weight: 700; }
.meta-muted { color: var(--text-muted); }

/* ============================================================
   SPARKLINE INLINE (mini chart 24h uptime)
   ============================================================ */
.sparkline {
    display: inline-block;
    vertical-align: middle;
    width: 110px;
    height: 26px;
}

.inline-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid;
}

.inline-status.operational { color: var(--status-operational); border-color: var(--status-operational); background: var(--status-operational-tint); }
.inline-status.warning     { color: var(--status-degraded);    border-color: var(--status-degraded);    background: var(--status-degraded-tint); }
.inline-status.error       { color: var(--status-down);        border-color: var(--status-down);        background: var(--status-down-tint); }
.inline-status.unknown     { color: var(--text-muted);         border-color: var(--text-muted);         background: rgba(136,136,136,0.06); }

/* ============================================================
   LIVE MONITOR (tab monitor con feed terminal-style)
   ============================================================ */
.live-monitor {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--sp-4);
    max-height: 600px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.monitor-line {
    display: grid;
    grid-template-columns: 90px 28px 1fr 100px 80px;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    transition: background var(--transition);
}

.monitor-line:hover { background: var(--bg-elevated); }
.monitor-line:last-child { border-bottom: none; }

.monitor-line .ml-time      { color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.05em; }
.monitor-line .ml-icon      { font-size: 0.9rem; text-align: center; }
.monitor-line .ml-service   { color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monitor-line .ml-status    { font-weight: 700; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.1em; }
.monitor-line .ml-rt        { color: var(--text-secondary); text-align: right; font-size: 0.72rem; }

.monitor-line.s-operational .ml-status { color: var(--status-operational); }
.monitor-line.s-warning     .ml-status { color: var(--status-degraded); }
.monitor-line.s-error       .ml-status { color: var(--status-down); }
.monitor-line.s-unknown     .ml-status { color: var(--text-muted); }

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-operational);
    box-shadow: 0 0 8px var(--status-operational-glow);
    animation: liveDotPulse 1.4s ease-in-out infinite;
    display: inline-block;
}

@keyframes liveDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(1.3); }
}

/* ============================================================
   FLOATING PROFILE (bottom-left, sempre visibile)
   ============================================================ */
.floating-profile {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.floating-profile:hover {
    border-color: var(--brand-color);
    box-shadow: 0 8px 24px var(--brand-glow);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-color), #c43e15);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--brand-glow);
}

.profile-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.profile-name {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.profile-status {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.05em;
}

.profile-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-operational);
    box-shadow: 0 0 6px var(--status-operational);
    animation: ledBlink 1.5s ease-in-out infinite;
}

.profile-logout {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.profile-logout:hover {
    background: var(--status-down);
    color: #fff;
    border-color: var(--status-down);
    box-shadow: 0 0 12px var(--status-down-glow);
}

/* ============================================================
   TOAST NOTIFICATIONS (per quick-check feedback)
   ============================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--brand-color);
    border-radius: var(--radius-sm);
    padding: var(--sp-3) var(--sp-4);
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 380px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    line-height: 1.5;
}

.toast.show { transform: translateX(0); opacity: 1; }

.toast-success { border-left-color: var(--status-operational); }
.toast-warning { border-left-color: var(--status-degraded); }
.toast-error   { border-left-color: var(--status-down); }
.toast-info    { border-left-color: var(--brand-color); }

.toast strong { color: var(--brand-color); font-weight: 700; }

/* ============================================================
   DASHBOARD PUBBLICA (client-facing Grafana panels)
   ============================================================ */
.pub-dashboard {
    margin: var(--sp-8) 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease 0.4s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.4s;
}

body.intro-done .pub-dashboard {
    opacity: 1;
    transform: translateY(0);
}

.pub-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    flex-wrap: wrap;
}

.pub-dash-header .section-header {
    margin-bottom: 0;
    flex: 1;
    min-width: 200px;
}

.pub-dash-meta {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.pub-timeline .gf-tl-desc {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 4px 0 6px;
}

/* ============================================================
   GRAFANA-STYLE DASHBOARD (per i clienti)
   ============================================================ */

/* Toolbar in alto con range/refresh */
.gf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
    padding: var(--sp-4) var(--sp-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.gf-workspace-title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.gf-ws-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.gf-ws-slug {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.gf-controls {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

.gf-control-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gf-control-label {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 600;
}

.gf-select {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 130px;
}

.gf-select:focus { outline: none; border-color: var(--brand-color); }

.gf-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    align-self: flex-end;
    transition: all var(--transition);
}

.gf-btn:hover { border-color: var(--brand-color); color: var(--brand-color); }

.gf-btn .spinning {
    display: inline-block;
    animation: gfSpin 0.6s linear;
}

@keyframes gfSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.gf-last-update {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    align-self: flex-end;
    padding-bottom: 6px;
}

/* Griglia panel */
.gf-grid {
    display: grid;
    gap: var(--sp-4);
    margin-bottom: var(--sp-4);
}

.gf-grid-4 { grid-template-columns: repeat(4, 1fr); }
.gf-grid-2 { grid-template-columns: repeat(2, 1fr); }
.gf-grid-1 { grid-template-columns: 1fr; }

@media (max-width: 1100px) {
    .gf-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .gf-grid-4, .gf-grid-2 { grid-template-columns: 1fr; }
}

/* Panel base */
.gf-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--sp-4) var(--sp-5);
    transition: border-color var(--transition);
}

.gf-panel:hover { border-color: var(--border-strong); }

.gf-panel-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: var(--sp-3);
}

.gf-panel-header {
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-color);
}

.gf-panel-header .gf-panel-title { margin-bottom: 4px; }

.gf-panel-sub {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.gf-panel-body { min-height: 60px; }

.gf-empty {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--sp-8) var(--sp-4);
}

/* KPI panel */
.gf-kpi { text-align: left; }

.gf-kpi-value {
    font-family: var(--font-display);
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: var(--sp-2);
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.gf-kpi-value.gf-value-warn {
    color: var(--status-degraded);
    text-shadow: 0 0 16px var(--status-degraded-glow);
}

.gf-kpi-unit {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 4px;
}

.gf-kpi-fraction { display: inline-flex; align-items: baseline; }

.gf-kpi-sep {
    color: var(--text-muted);
    font-weight: 400;
    margin: 0 4px;
    font-size: 1.5rem;
}

.gf-kpi-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* LED indicatori */
.gf-led {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

.gf-led-good { background: var(--status-operational); color: var(--status-operational); animation: gfLedPulse 1.5s ease-in-out infinite; }
.gf-led-warn { background: var(--status-degraded);    color: var(--status-degraded); }
.gf-led-bad  { background: var(--status-down);        color: var(--status-down); animation: gfLedBadPulse 0.9s ease-in-out infinite; }
.gf-led-muted { background: var(--text-muted); color: var(--text-muted); }

@keyframes gfLedPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes gfLedBadPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.2); } }

/* Uptime bars */
.gf-bar-row {
    margin-bottom: var(--sp-4);
}

.gf-bar-row:last-child { margin-bottom: 0; }

.gf-bar-label {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

.gf-bar-name {
    color: var(--text-primary);
    font-weight: 700;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gf-bar-rt {
    color: var(--text-secondary);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.gf-bar-track {
    position: relative;
    height: 26px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.gf-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gf-bar-fill.gf-bar-good  { background: linear-gradient(90deg, var(--status-operational), rgba(36,155,86,0.5)); }
.gf-bar-fill.gf-bar-warn  { background: linear-gradient(90deg, var(--status-degraded), rgba(245,158,11,0.5)); }
.gf-bar-fill.gf-bar-bad   { background: linear-gradient(90deg, var(--status-down), rgba(220,38,38,0.5)); }
.gf-bar-fill.gf-bar-muted { background: var(--bg-tertiary); }

.gf-bar-value {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Heatmap */
.gf-heat-wrap {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.gf-heat-days {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 0;
    flex-shrink: 0;
}

.gf-heat-day-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    height: 16px;
    display: flex;
    align-items: center;
    padding-right: 6px;
    white-space: nowrap;
}

.gf-heat-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.gf-heat-row {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    height: 16px;
}

.gf-heat-cell {
    height: 100%;
    border-radius: 2px;
    transition: transform var(--transition);
    background: rgba(255,255,255,0.03);
}

.gf-heat-cell:hover { transform: scale(1.4); z-index: 2; position: relative; }

.gf-heat-legend {
    display: flex;
    justify-content: space-between;
    margin-top: var(--sp-3);
    padding-left: calc(38px + 6px);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Log stream errori */
.gf-logstream {
    max-height: 340px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}

.gf-log-line {
    display: grid;
    grid-template-columns: 70px 1fr 1.2fr 70px;
    gap: var(--sp-2);
    padding: 8px var(--sp-3);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

.gf-log-line:last-child { border-bottom: none; }
.gf-log-line:hover { background: var(--bg-elevated); }

.gf-log-time { color: var(--text-muted); font-size: 0.7rem; }
.gf-log-svc  { color: var(--text-primary); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gf-log-msg  { color: var(--status-down); font-size: 0.72rem; }
.gf-log-ago  { color: var(--text-muted); font-size: 0.68rem; text-align: right; }

/* Timeline incident */
.gf-timeline {
    max-height: 340px;
    overflow-y: auto;
    padding-left: var(--sp-4);
}

.gf-tl-item {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.gf-tl-item:last-child { border-bottom: none; }

.gf-tl-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

.gf-tl-bad  { background: var(--status-down);        color: var(--status-down); }
.gf-tl-warn { background: var(--status-degraded);    color: var(--status-degraded); }
.gf-tl-good { background: var(--status-operational); color: var(--status-operational); }

.gf-tl-body { flex: 1; }

.gf-tl-date {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.gf-tl-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.gf-tl-type {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    font-weight: 700;
}

/* ============================================================
   FINE GRAFANA-STYLE DASHBOARD
   ============================================================ */
@media (max-width: 900px) {
    .container { padding: var(--sp-5); }
}

@media (max-width: 768px) {
    header { flex-direction: column; gap: var(--sp-4); align-items: flex-start; }
    .brand-logo { height: 30px; }
    .logo-divider { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .admin-header { padding: var(--sp-4); }
    .service-metrics { gap: var(--sp-1); }
    .metric-value { font-size: 0.95rem; }
    .metric-label { font-size: 0.55rem; }
    .admin-overview { grid-template-columns: 1fr; }
    .stat-value { font-size: 2rem; }
    .monitor-line { grid-template-columns: 75px 24px 1fr 70px; }
    .monitor-line .ml-rt { display: none; }
    .floating-profile { bottom: 12px; left: 12px; padding: 4px 8px 4px 4px; }
    .floating-profile .profile-info { display: none; }
    .toast-container { top: 12px; right: 12px; left: 12px; }
    .toast { min-width: 0; max-width: none; }
}

@media (max-width: 480px) {
    .container { padding: var(--sp-4); }
    .status-hero { padding: var(--sp-6) 0; }
    .history-timeline { padding-left: var(--sp-6); }
    .history-item::before { left: calc(-1 * var(--sp-6) - 5px); }
}

/* ============================================================
   ACCESSIBILITA'
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    #splash { display: none !important; }
    body .container { opacity: 1 !important; visibility: visible !important; }
    body header { opacity: 1 !important; transform: none !important; }
    body .status-hero { opacity: 1 !important; transform: none !important; }
    .service-card { opacity: 1 !important; transform: none !important; }
    .maintenance-section, .history-section { opacity: 1 !important; transform: none !important; }
    footer { opacity: 1 !important; }
}
