:root {
    color-scheme: light;
    --ink: #1c2430;
    --muted: #5c6675;
    --paper: #f3efe6;
    --card: #fffdf8;
    --line: #e2d8c8;
    --accent: #b8612d;
    --accent-dark: #8d4520;
    --ok: #1f6b45;
    --ok-bg: #e5f4eb;
    --error: #8d2b2b;
    --error-bg: #f8e8e4;
    --header: #1c2430;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Candara, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, #efe4d2 0, transparent 28rem),
        var(--paper);
}

.site-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.9rem 1.5rem;
    background: var(--header);
    color: #f7f1e7;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.brand img {
    height: 36px;
    width: auto;
}

.site-header nav {
    display: flex;
    gap: 1rem;
}

.site-header nav a {
    color: #f7f1e7;
    text-decoration: none;
}

.site-header nav a:hover {
    color: #f0c7a4;
}

.account {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #d9cfc2;
}

.account form {
    margin: 0;
}

main {
    width: min(1180px, calc(100% - 2rem));
    margin: 2rem auto 3rem;
}

.panel,
.auth-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.5rem 1.6rem 1.7rem;
    box-shadow: 0 12px 30px rgba(28, 36, 48, 0.05);
}

.auth-card {
    width: min(440px, 100%);
    margin: 8vh auto 0;
}

.panel + .panel {
    margin-top: 1rem;
}

.history-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.5rem;
}

.history-toolbar .lede {
    margin: 0;
}

.history-toolbar label {
    margin: 0;
}

.history-toolbar select {
    width: 5.5rem;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

.pager a,
.pager-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    text-decoration: none;
    font-weight: 700;
}

.pager-current {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 0.4rem;
    font-size: 1.8rem;
    font-weight: 650;
}

h2 {
    margin: 1.4rem 0 0.5rem;
    font-size: 1rem;
}

h3 {
    margin: 1.1rem 0 0.35rem;
    font-size: 0.95rem;
}

.lede,
.empty {
    color: var(--muted);
    line-height: 1.5;
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="file"],
select {
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: 1px solid #cbbfae;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.check input {
    width: 1rem;
    height: 1rem;
}

button,
.link {
    margin-top: 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: white;
    font: inherit;
    font-weight: 700;
    padding: 0.7rem 1.15rem;
    cursor: pointer;
}

button:hover,
.link:hover {
    background: var(--accent-dark);
}

.link {
    margin-top: 0;
}

.validation,
.banner-error {
    color: var(--error);
}

.validation {
    display: block;
    margin-top: 0.3rem;
}

.banner {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
}

.banner-error {
    background: var(--error-bg);
}

.banner-ok {
    color: var(--ok);
    background: var(--ok-bg);
}

.columns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.columns li {
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: #f6efe4;
    border: 1px solid var(--line);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.stats div {
    padding: 0.75rem;
    border-radius: 12px;
    background: #f7f3eb;
}

.stats dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.stats dd {
    margin: 0.2rem 0 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

.report-table {
    max-height: 28rem;
    overflow: auto;
    margin-top: 0.5rem;
}

.report-table thead th {
    position: sticky;
    top: 0;
    background: var(--card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 0.65rem 0.45rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.filters {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr auto;
    gap: 0.7rem;
    align-items: end;
    margin-top: 1rem;
}

.filters button,
.actions button {
    margin-top: 0;
}

.filter-label {
    margin-top: 0.4rem;
}

.suggestion {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e3b1a4;
    border-radius: 12px;
    background: var(--error-bg);
}

.unmatched-title {
    color: var(--error);
    font-weight: 700;
    background: #f8d9d2;
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.text-link,
.actions-cell a,
.panel a {
    color: var(--accent-dark);
    font-weight: 700;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell a + a {
    margin-left: 0.7rem;
}

@media (max-width: 900px) {
    .filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .site-header {
        flex-wrap: wrap;
    }

    .account {
        margin-left: 0;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }
}
