/* Facility 17966: clean, compact and athletic. One font (Inter), one type scale, pine green with a touch of gold. */
:root {
  --bg: #F5F7F6;
  --card: #FFFFFF;
  --ink: #172D24;
  --muted: #6B7972;
  --line: #E1E7E3;
  --line-soft: #EDF1EE;
  --brand: #205C43;
  --brand-deep: #174632;
  --brand-ink: #FFFFFF;
  --brand-soft: #E7F0EA;
  --hover: #F3F6F4;
  --gold: #B99743;
  --gold-soft: #F7F1E1;
  --wood: #B99743;
  --wood-soft: #F7F1E1;
  --clay: #B3261E;
  --warn: #8A5A0B;
  --warn-soft: #FDF3DC;
  --bad: #B3261E;
  --bad-soft: #FCEAE8;
  --info: #2F5B7A;
  --info-soft: #E8F0F6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 45, 36, .04), 0 1px 3px rgba(23, 45, 36, .03);
  --focus: 0 0 0 3px rgba(32, 92, 67, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--font);
  --side-open: 224px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-deep); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font); color: var(--ink); line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .15rem; letter-spacing: -.018em; }
h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: .9375rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted, .subtle { color: var(--muted); }
.subtle { margin: 0; font-size: .8125rem; }
.small { font-size: .8125rem; }
.strong { font-weight: 600; color: var(--ink); text-decoration: none; }
a.strong:hover { color: var(--brand); text-decoration: underline; }
.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; }

.topbar { background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(6px); }
.topbar .inner { max-width: 1100px; margin: 0 auto; padding: .65rem 16px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -.015em; display: inline-flex; align-items: center; gap: .45rem; }
.nav { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; padding: .35rem .65rem; border-radius: 6px; font-size: .92rem; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-deep); }
.nav a.on { background: var(--brand); color: #fff; }
.topbar form { margin: 0; }
.topbar .inner > nav { margin-left: auto; }
.linkbtn { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: .35rem .6rem; border-radius: 6px; }
.linkbtn:hover { background: var(--hover); }

/* ---- Sidebar: 224px, fixed. Slides away on desktop when closed; a drawer over the page on tablets and phones. ---- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-open); background: var(--card); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; transform: translateX(0); transition: transform .22s ease, box-shadow .22s ease; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: 0 .6rem 0 1rem; height: 60px; flex: 0 0 auto; }
.side-toggle { flex: 0 0 auto; width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.side-toggle:hover { background: var(--hover); color: var(--ink); }
.side-toggle .ic { width: 18px; height: 18px; flex-basis: 18px; color: currentColor; }
.side-brand { font-weight: 700; font-size: 1rem; letter-spacing: -.015em; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand:hover { color: var(--brand); }
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: .25rem .75rem 1rem; overscroll-behavior: contain; }
.side-section + .side-section { margin-top: .75rem; }
.side-group { font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: #8B968F; font-weight: 600; padding: 0 .75rem; margin-bottom: .25rem; white-space: nowrap; }
.side-link { position: relative; display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 38px; padding: 0 .75rem; border-radius: var(--radius-sm); color: #3E5048; font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap; background: none; border: 0; font-family: inherit; cursor: pointer; text-align: left; }
.side-link:hover { background: var(--hover); color: var(--ink); }
.side-link.on { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.side-link.on::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-link.on .ic, .side-link.open .ic { color: var(--brand); }
.side-link.open { color: var(--ink); font-weight: 600; }
.side-link.sub { min-height: 32px; padding-left: 2.6rem; font-size: .8125rem; color: var(--muted); }
.side-link.sub.on { color: var(--brand-deep); }
.side-link span { overflow: hidden; text-overflow: ellipsis; }
.ic { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: #7D8A83; }
.side-foot { flex: 0 0 auto; border-top: 1px solid var(--line); padding: .6rem .75rem; position: relative; background: var(--card); }
.side-foot form { margin: 0; }
.side-user { display: flex; align-items: center; gap: .65rem; min-height: 44px; padding: .25rem .5rem; border-radius: var(--radius-sm); cursor: pointer; list-style: none; }
.side-user::-webkit-details-marker { display: none; }
.side-user:hover { background: var(--hover); }
.side-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.side-user-text b { font-weight: 600; font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { color: var(--muted); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot[open] .chev { transform: rotate(180deg); }
.side-menu { position: absolute; left: .75rem; right: .75rem; bottom: calc(100% - .25rem); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(23, 45, 36, .12); padding: .3rem; }
.avatar { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; font-weight: 600; font-size: .8125rem; }
.side-backdrop { display: none; }
.app-main { margin-left: var(--side-open); transition: margin-left .22s ease; min-height: 100vh; }
.app-top { display: none; position: sticky; top: 0; z-index: 20; align-items: center; gap: .5rem; height: 56px; padding: 0 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.app-top .side-toggle { width: 44px; height: 44px; margin-left: -8px; color: var(--ink); }

/* Closed: the menu slides off to the left and the page takes the full width. */
.side-collapsed .side { transform: translateX(-100%); }
.side-collapsed .app-main { margin-left: 0; }
.side-collapsed .app-top { display: flex; }

/* Tablets and phones: the menu is a drawer over the page with a shade behind it, and starts closed. */
@media (max-width: 1023px) {
  .app-main, .side-collapsed .app-main { margin-left: 0; }
  .app-top { display: flex; }
  html:not(.side-collapsed) .side { box-shadow: 0 0 40px rgba(23, 45, 36, .22); }
  html:not(.side-collapsed) .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(23, 45, 36, .32); z-index: 25; }
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.app-main main { max-width: 1360px; margin: 0; padding: 28px 32px 48px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead > div:first-child > p:last-child { margin-bottom: 0; }
.pagehead .actions, .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel.flush > .panel-head { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.panel-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .8125rem; font-weight: 500; text-decoration: none; }
.panel-link .ic { width: 14px; height: 14px; flex-basis: 14px; color: currentColor; }
.panel-link:hover { text-decoration: underline; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }
.panel-foot .pager { display: inline-flex; align-items: center; gap: .5rem; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 24px; }
.grid > .card { margin-bottom: 0; }
.grid:last-child { margin-bottom: 0; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 24px; }
.split > .panel { margin-bottom: 0; }

/* Summary cards */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.kpi { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 112px; padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s ease, box-shadow .15s ease; }
.kpi:hover { border-color: #C9D5CE; box-shadow: 0 2px 8px rgba(23, 45, 36, .06); color: var(--ink); }
.kpi-label { font-size: .8125rem; color: var(--muted); font-weight: 500; padding-right: 28px; }
.kpi b { font-size: 1.875rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .75rem; }
.kpi .ic { position: absolute; top: 18px; right: 18px; width: 20px; height: 20px; color: #9AA8A0; }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 24px; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: .15rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s ease; }
a.stat:hover { border-color: #C9D5CE; }
.stat b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8125rem; font-weight: 500; }
.stat.alert b { color: var(--bad); }

/* Needs attention */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: .85rem; min-height: 52px; padding: .45rem 0; border-top: 1px solid var(--line-soft); }
.todo li:first-child { border-top: 0; }
.todo-text { flex: 1; min-width: 0; font-weight: 500; }
.todo-actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.count { display: inline-grid; place-items: center; min-width: 32px; height: 26px; padding: 0 .5rem; border-radius: 99px; font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--hover); color: var(--ink); }
.count.bad { background: var(--bad-soft); color: var(--bad); }
.count.warn { background: var(--warn-soft); color: var(--warn); }
.allclear { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--brand-deep); font-weight: 500; }
.panel.flush > .allclear { padding: 20px; }
.allclear .ic { color: var(--brand); }

/* Today's schedule */
.sched { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto auto; align-items: center; gap: .85rem; min-height: 56px; padding: .4rem 0; border-top: 1px solid var(--line-soft); }
.sched li:first-child { border-top: 0; }
.sched-time { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .8125rem; white-space: nowrap; }
.sched-name { font-weight: 500; min-width: 0; }
.sched-name .pill { margin-left: .35rem; vertical-align: 1px; }
.sched-count { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-count .ic { width: 16px; height: 16px; flex-basis: 16px; }

/* Recent activity */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--line-soft); }
.feed li:first-child { border-top: 0; padding-top: .2rem; }
.feed-ic { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; }
.feed-ic .ic { width: 15px; height: 15px; flex-basis: 15px; color: var(--brand); }
.feed-text { display: flex; flex-direction: column; min-width: 0; font-size: .8125rem; line-height: 1.4; }
.feed-text > span { overflow-wrap: anywhere; }
.feed-text small { color: var(--muted); font-size: .75rem; margin-top: .1rem; }

/* Empty states */
.empty { text-align: center; padding: 28px 16px; color: var(--ink); }
.empty > .ic { width: 28px; height: 28px; color: #A6B2AB; margin-bottom: .35rem; }
.empty p { margin: 0 0 .2rem; }

.flash { display: flex; gap: .4rem; flex-wrap: wrap; align-items: baseline; padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 20px; border: 1px solid transparent; font-weight: 500; }
.flash.ok { background: var(--brand-soft); color: var(--brand-deep); border-color: #CFE1D5; }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: #F3CFCB; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #F1DDAF; }
.flash a { color: inherit; font-weight: 700; }
.meter { height: 6px; background: var(--line-soft); border-radius: 99px; overflow: hidden; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.meter.warn span { background: #C98A12; }
.meter.over span { background: var(--bad); }
.reg { display: flex; flex-direction: column; gap: .35rem; max-width: 140px; font-variant-numeric: tabular-nums; }

/* Buttons: 44px, 8px corners */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); padding: 0 1.1rem; border-radius: var(--radius-sm); font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease; }
.btn .ic { width: 16px; height: 16px; flex-basis: 16px; color: currentColor; }
.btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); border-color: #CBD5CF; color: var(--ink); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #8F1E17; border-color: #8F1E17; }
.btn.sm { min-height: 34px; padding: 0 .75rem; font-size: .8125rem; }
.btn.sm .ic { width: 15px; height: 15px; flex-basis: 15px; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy .ic { opacity: 0; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost.is-busy::after { border-color: rgba(32, 92, 67, .25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (pointer: coarse) { .btn.sm { min-height: 44px; } }
.row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }
.row > input, .row > select { width: auto; flex: 0 1 220px; min-width: 0; }

/* Segmented tabs and search */
.list-tools { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; background: var(--hover); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.seg button { min-height: 32px; padding: 0 .85rem; border: 0; border-radius: 6px; background: none; font: inherit; font-size: .8125rem; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected=true] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 45, 36, .1); }
.seg button:focus-visible { outline: none; box-shadow: var(--focus); }
.search { position: relative; display: block; margin: 0; font-weight: 400; }
.search .ic { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
.search input[type=search] { width: 220px; min-height: 40px; padding-left: 2.2rem; }

label { display: block; font-weight: 600; font-size: .8125rem; margin: .8rem 0 .3rem; color: var(--ink); }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; font-size: .875rem; }
label.check input { margin-top: .2rem; }
label.check.consent { font-size: .8125rem; background: var(--gold-soft); border: 1px solid #EADFC0; border-radius: var(--radius-sm); padding: .7rem .8rem; margin-top: .9rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 42px; padding: .55rem .75rem; border: 1px solid #D5DDD8; border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #93A099; }
input:hover, select:hover, textarea:hover { border-color: #BFCAC3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 1rem; height: 1rem; }
textarea { min-height: 90px; resize: vertical; }
textarea.doc { min-height: 380px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8125rem; }
details.fields { margin: .6rem 0; }
details.fields summary { cursor: pointer; font-weight: 600; }
details.fields code { font-size: .8125rem; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1rem; }
.narrow { max-width: 460px; }
.mid { max-width: 760px; }

/* Tables */
.tablewrap { overflow-x: auto; }
.card > .tablewrap:first-child, .card > h2 + .tablewrap { margin: 0 -24px; }
.card > .tablewrap th:first-child, .card > .tablewrap td:first-child { padding-left: 24px; }
.card > .tablewrap th:last-child, .card > .tablewrap td:last-child { padding-right: 24px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: .75rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); background: #FAFBFA; border-bottom-color: var(--line); white-space: nowrap; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #F8FAF9; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); font-size: .75rem; margin-top: .1rem; }
table.list td { height: 56px; }
table.list th:first-child, table.list td:first-child { padding-left: 20px; }
table.list th:last-child, table.list td:last-child { padding-right: 20px; }
td.actions-cell { text-align: right; white-space: nowrap; }
td.actions-cell .btn + .btn { margin-left: .35rem; }

.pill { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; line-height: 1.4; background: #EEF2EF; color: #46574E; white-space: nowrap; text-transform: capitalize; }
.pill.ok { background: var(--brand-soft); color: var(--brand-deep); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.gold { background: var(--gold-soft); color: #7A6122; }
.pill.plain { text-transform: none; }

.waiverdoc { white-space: pre-wrap; background: #fbfcfa; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; max-height: 420px; overflow-y: auto; font-size: .92rem; }
.sigpad { position: relative; border: 2px dashed #cfd6cf; border-radius: var(--radius); background: #fff; touch-action: none; }
.sigpad canvas { display: block; width: 100%; height: 180px; cursor: crosshair; }
.sigpad .hint { position: absolute; left: 1rem; bottom: .6rem; color: #b5bbb2; pointer-events: none; font-size: .85rem; }
.sigpad.has .hint { display: none; }
.checklist { list-style: none; padding: 0; margin: .5rem 0 0; }
.checklist li { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--line); }
/* Home page banner: the facility photo (public/images/banner-facility.webp) with a pine shade behind the text. */
.hero {
  position: relative; color: #fff; display: flex; align-items: flex-end;
  height: clamp(340px, 45vw, 640px); /* the photo is about 2.2:1 */
  background: linear-gradient(90deg, rgba(16, 38, 27, .82) 0%, rgba(16, 38, 27, .55) 38%, rgba(16, 38, 27, .06) 72%),
    linear-gradient(0deg, rgba(16, 38, 27, .5) 0%, rgba(16, 38, 27, 0) 38%),
    url("../images/banner-facility.webp") center 60% / cover no-repeat, #1f5c3f;
}
/* Uploaded photos (Admin > Home banner) replace the drawing; several rotate with a crossfade. */
.hero.has-photo, .hero-shade { background: linear-gradient(90deg, rgba(16, 38, 27, calc(.78 * var(--shade, 1))) 0%, rgba(16, 38, 27, calc(.5 * var(--shade, 1))) 38%, rgba(16, 38, 27, calc(.08 * var(--shade, 1))) 72%), linear-gradient(0deg, rgba(16, 38, 27, calc(.5 * var(--shade, 1))) 0%, rgba(16, 38, 27, 0) 40%), var(--banner) var(--banner-pos, center) / cover no-repeat, #1f5c3f; }
.hero-shade { display: flex; align-items: flex-end; padding: .7rem .9rem; }
.hero-shade span { color: #fff; font-family: var(--display); font-weight: 600; font-size: 1.2rem; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16, 38, 27, calc(.78 * var(--shade, 1))) 0%, rgba(16, 38, 27, calc(.5 * var(--shade, 1))) 38%, rgba(16, 38, 27, calc(.08 * var(--shade, 1))) 72%), linear-gradient(0deg, rgba(16, 38, 27, calc(.5 * var(--shade, 1))) 0%, rgba(16, 38, 27, 0) 40%), var(--next, none) var(--next-pos, center) / cover no-repeat; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
.hero-fade.show { opacity: 1; }
.hero .inner { position: relative; z-index: 1; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: -.5rem 0 24px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85rem; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.banner-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.banner-thumb { aspect-ratio: 8 / 3; border-radius: 6px; background-size: cover; background-color: var(--line); margin-bottom: .6rem; }
.banner-card.is-hidden .banner-thumb { opacity: .45; }
input[type=file] { display: block; margin: .4rem 0 .6rem; font: inherit; }
.hero .inner { max-width: 1100px; width: 100%; margin: 0 auto; padding: 3rem 16px 2.4rem; }
.hero h1 { color: #fff; font-size: 2.6rem; line-height: 1.1; letter-spacing: -.025em; margin-bottom: .5rem; text-shadow: 0 2px 16px rgba(0, 0, 0, .25); }
.hero p { color: #eef3ea; max-width: 560px; font-size: 1.05rem; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: #e9dcc0; margin-bottom: .4rem; }
.hero .btn { background: #ffffff; color: var(--brand-deep); border-color: #ffffff; }
.hero .btn:hover { background: var(--wood-soft); border-color: var(--wood-soft); }
.hero .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 1.5rem 0 2rem; }
.features .card h3 { color: var(--ink); font-size: 1rem; }
.features .card { border-top: 3px solid var(--gold); margin-bottom: 0; }
footer.site { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 2.5rem; color: var(--muted); font-size: .8125rem; border-top: 1px solid var(--line); }
.app-main footer.site { max-width: 1360px; margin: 0 32px; padding: 1.25rem 0 2rem; }

@media (max-width: 640px) {
  .brand { flex: 1; }
  .hero { height: auto; min-height: 400px;
    background: linear-gradient(0deg, rgba(16, 38, 27, .9) 0%, rgba(16, 38, 27, .6) 50%, rgba(16, 38, 27, .15) 100%),
      url("../images/banner-facility.webp") 65% 60% / cover no-repeat, #1f5c3f; }
  .hero .inner { padding-top: 5rem; }
  .hero.has-photo, .hero-fade { background: linear-gradient(0deg, rgba(16, 38, 27, calc(.9 * var(--shade, 1))) 0%, rgba(16, 38, 27, calc(.65 * var(--shade, 1))) 55%, rgba(16, 38, 27, calc(.35 * var(--shade, 1))) 100%), var(--banner) var(--banner-pos, center) / cover no-repeat, #1f5c3f; }
  .hero-fade { background-image: linear-gradient(0deg, rgba(16, 38, 27, calc(.9 * var(--shade, 1))) 0%, rgba(16, 38, 27, calc(.65 * var(--shade, 1))) 55%, rgba(16, 38, 27, calc(.35 * var(--shade, 1))) 100%), var(--next, none); background-position: center, var(--next-pos, center); }
  .brand { font-size: 1rem; white-space: nowrap; }
  .topbar .inner > nav .btn.sm { padding: .3rem .7rem; }
  .hero h1 { font-size: 1.9rem; }
  th.hide-sm, td.hide-sm { display: none; }
}

/* Sortable headers and totals row */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable a { color: inherit; text-decoration: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after, th.sortable a::after { content: " ↕"; opacity: .3; }
th.sortable:has(a)::after { content: none; }
th[aria-sort=ascending]::after, th[aria-sort=ascending] a::after { content: " ↑"; opacity: .9; }
th[aria-sort=descending]::after, th[aria-sort=descending] a::after { content: " ↓"; opacity: .9; }
th[aria-sort] { color: var(--brand-deep); }
th.sortable:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* Totals: a quiet footer line, not a colored band. */
tfoot td { white-space: nowrap; font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 0; background: #FAFBFA; font-size: .8125rem; padding-top: .6rem; padding-bottom: .6rem; }
.total { margin: .6rem 0 0; font-weight: 600; color: var(--muted); font-size: .8125rem; }
[hidden] { display: none !important; }
.facts { display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: .45rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); font-size: .8125rem; }
.facts dd { margin: 0; }
.pre { white-space: pre-wrap; }
@media (max-width: 759px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .4rem; } }

/* Public pages */
.publicnav { gap: .35rem; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; margin-bottom: .4rem; }
.eyebrow.dark { color: #8C7231; }
@media (max-width: 640px) { .publicnav .hide-sm { display: none; } }
.hero-note { margin-top: .8rem; color: #e6efe9; }
.hero-note a { color: #fff; }
.h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
.features a.card { text-decoration: none; color: inherit; transition: border-color .15s ease; }
.features a.card:hover { border-color: var(--brand); }
.seo-block { margin: 1.8rem 0; }
.seo-block > p { max-width: 760px; }
ul.ticks { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.ticks li { padding: .3rem 0 .3rem 1.6rem; position: relative; }
ul.ticks li::before { content: ""; position: absolute; left: .2rem; top: .75rem; width: .7rem; height: .4rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
details.faq { border-bottom: 1px solid var(--line); padding: .7rem 0; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.faq p { margin: .5rem 0 0; color: var(--muted); max-width: 760px; }
.card.cta { text-align: center; padding: 1.8rem 1.35rem; border-top: 3px solid var(--gold); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }


/* ---- Responsive: tablets get a 2×2 summary and stacked sections; phones get 16px gutters and card rows ---- */
@media (max-width: 1199px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .app-main main { padding: 24px 24px 40px; }
  .app-main footer.site { margin: 0 24px; }
}
@media (max-width: 759px) {
  .app-main main { padding: 16px 16px 32px; }
  .app-main footer.site { margin: 0 16px; }
  .pagehead { margin-bottom: 16px; }
  .pagehead .actions { width: 100%; }
  .pagehead .actions .btn { flex: 1 1 auto; }
  .kpis { gap: 12px; margin-bottom: 16px; }
  .kpi { min-height: 96px; padding: 14px 16px; }
  .kpi b { font-size: 1.5rem; }
  .kpi .ic { top: 14px; right: 14px; }
  .card, .panel { padding: 16px; margin-bottom: 16px; }
  .panel.flush > .panel-head, .panel-foot { padding-left: 16px; padding-right: 16px; }
  .card > .tablewrap:first-child, .card > h2 + .tablewrap { margin: 0 -16px; }
  .card > .tablewrap th:first-child, .card > .tablewrap td:first-child { padding-left: 16px; }
  .card > .tablewrap th:last-child, .card > .tablewrap td:last-child { padding-right: 16px; }
  .split { gap: 16px; margin-bottom: 16px; }
  .todo li { flex-wrap: wrap; }
  .todo-text { flex-basis: calc(100% - 48px); }
  .todo-actions { width: 100%; justify-content: flex-start; padding-left: 44px; }
  .sched li { grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .7rem 0; }
  .sched-time { grid-column: 1 / -1; color: var(--muted); }
  .sched li .btn { grid-row: span 2; grid-column: 2; grid-row-start: 2; }
  .list-tools, .search, .search input[type=search] { width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; min-height: 38px; }

  /* Program rows become stacked cards */
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { height: auto !important; padding: .2rem 0 !important; border: 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .75rem; font-weight: 500; text-align: left; flex: 0 0 auto; padding-top: .1rem; }
  table.stack td:first-child { display: block; text-align: left; padding-bottom: .45rem !important; }
  table.stack td:first-child::before { content: none; }
  table.stack td:first-child small { display: inline; margin-left: .35rem; }
  table.stack td > small { display: block; }
  table.stack td.actions-cell { padding-top: .6rem !important; justify-content: flex-start; gap: .5rem; }
  table.stack td.actions-cell::before { content: none; }
  table.stack td.actions-cell .btn { flex: 1; margin: 0; }
  table.stack .reg { align-items: flex-end; margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; } }
