:root {
    --bg: #f4f1ea;
    --surface: #fffdf8;
    --ink: #1b241c;
    --muted: #4d5a50;
    --line: #d5d0c4;
    --accent: #1f4d3a;
    --accent-hover: #16382b;
    --danger: #8a1f1f;
    --danger-bg: #f8e8e8;
    --ok: #1f4d3a;
    --warn: #7a5b12;
    --focus: #0b57d0;
    --font: "Segoe UI", "Liberation Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    line-height: 1.5;
}

a { color: var(--accent); }

a:focus, button:focus, input:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.wrap {
    width: min(960px, calc(100% - 32px));
    margin: 32px auto;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 24px;
}

.site-header, .site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
    flex-wrap: wrap;
}

.muted { color: var(--muted); }

h1, h2 { line-height: 1.2; }

.login-box {
    width: min(420px, calc(100% - 32px));
    margin: 72px auto;
}

label {
    display: block;
    font-weight: 600;
    margin: 16px 0 6px;
}

input[type="text"], input[type="password"], input[type="date"], input[type="file"], textarea, select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #6b746c;
    border-radius: 4px;
    font: inherit;
    background: #fff;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 8px;
}

.admin-nav a[aria-current="page"] { font-weight: 700; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.data th, table.data td {
    border-bottom: 1px solid var(--line);
    text-align: left;
    padding: 8px 6px;
    vertical-align: top;
}

form.inline { display: inline-block; margin: 0 6px 0 0; }

form.inline button {
    padding: 6px 10px;
    font-size: 0.9rem;
}

pre.preview {
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid var(--line);
    padding: 12px;
    max-height: 480px;
    overflow: auto;
}

button, .button {
    display: inline-block;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .button:hover { background: var(--accent-hover); }

.alert {
    padding: 12px 14px;
    border-radius: 4px;
    margin: 12px 0;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.status {
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 4px;
}

.status strong { display: block; }

.skip-link {
    position: absolute;
    left: -999px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    background: #fff;
    padding: 8px;
    z-index: 10;
}

@media (max-width: 640px) {
    .wrap, .login-box { margin-top: 16px; }
}
