:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1b2c76;
    --muted: #697586;
    --line: #d8dee6;
    --brand: #1b2c76;
    --brand-dark: #213b9e;
    --accent: #ce4838;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1660px, calc(100% - 48px));
    margin: 0 auto;
}

.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

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

.user-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 0.95rem;
}

.link-button {
    border: 0;
    background: none;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0;
}

.page {
    padding: 32px 0 48px;
}

.page-title {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.2;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.25rem;
}

.panel,
.auth-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.06);
}

.panel {
    margin-bottom: 24px;
    padding: 24px;
}

.narrow-panel,
.auth-panel {
    max-width: 560px;
}

.auth-panel {
    margin: 48px auto 0;
    padding: 28px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-heading-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-heading p:not(.eyebrow) {
    margin: 6px 0 0;
    color: var(--muted);
}

.period-pager,
.year-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.messages {
    margin-bottom: 20px;
}

.message {
    margin: 0 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef7f5;
    color: var(--brand-dark);
    padding: 10px 12px;
}

.message-error {
    background: #fff1f0;
    color: var(--danger);
}

.notice {
    margin: 0 0 18px;
    border: 1px solid #bae6e0;
    border-radius: 8px;
    background: #eef7f5;
    color: var(--brand-dark);
    padding: 12px 14px;
}

.notice p {
    margin: 0 0 12px;
}

.notice p:last-child {
    margin-bottom: 0;
}

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

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.table-action {
    text-align: right;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.status-select-form {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.status-select-form select {
    min-width: 130px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 8px 10px;
}

.session-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.session-filters label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.session-filters select {
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 8px 10px;
}

.session-filters-actions {
    display: flex;
    gap: 8px;
}

.badge,
.status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.84rem;
    font-weight: 800;
}

.badge {
    background: #ecfdf3;
    color: #067647;
}

.status {
    background: #fff7e8;
    color: #965b00;
}

.empty-state,
.muted {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(31, 41, 51, 0.06);
    padding: 18px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
    line-height: 1;
}

.stat strong a {
    color: var(--primary);
    text-decoration: none;
}

.stat strong a:hover {
    text-decoration: underline;
}

.form p {
    margin: 0 0 16px;
}

.form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.form input,
.form select,
.form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 10px 12px;
}

.form input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin: 0;
}

.checkbox-field {
    margin: 0 0 14px;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    font-weight: 700;
}

.form input[type="file"] {
    padding: 9px;
}

.form .helptext {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.9rem;
}

.form ul.errorlist {
    margin: 0 0 8px;
    color: var(--danger);
    padding-left: 18px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 9px 14px;
}

.button:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
}

.button-secondary {
    background: #ffffff;
    color: var(--brand);
}

.button-secondary:hover {
    background: #eef7f5;
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.button-danger:hover {
    background: #8f1d14;
}

.full-width {
    width: 100%;
}

.compact-heading {
    margin-top: 24px;
}

.session-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.session-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.session-summary dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.session-summary dd {
    margin: 4px 0 0;
    font-weight: 700;
}

@media (max-width: 720px) {
    .header-inner,
    .form-actions,
    .section-heading-actions,
    .period-pager,
    .year-pager {
        align-items: stretch;
        flex-direction: column;
    }

    .user-nav {
        justify-content: space-between;
    }

    .panel,
    .auth-panel {
        padding: 18px;
    }

    .session-summary {
        grid-template-columns: 1fr;
    }

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

    .table-action {
        text-align: left;
    }

    .status-actions {
        justify-content: flex-start;
    }
}
