:root {
    color-scheme: dark;
    --text: #edf3fb;
    --muted: #a6b2c5;
    --border: #c5d9f51a;
    --accent: #70e4e3;
    --purple: #be9af0;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-padding-top: 24px;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 50px 28px;
    color: var(--text);
    background: radial-gradient(ellipse at 4% 60%, #12525a66, transparent 45%), radial-gradient(ellipse at 95% 10%, #48297066, transparent 50%), #090f1a;
    font: 14px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(32deg, transparent 49.8%, #72e7e609 50%, transparent 50.2%), linear-gradient(145deg, transparent 49.8%, #b48cef0c 50%, transparent 50.2%);
    background-size: 220px 280px, 340px 240px;
    z-index: -1;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px;
}

.app-shell {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    max-width: 1400px;
    margin: auto;
    border: 1px solid #d0d9fc24;
    border-radius: 20px;
    background: linear-gradient(115deg, #1b3039db, #242234e8 78%);
    box-shadow: 0 30px 100px #0007, inset 0 1px #ffffff09;
    backdrop-filter: blur(24px);
    overflow: hidden;
}

.sidebar {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 26px 10px;
    border-right: 1px solid var(--border);
    background: #08192226;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #70e4e350;
    border-radius: 13px;
    background: #70e4e312;
    color: var(--accent);
    font-size: 27px;
    box-shadow: 0 0 25px #70e4e310;
}

.sidebar-label {
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-top: 10px;
}

.sidebar nav {
    width: 100%;
    display: grid;
    gap: 9px;
    margin-top: 35px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 12px 3px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 10px;
    border: 1px solid transparent;
}

.nav-link span {
    font-size: 21px;
    line-height: 1.3;
}

.nav-link:hover,
.nav-link.active {
    background: #89dfeb12;
    color: var(--accent);
    border-color: #89dfeb19;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 35px;
    font-size: 9px;
    color: var(--muted);
    white-space: nowrap;
}

.sidebar-bottom .dot {
    color: var(--accent);
    margin-right: 3px;
}

.container {
    min-width: 0;
    padding: 28px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 25px;
}

.eyebrow {
    font-size: 9px;
    letter-spacing: 2.5px;
    color: var(--accent);
    font-weight: 650;
    margin: 0 0 6px;
}

h1 {
    font-size: clamp(20px, 2.2vw, 29px);
    line-height: 1.3;
    letter-spacing: -.7px;
    margin: 0 0 5px;
    font-weight: 600;
}

.subtitle {
    color: var(--muted);
    margin: 0;
    font-size: 12px;
}

.header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    color: var(--accent);
    background: #70e4e311;
    border: 1px solid #70e4e32a;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.snapshot {
    font-size: 10px;
    color: var(--muted);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.summary-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: linear-gradient(115deg, #ffffff08, #70e4e308);
}

.summary-card:nth-child(n+3) {
    background: linear-gradient(115deg, #ffffff08, #aa78e916);
}

.summary-card:hover {
    border-color: #70e4e366;
}

.summary-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #c3cfde;
}

.summary-label span {
    color: var(--accent);
}

.summary-card:nth-child(n+3) .summary-label span {
    color: var(--purple);
}

.summary-card strong {
    display: block;
    margin: 5px 0;
    font-size: 28px;
    letter-spacing: -.8px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.summary-caption {
    font-size: 10px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card {
    min-width: 0;
    padding: 21px 23px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: linear-gradient(125deg, #ffffff07, #ffffff03);
    box-shadow: 0 5px 18px #0000000d;
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 17px;
}

h2 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

.card-icon {
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
}

.metric {
    font-size: 34px;
    font-weight: 550;
    line-height: 1.2;
    letter-spacing: -1px;
    overflow-wrap: anywhere;
}

.online {
    color: var(--accent);
}

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

.online .dot {
    vertical-align: middle;
    margin-right: 5px;
    box-shadow: 0 0 12px #70e4e366;
}

.metric-caption {
    margin: 7px 0 18px;
    font-size: 11px;
    color: var(--muted);
}

.server-visual {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 5px 0 22px;
}

.status-ring {
    width: 118px;
    height: 118px;
    flex-shrink: 0;
    border: 7px solid var(--accent);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px #70e4e319, inset 0 0 20px #70e4e30c;
    font-size: 12px;
    color: var(--accent);
}

.ring-symbol {
    font-size: 26px;
    line-height: 1.4;
}

.server-visual .metric-caption {
    max-width: 170px;
    margin-bottom: 0;
}

progress {
    display: block;
    width: 100%;
    height: 5px;
    appearance: none;
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    background: #ffffff0c;
    color: var(--accent);
    margin-bottom: 23px;
}

progress::-webkit-progress-bar {
    background: #ffffff0c;
}

progress::-webkit-progress-value {
    background: var(--accent);
    border-radius: 20px;
}

progress::-moz-progress-bar {
    background: var(--accent);
    border-radius: 20px;
}

.memory-card,
.disk-card {
    --accent: var(--purple);
}

.details {
    margin: 0;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.details>div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 5px 0;
    font-size: 11px;
}

dt {
    color: var(--muted);
    flex-shrink: 0;
}

dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
    min-width: 0;
}

.unavailable {
    color: var(--muted);
    font-size: 12px;
}

.services {
    margin-top: 18px;
}

.services-heading {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
    margin-bottom: 18px;
}

.services-heading .subtitle {
    font-size: 11px;
    margin-top: 4px;
}

.service-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.service-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #070e1d16;
    flex-wrap: wrap;
}

.service-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.service-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #70e4e320;
    border-radius: 8px;
    background: #70e4e30a;
    color: var(--accent);
    font-size: 11px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    border-radius: 5px;
    padding: 4px 7px;
}

.running {
    color: #83e4c2;
    background: #83e4c210;
}

.stopped {
    color: #ffa6b0;
    background: #ffa6b010;
}

.unknown {
    color: #e7ca88;
    background: #e7ca8810;
}

.not-installed {
    color: var(--muted);
    background: #ffffff08;
}

.service-note {
    margin: 15px 0 0;
    font-size: 10px;
    color: var(--muted);
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    font-size: 10px;
    color: var(--muted);
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #152333;
    padding: 10px;
    z-index: 2;
}

.skip-link:focus {
    top: 10px;
}

@media (max-width: 1100px) {
    body {
        padding: 24px 16px;
    }

    .container {
        padding: 22px;
    }

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

    .service-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    html {
        --mobile-menu-height: 84px;
        scroll-padding-top: calc(var(--mobile-menu-height) + 16px);
    }

    body {
        padding: 12px;
    }

    .app-shell {
        grid-template-columns: minmax(0, 1fr);
        border-radius: 14px;
        padding-top: var(--mobile-menu-height);
        backdrop-filter: none;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 12px;
        right: 12px;
        height: var(--mobile-menu-height);
        z-index: 20;
        border-radius: 0 0 14px 14px;
        box-shadow: 0 8px 20px #0004;
        min-width: 0;
        background: #14232d;
        flex-direction: row;
        padding: 12px 18px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        gap: 18px;
    }

    .skip-link:focus {
        position: fixed;
        z-index: 21;
    }

    .sidebar-label,
    .sidebar-bottom {
        display: none;
    }

    .sidebar .brand-mark {
        flex-shrink: 0;
    }

    .sidebar nav {
        display: flex;
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        gap: 8px;
        width: auto;
        margin: 0;
        margin-left: auto;
    }

    .nav-link {
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 9px;
    }

    .nav-link span {
        font-size: 18px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .header-meta {
        align-items: flex-start;
    }

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

    footer {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 400px) {
    .container {
        padding: 16px;
    }

    .sidebar {
        gap: 8px;
        padding: 12px;
    }

    .nav-link {
        padding: 6px;
    }

    .summary-grid {
        gap: 10px;
    }

    .summary-card {
        padding: 13px;
    }

    .summary-card strong {
        font-size: 23px;
    }

    .card {
        padding: 18px;
    }

    .server-visual {
        gap: 16px;
    }

    .status-ring {
        width: 95px;
        height: 95px;
        border-width: 5px;
    }

    .details>div {
        flex-direction: column;
        gap: 2px;
    }

    dd {
        text-align: left;
    }
}

.login-page {
    display: grid;
    place-items: center;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 32px;
    background: #192432;
}

.login-form {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.login-form label {
    font-size: 12px;
    color: var(--text);
}

.login-form input {
    width: 100%;
    min-width: 0;
    border: 1px solid #a6b2c555;
    border-radius: 7px;
    background: #0c1522;
    padding: 12px;
    color: var(--text);
    font: inherit;
}

.login-form input:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button {
    cursor: pointer;
    font: inherit;
}

.button-primary {
    padding: 12px 16px;
    border: 0;
    border-radius: 7px;
    color: #09121d;
    background: var(--accent);
    font-weight: 600;
    margin-top: 10px;
}

.button-primary:hover {
    background: #9af0ee;
}

.field-help {
    color: var(--muted);
    font-size: 11px;
    margin: -4px 0 4px;
}

.form-error {
    padding: 12px;
    color: #ffbdc5;
    background: #ffa6b010;
    border: 1px solid #ffa6b040;
    border-radius: 7px;
    font-size: 12px;
}

.login-note {
    color: var(--muted);
    font-size: 11px;
    margin: 20px 0 0;
}

.account-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--muted);
}

.account-menu form {
    margin: 0;
}

.button-logout {
    color: var(--text);
    background: #ffffff08;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
}

.button-logout:hover {
    border-color: var(--accent);
}

@media (max-width: 400px) {
    .login-card {
        padding: 22px;
    }
}

.button-danger {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #ffa6b055;
    border-radius: 7px;
    padding: 10px 14px;
    color: #ffbdc5;
    background: #ffa6b014;
    font-weight: 600;
}

.button-danger:hover {
    border-color: #ffa6b0;
    background: #ffa6b024;
}

.button-danger:disabled {
    opacity: .6;
    cursor: wait;
}

.reboot-card .button-danger {
    margin-top: 10px;
}

.back-link {
    display: inline-block;
    margin-top: 22px;
    color: var(--accent);
    font-size: 12px;
}

.power-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.button-server {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: rgb(134 216 161 / 15%);
    color: #edf3fb;
    font-size: 12px;
    font-weight: 600;
}

.button-server:hover {
    background: rgb(161 229 182 / 35%);
    border-color: #bcefc9;
}

.shutdown-card .button-danger {
    margin-top: 10px;
}

[hidden] {
    display: none !important;
}

.cpu-processes {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.cpu-processes h3 {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
}

.process-note {
    color: var(--muted);
    font-size: 10px;
    margin: 6px 0 12px;
}

.process-table-wrap {
    overflow-x: auto;
}

.process-table {
    width: 100%;
    min-width: 270px;
    border-collapse: collapse;
    font-size: 11px;
}

.process-table th,
.process-table td {
    padding: 7px 5px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}

.process-table th {
    color: var(--muted);
    font-weight: 500;
}

.process-table th:first-child,
.process-table td:first-child {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
.storage-drives {
    margin-top: 18px;
}

.storage-drive {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.storage-drive h3 {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 10px;
}

.storage-drive h3 span,
.storage-volume-note,
.storage-measured {
    color: var(--muted);
    font-size: 11px;
}

.storage-volume {
    margin: 10px 0;
    overflow-wrap: anywhere;
}

.storage-volume-title {
    font-size: 11px;
    margin: 0;
}

.storage-volume-note {
    margin: 3px 0;
}

.storage-measured {
    margin-top: 14px;
}

.monitoring-alerts {
    margin-bottom: 24px;
}

.monitoring-alerts h2 {
    font-size: 16px;
    margin-top: 0;
}

.monitoring-alerts ul {
    color: #ffd18a;
    padding-left: 20px;
    font-size: 13px;
}

.monitoring-alerts ul:empty {
    display: none;
}

.monitoring-grid {
    margin-top: 24px;
}

.monitoring-row {
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.monitoring-row-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.monitoring-row-heading h3 {
    font-size: 13px;
    margin: 0;
}

.monitoring-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgb(255 255 255 / 6%);
}

.tone-ok { color: #a8e7bb; }
.tone-warning { color: #ffd18a; }
.tone-error { color: #ffaaaa; }
.tone-unknown { color: var(--muted); }
