:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-subtle: #f7f9fc;
    --text: #111827;
    --text-soft: #354052;
    --muted: #667085;
    --muted-light: #98a2b3;
    --border: #d6dee8;
    --border-strong: #bac6d5;
    --accent: #1452a4;
    --accent-hover: #0f4388;
    --accent-soft: #edf5ff;
    --overdue: #d31d25;
    --soon: #d99100;
    --ok: #2f8b1f;
    --no-data: #74808c;
    --danger-soft: #fff1f1;
    --radius: 8px;
    --radius-lg: 10px;
    --focus: 0 0 0 3px rgba(20, 82, 164, .16);
    --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

.app-page {
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

.sr-only {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #172b49;
    font-size: 22px;
    font-weight: 720;
    letter-spacing: -.02em;
    text-decoration: none;
    white-space: nowrap;
}

.brand__mark {
    width: 28px;
    height: 32px;
    color: #183c69;
    flex: none;
}

.brand--large {
    gap: 14px;
    font-size: 34px;
}

.brand--large .brand__mark {
    width: 49px;
    height: 55px;
    color: var(--accent);
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible,
.icon-button:focus-visible,
.expander:focus-visible,
.row-action:focus-visible,
.user-menu__logout:focus-visible,
.main-nav__link:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

.button--primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

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

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

.button--outline:hover {
    background: var(--accent-soft);
}

.button--quiet {
    border-color: var(--border);
    color: var(--text-soft);
}

.button--quiet:hover {
    border-color: var(--border-strong);
    background: var(--surface-subtle);
}

.button--wide {
    width: 100%;
    min-height: 54px;
    font-size: 17px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input,
select {
    min-height: 44px;
    padding: 9px 12px;
}

textarea {
    min-height: 82px;
    padding: 11px 12px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-light);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: var(--focus);
}

.field {
    display: grid;
    gap: 7px;
}

.field__label {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

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

.form-alert,
.app-alert {
    border: 1px solid #efb7b9;
    border-radius: var(--radius);
    background: var(--danger-soft);
    color: #9f1820;
}

.form-alert {
    margin-bottom: 18px;
    padding: 11px 13px;
    font-size: 14px;
}

.app-alert {
    position: fixed;
    z-index: 60;
    top: 82px;
    right: 28px;
    max-width: 440px;
    padding: 12px 16px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .12);
}

.app-alert.is-success {
    border-color: #a9d39f;
    background: #f1faef;
    color: #226419;
}

/* Authentication */

.auth-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    align-items: center;
    overflow: hidden;
}

.auth-shell {
    width: 100%;
    padding: 72px 24px;
}

.auth-panel {
    width: min(620px, 100%);
    margin: 0 auto;
}

.auth-panel > .brand {
    display: flex;
    width: max-content;
    margin: 0 auto;
}

.auth-heading {
    margin: 75px 0 58px;
    text-align: center;
}

.auth-heading h1,
.setup-panel h1 {
    margin: 0;
    font-size: clamp(32px, 4vw, 43px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.auth-heading p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 19px;
}

.auth-form {
    display: grid;
    gap: 30px;
}

.auth-form .field__label {
    font-size: 16px;
}

.input-with-icon {
    position: relative;
    display: block;
}

.input-with-icon svg {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    width: 23px;
    height: 23px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted-light);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    pointer-events: none;
}

.input-with-icon input {
    min-height: 58px;
    padding-left: 54px;
    font-size: 17px;
}

.auth-note {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 75px;
    padding-top: 45px;
    color: var(--text-soft);
    font-size: 16px;
}

.auth-note::before,
.auth-note::after {
    position: absolute;
    top: 0;
    width: calc(50% - 24px);
    height: 1px;
    background: var(--border);
    content: "";
}

.auth-note::before { left: 0; }
.auth-note::after { right: 0; }

.auth-note svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.8;
}

.auth-note::marker {
    color: var(--accent);
}

.auth-rail {
    position: absolute;
    right: 3vw;
    left: 3vw;
    height: 2px;
    background: repeating-linear-gradient(to right, var(--border) 0, var(--border) 28%, transparent 28%, transparent 29.4%);
}

.auth-rail::before,
.auth-rail::after,
.auth-rail span {
    position: absolute;
    top: -1px;
    height: 4px;
    background: var(--accent);
    content: "";
}

.auth-rail::before { left: 42%; width: 14%; }
.auth-rail::after { right: 30.5%; width: 6px; background: var(--border-strong); }
.auth-rail span { left: 28.5%; width: 6px; background: var(--border-strong); }
.auth-rail--top { top: 5%; }
.auth-rail--bottom { bottom: 5%; }

/* Setup */

.setup-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background: var(--surface-subtle);
}

.setup-shell {
    width: 100%;
    padding: 40px 20px;
}

.setup-panel {
    width: min(560px, 100%);
    margin: 0 auto;
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
}

.setup-panel h1 {
    margin-top: 34px;
    font-size: 30px;
}

.setup-copy {
    margin: 10px 0 24px;
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 17px;
}

/* App shell */

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    min-height: 70px;
    grid-template-columns: minmax(210px, auto) 1fr auto;
    align-items: stretch;
    padding: 0 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .97);
}

.topbar > .brand {
    align-self: center;
}

.main-nav {
    display: flex;
    align-items: stretch;
    gap: 30px;
    margin-left: 48px;
}

.main-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 3px 3px 0;
    color: var(--text-soft);
    font-size: 15px;
    font-weight: 540;
    text-decoration: none;
}

.main-nav__link::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
    content: "";
}

.main-nav__link:hover,
.main-nav__link.is-active {
    color: var(--accent);
}

.main-nav__link.is-active::after {
    background: var(--accent);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu__avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #334155;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.user-menu__name {
    max-width: 180px;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu form {
    margin: 0;
}

.user-menu__logout {
    padding: 6px 7px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
}

.user-menu__logout:hover {
    color: var(--accent);
}

.app-main {
    width: 100%;
    margin: 0;
    padding: 34px 20px 28px;
}

.view {
    display: none;
}

.view.is-active {
    display: block;
}

.page-heading {
    display: flex;
    min-height: 70px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
}

.page-heading h1 {
    margin: 0;
    color: #0d1117;
    font-size: clamp(27px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -.035em;
}

.page-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.metrics-rail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 26px;
    padding: 15px 0 18px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.metric {
    min-width: 0;
    padding: 0 38px;
    border-left: 1px solid var(--border);
}

.metric:first-child {
    padding-left: 40px;
    border-left: 0;
}

.metric__label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-soft);
    font-size: 14px;
    white-space: nowrap;
}

.metric__dot,
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 50%;
    background: currentColor;
}

.metric.status-overdue .metric__dot { background: var(--overdue); }
.metric.status-soon .metric__dot { background: var(--soon); }
.metric.status-ok .metric__dot { background: var(--ok); }
.metric.status-no_data .metric__dot { background: var(--no-data); }

.metric__value {
    margin: 2px 0 0 22px;
    color: currentColor;
    font-size: 31px;
    font-weight: 520;
    line-height: 1.2;
}

.status-overdue { color: var(--overdue); }
.status-soon { color: var(--soon); }
.status-ok { color: var(--ok); }
.status-no_data { color: var(--no-data); }

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 1fr) minmax(190px, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.filters input,
.filters select {
    min-height: 46px;
}

.search-control {
    position: relative;
}

.search-control svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 21px;
    height: 21px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 1.8;
}

.search-control input {
    padding-left: 44px;
}

.check-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 14px;
    white-space: nowrap;
}

.check-control input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
}

.table-frame {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.table-scroll {
    overflow-x: visible;
    overflow-y: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th:not(:last-child),
td:not(:last-child) {
    border-right: 1px solid rgba(214, 222, 232, .75);
}

thead th {
    height: 50px;
    padding: 10px;
    background: #fbfcfe;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;
    white-space: normal;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody td {
    height: 58px;
    padding: 8px 10px;
    color: var(--text-soft);
    font-size: 13px;
}

.resource-table {
    min-width: 0;
    table-layout: fixed;
}

.resource-table th:nth-child(1) { width: 25%; }
.resource-table th:nth-child(2) { width: 7%; }
.resource-table th:nth-child(3) { width: 9%; }
.resource-table th:nth-child(4) { width: 6%; }
.resource-table th:nth-child(5) { width: 9%; }
.resource-table th:nth-child(6) { width: 9%; }
.resource-table th:nth-child(7) { width: 7%; }
.resource-table th:nth-child(8) { width: 5%; }
.resource-table th:nth-child(9) { width: 6%; }
.resource-table th:nth-child(10) { width: 17%; }

.resource-table th:nth-child(4),
.resource-table th:nth-child(9),
.resource-table td:nth-child(4),
.resource-table td:nth-child(9),
.indicator-cell {
    padding-right: 4px;
    padding-left: 4px;
    text-align: center;
}

.resource-table tbody tr {
    position: relative;
    transition: background-color .12s ease;
}

.resource-table tbody tr:hover,
.resource-table tbody tr:focus-within {
    background: var(--accent-soft);
}

.resource-table tbody tr td:first-child {
    position: relative;
}

.resource-table tbody tr td:first-child::before {
    position: absolute;
    top: -1px;
    bottom: -1px;
    left: 0;
    width: 4px;
    background: var(--row-status, transparent);
    content: "";
}

.resource-table tr[data-status="overdue"] { --row-status: var(--overdue); }
.resource-table tr[data-status="soon"] { --row-status: var(--soon); }
.resource-table tr[data-status="ok"] { --row-status: var(--ok); }
.resource-table tr[data-status="no_data"] { --row-status: var(--no-data); }

.client-row td {
    height: 62px;
    background: #fdfefe;
    font-weight: 610;
}

.client-row:hover td,
.client-row:focus-within td {
    background: var(--accent-soft);
}

.name-cell {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.expander {
    display: grid;
    width: 30px;
    height: 30px;
    flex: none;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: #fff;
    color: var(--text-soft);
}

.expander svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    transition: transform .15s ease;
}

.expander[aria-expanded="true"] svg {
    transform: rotate(90deg);
}

.name-stack {
    min-width: 0;
}

.name-stack strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.name-stack small {
    display: block;
    overflow: hidden;
    margin-top: 1px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-name {
    position: relative;
    padding-left: 42px;
}

.resource-name::before {
    position: absolute;
    top: -29px;
    bottom: -29px;
    left: 19px;
    width: 1px;
    background: var(--border);
    content: "";
}

.resource-name::after {
    position: absolute;
    top: 50%;
    left: 19px;
    width: 13px;
    height: 1px;
    background: var(--border);
    content: "";
}

.resource-glyph {
    display: grid;
    width: 29px;
    height: 29px;
    flex: none;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    color: #40526a;
}

.resource-glyph svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
}

.abb-resource-meta {
    max-width: 300px;
}

.table-muted {
    color: var(--muted);
}

.backup-volume {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.backup-count {
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
}

.abb-state,
.abb-result {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.abb-state::before,
.abb-result::before {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--abb-color, var(--no-data));
    content: "";
}

.abb-state[data-state="online"],
.abb-result[data-result="success"] {
    --abb-color: var(--ok);
}

.abb-state[data-state="offline"],
.abb-result[data-result="failure"] {
    --abb-color: var(--overdue);
}

.abb-result[data-result="partial_success"],
.abb-result[data-result="cancelled"] {
    --abb-color: var(--soon);
}

.problems-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    white-space: nowrap;
}

.status-label .status-dot {
    width: 8px;
    height: 8px;
    color: var(--status-color);
}

.status-label[data-status="overdue"] { --status-color: var(--overdue); }
.status-label[data-status="soon"] { --status-color: var(--soon); }
.status-label[data-status="ok"] { --status-color: var(--ok); }
.status-label[data-status="no_data"] { --status-color: var(--no-data); }

.compact-indicator {
    position: relative;
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    cursor: help;
    vertical-align: middle;
}

.compact-indicator__dot {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 50%;
    background: var(--indicator-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--indicator-color) 38%, transparent),
        0 2px 5px color-mix(in srgb, var(--indicator-color) 24%, transparent);
}

.compact-indicator[data-state="success"] { --indicator-color: var(--ok); }
.compact-indicator[data-state="error"] { --indicator-color: var(--overdue); }

.compact-indicator::after {
    position: absolute;
    z-index: 40;
    bottom: calc(100% + 7px);
    left: 50%;
    max-width: 280px;
    padding: 7px 9px;
    border-radius: 5px;
    background: #142033;
    box-shadow: 0 6px 18px rgba(20, 32, 51, .2);
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 520;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    text-align: left;
    transform: translate(-50%, 4px);
    transition: opacity .12s ease, transform .12s ease;
    white-space: nowrap;
}

.compact-indicator:hover::after,
.compact-indicator:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.compact-indicator:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.actions-cell {
    text-align: right;
    white-space: normal;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 7px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    background: #fff;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 620;
    line-height: 1.2;
    text-decoration: none;
}

.row-action:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.resource-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.row-action--details {
    border-color: var(--accent);
    color: var(--accent);
}

.row-action--icon {
    width: 36px;
    padding: 5px;
}

.row-action--icon svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.row-action--confirm {
    visibility: hidden;
    margin: 2px 4px 2px 0;
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.row-action--download {
    margin: 2px 3px 2px 0;
    border-color: #b8c9dc;
    background: #f5f8fb;
    color: #315474;
    font-size: 10px;
    letter-spacing: .03em;
}

.row-action--secret {
    margin: 2px 3px 2px 0;
}

.secret-value {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    letter-spacing: .02em;
}

tr:hover .row-action--confirm,
tr:focus-within .row-action--confirm {
    visibility: visible;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 2px 0;
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    padding: 58px 24px;
    color: var(--muted);
    text-align: center;
}

.management-table,
.history-table {
    min-width: 850px;
}

.management-table th:first-child { width: 24%; }
.management-table th:nth-child(2),
.management-table th:nth-child(3) { width: 13%; }
.management-table th:last-child { width: 160px; }
.history-table th:first-child { width: 15%; }
.history-table th:nth-child(2) { width: 22%; }
.history-table th:nth-child(3) { width: 14%; }
.history-table th:nth-child(4) { width: 16%; }
.history-table th:nth-child(5) { width: 15%; }

.management-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.muted {
    color: var(--muted);
}

/* Dialogs */

.app-dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: 0 22px 60px rgba(16, 24, 40, .18);
}

.app-dialog--wide {
    width: min(720px, calc(100vw - 32px));
}

.app-dialog::backdrop {
    background: rgba(17, 24, 39, .42);
    backdrop-filter: blur(1px);
}

.dialog-form {
    padding: 26px;
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.dialog-heading h2 {
    margin: 0;
    font-size: 23px;
    line-height: 1.25;
    letter-spacing: -.025em;
}

.dialog-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: none;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: var(--muted);
    font-size: 21px;
    line-height: 1;
}

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

.dialog-form > .field + .field {
    margin-top: 17px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 17px;
}

.field--span-2 {
    grid-column: 1 / -1;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 26px;
    padding-top: 19px;
    border-top: 1px solid var(--border);
}

.dialog-note {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .topbar {
        grid-template-columns: auto 1fr;
        padding: 0 20px;
    }

    .main-nav {
        order: 3;
        grid-column: 1 / -1;
        height: 46px;
        margin-left: 0;
        border-top: 1px solid var(--border);
    }

    .user-menu {
        justify-self: end;
    }

    .app-main {
        padding: 28px 20px;
    }

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

    .resource-table {
        min-width: 1100px;
    }

    .filters {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .check-control {
        min-height: 44px;
    }

    .metric,
    .metric:first-child {
        padding: 0 22px;
    }
}

@media (max-width: 680px) {
    .topbar {
        position: static;
        min-height: 60px;
        padding: 0 14px;
    }

    .topbar .brand {
        font-size: 19px;
    }

    .topbar .brand__mark {
        width: 24px;
        height: 28px;
    }

    .main-nav {
        gap: 22px;
        overflow-x: auto;
    }

    .user-menu__name {
        display: none;
    }

    .user-menu__logout {
        font-size: 12px;
    }

    .app-main {
        padding: 23px 14px;
    }

    .page-heading {
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .page-heading .button {
        align-self: flex-start;
    }

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

    .metric,
    .metric:first-child {
        padding: 14px 18px;
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .metric:nth-child(odd) {
        border-right: 1px solid var(--border);
    }

    .metric:nth-child(-n+2) {
        border-top: 0;
    }

    .metric__value {
        font-size: 27px;
    }

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

    .row-action--confirm {
        visibility: visible;
    }

    .table-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

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

    .field--span-2 {
        grid-column: auto;
    }

    .dialog-form {
        padding: 20px;
    }

    .auth-shell {
        padding: 55px 20px;
    }

    .brand--large {
        font-size: 28px;
    }

    .brand--large .brand__mark {
        width: 41px;
        height: 47px;
    }

    .auth-heading {
        margin: 34px 0 28px;
    }

    .auth-heading h1 {
        font-size: 32px;
    }

    .auth-heading p {
        font-size: 16px;
    }

    .auth-note {
        align-items: flex-start;
        text-align: center;
    }

    .auth-rail {
        right: 20px;
        left: 20px;
    }

    .setup-panel {
        padding: 26px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
