:root {
    --bg: #f5f1e8;
    --panel: #fffdf8;
    --ink: #1e2430;
    --muted: #5f6b7a;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --border: #d9d1c3;
    --shadow: 0 18px 50px rgba(30, 36, 48, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 30%),
        linear-gradient(180deg, #f7f2e8 0%, #efe7d8 100%);
}

.page-shell {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3rem 0 4rem;
}

.page-shell-with-sidebar {
    width: min(1180px, calc(100% - 19rem));
    margin-left: 17.5rem;
    margin-right: 1.5rem;
}

.page-shell-with-sidebar .top-nav {
    display: none;
}

.global-sidebar {
    position: fixed;
    inset: 1rem auto 1rem 1rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 14.5rem;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.sidebar-brand {
    display: block;
    padding: 0.5rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #f1ddbe 0%, #ead0a4 100%);
    border: 1px solid #d3bb90;
}

.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
}

.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar-nav a,
.sidebar-group summary,
.sidebar-logout {
    display: block;
    padding: 0.65rem 0.75rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 14px;
}

.sidebar-nav a:hover,
.sidebar-group summary:hover,
.sidebar-logout:hover {
    color: var(--accent-dark);
    background: #f2eadb;
}

.sidebar-group {
    border: 1px solid transparent;
    border-radius: 16px;
}

.sidebar-group[open] {
    background: rgba(15, 118, 110, 0.05);
    border-color: rgba(15, 118, 110, 0.18);
}

.sidebar-group summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.sidebar-group summary::-webkit-details-marker {
    display: none;
}

.sidebar-group summary::after {
    content: "+";
    float: right;
    color: var(--accent-dark);
}

.sidebar-group[open] summary::after {
    content: "-";
}

.sidebar-subnav {
    display: grid;
    gap: 0.2rem;
    padding: 0 0.4rem 0.45rem 0.75rem;
}

.sidebar-subnav a {
    padding: 0.5rem 0.65rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.sidebar-logout {
    margin-top: auto;
    color: var(--accent-dark);
    font-weight: 700;
}

.top-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.top-nav a {
    color: var(--accent-dark);
    text-decoration: none;
    font-weight: 700;
}

.brand-wordmark {
    margin-right: auto;
    display: inline-flex;
    align-items: center;
}

.nav-logo {
    display: block;
    height: 42px;
    width: auto;
}

.message-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.message-banner {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.message-banner.success {
    border-color: #9ad0b8;
    background: #edf8f2;
}

.message-banner.error {
    border-color: #e3a7a0;
    background: #fff2ef;
}

.hero,
.content-grid {
    display: grid;
    gap: 1.5rem;
}

.hero {
    grid-template-columns: 2fr 1fr;
    align-items: end;
    margin-bottom: 1.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

h1,
h2 {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    line-height: 0.95;
    margin-bottom: 1rem;
}

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

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

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

.admin-shell {
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.95fr);
    align-items: start;
}

.stats article,
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.stats article {
    padding: 1.25rem;
}

.stats span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.stats strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 2rem;
}

.card {
    padding: 1.5rem;
}

.narrow-card {
    max-width: 760px;
}

.evaluation-form {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

label {
    font-weight: 700;
}

input,
select,
textarea,
button,
.button-link {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
}

.evaluation-form input[type="radio"] {
    width: auto;
    margin-right: 0.5rem;
}

.evaluation-form ul {
    display: grid;
    gap: 0.5rem;
    padding-left: 0;
    list-style: none;
}

.evaluation-form li label {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-weight: 400;
}

.question-subsection {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.evaluation-instrument {
    max-width: 840px;
}

.evaluation-instrument .evaluation-section {
    box-shadow: none;
    background: #fffefa;
}

.evaluation-instrument h3 {
    margin-bottom: 0.35rem;
    color: var(--accent-dark);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.015em;
    text-transform: none;
}

.evaluation-instrument h4 {
    margin: 0.25rem 0 0;
    color: var(--accent-dark);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
}

.question-field {
    gap: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(217, 209, 195, 0.65);
}

.question-field:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.question-prompt {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.evaluation-instrument .response-options > div {
    display: grid;
    gap: 0.75rem;
    margin: 0.1rem 0 0;
}

.evaluation-instrument .response-options label {
    align-items: flex-start;
    display: flex;
    gap: 0.7rem;
    padding: 0.72rem 0.9rem;
    color: #344054;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.48;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(228, 220, 205, 0.75);
    border-radius: 12px;
}

.evaluation-instrument .response-options label:hover {
    border-color: rgba(15, 118, 110, 0.45);
    background: #fffaf0;
}

.evaluation-instrument input[type="radio"] {
    flex: 0 0 auto;
    margin: 0.15rem 0 0;
}

button,
.button-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    padding: 0.85rem 1.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.button-link-secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--accent-dark);
}

button:hover,
.button-link:hover {
    background: var(--accent-dark);
}

.button-link-secondary:hover {
    color: #fff;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.session-banner {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.auto-submit-form {
    align-items: end;
}

.auto-submit-form select {
    min-width: 260px;
}

.side-menu {
    position: sticky;
    top: 1.5rem;
}

.admin-menu {
    display: grid;
    gap: 0.75rem;
}

.admin-menu .button-link {
    width: 100%;
    justify-content: flex-start;
}

.status-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin: 1rem 0;
}

.status-grid article {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.status-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.status-grid strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.6rem;
}

.live-preview-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 34%),
        #fff;
}

.live-preview-card strong {
    font-size: 1.45rem;
}

.campaign-history-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 1rem 0;
}

.history-stat {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.history-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.history-stat strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.5rem;
}

.inline-assign-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.inline-assign-form select {
    width: auto;
    min-width: 220px;
}

.campaign-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.campaign-filter-form .action-row {
    grid-column: 1 / -1;
}

.schedule-date-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.schedule-date-picker input {
    width: auto;
    min-width: 190px;
}

.selected-date-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.date-chip {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    padding: 0.45rem 0.75rem;
    cursor: pointer;
}

.date-chip:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.stacked-actions {
    display: grid;
    gap: 0.6rem;
}

.submission-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.submission-list li {
    display: grid;
    gap: 0.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.submission-list li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.error {
    color: #b42318;
}

.muted-copy {
    color: var(--muted);
}

.directory-list {
    display: grid;
    gap: 0.85rem;
}

.directory-item {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--border);
}

.directory-item-static {
    align-items: start;
}

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

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 0.85rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 0.9rem;
}

.thanks-card {
    max-width: 700px;
    margin: 10vh auto 0;
    text-align: center;
}

.portal-shell {
    min-height: calc(100vh - 6rem);
    display: grid;
    place-items: center;
}

.portal-card {
    width: min(680px, 100%);
    padding: 2.5rem;
    text-align: center;
    background: rgba(255, 253, 248, 0.94);
    border: 1px solid var(--border);
    border-radius: 32px;
    box-shadow: var(--shadow);
}

.portal-logo-frame {
    margin: 0 auto 1.5rem;
    max-width: 360px;
    padding: 0.85rem;
    border-radius: 28px;
    background: linear-gradient(180deg, #f1ddbe 0%, #ead0a4 100%);
    border: 1px solid #d3bb90;
}

.portal-logo {
    display: block;
    width: 100%;
    height: auto;
    min-height: 140px;
    object-fit: contain;
    border-radius: 20px;
    background: #f5efe4;
}

.portal-title {
    margin-bottom: 1.5rem;
}

.portal-role-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-action-row {
    justify-content: center;
    margin-top: 1.25rem;
}

.portal-role-card {
    display: grid;
    place-items: center;
    min-height: 92px;
    padding: 1rem;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 26px rgba(30, 36, 48, 0.07);
    transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.portal-role-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 18px 32px rgba(15, 118, 110, 0.14);
}

.portal-footnote {
    margin: 1.35rem 0 0;
    color: var(--muted);
}

@media (max-width: 800px) {
    .hero,
    .stats,
    .content-grid,
    .content-grid-wide,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .page-shell {
        width: min(100% - 1.25rem, 700px);
        padding-top: 1.5rem;
    }

    .page-shell-with-sidebar {
        width: min(100% - 1.25rem, 700px);
        margin: 0 auto;
    }

    .global-sidebar {
        position: static;
        width: min(100% - 1.25rem, 700px);
        margin: 0.75rem auto 0;
    }

    .sidebar-brand {
        max-width: 180px;
    }

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

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

    .side-menu {
        position: static;
    }

    .auto-submit-form select,
    .inline-assign-form select {
        min-width: 0;
        width: 100%;
    }

    .campaign-filter-form {
        grid-template-columns: 1fr;
    }

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

    .portal-card {
        padding: 1.5rem;
    }

    .portal-role-grid {
        grid-template-columns: 1fr;
    }
}
