:root {
    color-scheme: light;
    --bg: #f3f0e8;
    --surface: #fffaf3;
    --panel: rgba(255, 255, 255, .9);
    --text: #17211d;
    --muted: #637169;
    --line: rgba(23, 33, 29, .12);
    --primary: #0f6b57;
    --primary-dark: #0a4b3e;
    --accent: #c86f43;
    --gold: #b99655;
    --blue: #315f77;
    --danger: #a53434;
    --shadow: 0 24px 70px rgba(23, 33, 29, .14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(15, 107, 87, .12), transparent 34%),
        linear-gradient(315deg, rgba(200, 111, 67, .12), transparent 28%),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    background-image:
        linear-gradient(rgba(23, 33, 29, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 33, 29, .035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

.page-shell,
.admin-shell {
    width: min(1160px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.page-shell.compact {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.topbar,
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 32px;
}

.brand,
.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 900;
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--text);
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 33, 29, .22);
}

.admin-link {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .62);
    color: var(--primary-dark);
    padding: 8px 14px;
}

.intro {
    margin-bottom: 30px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    align-items: stretch;
    gap: 26px;
}

.hero-copy {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 8px;
    background:
        linear-gradient(115deg, rgba(23, 33, 29, .82), rgba(23, 33, 29, .48)),
        linear-gradient(135deg, #2f574b, #91644c 55%, #d6b371);
    color: #fff;
    overflow: hidden;
    padding: clamp(28px, 5vw, 54px);
    position: relative;
    box-shadow: var(--shadow);
}

.hero-copy::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 52%;
    height: 58%;
    content: "";
    background:
        linear-gradient(135deg, transparent 0 48%, rgba(255, 255, 255, .18) 48% 51%, transparent 51%),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .18) 0 1px, transparent 1px 32px);
    opacity: .5;
}

.hero-copy > * {
    position: relative;
    z-index: 1;
}

.intro h1,
.admin-header h1,
.login-panel h1 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(2.25rem, 5.2vw, 5rem);
    line-height: .96;
    letter-spacing: 0;
}

.intro p {
    max-width: 640px;
    color: rgba(255, 255, 255, .78);
    font-size: 1.08rem;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero-visual {
    display: grid;
    align-content: end;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(255, 250, 243, .96)),
        var(--surface);
    padding: 18px;
    box-shadow: var(--shadow);
}

.visual-card {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.visual-card span,
.visual-card small {
    color: var(--muted);
    font-size: .88rem;
}

.visual-card strong {
    font-size: 1.35rem;
}

.primary-card {
    background: var(--text);
    color: #fff;
}

.primary-card span,
.primary-card small {
    color: rgba(255, 255, 255, .68);
}

.accent-card {
    border-color: rgba(200, 111, 67, .32);
    background: #fff2ea;
}

.mini-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-tags b {
    border-radius: 999px;
    background: #edf5f2;
    color: var(--primary-dark);
    font-size: .82rem;
    padding: 6px 9px;
}

.form-panel,
.login-panel,
.detail-panel,
.list-panel {
    border: 1px solid rgba(255, 255, 255, .68);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.form-panel {
    overflow: hidden;
}

.form-section {
    padding: 30px;
    border-top: 1px solid var(--line);
}

.form-section:first-child {
    border-top: 0;
}

.form-section h2,
.detail-panel h2,
.detail-panel h3 {
    margin: 0 0 18px;
    font-size: 1.25rem;
}

.form-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h2 span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--text);
    color: #fff;
    font-size: .78rem;
    flex: 0 0 auto;
}

.section-help {
    margin-top: -8px;
    color: var(--muted);
}

.grid {
    display: grid;
    gap: 18px;
}

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

label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(23, 33, 29, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    padding: 13px 14px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

textarea {
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(15, 107, 87, .38);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(15, 107, 87, .16);
    box-shadow: 0 8px 22px rgba(15, 107, 87, .08);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-card {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    padding: 11px 12px;
    font-weight: 800;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.checkbox-card:hover {
    border-color: rgba(15, 107, 87, .36);
    background: #fff;
    box-shadow: 0 10px 22px rgba(23, 33, 29, .08);
    transform: translateY(-1px);
}

.checkbox-card input {
    width: 19px;
    height: 19px;
    accent-color: var(--primary);
}

.checkbox-card:has(input:checked) {
    border-color: rgba(15, 107, 87, .48);
    background: #edf5f2;
    color: var(--primary-dark);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding: 24px 30px 30px;
    border-top: 1px solid var(--line);
    background: rgba(255, 250, 243, .58);
}

button,
.link-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    padding: 12px 18px;
    text-decoration: none;
    box-shadow: 0 14px 26px rgba(15, 107, 87, .22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button:hover,
.link-button:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(15, 107, 87, .28);
}

button.secondary,
.link-button.subtle {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .82);
    color: var(--text);
    box-shadow: none;
}

.login-panel {
    width: min(460px, 100%);
    margin: 12vh auto 0;
    padding: 30px;
}

.login-panel .eyebrow {
    color: var(--accent);
}

.login-panel h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
}

.login-panel label {
    margin-top: 16px;
}

.login-panel button {
    width: 100%;
    margin-top: 20px;
}

.error {
    border: 1px solid rgba(165, 52, 52, .24);
    border-radius: 8px;
    background: rgba(165, 52, 52, .08);
    color: var(--danger);
    padding: 10px 12px;
}

.admin-header {
    align-items: flex-end;
    margin-bottom: 24px;
}

.admin-header .eyebrow {
    color: var(--accent);
}

.admin-header h1 {
    font-size: clamp(2.1rem, 4vw, 3.7rem);
}

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

.admin-layout {
    display: grid;
    grid-template-columns: 370px minmax(0, 1fr);
    gap: 18px;
}

.list-panel {
    overflow: hidden;
}

.request-row {
    display: grid;
    gap: 3px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    padding: 16px;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

.request-row:hover,
.request-row.active {
    background: #edf5f2;
}

.request-row strong {
    font-size: 1.02rem;
}

.request-row span,
.request-row small,
.detail-grid span {
    color: var(--muted);
}

.detail-panel {
    min-height: 520px;
    padding: 24px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.detail-grid div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .64);
    padding: 13px;
}

.empty {
    color: var(--muted);
    margin: 0;
    padding: 18px;
}

@media (max-width: 920px) {
    .hero-grid,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        min-height: 250px;
    }

    .hero-visual {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-content: stretch;
    }
}

@media (max-width: 820px) {
    .grid.two,
    .detail-grid {
        grid-template-columns: 1fr;
    }

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

    .admin-header,
    .admin-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-visual {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .page-shell,
    .admin-shell {
        width: min(100% - 20px, 1120px);
        padding: 20px 0 36px;
    }

    .form-section,
    .detail-panel,
    .login-panel {
        padding: 20px;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        padding: 20px;
    }

    .form-actions button {
        width: 100%;
    }
}
