* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --ink: #142b3b;
  --muted: #506675;
  --line: #d6e0e4;
  --paper: #ffffff;
  --canvas: #f2f6f7;
  --navy: #102d41;
  --accent: #00695e;
  --accent-hover: #00544b;
  --focus: #0076ce;
  --danger: #a52233;
  font: 1rem/1.5 system-ui, -apple-system, sans-serif;
}
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input { font: inherit; }
button, .button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 0.2em; }
:where(a, button, input, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1 { margin: 0; line-height: 1.15; font-size: clamp(2rem, 4vw, 2.65rem); letter-spacing: -0.045em; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 0.75rem; font-size: 0.99rem; font-weight: 700; letter-spacing: 0.01em; }
.brand-logo {
  display: block;
  box-sizing: content-box;
  flex: none;
  padding: 0.32rem 0.52rem;
  border-radius: 0.4rem;
  background: var(--paper);
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.login-page {
  --ink: #191816;
  --focus: #806200;
  --login-yellow: #ffcc00;
  --login-yellow-hover: #efbe00;
  min-height: 100svh;
  background: #f8f7f3;
}
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 1.25rem; }
.login-card {
  width: min(100%, 25rem);
  padding: clamp(1.5rem, 6vw, 2.75rem);
  background: var(--paper);
  border: 1px solid #e5e2d8;
  border-radius: 1rem;
  box-shadow: 0 16px 44px #29200a0a;
}
.login-logo { display: block; max-width: 100%; height: auto; margin: 0 auto 2.4rem; }
.login-card input:not([type=hidden]) { border-color: #8f8b80; }
.login-card .primary { background: var(--login-yellow); color: var(--ink); }
.login-card .primary:hover { background: var(--login-yellow-hover); }
.form-card { padding: clamp(1.4rem, 5vw, 2.5rem); background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 14px 38px #102d4111; }
.field { display: grid; gap: 0.42rem; margin-block-end: 1.25rem; }
label { font-size: 0.94rem; font-weight: 650; }
input:not([type=hidden]) { width: 100%; min-height: 3rem; padding: 0.65rem 0.75rem; border: 1px solid #78909c; border-radius: 0.45rem; color: var(--ink); background: var(--paper); font-size: max(1rem, 1em); }
input[aria-invalid=true] { border-color: var(--danger); }
.field-help { color: var(--muted); font-size: 0.88rem; }
.field-help ul, .errorlist { margin-block: 0.15rem; padding-inline-start: 1.2rem; }
.errorlist { color: var(--danger); }
.alert, .notice { padding: 0.7rem 0.9rem; border: 1px solid #e4b2bb; border-radius: 0.45rem; background: #fff3f4; color: #8c1728; font-size: 0.92rem; }
.notice { border-color: #b2dbd3; background: #e7f5f1; color: #205c51; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: 0.55rem 1.1rem; border: 1px solid transparent; border-radius: 0.5rem; font-size: 0.94rem; font-weight: 700; line-height: 1.35; text-decoration: none; white-space: nowrap; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-hover); }
.secondary { color: var(--ink); border-color: #aabfca; background: #fff; }
.secondary:hover { background: #ebf2f5; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #811b28; }
.full { width: 100%; }
.topbar { background: var(--navy); color: var(--paper); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; width: min(100% - 2.5rem, 72rem); margin-inline: auto; min-height: 4.4rem; gap: 1rem; }
.topbar .secondary { border-color: #63899b; background: transparent; color: #fff; }
.topbar .secondary:hover { background: #20465c; }
.portal { width: min(100% - 2.5rem, 72rem); margin-inline: auto; padding-block: clamp(2.2rem, 6vw, 4.5rem); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; margin-block-end: 1.5rem; }
.page-heading p { margin: 0.55rem 0 0; }
.table-frame { overflow-x: auto; border: 1px solid var(--line); border-radius: 0.78rem; background: var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: start; font-size: 0.93rem; }
th, td { padding: 0.95rem 1.1rem; text-align: start; white-space: nowrap; }
thead { color: var(--muted); background: #eaf1f3; }
tbody tr + tr { border-top: 1px solid #e5edef; }
tbody tr:hover { background: #f8fbfc; }
.status { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.18rem 0.64rem; border-radius: 10rem; font-size: 0.82rem; font-weight: 700; }
.status::before { content: ""; inline-size: 0.38rem; block-size: 0.38rem; border-radius: 50%; background: currentColor; }
.active { color: #156257; background: #e3f3ed; }
.locked { color: #8f3a1e; background: #fcefe4; }
.actions-heading { text-align: end; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.9rem; }
.text-button { display: inline-flex; align-items: center; min-height: 3rem; color: var(--accent); background: transparent; border: 0; padding: 0.3rem 0; font-size: 0.9rem; font-weight: 650; text-decoration: underline; }
.danger-text { color: var(--danger); }
.portal.narrow { max-width: 35rem; }
.back { display: inline-block; margin-block-end: 1rem; font-weight: 650; }
.form-card h1 { margin-block-end: 1.4rem; }
.form-actions { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-block-start: 1.2rem; }
@media (max-width: 37rem) {
  .page-heading { flex-wrap: wrap; }
  th, td { padding-inline: 0.82rem; }
  .topbar-inner { gap: 0.65rem; }
  .topbar .brand { font-size: 0.86rem; gap: 0.45rem; }
  .topbar .brand-logo { width: 5.5rem; height: auto; }
}
