:root {
    --bg: #f5efe5;
    --bg-alt: #fffaf4;
    --ink: #1b1916;
    --muted: #6e655b;
    --line: #d7ccbe;
    --card: rgba(255, 250, 244, 0.88);
    --primary: #0f766e;
    --primary-strong: #115e59;
    --secondary: #1d4ed8;
    --danger: #b91c1c;
    --shadow: 0 20px 60px rgba(46, 34, 16, 0.12);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 26rem),
        radial-gradient(circle at bottom right, rgba(29, 78, 216, 0.1), transparent 24rem),
        linear-gradient(180deg, #efe3d1 0%, #f8f2e8 32%, #f3ecdf 100%);
    font-family: "IBM Plex Sans", sans-serif;
    min-height: 100vh;
}

.page-shell {
    min-height: 100vh;
}

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

.container {
    width: min(1180px, calc(100vw - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    background: rgba(245, 239, 229, 0.82);
    border-bottom: 1px solid rgba(110, 101, 91, 0.16);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

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

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary), #164e63);
    color: white;
    font-weight: 700;
}

.brand strong,
.brand small {
    display: block;
}

.brand small,
.muted,
.label {
    color: var(--muted);
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.nav form {
    margin: 0;
}

.nav-toggle {
    display: none;
    width: 3rem;
    height: 3rem;
    padding: 0.7rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(215, 204, 190, 0.85);
    box-shadow: var(--shadow);
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    margin: 0.22rem 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.main-content {
    padding: 2rem 0 3rem;
}

.hero,
.section-heading,
.calendar-layout,
.two-column,
.info-grid,
.card-grid,
.button-row,
.header-inner,
.sidebar-header,
.card-title-row,
.inline-form,
.subnav,
.actions {
    display: flex;
}

.hero {
    gap: 1.5rem;
    align-items: stretch;
    min-height: 60vh;
}

.hero > * {
    flex: 1;
}

.hero h1,
.section-heading h1,
.panel h1 {
    font-family: "IBM Plex Serif", serif;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 0.95;
    margin: 0 0 1rem;
}

.panel h1 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.eyebrow {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    color: var(--primary);
    font-weight: 700;
}

.lead {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #3c352d;
}

.hero-card,
.panel,
.stat-card {
    background: var(--card);
    border: 1px solid rgba(215, 204, 190, 0.85);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card,
.panel {
    padding: 1.4rem;
}

.hero-card {
    align-self: center;
    transform: rotate(-1.5deg);
}

.steps {
    padding-left: 1.2rem;
    margin: 0;
}

.steps li {
    margin-bottom: 0.9rem;
}

.hero-actions,
.button-row,
.subnav,
.actions,
.inline-form {
    gap: 0.75rem;
    flex-wrap: wrap;
}

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

.button,
button[type="submit"] {
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.button:hover,
button[type="submit"]:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--primary);
    color: white;
}

.button-secondary {
    background: rgba(29, 78, 216, 0.12);
    color: #123774;
}

.button-ghost {
    background: transparent;
    color: var(--muted);
}

.button-danger {
    background: rgba(185, 28, 28, 0.1);
    color: var(--danger);
}

.alert {
    padding: 1rem 1.2rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: rgba(15, 118, 110, 0.12);
    color: #0f4d48;
}

.alert-error {
    background: rgba(185, 28, 28, 0.08);
    color: #7f1d1d;
}

.alert ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.stacked-form,
.stack {
    display: grid;
    gap: 1rem;
}

.stacked-form label,
.fieldset {
    display: grid;
    gap: 0.4rem;
}

.form-hint {
    margin: -0.3rem 0 0;
    font-size: 0.92rem;
}

.stacked-form input,
.stacked-form select,
.stacked-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: white;
    padding: 0.85rem 1rem;
    color: var(--ink);
}

.checkbox {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.checkbox input {
    width: auto;
}

.date-shortcut {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.auth-panel,
.narrow-panel {
    max-width: 42rem;
    margin: 0 auto;
}

.section-heading,
.sidebar-header,
.card-title-row {
    align-items: center;
    justify-content: space-between;
}

.section-heading {
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    padding: 1rem 1.25rem;
    min-width: 220px;
}

.stat-card span,
.stat-card small {
    display: block;
}

.calendar-layout {
    gap: 1rem;
    align-items: flex-start;
}

.calendar-layout > :first-child {
    flex: 1.65;
}

.sidebar-panel {
    flex: 0.85;
    position: sticky;
    top: 6rem;
}

.list-block {
    margin-top: 1.4rem;
}

.list-card {
    border: 1px solid rgba(215, 204, 190, 0.75);
    border-radius: 1.1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    display: grid;
    gap: 0.35rem;
}

.list-card + .list-card {
    margin-top: 0.75rem;
}

.admin-card {
    align-content: start;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-strong);
    font-size: 0.85rem;
}

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

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

th,
td {
    text-align: left;
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid rgba(215, 204, 190, 0.75);
    vertical-align: top;
}

.two-column,
.calendar-layout {
    align-items: flex-start;
}

.two-column {
    gap: 1rem;
}

.two-column > * {
    flex: 1;
}

.info-grid,
.card-grid {
    gap: 1rem;
}

.info-grid {
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.info-grid > div {
    flex: 1 1 12rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.65);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.subnav a {
    color: var(--secondary);
    font-weight: 600;
}

.fieldset {
    border: 1px solid var(--line);
    border-radius: 1rem;
    padding: 1rem;
}

.compact-form {
    gap: 0.8rem;
}

.hidden {
    display: none !important;
}

.fc {
    --fc-border-color: rgba(215, 204, 190, 0.85);
    --fc-button-bg-color: var(--primary);
    --fc-button-border-color: var(--primary);
    --fc-button-hover-bg-color: var(--primary-strong);
    --fc-button-hover-border-color: var(--primary-strong);
    --fc-today-bg-color: rgba(15, 118, 110, 0.08);
}

.fc .fc-toolbar-title {
    font-family: "IBM Plex Serif", serif;
    font-size: 1.5rem;
}

.fc .fc-button {
    border-radius: 999px;
    padding: 0.7rem 1rem;
}

@media (max-width: 960px) {
    .hero,
    .calendar-layout,
    .two-column,
    .section-heading {
        flex-direction: column;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .sidebar-panel {
        position: static;
        width: 100%;
    }

    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        margin-left: auto;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding-top: 0.5rem;
    }

    .nav.is-open {
        display: flex;
    }

    .nav a,
    .nav form,
    .nav form button,
    .nav > .button {
        width: 100%;
    }

    .nav a,
    .nav .button,
    .nav button {
        text-align: center;
    }

    .button-row > * {
        width: 100%;
    }

    .date-shortcut {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(100vw - 1rem, 1180px);
    }

    .main-content {
        padding: 1.25rem 0 2rem;
    }

    .hero-card {
        transform: none;
    }

    .panel,
    .hero-card {
        padding: 1.15rem;
    }

    .section-heading,
    .sidebar-header,
    .card-title-row {
        align-items: flex-start;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .fc .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2rem;
        text-align: center;
    }

    .fc .fc-button {
        font-size: 0.92rem;
        padding: 0.65rem 0.9rem;
    }
}

@media (min-width: 961px) {
    .nav {
        display: flex !important;
    }
}
