:root {
    color-scheme: light;
    --ink: #182f4c;
    --muted: #52657c;
    --blue: #245cce;
    --line: #e1e8f1;
    --paper: #f4f7fb;
    --amber: #99600b;
    --red: #b42f42;
    --green: #197454;
    --sidebar: 224px
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.55 Arial, sans-serif
}

a {
    color: var(--blue);
    text-underline-offset: 3px
}

a:hover {
    text-decoration-thickness: 2px
}

h1,
h2,
h3 {
    font-family: 'Trebuchet MS', Arial, sans-serif;
    line-height: 1.2;
    margin: 0 0 18px
}

h1 {
    font-size: 32px;
    letter-spacing: -.8px
}

h2 {
    font-size: 20px;
    letter-spacing: -.3px
}

p {
    margin: 0 0 16px
}

small {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px
}

.mono,
time {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 13px
}

.muted,
.hint,
.timezone {
    color: var(--muted)
}

.hint {
    font-size: 13px;
    margin: 6px 0 0
}

.eyebrow {
    font: 11px/1.4 ui-monospace, monospace;
    letter-spacing: 1.8px;
    color: var(--muted);
    margin: 0 0 10px
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    background: var(--ink);
    color: #c7d7ed;
    display: flex;
    flex-direction: column;
    padding: 30px 16px;
    z-index: 1
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    text-decoration: none;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-weight: bold;
    line-height: 1.2;
    margin: 0 8px 40px
}

.brand small {
    color: #c7d7ed;
    font-weight: normal;
    margin-top: 7px
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    background: var(--blue);
    color: white;
    width: 43px;
    height: 43px;
    font: 700 19px 'Trebuchet MS', sans-serif;
    border-radius: 10px;
    flex-shrink: 0
}

.sidebar nav {
    display: grid;
    gap: 6px
}

.sidebar nav a {
    padding: 11px 15px;
    color: #c7d7ed;
    text-decoration: none;
    border-radius: 6px;
    border-left: 3px solid transparent
}

.sidebar nav a[aria-current] {
    background: #2a466a;
    border-left-color: #7da9ff;
    color: #fff
}

.sidebar nav a:hover {
    background: #2a466a;
    color: white
}

.sidebar-bottom {
    margin-top: auto;
    font-size: 12px;
    padding: 24px 8px 0
}

.worker-dot {
    display: inline-block;
    background: #8ea0b9;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 7px
}

.worker-dot.alive {
    background: #66d8b0
}

.logout {
    background: transparent;
    color: #c7d7ed;
    padding: 8px 0;
    margin-top: 12px;
    border: none;
    font-size: 13px
}

.main {
    margin-left: var(--sidebar);
    padding: 36px clamp(20px, 4vw, 60px);
    max-width: 1600px
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px
}

.page-header h1 {
    margin-bottom: 0
}

.timezone {
    font-size: 12px
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 26px;
    margin-bottom: 22px
}

.dispatch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #eaf0fc;
    border-left: 4px solid var(--blue);
    padding: 24px 26px;
    margin-bottom: 22px;
    border-radius: 0 10px 10px 0
}

.dispatch h2 {
    margin-bottom: 10px
}

.dispatch p:last-child {
    margin-bottom: 0
}

.lanes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px
}

.lane {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
    background: white;
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: 8px;
    padding: 24px
}

.lane:nth-child(2) {
    border-top-color: var(--amber)
}

.lane-label {
    font: 12px ui-monospace, monospace;
    letter-spacing: 1.4px
}

.lane strong {
    grid-column: 2;
    grid-row: 1/3;
    font-size: 34px;
    align-self: center;
    font-family: ui-monospace, monospace
}

.lane>span:last-child {
    font-size: 13px;
    color: var(--muted)
}

.lane:hover {
    border-color: #8ba9dd
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 0 0 22px;
    gap: 20px
}

.metrics div {
    padding-left: 18px;
    border-left: 2px solid var(--line)
}

dt {
    color: var(--muted);
    font-size: 13px
}

dd {
    margin: 6px 0 0
}

.metrics dd {
    font: 600 26px/1.4 ui-monospace, monospace
}

.metrics+p {
    margin-bottom: 0
}

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

.section-heading h2 {
    margin: 0
}

.section-heading>a {
    font-size: 13px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left
}

th {
    font-size: 12px;
    color: var(--muted);
    font-weight: normal;
    border-bottom: 2px solid var(--line);
    padding: 10px 12px;
    white-space: nowrap
}

td {
    border-bottom: 1px solid var(--line);
    padding: 16px 12px;
    vertical-align: top
}

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

.title-cell {
    min-width: 240px;
    max-width: 550px;
    overflow-wrap: anywhere
}

.title-cell a {
    color: var(--ink);
    text-decoration: none
}

.title-cell a:hover {
    color: var(--blue);
    text-decoration: underline
}

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

.badge {
    display: inline-block;
    font-size: 12px;
    border-radius: 5px;
    padding: 4px 8px;
    background: #edf1f6;
    color: var(--muted);
    white-space: nowrap
}

.badge.synced,
.badge.completed {
    background: #e4f3ed;
    color: var(--green)
}

.badge.error,
.badge.partial {
    background: #fcecef;
    color: var(--red)
}

.badge.running,
.badge.syncing,
.badge.customer {
    background: #e9effc;
    color: var(--blue)
}

.badge.unknown {
    background: #fff3dc;
    color: var(--amber)
}

.badge.supplier {
    background: #e8f2f1;
    color: #24625d
}

.notice {
    background: #eaf0fc;
    border: 1px solid #bfd0f4;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 0 22px;
    overflow-wrap: anywhere
}

.notice.error {
    background: #fcecef;
    border-color: #f1c4cb;
    color: var(--red)
}

.error-text {
    color: var(--red)
}

.log-list {
    list-style: none;
    margin: 0;
    padding: 0
}

.log-list li {
    display: flex;
    align-items: baseline;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    font-size: 13px
}

.log-list li:last-child {
    border: 0
}

.log-list time {
    color: var(--muted);
    white-space: nowrap
}

.log-list li>span {
    flex: 1;
    overflow-wrap: anywhere
}

.log-list a {
    white-space: nowrap
}

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

.form-grid .wide {
    grid-column: 1/-1
}

.stack {
    display: grid;
    gap: 20px
}

.stack>.panel {
    margin: 0
}

.inline-form,
.filter-bar {
    display: flex;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap
}

.inline-form>div {
    flex: 1;
    min-width: 170px
}

.inline-form button,
.filter-bar button {
    flex-shrink: 0
}

.filter-bar>div {
    min-width: 160px
}

.search-field {
    flex: 1
}

label,
legend {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600
}

input,
textarea,
select {
    font: inherit;
    line-height: 1.4;
    border: 1px solid #9aaec7;
    border-radius: 5px;
    padding: 10px 12px;
    background: white;
    color: var(--ink);
    width: 100%;
    min-height: 43px
}

input[type=checkbox] {
    width: 17px;
    height: 17px;
    min-height: 0;
    accent-color: var(--blue);
    margin: 0
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    margin: 0 0 20px;
    cursor: pointer
}

button,
.button {
    display: inline-block;
    font: 600 14px/1.4 Arial, sans-serif;
    border: 1px solid var(--blue);
    border-radius: 5px;
    background: var(--blue);
    color: #fff;
    padding: 11px 18px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    min-height: 43px
}

button:hover,
.button:hover {
    background: #174aaf
}

.secondary {
    background: white;
    color: var(--blue);
    border-color: #a8bbda
}

.secondary:hover {
    background: #edf2fc
}

.logout:hover {
    background: transparent;
    color: white
}

fieldset {
    border: 0;
    padding: 0;
    margin: 24px 0 0
}

.weekdays {
    display: flex;
    gap: 24px;
    flex-wrap: wrap
}

.weekdays .check {
    margin-bottom: 0
}

.form-actions {
    display: flex
}

.check-form {
    margin-top: 25px
}

.connection {
    font-size: 13px;
    color: var(--amber)
}

.connection.connected {
    color: var(--green)
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 25px;
    align-items: center;
    font-size: 13px;
    padding-top: 20px
}

.count {
    font-size: 14px;
    color: var(--muted);
    margin-left: 8px
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 13px
}

.record-title {
    font-size: 17px;
    overflow-wrap: anywhere
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 24px 0
}

.details-grid dd {
    overflow-wrap: anywhere
}

.evidence {
    overflow-wrap: anywhere
}

.preserve-lines {
    white-space: pre-line
}

pre {
    background: #f2f5fa;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px;
    font: 12px/1.6 ui-monospace, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 600px;
    overflow: auto
}

summary {
    color: var(--blue);
    cursor: pointer
}

.login-main {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px
}

.login-main>.notice {
    width: min(430px, 100%)
}

.login-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 36px;
    width: min(430px, 100%)
}

.login-card .brand-mark {
    margin-bottom: 28px
}

.login-card h1 {
    font-size: 28px
}

.login-card .stack {
    margin-top: 25px
}

.visually-hidden {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: white;
    padding: 12px;
    transform: translateY(-200%)
}

.skip-link:focus {
    transform: translateY(0)
}

:focus-visible {
    outline: 3px solid #be7c0a;
    outline-offset: 4px
}

@media(max-width:1000px) {
    :root {
        --sidebar: 190px
    }

    .main {
        padding: 28px 22px
    }

    .filter-bar>div {
        flex: 1
    }

    .dispatch {
        align-items: flex-start;
        flex-direction: column
    }

    .log-list li {
        flex-wrap: wrap
    }

    .log-list li>span {
        min-width: 50%
    }
}

@media(max-width:720px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 18px
    }

    .brand {
        margin: 0 0 18px
    }

    .brand br {
        display: none
    }

    .brand small {
        margin-top: 3px
    }

    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 2px
    }

    .sidebar nav a {
        font-size: 13px;
        padding: 8px 10px
    }

    .sidebar-bottom {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
        padding: 14px 8px 0
    }

    .sidebar-bottom form {
        margin-left: auto
    }

    .logout {
        padding: 0;
        margin: 0;
        min-height: 30px
    }

    .main {
        margin-left: 0;
        padding: 26px 16px
    }

    .page-header {
        align-items: flex-start
    }

    .page-header h1 {
        font-size: 27px
    }

    .panel {
        padding: 20px 16px
    }

    .lanes {
        grid-template-columns: 1fr;
        gap: 12px
    }

    .lane {
        padding: 20px
    }

    .form-grid,
    .details-grid {
        grid-template-columns: 1fr
    }

    .form-grid .wide {
        grid-column: auto
    }

    .inline-form {
        align-items: stretch
    }

    .inline-form>div,
    .filter-bar>div {
        flex-basis: 100%
    }

    .inline-form button,
    .filter-bar button {
        width: 100%
    }

    .weekdays {
        gap: 17px
    }

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

    .metrics dd {
        font-size: 23px
    }

    .timezone {
        max-width: 110px;
        overflow-wrap: anywhere
    }

    .dispatch {
        padding: 20px
    }

    .login-card {
        padding: 28px
    }

    .log-list li>span {
        flex-basis: 100%
    }
}

.probe-import {
    margin-top: 24px;
}

.probe-import .stack {
    margin-top: 18px;
}

.probe-import textarea {
    font-family: monospace;
    font-size: 16px;
    resize: vertical;
}

.probe-copy {
    margin-bottom: 20px;
}

.probe-value {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 34rem;
    max-height: 14rem;
    overflow: auto;
    min-width: 12rem;
    margin: 0;
}

.probe-warnings {
    padding-inline-start: 22px;
    line-height: 1.6;
}

.probe-actions {
    flex-wrap: wrap;
    gap: 12px;
}

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

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto
    }
}
