:root {
    color-scheme: dark;
    font-family: Inter, "Segoe UI", sans-serif;
    background: #101318;
    color: #eef1f5;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 10% 0%, #272219 0, transparent 35rem),
        #101318;
}

button,
input {
    font: inherit;
}

.shell {
    width: min(100% - 32px, 1040px);
    margin: 0 auto;
    padding: 38px 0 64px;
}

.topbar,
.machines-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topbar {
    margin-bottom: 32px;
}

.eyebrow {
    margin: 0 0 7px;
    color: #d3a956;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(1.7rem, 5vw, 2.4rem);
}

h2 {
    margin-bottom: 0;
    font-size: 1.4rem;
}

.panel {
    border: 1px solid #2e343e;
    border-radius: 12px;
    background: #191d24;
    box-shadow: 0 12px 30px #0002;
}

.login-panel {
    width: min(100%, 440px);
    padding: 26px;
}

.login-panel p {
    color: #a7afbb;
    line-height: 1.5;
}

form {
    display: grid;
    gap: 12px;
}

label {
    color: #d4d9e1;
    font-size: 0.9rem;
}

input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #3c444f;
    border-radius: 7px;
    outline: none;
    background: #101318;
    color: #fff;
}

input:focus {
    border-color: #d3a956;
    box-shadow: 0 0 0 3px #d3a95633;
}

.button {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease;
}

.button:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button-primary {
    background: #407b52;
}

.button-danger {
    background: #9c4140;
}

.button-muted {
    border-color: #414852;
    background: #252a32;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 38px;
}

.summary-card {
    display: grid;
    gap: 9px;
    padding: 18px;
}

.summary-label {
    color: #a7afbb;
    font-size: 0.82rem;
}

.summary-card strong {
    font-size: 1.1rem;
}

.stress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #303640;
}

.stress-track div {
    height: 100%;
    border-radius: inherit;
    background: #d3a956;
    transition: width 180ms ease;
}

.stress-track div.over-capacity {
    background: #d75c50;
}

.machines-heading {
    margin-bottom: 15px;
}

.machine-list {
    display: grid;
    gap: 12px;
}

.machine-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, auto) auto;
    align-items: center;
    gap: 20px;
    padding: 17px 18px;
}

.machine-info h3 {
    margin: 0 0 5px;
    overflow-wrap: anywhere;
}

.machine-info p,
.machine-state {
    margin: 0;
    color: #a7afbb;
    font-size: 0.88rem;
}

.machine-online {
    color: #80ca91 !important;
}

.machine-offline {
    color: #df837b !important;
}

.empty-state {
    padding: 28px;
    border: 1px dashed #3c444f;
    border-radius: 10px;
    color: #a7afbb;
    text-align: center;
    line-height: 1.5;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #3b7250;
    border-radius: 8px;
    background: #1b3024;
}

.notice-error {
    border-color: #884441;
    background: #321f20;
}

.hidden {
    display: none !important;
}

@media (max-width: 680px) {
    .shell {
        padding-top: 24px;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stress-card {
        grid-column: 1 / -1;
    }

    .machine-card {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .machine-state {
        grid-column: 1;
        grid-row: 2;
    }

    .machine-card .button {
        grid-column: 2;
        grid-row: 1 / 3;
    }
}
