:root {
    --background: #f5f6f7;
    --surface: #ffffff;
    --surface-muted: #f3f4f5;
    --border: #d7dadd;
    --border-dark: #aeb3b8;

    --text: #202326;
    --text-muted: #686e73;

    --primary: #315f9c;
    --primary-hover: #254b7c;

    --success: #287a43;
    --success-background: #e6f4ea;

    --warning: #a45b08;
    --warning-background: #fff0d8;

    --danger: #a02c2c;
    --danger-background: #fce8e8;

    --radius: 0.3rem;
}

* {
    box-sizing: border-box;
}

html {
    color: var(--text);
    background: var(--background);
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 16px;
}

body {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--background);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

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

button,
.button {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    border-color: #777;
    background: var(--surface-muted);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

input,
select,
textarea {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    color: var(--text);
    background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(49, 95, 156, 0.3);
    outline-offset: 1px;
    border-color: var(--primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

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

th {
    color: var(--text-muted);
    background: var(--surface-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

tbody tr:hover {
    background: #fafafa;
}

.badge {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.15rem 0.35rem;
    border: 1px solid transparent;
    border-radius: 999px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.success {
    color: var(--success);
    border-color: #aed5ba;
    background: var(--success-background);
}

.badge.danger {
    color: var(--danger);
    border-color: #e2b6b6;
    background: var(--danger-background);
}

.messages {
    margin: 0 0 1rem;
    padding: 0;
}

.messages li {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    list-style: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.errorlist {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
    color: var(--danger);
}

.progress-column {
    min-width: 18rem;
}

.review-progress {
    min-width: 15rem;
}

.review-progress-bar {
    display: flex;
    width: 100%;
    height: 0.65rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #e6e7e8;
}

.progress-segment {
    min-width: 0;
}

.progress-segment.reviewed {
    background: var(--success);
}

.progress-segment.problematic {
    background: #d9821b;
}

.progress-segment.unreviewed {
    background: #c7c9cb;
}

.review-progress-summary {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.review-progress-summary strong {
    color: var(--text);
}

.progress-problematic {
    color: var(--warning);
}

.progress-state {
    font-size: 0.85rem;
}

.progress-state.muted {
    color: var(--text-muted);
}

.progress-state.error {
    color: var(--danger);
    font-weight: 600;
}