:root {
    color-scheme: dark;
    --background: #202122;
    --background-deep: #18191a;
    --sidebar: #171819;
    --surface: #2c2d2e;
    --surface-raised: #343536;
    --surface-hover: #3a3b3c;
    --border: #4b4c4d;
    --border-soft: #3d3e3f;
    --text: #f0f0f0;
    --text-muted: #b9b9b9;
    --text-subtle: #858585;
    --orange: #ff9f2f;
    --orange-bright: #ffad5a;
    --green: #64c466;
    --red: #f05c55;
    --yellow: #f2b84b;
    --sidebar-width: 252px;
    --topbar-height: 68px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--background);
}

body {
    min-width: 320px;
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}

button,
a,
input,
select {
    font: inherit;
}

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

button {
    color: inherit;
}

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

.icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    background: var(--sidebar);
    border-right: 1px solid var(--border-soft);
    transition: transform 180ms ease;
}

.sidebar__brand {
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 22px 0 24px;
    border-bottom: 1px solid var(--border-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand__logo {
    display: block;
    width: 146px;
    height: 40px;
    object-fit: contain;
}

.sidebar__nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    padding: 18px 0;
}

.nav-item {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 18px;
    padding: 0 27px;
    color: #dedede;
    font-size: 15px;
    transition: background-color 150ms ease, color 150ms ease;
}

.nav-item .icon {
    width: 22px;
    height: 22px;
    color: #e1e1e1;
}

.nav-item:hover,
.nav-item:focus-visible {
    background: var(--surface);
    color: #fff;
    outline: none;
}

.nav-item--active {
    background: var(--surface-raised);
    color: var(--orange-bright);
}

.nav-item--active::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--orange);
    content: "";
}

.nav-item--active .icon {
    color: var(--orange);
}

.sidebar__bottom {
    padding: 10px 0 18px;
    border-top: 1px solid var(--border-soft);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 13px 14px 0;
    padding: 10px 10px;
    border-radius: 8px;
    background: #252627;
}

.profile-card__avatar {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 1px solid #666;
    border-radius: 50%;
    color: #f6f6f6;
    font-weight: 600;
}

.profile-card__text {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.profile-card__text strong {
    font-size: 13px;
}

.profile-card__text small {
    color: var(--text-subtle);
    font-size: 11px;
}

.profile-card__chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.profile-card__logout-form {
    margin-left: auto;
}

.profile-card__logout {
    width: 28px;
    height: 28px;
}

.profile-card__logout .icon {
    width: 17px;
    height: 17px;
}

.app-content {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.topbar {
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border-soft);
    background: #242526;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.icon-button {
    position: relative;
    display: inline-grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.icon-button--small {
    width: 28px;
    height: 28px;
}

.icon-button--small .icon {
    width: 18px;
    height: 18px;
}

.notification-button__badge {
    position: absolute;
    top: -2px;
    right: -1px;
    display: grid;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    place-items: center;
    border: 2px solid #242526;
    border-radius: 99px;
    background: var(--orange);
    color: #1d1d1d;
    font-size: 10px;
    font-weight: 700;
}

.user-menu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 0 7px 4px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.user-menu .icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.topbar__menu,
.sidebar__close {
    display: none;
}

.page-content {
    max-width: 1540px;
    margin: 0 auto;
    padding: 28px 26px 42px;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 23px;
}

.eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--orange);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f3f3f3;
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.03em;
}

.heading-icon {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: #b9b9b9;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.page-heading__date {
    color: var(--text-subtle);
    font-size: 12px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.metric-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .08);
}

.metric-card {
    display: grid;
    min-height: 144px;
    grid-template-columns: 64px 1fr;
    grid-template-rows: 1fr auto;
    gap: 10px 14px;
    padding: 20px 17px 15px;
}

.metric-card__icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.metric-card__icon .icon {
    width: 29px;
    height: 29px;
}

.metric-card__icon--orange {
    color: var(--orange);
}

.metric-card__icon--red {
    color: var(--red);
}

.metric-card__body {
    padding-top: 1px;
}

.metric-card__label {
    display: block;
    color: #e4e4e4;
    font-size: 14px;
}

.metric-card__value {
    display: block;
    margin-top: 2px;
    color: #f5f5f5;
    font-size: 30px;
    font-weight: 650;
    letter-spacing: -.03em;
}

.metric-card__value small {
    color: #e5e5e5;
    font-size: 20px;
    font-weight: 400;
}

.text-success {
    color: var(--green) !important;
}

.text-danger {
    color: var(--red) !important;
}

.card-link {
    display: inline-flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 5px;
    width: fit-content;
    color: var(--orange-bright);
    font-size: 13px;
    font-weight: 600;
}

.card-link:hover,
.card-link:focus-visible {
    color: #ffc783;
    outline: none;
}

.card-link .icon {
    width: 15px;
    height: 15px;
    stroke-width: 2.2;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(205px, .65fr) minmax(280px, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.panel {
    min-width: 0;
    overflow: hidden;
}

.panel__header {
    display: flex;
    min-height: 57px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-soft);
}

.panel__header h2 {
    color: #f0f0f0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.capacity-content {
    display: flex;
    min-height: 246px;
    align-items: center;
    gap: 22px;
    padding: 20px 17px 12px;
}

.donut-chart {
    position: relative;
    flex: 0 0 174px;
    width: 174px;
    height: 174px;
}

.donut-chart svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-chart circle {
    fill: none;
    stroke-width: 13;
}

.donut-chart__track {
    stroke: #606163;
}

.donut-chart__value {
    stroke: var(--orange);
    stroke-dasharray: 179 290;
    stroke-linecap: butt;
}

.donut-chart__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.donut-chart__label strong {
    font-size: 28px;
    line-height: 1;
}

.donut-chart__label span {
    color: var(--text-muted);
    font-size: 12px;
}

.capacity-list {
    flex: 1;
    min-width: 0;
}

.capacity-list__head,
.capacity-row {
    display: grid;
    grid-template-columns: minmax(102px, 1fr) 94px 85px;
    align-items: center;
    gap: 9px;
}

.capacity-list__head {
    padding: 0 0 7px;
    color: #e1e1e1;
    font-size: 12px;
    text-align: right;
}

.capacity-list__head span:first-child {
    text-align: left;
}

.capacity-row {
    min-height: 38px;
    border-top: 1px solid var(--border-soft);
    color: #e2e2e2;
    font-size: 13px;
    text-align: right;
}

.capacity-row span:first-child {
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dot {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    vertical-align: -2px;
    border-radius: 50%;
}

.dot--orange {
    background: var(--orange);
}

.dot--green {
    background: var(--green);
}

.dot--red {
    background: var(--red);
}

.dot--muted {
    background: #a4a5a6;
}

.panel__footer {
    display: grid;
    min-height: 43px;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 36px;
    padding: 0 17px;
    border-top: 1px solid var(--border-soft);
    color: #e5e5e5;
    font-size: 13px;
}

.status-list {
    padding: 9px 17px 5px;
}

.status-row {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    color: #dedede;
    font-size: 13px;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-row strong {
    font-size: 16px;
    font-weight: 500;
}

.alert-list {
    padding: 7px 17px 3px;
}

.alert-row {
    display: grid;
    min-height: 61px;
    grid-template-columns: 23px 1fr auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-soft);
    color: #e1e1e1;
    font-size: 12px;
    line-height: 1.3;
}

.alert-row:last-child {
    border-bottom: 0;
}

.alert-row strong {
    font-weight: 500;
}

.alert-row time {
    align-self: start;
    padding-top: 14px;
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.alert-row__icon {
    display: inline-flex;
}

.alert-row__icon .icon {
    width: 20px;
    height: 20px;
}

.alert-row__icon--danger {
    color: var(--red);
}

.alert-row__icon--warning {
    color: var(--orange);
}

.panel__link {
    margin: 9px 17px 13px;
}

.runs-panel .panel__header {
    min-height: 59px;
}

.button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 650;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.button .icon {
    width: 17px;
    height: 17px;
}

.button--primary {
    background: var(--orange);
    color: #21170c;
}

.button--primary:hover,
.button--primary:focus-visible {
    background: #ffb24e;
    outline: none;
}

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

.data-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    color: #e3e3e3;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background: #353637;
    color: #e9e9e9;
    font-size: 12px;
    font-weight: 500;
}

.data-table tbody tr:hover {
    background: var(--surface-hover);
}

.data-table td:last-child,
.data-table th:last-child {
    width: 52px;
    padding-right: 10px;
    padding-left: 10px;
    text-align: center;
}

.status-badge {
    display: inline-flex;
    min-width: 57px;
    min-height: 23px;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
}

.status-badge--success {
    background: #43884e;
}

.status-badge--running {
    background: #e68f21;
    color: #1d170f;
}

.status-badge--danger {
    background: #d84e4b;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    vertical-align: -5px;
    border: 2px solid #707274;
    border-top-color: var(--text);
    border-radius: 50%;
}

.runs-panel__link {
    justify-content: center;
    margin: 12px auto 13px;
}

.toast {
    position: fixed;
    z-index: 50;
    right: 24px;
    bottom: 24px;
    max-width: min(360px, calc(100vw - 48px));
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-raised);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px 16px;
    background: var(--background-deep);
}

.auth-shell {
    display: flex;
    width: min(100%, 430px);
    align-items: center;
    flex-direction: column;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: #f4f4f4;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.04em;
}

.auth-brand__logo {
    display: block;
    width: 165px;
    height: 46px;
    object-fit: contain;
}

.auth-card {
    width: 100%;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}

.auth-card__heading {
    margin-bottom: 25px;
}

.auth-card__heading h1 {
    display: block;
    margin-bottom: 8px;
    font-size: 27px;
}

.auth-card__heading p {
    color: var(--text-muted);
    font-size: 13px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-field label {
    color: #e7e7e7;
    font-size: 13px;
    font-weight: 600;
}

.form-field input {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #5a5b5c;
    border-radius: 5px;
    background: #242526;
    color: var(--text);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 159, 47, .14);
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.checkbox-field input {
    width: 15px;
    height: 15px;
    accent-color: var(--orange);
}

.auth-form__submit {
    width: 100%;
    min-height: 43px;
    margin-top: 3px;
}

.form-alert {
    display: flex;
    margin-bottom: 18px;
    padding: 11px 12px;
    flex-direction: column;
    gap: 2px;
    border: 1px solid rgba(240, 92, 85, .5);
    border-radius: 5px;
    background: rgba(240, 92, 85, .1);
    color: #ffb0aa;
    font-size: 12px;
}

.form-alert strong {
    color: #ff8179;
}

.auth-footer {
    margin-top: 17px;
    color: var(--text-subtle);
    font-size: 11px;
}

@media (max-width: 1250px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
    }

    .panel--alerts {
        grid-column: 1 / -1;
    }

    .alert-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }

    .alert-row {
        border-bottom: 0;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar--open {
        transform: translateX(0);
        box-shadow: 8px 0 24px rgba(0, 0, 0, .3);
    }

    .sidebar__close,
    .topbar__menu {
        display: inline-grid;
    }

    .app-content {
        width: 100%;
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar__menu {
        color: var(--text);
    }

    .page-content {
        padding: 22px 16px 32px;
    }

    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }

    .panel--alerts {
        grid-column: auto;
    }
}

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

    .page-heading {
        display: block;
    }

    .page-heading__date {
        display: block;
        margin-top: 8px;
    }

    h1 {
        font-size: 27px;
    }

    .capacity-content {
        flex-direction: column;
        padding-top: 22px;
    }

    .capacity-list {
        width: 100%;
    }

    .alert-list {
        display: block;
    }

    .alert-row {
        border-bottom: 1px solid var(--border-soft);
    }

    .alert-row:last-child {
        border-bottom: 0;
    }

    .user-menu span {
        display: none;
    }

    .topbar__actions {
        gap: 8px;
    }
}
