:root {
    color-scheme: light;
    --bg: #f6f7f8;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #5d6875;
    --line: #d9dee4;
    --accent: #0f766e;
    --accent-dark: #0b5e58;
    --danger: #b42318;
    --focus: #1d4ed8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a {
    color: var(--accent-dark);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.brand {
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.topbar nav a {
    padding: 7px 9px;
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
}

.topbar nav a:hover,
.topbar nav a:focus-visible,
.nav-more summary:hover,
.nav-more summary:focus-visible {
    background: #edf7f5;
    outline: 2px solid transparent;
}

.nav-more {
    position: relative;
}

.nav-more summary {
    min-height: 34px;
    padding: 7px 9px;
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.nav-more summary::-webkit-details-marker {
    display: none;
}

.nav-more div {
    position: absolute;
    right: 0;
    top: 40px;
    z-index: 10;
    display: grid;
    min-width: 220px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(31, 41, 51, .16);
}

.shell {
    width: min(1180px, calc(100% - 28px));
    margin: 24px auto 56px;
}

.hero,
.panel,
.login-box,
.maintenance {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px;
}

.simple-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--accent-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 30px;
    line-height: 1.15;
}

h2 {
    font-size: 22px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.quick-stats article {
    min-height: 124px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 16px;
}

.quick-stats span,
.quick-stats p {
    color: var(--muted);
}

.quick-stats strong {
    display: block;
    margin: 8px 0;
    font-size: 34px;
    line-height: 1;
}

.quick-stats p {
    margin-bottom: 0;
}

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
    align-items: start;
}

.side-stack {
    display: grid;
    gap: 16px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-head p {
    margin-bottom: 0;
    color: var(--muted);
}

.simple-list,
.compact-list,
.archive-links {
    display: grid;
    gap: 10px;
}

.simple-row {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fbfcfd;
}

.row-main strong,
.compact-list strong {
    display: block;
}

.row-main span,
.compact-list span,
.score-line {
    color: var(--muted);
}

.row-main p {
    margin: 8px 0 0;
}

.score-line,
.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.score-line span {
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
}

.score-line .status-pill {
    border-color: #9bd8ad;
    background: #e8f7ee;
    color: #22543d;
}

.row-actions form {
    margin: 0;
}

.row-actions button.small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

button.danger,
.button.danger {
    border-color: var(--danger);
    background: var(--danger);
}

button.danger:hover,
.button.danger:hover {
    border-color: #8f1d14;
    background: #8f1d14;
}

.compact-list {
    margin-bottom: 14px;
}

.compact-list a,
.archive-links a {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    background: #fbfcfd;
}

.compact-list a:hover,
.compact-list a:focus-visible,
.archive-links a:hover,
.archive-links a:focus-visible {
    border-color: var(--accent);
    outline: 0;
}

.archive-panel {
    margin-top: 16px;
}

.archive-links {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.archive-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.stats article {
    min-height: 132px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 16px;
}

.stats span {
    display: block;
    color: var(--muted);
}

.stats strong {
    display: block;
    margin: 8px 0 12px;
    font-size: 34px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.filters,
.editor {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 16px;
}

.filters {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #b8c1cc;
    border-radius: 4px;
    color: var(--text);
    font: inherit;
    font-weight: 400;
    background: #ffffff;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus-visible,
.button:focus-visible {
    outline: 3px solid rgba(29, 78, 216, .22);
    border-color: var(--focus);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

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

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

.button.secondary {
    background: #ffffff;
    color: var(--accent-dark);
}

.button.small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    background: #eef2f4;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.actions form {
    margin: 0;
}

.actions a,
.actions button {
    min-height: 34px;
    padding: 6px 9px;
    border-radius: 4px;
    font-size: 14px;
}

.detail {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
}

.detail dt,
.detail dd {
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.detail dt {
    background: #eef2f4;
    font-weight: 700;
}

.form-actions,
.flow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.flow {
    padding-left: 20px;
}

.notice,
.error {
    padding: 12px;
    border-radius: 4px;
}

.notice {
    background: #e8f7ee;
    border: 1px solid #9bd8ad;
}

.error {
    background: #fff1f0;
    border: 1px solid #f3a7a0;
    color: var(--danger);
}

.login-page,
.front {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box,
.maintenance {
    width: min(460px, 100%);
}

.working {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(31, 41, 51, .42);
    z-index: 20;
}

.working[hidden] {
    display: none;
}

.working div {
    width: min(360px, calc(100% - 32px));
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.working strong,
.working span {
    display: block;
}

.working span {
    margin-top: 6px;
    color: var(--muted);
}

@media (max-width: 760px) {
    .topbar,
    .page-head,
    .simple-hero,
    .section-head {
        display: block;
    }

    .topbar nav {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .nav-more div {
        left: 0;
        right: auto;
    }

    .quick-stats,
    .work-grid {
        grid-template-columns: 1fr;
    }

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

    table {
        min-width: 680px;
    }
}
