:root {
    --bg: #f4efe5;
    --bg-strong: #e7dcc8;
    --surface: #fffaf2;
    --surface-strong: #f8f0e2;
    --ink: #1f1b16;
    --muted: #6f6559;
    --line: rgba(31, 27, 22, 0.12);
    --brand: #bf5a36;
    --brand-dark: #7a3218;
    --accent: #1f6b5d;
    --danger: #8e2f2f;
    --shadow: 0 24px 60px rgba(77, 52, 30, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(191, 90, 54, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(31, 107, 93, 0.14), transparent 28%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: Consolas, "Courier New", monospace;
    background: rgba(31, 27, 22, 0.06);
    padding: 0.14rem 0.4rem;
    border-radius: 999px;
}

.page-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    padding: 30px 24px;
    border-right: 1px solid var(--line);
    background: rgba(255, 250, 242, 0.82);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 30px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.brand strong,
.hero h1,
.panel h2,
.card h3,
.login-card h1,
.admin-header h1 {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.brand small,
.muted {
    display: block;
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.sidebar-nav a {
    padding: 11px 14px;
    border-radius: 14px;
    transition: 0.2s ease;
}

.sidebar-nav a:hover {
    background: var(--surface-strong);
    transform: translateX(3px);
}

.sidebar-card,
.panel,
.card,
.hero-panel,
.login-card,
.admin-table,
.meta-panel {
    background: rgba(255, 250, 242, 0.9);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.sidebar-card,
.panel,
.card,
.hero-panel,
.login-card {
    border-radius: var(--radius);
}

.content {
    padding: 36px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}

.hero.compact {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--brand-dark);
    margin: 0 0 8px;
}

.lead {
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-panel {
    padding: 24px;
    display: grid;
    gap: 16px;
    align-content: center;
}

.stat strong {
    display: block;
    font-size: 2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.panel {
    padding: 26px;
    margin-bottom: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
}

.button.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}

.button.subtle {
    background: var(--surface-strong);
    color: var(--ink);
}

.card-grid,
.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card {
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.card::after {
    content: "";
    position: absolute;
    inset: auto -10% -40% auto;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(191, 90, 54, 0.2), transparent 70%);
}

.card-top,
.pill-row,
.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.tag,
.pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    font-size: 0.92rem;
}

.database-list article + article {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.rich-content,
.rich-content ul,
.rich-content ol {
    color: var(--ink);
}

.rich-content ul,
.rich-content ol {
    padding-left: 20px;
}

.meta-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 24px 26px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.database-callout {
    border-color: rgba(31, 107, 93, 0.3);
}

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

.login-card {
    width: min(540px, 100%);
    padding: 32px;
}

.alert.error {
    background: rgba(142, 47, 47, 0.12);
    color: var(--danger);
    border: 1px solid rgba(142, 47, 47, 0.2);
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.admin-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.admin-shell.narrow {
    max-width: 860px;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: var(--radius);
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.section-row {
    background: rgba(31, 27, 22, 0.04);
}

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

.actions a {
    color: var(--brand-dark);
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}

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

textarea.is-focused,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(191, 90, 54, 0.22);
    border-color: rgba(191, 90, 54, 0.45);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: auto;
}

.text-link {
    color: var(--brand-dark);
    font-weight: 700;
}

@media (max-width: 980px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .content,
    .admin-shell {
        padding: 24px 16px 36px;
    }

    .hero,
    .card-grid,
    .two-col,
    .meta-panel,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

