:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f5f7fb;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; }

a { color: #174ea6; }

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

.site-header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dbe2ef;
    display: flex;
    justify-content: space-between;
    min-height: 4.5rem;
    padding: 0 5vw;
}

.wordmark { color: #172033; font-size: 1.05rem; font-weight: 750; text-decoration: none; }

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

nav a, .link-button { color: #32415f; font-size: .92rem; }

nav form { margin: 0; }

.link-button { background: transparent; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }

.page-shell { margin: 0 auto; max-width: 72rem; padding: 3.5rem 5vw 5rem; }

.portal-admin-shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); min-height: 100vh; }
.portal-sidebar { background: #1d2327; color: #c3c4c7; display: flex; flex-direction: column; gap: 1.5rem; min-height: 100vh; padding: 1.25rem 0 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-wordmark { color: #fff; font-size: 1.05rem; font-weight: 750; padding: .45rem 1.25rem 0; text-decoration: none; }
.sidebar-label { color: #a7aaad; font-size: .72rem; font-weight: 750; letter-spacing: .08em; margin: -1rem 0 0; padding: 0 1.25rem; text-transform: uppercase; }
.portal-workspace { min-width: 0; }
.portal-workspace-header { align-items: center; background: #fff; border-bottom: 1px solid #dbe2ef; color: #536078; display: flex; font-size: .88rem; font-weight: 700; min-height: 3.5rem; padding: 0 clamp(1.5rem, 4vw, 4rem); }
.admin-page-shell { margin: 0; max-width: none; padding: 2.5rem clamp(1.5rem, 4vw, 4rem) 5rem; }

.auth-card, .organization-card, .empty-panel, .metric-grid article {
    background: #fff;
    border: 1px solid #dbe2ef;
    border-radius: .9rem;
    box-shadow: 0 .5rem 1.5rem rgba(21, 35, 62, .05);
}

.auth-card { margin: 8vh auto; max-width: 31rem; padding: 2.5rem; }

.eyebrow { color: #486284; font-size: .78rem; font-weight: 750; letter-spacing: .08em; margin: 0 0 .65rem; text-transform: uppercase; }

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.04em; margin-bottom: .7rem; }
h2 { font-size: 1.35rem; margin-bottom: 1.5rem; }
h3 { font-size: 1rem; margin-bottom: .8rem; }
p { color: #4a5871; line-height: 1.6; }

.stacked-form { display: grid; gap: .7rem; margin-top: 1.75rem; }
label { font-weight: 650; }
input { border: 1px solid #9cacbf; border-radius: .45rem; min-height: 2.8rem; padding: .65rem .8rem; }
input:focus { border-color: #174ea6; box-shadow: 0 0 0 3px rgba(23, 78, 166, .18); outline: 0; }
button, .button { background: #174ea6; border: 1px solid #174ea6; border-radius: .45rem; color: #fff; cursor: pointer; display: inline-block; font-weight: 700; padding: .7rem 1rem; text-align: center; text-decoration: none; }
.button.secondary { background: #fff; color: #174ea6; }
.field-error { color: #a32222; font-size: .9rem; margin: 0; }
.fine-print { font-size: .88rem; margin: 1.5rem 0 0; }

.notice { background: #e8f6ed; border: 1px solid #9bd1ac; border-radius: .5rem; color: #164a27; margin-bottom: 1.5rem; padding: .85rem 1rem; }
.notice.warning { background: #fff7dd; border-color: #e7c45d; color: #5f4700; }
.notice.error { background: #fff0f0; border-color: #e1a3a3; color: #7b1d1d; }
.notice ul { margin-bottom: 0; }
.page-heading { align-items: flex-start; display: flex; gap: 2rem; justify-content: space-between; margin-bottom: 2rem; }
.organization-card { margin-bottom: 1.25rem; padding: 1.5rem; }
.dashboard-columns { display: grid; gap: 2rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li { border-top: 1px solid #e6ebf4; display: grid; gap: .2rem; padding: .85rem 0; }
.record-list span, .empty-state { color: #63718a; font-size: .9rem; }
.empty-state { margin: 0; }
.empty-panel { margin-top: 1.5rem; padding: 1.5rem; }
.metric-grid { display: grid; gap: 1rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-grid article { display: grid; gap: .65rem; min-height: 9rem; padding: 1.25rem; }
.metric-grid span { color: #5f6d84; font-size: .88rem; }
.metric-grid strong { font-size: 2rem; }
.admin-navigation { display: grid; gap: 1.25rem; }
.admin-navigation section { border-top: 1px solid #3c434a; padding-top: 1.25rem; }
.admin-navigation h2 { color: #a7aaad; font-size: .72rem; letter-spacing: .08em; margin-bottom: .5rem; padding: 0 1.25rem; text-transform: uppercase; }
.admin-navigation nav { align-items: stretch; display: grid; gap: .1rem; }
.admin-navigation nav a, .admin-home-link { border-left: 3px solid transparent; color: #c3c4c7; padding: .6rem 1.25rem; text-decoration: none; }
.admin-navigation nav a:hover, .admin-navigation nav a:focus-visible, .admin-home-link:hover, .admin-home-link:focus-visible { background: #32373c; color: #fff; }
.admin-navigation nav a.is-active, .admin-home-link.is-active { background: #2271b1; border-left-color: #72aee6; color: #fff; }
.admin-home-link { font-weight: 750; }
.sidebar-footer { border-top: 1px solid #3c434a; display: grid; gap: .8rem; margin-top: auto; padding: 1rem 1.25rem 0; }
.sidebar-footer a, .sidebar-footer .link-button { color: #c3c4c7; font-size: .88rem; text-align: left; }
.sidebar-footer a:hover, .sidebar-footer a:focus-visible, .sidebar-footer .link-button:hover, .sidebar-footer .link-button:focus-visible { color: #fff; }
.portal-sidebar .site-picker { padding: 0 1.25rem; }
.portal-sidebar .site-picker label { color: #f0f0f1; }
.portal-sidebar select { background: #fff; }
.site-picker { display: grid; gap: .65rem; }
.site-picker label { font-size: .9rem; }
select { background: #fff; border: 1px solid #9cacbf; border-radius: .45rem; min-height: 2.8rem; padding: .6rem .7rem; width: 100%; }
.settings-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-grid article { background: #fff; border: 1px solid #dbe2ef; border-radius: .9rem; padding: 1.5rem; }
.import-grid { margin-bottom: 2rem; }
.import-grid .panel { margin-bottom: 0; }
.import-grid input[type="file"] { background: #fff; padding: .55rem; width: 100%; }
.import-preview h2 { margin-bottom: .65rem; }
.settings-grid h2 { margin-bottom: .65rem; }
.settings-grid p { margin-bottom: 0; }
.admin-shortcuts { margin-top: 1.5rem; }
.record-actions { margin-bottom: 1.5rem; }
.admin-shortcuts article { min-height: 10rem; }
.form-section { border-top: 1px solid #dbe2ef; display: grid; gap: .7rem; margin-top: 1.25rem; padding-top: 1.5rem; }
.form-section h2 { margin-bottom: .35rem; }
.field-group { display: grid; gap: .55rem; }
.hours-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem; margin-bottom: .7rem; }
.hours-row > div { display: grid; gap: .4rem; min-width: 0; }
.stacked-form input, .stacked-form textarea { min-width: 0; width: 100%; }
textarea { border: 1px solid #9cacbf; border-radius: .45rem; padding: .65rem .8rem; resize: vertical; }
fieldset { border: 1px solid #dbe2ef; border-radius: .45rem; min-width: 0; }
legend { font-weight: 700; }
button.secondary { background: #fff; color: #174ea6; }
:focus-visible { outline: 3px solid #2271b1; outline-offset: 3px; }
.stacked-form .choice-grid input { width: auto; }
.choice-grid { display: grid; gap: .55rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid label { align-items: center; display: flex; gap: .5rem; font-weight: 500; }
.choice-grid input { min-height: auto; }
[hidden] { display: none !important; }
.status-badge { background: #e8f6ed; border: 1px solid #9bd1ac; border-radius: 999px; color: #164a27; font-size: .85rem; font-weight: 700; padding: .4rem .75rem; }
.status-badge.muted { background: #eef1f5; border-color: #cbd3df; color: #536078; }
.status-submitted { background: #fff7dd; border-color: #e7c45d; color: #5f4700; }
.status-reviewing { background: #e7f1ff; border-color: #9fc4ef; color: #164d81; }
.status-rejected { background: #fff0f0; border-color: #e1a3a3; color: #7b1d1d; }
.status-closed { background: #eef1f5; border-color: #cbd3df; color: #536078; }
.panel { background: #fff; border: 1px solid #dbe2ef; border-radius: .9rem; box-shadow: 0 .5rem 1.5rem rgba(21, 35, 62, .05); margin-bottom: 1.5rem; padding: 1.5rem; }
.panel > :last-child { margin-bottom: 0; }
.inline-form, .filter-form { align-items: end; display: grid; gap: 1rem; grid-template-columns: minmax(14rem, 1fr) auto; }
.filter-form { grid-template-columns: minmax(12rem, 1fr) minmax(9rem, .45fr) minmax(11rem, .55fr) auto; }
.filter-form.compact { grid-template-columns: minmax(14rem, 1fr) minmax(10rem, .45fr) auto; }
.inline-form > div, .filter-form > div { display: grid; gap: .45rem; }
.table-scroll, .table-wrap { max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; margin-top: 1rem; width: 100%; }
th, td { border-bottom: 1px solid #e6ebf4; padding: .85rem .65rem; text-align: left; vertical-align: top; }
th { color: #486284; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
td small { color: #63718a; display: block; margin-top: .2rem; }
.pager { justify-content: space-between; margin-top: 1.25rem; }
.pager span { color: #63718a; }
.breadcrumbs { color: #63718a; font-size: .9rem; margin-bottom: 1.25rem; }
.detail-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-list div { border-top: 1px solid #e6ebf4; display: grid; gap: .3rem; padding: .8rem 0; }
.detail-list.columns div { padding-right: 1rem; }
.detail-list dt { color: #63718a; font-size: .82rem; font-weight: 700; text-transform: uppercase; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.button-row { align-items: center; display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
button.danger, .button.danger { background: #a32222; border-color: #a32222; }
.confirmation-card { margin-top: 2rem; }
.membership-row, .record-row { align-items: center; border-top: 1px solid #e6ebf4; display: flex; gap: 1rem; justify-content: space-between; padding: .85rem 0; }
.membership-row > div, .record-row > div { display: grid; gap: .2rem; }
.membership-row span, .record-row span, .timeline span { color: #63718a; font-size: .9rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-top: 1px solid #e6ebf4; display: grid; gap: .25rem; padding: .85rem 0; }
.section-heading { margin-top: 1.75rem; }
.prose { color: #4a5871; line-height: 1.65; margin-bottom: 1.5rem; }
.queue-summary { align-items: stretch; display: grid; gap: .75rem; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 1.5rem; }
.queue-summary a { background: #fff; border: 1px solid #dbe2ef; border-radius: .7rem; display: grid; gap: .15rem; padding: 1rem; text-decoration: none; }
.queue-summary a.is-active { border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34, 113, 177, .14); }
.queue-summary strong { color: #172033; font-size: 1.4rem; }
.queue-summary span { color: #63718a; font-size: .82rem; }
.submission-filters { grid-template-columns: minmax(12rem, 1fr) repeat(3, minmax(8rem, .55fr)) auto auto; margin-bottom: 1.5rem; }
.submission-filters label { display: grid; gap: .4rem; min-width: 0; }
.review-layout { align-items: start; display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, .8fr); }
.detail-panel, .workflow-panel, .workflow-notice, .error-summary { background: #fff; border: 1px solid #dbe2ef; border-radius: .9rem; margin-bottom: 1.5rem; padding: 1.5rem; }
.workflow-panel { position: sticky; top: 1.5rem; }
.workflow-notice { background: #eaf4ff; border-color: #9fc4ef; }
.workflow-notice h2 { margin-bottom: .65rem; }
.workflow-notice p:last-child { margin-bottom: 0; }
.error-summary { background: #fff0f0; border-color: #e1a3a3; color: #7b1d1d; }
.error-summary ul { margin-bottom: 0; }
.review-diff { margin: 0; }
.review-diff th:first-child { width: 22%; }
.review-diff td { overflow-wrap: anywhere; white-space: pre-wrap; }
.review-diff-value { color: #263550; }
.review-value { color: #536078; white-space: pre-wrap; }
.review-value.proposed { color: #172033; font-weight: 600; }
.change-badge { background: #e7f1ff; border-radius: 999px; color: #164d81; display: inline-block; font-size: .68rem; letter-spacing: .02em; margin-left: .5rem; padding: .2rem .45rem; text-transform: none; }
.workflow-steps { display: grid; gap: 0; list-style: none; margin: 0 0 1.5rem; padding: 0; }
.workflow-steps li { border-left: 3px solid #cbd3df; display: grid; gap: .25rem; padding: 0 0 1.25rem 1rem; }
.workflow-steps li.is-current { border-left-color: #2271b1; }
.workflow-steps li.is-complete { border-left-color: #2f7d45; }
.workflow-steps span { color: #63718a; font-size: .9rem; line-height: 1.45; }
.workflow-panel details { border-top: 1px solid #dbe2ef; margin-top: 1.5rem; padding-top: 1rem; }
.workflow-panel summary { color: #174ea6; cursor: pointer; font-weight: 700; }
.approval-form { border-top: 1px solid #dbe2ef; padding-top: 1.25rem; }
.confirmation-check { align-items: flex-start; display: flex; gap: .65rem; font-weight: 600; line-height: 1.45; }
.confirmation-check input { flex: 0 0 auto; min-height: auto; width: auto; }
.button-secondary { background: #fff; color: #174ea6; }
.preserve-lines { white-space: pre-wrap; }
.outcome-panel dl, .detail-panel dl { display: grid; grid-template-columns: minmax(7rem, .35fr) minmax(0, 1fr); margin: 0; }
.outcome-panel dt, .outcome-panel dd, .detail-panel dt, .detail-panel dd { border-top: 1px solid #e6ebf4; margin: 0; overflow-wrap: anywhere; padding: .65rem 0; }
.outcome-panel dt, .detail-panel dt { color: #63718a; font-size: .8rem; font-weight: 700; padding-right: .75rem; text-transform: uppercase; }

@media (max-width: 760px) {
    .site-header, .page-heading { align-items: flex-start; flex-direction: column; padding-bottom: 1rem; padding-top: 1rem; }
    .dashboard-columns { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-admin-shell, .settings-grid, .choice-grid, .hours-row { grid-template-columns: 1fr; }
    .detail-grid, .detail-list.columns, .inline-form, .filter-form, .filter-form.compact, .submission-filters, .review-layout { grid-template-columns: 1fr; }
    .queue-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow-panel { position: static; }
    .portal-sidebar { height: auto; min-height: auto; position: static; }
    .portal-workspace-header { min-height: 3.25rem; }
    .admin-page-shell { padding-top: 2rem; }
}
