:root {
    --background: #060816;
    --surface: #101426;
    --primary: #8b5cf6;
    --secondary: #22d3ee;
    --online: #2dd4a7;
    --oscillation: #38bdf8;
    --unstable: #fbbf24;
    --offline: #fb7185;
    --text: #f7f8ff;
    --muted: #7f89a7;
    --border: rgba(176, 189, 230, 0.12);
    --surface-soft: rgba(16, 20, 38, 0.74);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -5%, color-mix(in srgb, var(--primary) 25%, transparent), transparent 32rem),
        radial-gradient(circle at 92% 12%, color-mix(in srgb, var(--secondary) 12%, transparent), transparent 28rem),
        linear-gradient(180deg, color-mix(in srgb, var(--background) 96%, #000), var(--background));
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.24;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

.page-shell {
    width: min(1480px, calc(100% - 72px));
    margin: 0 auto;
    padding: 46px 0 28px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    display: block;
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    object-fit: contain;
    filter:
        drop-shadow(0 16px 24px rgba(0, 0, 0, 0.35))
        drop-shadow(0 0 18px color-mix(in srgb, var(--secondary) 22%, transparent));
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-copy strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 25px;
    line-height: 1.1;
    letter-spacing: -0.7px;
}

.brand-copy small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}

.audio-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.025);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 180ms ease;
}

.audio-toggle:hover,
.audio-toggle:focus-visible {
    color: var(--text);
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    outline: none;
}

.audio-toggle.active {
    color: var(--secondary);
    border-color: color-mix(in srgb, var(--secondary) 45%, transparent);
    background: color-mix(in srgb, var(--secondary) 8%, transparent);
}

.sync-status {
    display: grid;
    min-width: 165px;
    justify-items: end;
}

.sync-status span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sync-status i {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--online);
    box-shadow: 0 0 12px var(--online);
    animation: live-pulse 2.4s infinite;
}

.sync-status time {
    font-family: "Space Grotesk", sans-serif;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

.intro-panel {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
    gap: 44px;
    align-items: end;
    margin: 38px 0;
    padding: 32px 34px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        linear-gradient(125deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent 42%),
        var(--surface-soft);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.intro-panel::after {
    position: absolute;
    top: -80px;
    right: -50px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--secondary) 9%, transparent);
    filter: blur(10px);
    content: "";
    pointer-events: none;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.19em;
    text-transform: uppercase;
}

.intro-copy h1 {
    max-width: 560px;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(25px, 3vw, 42px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.intro-copy p {
    max-width: 680px;
    margin-top: 13px;
    color: #aab2cc;
    font-size: 13px;
}

.legend {
    display: grid;
    grid-template-columns: repeat(5, max-content);
    justify-content: end;
    gap: 12px 18px;
    position: relative;
    z-index: 1;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #bdc4d9;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.legend i {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    box-shadow: 0 0 12px color-mix(in srgb, currentColor 42%, transparent);
}

.legend i.operacional,
.tick.operacional {
    color: var(--online);
    background: var(--online);
}

.legend i.oscilacao,
.tick.oscilacao {
    color: var(--oscillation);
    background: var(--oscillation);
}

.legend i.instavel,
.tick.instavel {
    color: var(--unstable);
    background: var(--unstable);
}

.legend i.offline,
.tick.offline {
    color: var(--offline);
    background: var(--offline);
}

.legend i.sem-dados,
.tick.sem-dados {
    color: #303750;
    background: #303750;
}

.monitor-list {
    display: grid;
    gap: 14px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.monitor-list.refreshing {
    opacity: 0.35;
    transform: translateY(3px);
}

.server-card {
    display: grid;
    grid-template-columns: 225px minmax(0, 1fr) 178px;
    gap: 36px;
    align-items: center;
    min-height: 178px;
    padding: 24px 28px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.026), transparent 30%),
        color-mix(in srgb, var(--surface) 84%, transparent);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.17);
    backdrop-filter: blur(16px);
    transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.server-card:hover {
    border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
    background:
        linear-gradient(115deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent 33%),
        color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.server-card.offline {
    border-color: color-mix(in srgb, var(--offline) 30%, var(--border));
}

.server-info {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.server-status-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
    box-shadow: 0 0 16px color-mix(in srgb, var(--muted) 60%, transparent);
}

.server-card.online .server-status-dot {
    background: var(--online);
    box-shadow: 0 0 16px color-mix(in srgb, var(--online) 70%, transparent);
}

.server-card.offline .server-status-dot {
    background: var(--offline);
    box-shadow: 0 0 16px color-mix(in srgb, var(--offline) 70%, transparent);
}

.server-info h2 {
    overflow: hidden;
    font-family: "Space Grotesk", sans-serif;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-info p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.server-info strong {
    margin-left: 4px;
    font-size: 11px;
}

.server-info strong.operacional {
    color: var(--online);
}

.server-info strong.oscilacao {
    color: var(--oscillation);
}

.server-info strong.instavel {
    color: var(--unstable);
}

.server-info strong.offline {
    color: var(--offline);
}

.server-info strong.pending,
.server-info strong.sem-dados {
    color: var(--muted);
}

.server-timelines {
    display: grid;
    min-width: 0;
    gap: 10px;
}

.timeline-group {
    min-width: 0;
}

.chart-title {
    margin-bottom: 4px;
    color: #707a9a;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.timeline {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 22px;
    gap: 2px;
}

.tick {
    flex: 1 1 0;
    min-width: 1px;
    height: 100%;
    border-radius: 3px;
    cursor: crosshair;
    opacity: 0.94;
    transition: transform 140ms ease, opacity 140ms ease, filter 140ms ease;
}

.tick.aguardando {
    visibility: hidden;
    pointer-events: none;
}

.timeline:hover .tick:not(:hover) {
    opacity: 0.28;
}

.tick:hover {
    z-index: 2;
    opacity: 1;
    filter: brightness(1.15) drop-shadow(0 0 6px currentColor);
    transform: scaleY(1.34);
}

.server-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    justify-self: end;
    min-width: 162px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.server-badge span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.server-badge.online {
    color: var(--online);
    border-color: color-mix(in srgb, var(--online) 26%, transparent);
    background: color-mix(in srgb, var(--online) 7%, transparent);
}

.server-badge.offline {
    color: var(--offline);
    border-color: color-mix(in srgb, var(--offline) 28%, transparent);
    background: color-mix(in srgb, var(--offline) 7%, transparent);
}

.server-badge.pending {
    color: var(--muted);
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.018);
}

.smart-tooltip {
    position: fixed;
    z-index: 100;
    display: grid;
    min-width: 210px;
    padding: 13px 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 12px;
    color: var(--text);
    background: rgba(8, 11, 25, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -100%) translateY(-4px);
    backdrop-filter: blur(16px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.smart-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-10px);
}

.smart-tooltip span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.smart-tooltip strong {
    margin-top: 2px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 16px;
    font-weight: 600;
}

.smart-tooltip em {
    margin-top: 4px;
    font-size: 9px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 210px;
    padding: 34px;
    border: 1px dashed color-mix(in srgb, var(--primary) 38%, var(--border));
    border-radius: 18px;
    color: var(--muted);
    background: var(--surface-soft);
    text-align: left;
}

.empty-state strong {
    color: var(--text);
    font-size: 15px;
}

.empty-state p {
    margin-top: 4px;
    font-size: 12px;
}

.empty-state code {
    color: var(--secondary);
}

.empty-icon {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--primary) 38%, transparent);
    border-radius: 12px;
    color: var(--primary);
    font-size: 22px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding: 26px 4px 6px;
    border-top: 1px solid var(--border);
    color: #626c8a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@keyframes live-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 42%, transparent);
    }
    50% {
        box-shadow: 0 0 0 6px transparent;
    }
}

@media (max-width: 1180px) {
    .intro-panel {
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: start;
    }

    .legend {
        grid-template-columns: repeat(5, max-content);
        justify-content: start;
    }

    .server-card {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 24px 30px;
    }

    .server-badge {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
    }

    .server-timelines {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 780px) {
    .page-shell {
        width: min(100% - 28px, 680px);
        padding-top: 22px;
    }

    .site-header {
        align-items: flex-start;
        padding-bottom: 22px;
    }

    .brand-logo {
        width: 64px;
        height: 64px;
    }

    .brand-copy strong {
        font-size: 21px;
    }

    .brand-copy small {
        max-width: 160px;
        line-height: 1.4;
    }

    .header-actions {
        align-items: flex-end;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .sync-status {
        min-width: 0;
    }

    .sync-status span {
        font-size: 8px;
    }

    .sync-status time {
        font-size: 18px;
    }

    .intro-panel {
        margin: 24px 0;
        padding: 25px 22px;
        border-radius: 16px;
    }

    .intro-copy h1 {
        font-size: 29px;
    }

    .legend {
        grid-template-columns: repeat(2, max-content);
    }

    .server-card {
        grid-template-columns: 1fr;
        min-height: 0;
        gap: 20px;
        padding: 22px 20px;
        border-radius: 16px;
    }

    .server-info,
    .server-timelines,
    .server-badge {
        grid-column: 1;
        grid-row: auto;
    }

    .server-badge {
        justify-self: stretch;
    }

    .timeline {
        gap: 1.5px;
        height: 21px;
    }

    .site-footer {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .site-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: row;
        justify-content: space-between;
    }

    .sync-status {
        justify-items: end;
    }

    .audio-toggle {
        max-width: 150px;
    }

    .legend {
        grid-template-columns: 1fr 1fr;
    }

    .timeline {
        overflow: hidden;
    }

    .chart-title {
        font-size: 7.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
