* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: #1d1d1b;
    background:
        radial-gradient(circle at top right, rgba(207, 226, 243, 0.8), transparent 28%),
        linear-gradient(180deg, #f8f2e8 0%, #f4eee4 100%);
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

a {
    color: #164c5a;
}

.sidebar {
    padding: 32px 24px;
    background: #0f3d3e;
    color: #f7f0e4;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar h1,
.page-header h2,
.card h3,
.auth-card h2 {
    margin: 0;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    opacity: 0.7;
}

.muted {
    color: rgba(29, 29, 27, 0.7);
}

.sidebar .muted,
.sidebar a,
.sidebar span {
    color: rgba(247, 240, 228, 0.8);
}

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

.nav a,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 160ms ease;
}

.nav a {
    background: rgba(255, 255, 255, 0.08);
}

.nav a:hover,
.button:hover {
    transform: translateY(-1px);
}

.main {
    padding: 32px;
    display: grid;
    gap: 24px;
}

.page-header,
.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

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

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

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

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

.admin-grid {
    grid-template-columns: minmax(280px, 360px) 1fr;
}

.card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 61, 62, 0.12);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 18px 40px rgba(42, 61, 69, 0.08);
}

.narrow {
    max-width: 620px;
}

.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #c9c2b6;
    background: rgba(255, 255, 255, 0.9);
    font: inherit;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e6dece;
    text-align: left;
    vertical-align: top;
}

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

.button {
    background: #b14f2d;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(177, 79, 45, 0.22);
}

.button.secondary {
    background: #275d63;
    box-shadow: 0 10px 24px rgba(39, 93, 99, 0.2);
}

.button.danger {
    background: #8a2d2d;
    box-shadow: none;
}

.flash {
    padding: 14px 16px;
    border-radius: 14px;
}

.flash-success {
    background: #dff3df;
    color: #144714;
}

.flash-error {
    background: #f8dddd;
    color: #6c1b1b;
}

.user-card {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 4px;
}

.stat-card strong {
    font-size: 40px;
}

.json-view {
    padding: 16px;
    border-radius: 16px;
    background: #f5efe5;
    overflow: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 16px;
    padding: 12px 0 4px;
}

.hero {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: stretch;
}

.hero-copy,
.hero-panel {
    padding: 28px;
}

.hero-copy {
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(15, 61, 62, 0.92), rgba(39, 93, 99, 0.88)),
        linear-gradient(180deg, #f8f2e8 0%, #f4eee4 100%);
    color: #f7f0e4;
    box-shadow: 0 26px 54px rgba(15, 61, 62, 0.22);
}

.hero-copy .hero-text,
.hero-copy .eyebrow {
    color: rgba(247, 240, 228, 0.85);
}

.hero-copy h2 {
    margin: 0 0 12px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.03;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.hero-panel {
    display: grid;
    gap: 16px;
}

.mini-stat {
    padding: 18px;
    border-radius: 18px;
    background: rgba(245, 239, 229, 0.8);
    border: 1px solid rgba(15, 61, 62, 0.12);
}

.mini-stat span,
.stat-card span {
    display: block;
    font-size: 14px;
    color: rgba(29, 29, 27, 0.7);
}

.mini-stat strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

.feature-card h3 {
    margin-bottom: 10px;
}

.portal-intro {
    display: grid;
    gap: 16px;
}


.module-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.module-card {
    display: grid;
    gap: 16px;
}

.module-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.module-head p {
    margin: 6px 0 0;
}

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

.module-body[hidden] {
    display: none;
}

.module-toggle {
    min-width: 108px;
}

.section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.section-nav a,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(39, 93, 99, 0.1);
    border: 1px solid rgba(39, 93, 99, 0.16);
    color: #164c5a;
    font-size: 13px;
    text-decoration: none;
}

.survey-form .card {
    scroll-margin-top: 24px;
}

.survey-form .card.is-active {
    border-color: rgba(177, 79, 45, 0.45);
    box-shadow: 0 20px 44px rgba(177, 79, 45, 0.1);
}

.repeater .section-title p {
    margin: 6px 0 0;
}

.dashboard-hero {
    padding: 4px 0 8px;
}

@media (max-width: 1024px) {
    .shell,
    .hero,
    .admin-grid,
    .dashboard-stats,
    .two-up,
    .three-up {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 16px;
    }

    .main {
        padding: 20px;
    }

    .hero-copy {
        padding: 24px;
    }

    .form-actions {
        position: static;
    }
}

@media (max-width: 720px) {
    .page-header,
    .section-title,
    .module-head,
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    .sidebar {
        padding: 20px;
    }
}
