:root {
  color-scheme: light;
  --text: #132743;
  --muted: #516680;
  --line: #dbe4ef;
  --accent: #125e65;
  --tint: #ebf6f6;
  --paper: #fff;
  --bg: #f3f6fb;
  font: 15px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.top { display: flex; gap: 22px; align-items: center; padding: 12px max(24px, calc((100% - 1380px)/2)); background: #142944; color: white; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; font-weight: 700; }
.mark { color: #142944; background: #a4ece0; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.top a { color: #cef5f0; white-space: nowrap; }
.top button { min-height: 32px; padding: 4px 9px; }
#identity { overflow-wrap: anywhere; font-size: 13px; color: #dee7f0; }
main { width: min(100% - 48px, 1380px); margin: 30px auto 56px; }
.heading, .table-head, .dialog-head, .actions, .pagination { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.heading { margin-bottom: 22px; }
.heading-actions, .report-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 38px); letter-spacing: -.035em; }
h2 { font-size: 17px; letter-spacing: -.015em; }
p { color: var(--muted); }
#dashboard { display: grid; gap: 16px; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-nav a { border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; color: var(--text); background: var(--paper); font-weight: 650; text-decoration: none; }
.portal-nav a[aria-current="page"] { border-color: var(--accent); background: var(--tint); color: var(--accent); }
.portal-nav a:hover { border-color: var(--accent); }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.filters, #filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters .search { flex: 1; min-width: 160px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 650; }
select, input, button { font: inherit; border-radius: 7px; min-height: 38px; }
input, select { padding: 7px 9px; width: 100%; border: 1px solid #afbed0; background: var(--paper); color: var(--text); }
select { max-width: 220px; }
button { padding: 7px 12px; border: 1px solid var(--accent); background: var(--accent); color: white; cursor: pointer; font-weight: 650; }
button.secondary { border-color: #afbed0; color: var(--text); background: white; }
button:disabled { cursor: default; opacity: .52; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #267dce; outline-offset: 2px; }
.metrics, .charts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.metrics strong { display: block; font-size: 31px; letter-spacing: -.035em; color: var(--accent); }
.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.4fr) 34px; gap: 9px; align-items: center; margin-top: 7px; font-size: 13px; }
.chart-row span:first-child { overflow-wrap: anywhere; }
.chart-row strong { text-align: right; }
meter { width: 100%; height: 13px; }
meter::-webkit-meter-optimum-value { background: #278b85; }
meter::-moz-meter-bar { background: #278b85; }
.badge { background: var(--tint); color: var(--accent); font-weight: 700; padding: 3px 9px; border-radius: 16px; white-space: nowrap; }
.badge.resigned { background: #fff1d9; color: #794300; }
.scroll { overflow: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { background: #edf3f9; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td small { display: block; color: var(--muted); }
td button { min-height: 32px; padding: 3px 9px; }
.pagination { justify-content: flex-end; padding-top: 12px; }
dialog { width: min(750px, calc(100% - 30px)); border: 1px solid var(--line); border-radius: 13px; padding: 24px; color: var(--text); max-height: 90vh; }
dialog::backdrop { background: #10233db0; }
.dialog-head, .actions { margin-bottom: 12px; }
.dialog-head h2 { font-size: 22px; }
.eyebrow { font-size: 12px; font-weight: 700; }
.edit-fields, dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 15px 0; }
.edit-fields label { background: #fff3c5; border: 1px solid #edd982; border-radius: 8px; padding: 8px; }
.edit-fields select { max-width: none; }
.location-editor > input { margin-top: 6px; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 1px 0 0; overflow-wrap: anywhere; }
summary { cursor: pointer; }
#edit-status { margin: 10px 0; }
.error { color: #a82529; }
.account-panel { max-width: 450px; margin: 45px auto; padding: 24px; }
.account-form { display: grid; gap: 12px; margin-top: 18px; }
.account-form h3 { margin: 0; }
.account-form > button { justify-self: start; }
.code-text { font-family: ui-monospace, Consolas, monospace; }
.recovery-codes { list-style: none; padding: 10px; border-radius: 8px; background: var(--bg); }
.recovery-codes li { padding: 4px; overflow-wrap: anywhere; }
#manager-form { padding: 14px; border-radius: 8px; background: var(--bg); }
#manager-list td:last-child button { margin: 0 5px 5px 0; }
.actions { justify-content: flex-start; margin-bottom: 0; }
#reference-dialog { width: min(1100px, calc(100% - 30px)); }
#reference-dialog td { min-width: 115px; }
#monthly-report { width: min(1080px, calc(100% - 30px)); }
#report-period { margin: 14px 0 4px; }
.report-table :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.report-table th { white-space: nowrap; }
.report-table tbody th { background: transparent; white-space: normal; }
.report-table tfoot { background: var(--tint); font-weight: 700; }
.report-table tfoot th { background: var(--tint); }
.report-note { margin-top: 9px; font-size: 13px; }
.download-button { border: 1px solid var(--accent); border-radius: 7px; color: var(--accent); background: var(--paper); padding: 7px 12px; min-height: 38px; font-weight: 650; text-decoration: none; }
@media (max-width: 720px) {
  main { width: calc(100% - 28px); margin-top: 20px; }
  .top { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .charts { grid-template-columns: 1fr; }
  .heading { align-items: start; flex-direction: column; }
}
@media (max-width: 430px) { .edit-fields, dl { grid-template-columns: 1fr; } }
