:root {
    color-scheme: dark;

    --background: #020712;
    --panel: rgba(8, 24, 42, 0.92);
    --panel-hover: rgba(11, 32, 54, 0.97);

    --border: rgba(101, 216, 255, 0.15);
    --border-strong: rgba(101, 216, 255, 0.32);

    --text: #f3f8fd;
    --text-secondary: #a5b9ca;
    --text-muted: #71879a;

    --ice: #63dbff;
    --ice-soft: rgba(99, 219, 255, 0.10);

    --green: #57dfa3;
    --orange: #ff9d66;
    --red: #ff657d;

    --shadow:
        0 24px 70px rgba(0, 0, 0, 0.30);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at 8% 0%,
            rgba(39, 163, 218, 0.17),
            transparent 30%
        ),
        radial-gradient(
            circle at 92% 4%,
            rgba(71, 86, 218, 0.13),
            transparent 27%
        ),
        linear-gradient(
            145deg,
            #020712 0%,
            #06111f 50%,
            #020814 100%
        );

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button {
    font: inherit;
}

.app-shell {
    width: min(1460px, calc(100% - 36px));
    margin: 0 auto;
    padding: 18px 0 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;

    padding: 17px 22px;

    background:
        linear-gradient(
            135deg,
            rgba(10, 31, 52, 0.96),
            rgba(5, 17, 30, 0.91)
        );

    border: 1px solid var(--border);
    border-radius: 22px;

    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand-logo {
    width: 118px;
    height: 118px;

    object-fit: cover;

    border-radius: 20px;

    box-shadow:
        0 0 34px rgba(99, 219, 255, 0.18);
}

.eyebrow {
    display: block;

    color: var(--ice);

    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.equipment-title h1 {
    margin: 5px 0 10px;

    font-size: clamp(1.55rem, 3vw, 2.25rem);
    line-height: 1;
}

.equipment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;

    color: var(--text-secondary);
    font-size: 0.77rem;
}

.equipment-meta strong {
    margin-left: 6px;
    color: var(--text);
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 28px;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 14px;

    background: rgba(87, 223, 163, 0.08);
    border: 1px solid rgba(87, 223, 163, 0.20);
    border-radius: 15px;
}

.online-status strong,
.online-status span {
    display: block;
}

.online-status strong {
    font-size: 0.82rem;
}

.online-status span:not(.status-dot) {
    margin-top: 3px;

    color: var(--text-secondary);
    font-size: 0.72rem;
}

.status-dot {
    width: 10px;
    height: 10px;

    background: var(--green);
    border-radius: 50%;

    box-shadow:
        0 0 0 6px rgba(87, 223, 163, 0.08),
        0 0 17px rgba(87, 223, 163, 0.70);

    animation: pulse 2s infinite;
}

@keyframes pulse {
    50% {
        opacity: 0.55;
        transform: scale(0.88);
    }
}

.last-update {
    min-width: 175px;
    text-align: right;
}

.last-update span,
.last-update strong {
    display: block;
}

.last-update span {
    color: var(--text-muted);

    font-size: 0.67rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.last-update strong {
    margin-top: 6px;

    color: var(--text-secondary);
    font-size: 0.82rem;
}

main {
    margin-top: 16px;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(330px, 0.85fr) 2fr;
    gap: 15px;
}

.health-panel,
.metric-card,
.chart-panel {
    background:
        linear-gradient(
            145deg,
            rgba(11, 31, 52, 0.94),
            rgba(6, 19, 34, 0.91)
        );

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
    backdrop-filter: blur(17px);
}

.health-panel {
    min-height: 300px;
    padding: 21px;

    border-radius: 21px;
}

.panel-heading,
.chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading h2,
.chart-heading h2 {
    margin: 5px 0 0;
    font-size: 1.08rem;
}

.health-badge {
    padding: 7px 11px;

    border-radius: 999px;

    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.health-good {
    color: var(--green);
    background: rgba(87, 223, 163, 0.09);
    border: 1px solid rgba(87, 223, 163, 0.22);
}

.health-warning {
    color: var(--orange);
    background: rgba(255, 157, 102, 0.10);
    border: 1px solid rgba(255, 157, 102, 0.22);
}

.health-critical {
    color: var(--red);
    background: rgba(255, 101, 125, 0.10);
    border: 1px solid rgba(255, 101, 125, 0.22);
}

.health-main {
    display: flex;
    align-items: center;
    gap: 24px;

    margin-top: 27px;
}

.health-ring {
    --score: 100;
    --health-color: var(--green);

    position: relative;

    display: grid;
    flex: 0 0 auto;
    place-items: center;

    width: 142px;
    height: 142px;

    background:
        conic-gradient(
            var(--health-color)
            calc(var(--score) * 1%),
            rgba(126, 163, 192, 0.12) 0
        );

    border-radius: 50%;

    box-shadow:
        0 0 31px rgba(87, 223, 163, 0.13);
}

.health-ring::before {
    content: "";

    position: absolute;

    width: 116px;
    height: 116px;

    background:
        linear-gradient(
            145deg,
            #0b2037,
            #061421
        );

    border-radius: 50%;
}

.health-ring-center {
    position: relative;
    z-index: 1;

    text-align: center;
}

.health-ring-center strong {
    font-size: 2.55rem;
    line-height: 1;
}

.health-ring-center span {
    color: var(--text-secondary);
}

.health-description strong {
    display: block;
    line-height: 1.45;
}

.health-description p {
    margin: 9px 0 0;

    color: var(--text-secondary);
    font-size: 0.80rem;
    line-height: 1.55;
}

.health-footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;

    margin-top: 23px;
    padding-top: 14px;

    border-top: 1px solid rgba(99, 219, 255, 0.09);

    color: var(--text-muted);
    font-size: 0.70rem;
}

.health-footer strong {
    color: var(--ice);
    font-weight: 600;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric-card {
    min-height: 144px;
    padding: 17px;

    border-radius: 19px;

    transition:
        transform 170ms ease,
        border-color 170ms ease,
        background 170ms ease;
}

.metric-card:hover {
    transform: translateY(-3px);

    background: var(--panel-hover);
    border-color: var(--border-strong);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 11px;

    color: var(--text-secondary);
    font-size: 0.75rem;
}

.metric-symbol {
    display: grid;
    flex: 0 0 auto;
    place-items: center;

    width: 39px;
    height: 39px;

    color: var(--ice);

    background: var(--ice-soft);
    border: 1px solid rgba(99, 219, 255, 0.20);
    border-radius: 12px;

    font-size: 0.68rem;
    font-weight: 900;
}

.metric-symbol.warm {
    color: var(--orange);
    background: rgba(255, 157, 102, 0.09);
    border-color: rgba(255, 157, 102, 0.20);
}

.metric-symbol.electric {
    color: #ffd56b;
    background: rgba(255, 213, 107, 0.08);
    border-color: rgba(255, 213, 107, 0.18);
}

.metric-symbol.active {
    color: var(--green);
    background: rgba(87, 223, 163, 0.08);
    border-color: rgba(87, 223, 163, 0.20);
}

.metric-reading {
    display: flex;
    align-items: baseline;
    gap: 6px;

    margin-top: 18px;
}

.metric-reading strong {
    font-size: clamp(1.55rem, 2.5vw, 2.05rem);
    line-height: 1;
}

.metric-reading small {
    color: var(--text-secondary);
    font-size: 0.80rem;
}

.metric-card p {
    margin: 13px 0 0;

    color: var(--text-muted);
    font-size: 0.67rem;
}

.acquisition-state {
    margin-top: 18px;
}

.acquisition-state strong,
.acquisition-state span {
    display: block;
}

.acquisition-state strong {
    color: var(--green);
    font-size: 1.28rem;
}

.acquisition-state span {
    margin-top: 6px;

    color: var(--text-secondary);
    font-size: 0.74rem;
}

.chart-panel {
    margin-top: 15px;
    padding: 21px;

    border-radius: 21px;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.period-selector {
    display: flex;
    gap: 4px;

    padding: 4px;

    background: rgba(3, 13, 24, 0.72);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.period-button,
.control-button {
    color: var(--text-secondary);

    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;

    cursor: pointer;

    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.period-button {
    padding: 7px 10px;
    font-size: 0.71rem;
}

.period-button:hover,
.period-button.active {
    color: #03111b;
    background: var(--ice);
}

.control-button {
    padding: 9px 11px;

    border-color: var(--border);

    font-size: 0.71rem;
}

.control-button:hover {
    color: var(--text);

    background: var(--ice-soft);
    border-color: var(--border-strong);
}

.chart-guidance {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;

    margin-top: 13px;

    color: var(--text-muted);
    font-size: 0.68rem;
}

.chart-container {
    position: relative;

    height: 390px;
    margin-top: 14px;
}

.chart-panel:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 28px;

    background: #03101d;
    border-radius: 0;
}

.chart-panel:fullscreen .chart-container {
    height: calc(100vh - 145px);
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding: 20px 3px 0;

    color: var(--text-muted);
    font-size: 0.68rem;
}

.empty-state {
    display: grid;
    min-height: 68vh;
    place-items: center;

    text-align: center;
}

.empty-state img {
    width: 190px;
    border-radius: 24px;
}

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

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

@media (max-width: 800px) {
    .app-shell {
        width: min(100% - 20px, 1460px);
        padding-top: 10px;
    }

    .topbar,
    .topbar-status,
    .chart-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .last-update {
        text-align: left;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-controls {
        justify-content: flex-start;
    }

    .chart-container {
        height: 340px;
    }
}

@media (max-width: 560px) {
    .brand-block,
    .health-main {
        align-items: flex-start;
        flex-direction: column;
    }

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

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

    footer {
        flex-direction: column;
    }
}

.fleet-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
 
.fleet-stat {
    padding: 20px;
 
    background:
        linear-gradient(
            145deg,
            rgba(11, 31, 52, 0.94),
            rgba(6, 19, 34, 0.91)
        );
 
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
 
.fleet-stat span,
.fleet-stat strong {
    display: block;
}
 
.fleet-stat span {
    color: var(--text-secondary);
    font-size: 0.75rem;
}
 
.fleet-stat strong {
    margin-top: 10px;
    font-size: 2rem;
}
 
.fleet-stat-good strong {
    color: var(--green);
}
 
.fleet-heading {
    margin-bottom: 14px;
}
 
.fleet-heading h2 {
    margin: 5px 0 0;
}
 
.fleet-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(310px, 1fr));
    gap: 15px;
}
 
.equipment-card {
    display: block;
    padding: 20px;
 
    color: inherit;
    text-decoration: none;
 
    background:
        linear-gradient(
            145deg,
            rgba(11, 31, 52, 0.94),
            rgba(6, 19, 34, 0.91)
        );
 
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
 
    transition:
        transform 170ms ease,
        border-color 170ms ease;
}
 
.equipment-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}
 
.equipment-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}
 
.equipment-card h3 {
    margin: 5px 0;
    font-size: 1.25rem;
}
 
.equipment-type,
.equipment-device {
    color: var(--text-muted);
    font-size: 0.7rem;
}
 
.fleet-health {
    padding: 7px 10px;
 
    border-radius: 999px;
 
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}
 
.fleet-health.excellent {
    color: var(--green);
    background: rgba(87, 223, 163, 0.09);
}
 
.fleet-health.watch {
    color: #f1d45a;
    background: rgba(241, 212, 90, 0.09);
}
 
.fleet-health.warning {
    color: var(--orange);
    background: rgba(255, 157, 102, 0.09);
}
 
.fleet-health.critical {
    color: var(--red);
    background: rgba(255, 101, 125, 0.09);
}
 
.fleet-health.offline {
    color: var(--text-muted);
    background: rgba(113, 135, 154, 0.10);
}
 
.equipment-card-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
 
    margin-top: 24px;
}
 
.equipment-card-values div {
    padding: 13px;
 
    background: rgba(3, 13, 24, 0.46);
    border-radius: 13px;
}
 
.equipment-card-values span,
.equipment-card-values strong {
    display: block;
}
 
.equipment-card-values span {
    color: var(--text-muted);
    font-size: 0.66rem;
}
 
.equipment-card-values strong {
    margin-top: 7px;
    font-size: 1.18rem;
}
 
.equipment-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
 
    margin-top: 18px;
    padding-top: 14px;
 
    border-top: 1px solid rgba(99, 219, 255, 0.08);
 
    color: var(--text-muted);
    font-size: 0.67rem;
}
 
.equipment-card-footer strong {
    color: var(--ice);
}
 
@media (max-width: 700px) {
    .fleet-summary {
        grid-template-columns: 1fr;
    }
 
    .equipment-card-footer {
        flex-direction: column;
    }
}