:root {
    --bg: #f5efe3;
    --bg-strong: #e9dfcf;
    --paper: rgba(255, 251, 244, 0.84);
    --ink: #1d2430;
    --muted: #6b7280;
    --line: rgba(29, 36, 48, 0.14);
    --accent: #a23f2b;
    --accent-strong: #7a2617;
    --olive: #5d6c4e;
    --warn: #8c5d12;
    --ok: #295f46;
    --shadow: 0 24px 70px rgba(59, 39, 17, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "IBM Plex Sans", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(162, 63, 43, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(93, 108, 78, 0.12), transparent 34%),
        linear-gradient(180deg, #fbf6ee 0%, var(--bg) 48%, #efe5d5 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(29, 36, 48, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(29, 36, 48, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
}

.admin-shell {
    width: min(1320px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.hero,
.panel,
.models-section,
.status-strip {
    position: relative;
    z-index: 1;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
    padding: 24px 28px 28px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255, 250, 243, 0.92), rgba(238, 227, 209, 0.84));
    box-shadow: var(--shadow);
    border-radius: 28px;
}

.eyebrow,
.panel-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1,
.section-heading h2,
.panel h2 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero h1 {
    font-size: clamp(2.7rem, 5vw, 4.8rem);
    line-height: 0.92;
    max-width: 9ch;
}

.hero-text,
.section-note {
    color: var(--muted);
    max-width: 64ch;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: end;
    gap: 12px;
}

.ghost-btn,
.primary-btn {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.ghost-btn {
    color: var(--ink);
    background: rgba(255, 251, 244, 0.76);
}

.primary-btn {
    color: #fffaf3;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    box-shadow: 0 18px 35px rgba(122, 38, 23, 0.24);
}

.ghost-btn:hover,
.primary-btn:hover {
    transform: translateY(-1px);
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.status-card,
.panel,
.models-section {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
}

.status-card {
    padding: 18px 20px;
}

.status-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-bottom: 8px;
}

.status-card strong {
    display: block;
    font-size: 15px;
    word-break: break-word;
}

.status-banner {
    margin-top: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    font-size: 14px;
}

.status-banner.is-error {
    color: #6f1d1b;
    background: rgba(162, 63, 43, 0.14);
    border-color: rgba(162, 63, 43, 0.2);
}

.status-banner.is-success {
    color: var(--ok);
    background: rgba(41, 95, 70, 0.12);
    border-color: rgba(41, 95, 70, 0.18);
}

.status-banner.is-warning {
    color: var(--warn);
    background: rgba(140, 93, 18, 0.12);
    border-color: rgba(140, 93, 18, 0.18);
}

.panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.75fr) minmax(320px, 0.75fr);
    gap: 18px;
    margin-top: 18px;
}

.panel,
.models-section {
    padding: 22px;
}

.panel-wide {
    grid-column: span 1;
}

.panel-header,
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--muted);
}

.field-grid {
    display: grid;
    gap: 14px;
}

.compact-grid {
    align-content: start;
}

.field {
    display: grid;
    gap: 8px;
}

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

.field label,
.subfield label {
    display: block;
    font-size: 13px;
    color: var(--muted);
}

.field input,
.field textarea,
.subfield input,
.subfield textarea {
    width: 100%;
    border: 1px solid rgba(29, 36, 48, 0.12);
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
    color: var(--ink);
    background: rgba(255, 254, 250, 0.9);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field textarea:focus,
.subfield input:focus,
.subfield textarea:focus {
    outline: none;
    border-color: rgba(162, 63, 43, 0.4);
    box-shadow: 0 0 0 4px rgba(162, 63, 43, 0.08);
}

.field textarea,
.subfield textarea {
    min-height: 98px;
    resize: vertical;
}

.field-help {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.models-section {
    margin-top: 18px;
}

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

.model-card {
    padding: 18px;
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 253, 248, 0.96), rgba(241, 233, 219, 0.92)),
        var(--paper);
    border: 1px solid rgba(29, 36, 48, 0.1);
}

.model-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.model-title {
    margin: 0;
    font-size: 24px;
    font-family: "Cormorant Garamond", serif;
}

.model-chip {
    align-self: start;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(93, 108, 78, 0.12);
    color: var(--olive);
    font-size: 12px;
}

.subfield {
    margin-top: 12px;
}

.forbidden-state {
    display: grid;
    place-items: center;
    min-height: 60vh;
}

.forbidden-card {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 251, 244, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-align: center;
}

.forbidden-card h2 {
    margin-top: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: 42px;
}

@media (max-width: 1080px) {
    .panel-grid,
    .models-grid,
    .status-strip,
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        justify-content: start;
    }
}

@media (max-width: 640px) {
    .admin-shell {
        width: min(100vw - 20px, 1320px);
        padding-top: 18px;
    }

    .hero,
    .panel,
    .models-section {
        padding: 18px;
        border-radius: 22px;
    }

    .field.two-col {
        grid-template-columns: 1fr;
    }
}
