:root {
    color-scheme: light;
    --bg: #f3ead9;
    --bg-accent: #dce8d2;
    --surface: rgba(255, 251, 244, 0.92);
    --surface-strong: #fff8ee;
    --surface-tint: #e6efe2;
    --text: #213126;
    --muted: #5f6f62;
    --line: rgba(53, 76, 58, 0.15);
    --shadow: 0 14px 40px rgba(55, 74, 49, 0.12);
    --shadow-soft: 0 10px 24px rgba(55, 74, 49, 0.08);
    --brand: #305b3c;
    --brand-strong: #223f2b;
    --brand-soft: #dcebd7;
    --action: #c76a39;
    --action-strong: #a95228;
    --good-bg: #dcefd8;
    --good-text: #234f2e;
    --attention-bg: #f3e8c8;
    --attention-text: #785a17;
    --warning-bg: #f6d7ba;
    --warning-text: #8f4b20;
    --danger-bg: #f7cfca;
    --danger-text: #8f302a;
    --muted-bg: #ebe7de;
    --muted-text: #625b50;
    --neutral-bg: #e7efe8;
    --neutral-text: #395346;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 999px;
}

* {
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top left, rgba(244, 205, 160, 0.35), transparent 28rem),
        radial-gradient(circle at top right, rgba(150, 182, 131, 0.28), transparent 24rem),
        linear-gradient(180deg, #f7efe3 0%, #eff5eb 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
    line-height: 1.55;
}

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

img {
    display: block;
    max-width: 100%;
}

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

.site-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: 1rem;
}

.site-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 252, 246, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(53, 76, 58, 0.12);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem;
}

.brand {
    display: flex;
    gap: 0.9rem;
    align-items: center;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, var(--brand) 0%, #57835c 100%);
    color: #fff8ef;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name,
.hero-title,
.section-title,
.card-title,
.page-title {
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.86rem;
}

.nav-links,
.nav-meta {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: var(--surface-tint);
    color: var(--brand-strong);
    transform: translateY(-1px);
}

.nav-link-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 700;
}

.nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    background: rgba(53, 91, 60, 0.08);
    color: var(--brand-strong);
    font-size: 0.9rem;
}

.nav-counter {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--action);
    color: white;
    font-size: 0.76rem;
    font-weight: 700;
}

.nav-logout {
    margin: 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button-primary,
button {
    background: linear-gradient(135deg, var(--action) 0%, var(--action-strong) 100%);
    color: #fffaf5;
    box-shadow: 0 12px 24px rgba(199, 106, 57, 0.22);
}

.button-secondary {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

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

.button:hover,
button:hover,
.button:focus-visible,
button:focus-visible {
    transform: translateY(-1px);
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-top: 1rem;
}

.hero,
.panel,
.stat-card,
.list-card,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -4rem -4rem auto;
    width: 16rem;
    height: 16rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(199, 106, 57, 0.16), transparent 65%);
    pointer-events: none;
}

.hero-kicker,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--brand);
    font-weight: 700;
}

.hero-title,
.page-title {
    margin: 0.25rem 0 0;
    font-size: clamp(2rem, 3vw, 3.15rem);
    line-height: 1.05;
}

.hero-text,
.page-intro,
.muted {
    color: var(--muted);
}

.hero-actions,
.panel-actions,
.inline-actions,
.stat-grid,
.detail-grid,
.card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hero-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.meta-pill {
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    background: rgba(48, 91, 60, 0.08);
    color: var(--brand-strong);
    font-weight: 600;
}

.panel {
    padding: 1.35rem;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: clamp(1.8rem, 2.8vw, 2.55rem);
}

.section-title,
.card-title {
    margin: 0;
    font-size: 1.25rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.stat-card {
    padding: 1.1rem;
    background:
        linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(236, 244, 232, 0.88));
}

.stat-label {
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat-value {
    margin-top: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-strong);
}

.stat-note {
    margin-top: 0.25rem;
    color: var(--muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: var(--radius-sm);
    padding: 0.42rem 0.75rem;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-good { background: var(--good-bg); color: var(--good-text); }
.status-attention { background: var(--attention-bg); color: var(--attention-text); }
.status-warning { background: var(--warning-bg); color: var(--warning-text); }
.status-danger { background: var(--danger-bg); color: var(--danger-text); }
.status-muted { background: var(--muted-bg); color: var(--muted-text); }
.status-neutral { background: var(--neutral-bg); color: var(--neutral-text); }

.list-card {
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(55, 74, 49, 0.12);
}

.list-card-top,
.list-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: start;
}

.list-meta,
.detail-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.95rem;
}

.list-photo,
.detail-photo {
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(180deg, #e6efe2, #f6e8dc);
    min-height: 12rem;
}

.list-photo img,
.detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-state {
    padding: 1.3rem;
    color: var(--muted);
    text-align: center;
}

.two-column {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
    gap: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.detail-card {
    background: rgba(48, 91, 60, 0.06);
    border-radius: 1rem;
    padding: 0.9rem;
}

.detail-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.timeline-item {
    display: flex;
    gap: 0.75rem;
    align-items: start;
}

.timeline-mark {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--brand);
    margin-top: 0.45rem;
    flex: none;
}

.notification-card.is-unread {
    border-left: 5px solid var(--action);
    background: #fff9f2;
}

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

.form-panel form {
    display: grid;
    gap: 0.9rem;
}

form p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

label {
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.82rem 0.95rem;
    border-radius: 1rem;
    border: 1px solid rgba(53, 76, 58, 0.15);
    background: rgba(255, 255, 255, 0.72);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
.button:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid rgba(199, 106, 57, 0.28);
    outline-offset: 2px;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 0;
    display: grid;
    gap: 0.5rem;
}

.messages li {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(48, 91, 60, 0.1);
    border: 1px solid rgba(48, 91, 60, 0.14);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.panel,
.stat-card,
.list-card,
.empty-state {
    animation: rise-in 220ms ease;
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .two-column {
        grid-template-columns: 1fr;
    }

    .site-shell {
        padding: 1rem;
    }
}

@media (max-width: 680px) {
    .site-nav,
    .page-header,
    .list-card-top,
    .list-row {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-meta {
        width: 100%;
        justify-content: space-between;
    }

    .button,
    button {
        width: 100%;
    }

    .nav-logout {
        width: 100%;
    }
}
