:root {
  color-scheme: light;
  --navy: #172637;
  --navy-light: #25394d;
  --paper: #fff;
  --canvas: #f2f5f8;
  --ink: #172c3c;
  --muted: #506478;
  --line: #d9e2ea;
  --teal: #086b65;
  --teal-light: #e9f7f4;
  --danger: #98412b;
  font-family: Tahoma, "Segoe UI", system-ui, sans-serif;
  line-height: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: var(--teal); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  width: fit-content; border: 1px solid var(--line); border-radius: 7px;
  padding: .42rem .8rem; background: var(--paper); color: var(--ink);
  text-decoration: none; cursor: pointer; font-weight: 600;
}
button:hover, .button:hover { border-color: var(--teal); color: var(--teal); }
:focus-visible { outline: 3px solid #c28421; outline-offset: 2px; }
button.primary, .button.primary { background: var(--teal); border-color: var(--teal); color: white; }
button.primary:hover, .button.primary:hover { background: #07554f; }
button.danger { border-color: #f0d5cd; color: var(--danger); }
.quiet { background: transparent; color: #e5edf5; border-color: #6d7e91; }
.quiet:hover { color: white; border-color: white; }
.top {
  min-height: 64px; padding: .65rem clamp(.8rem, 3vw, 2rem);
  background: var(--navy); color: #eef5fa; display: flex;
  align-items: center; justify-content: space-between; gap: .9rem;
  border-bottom: 3px solid #18a58d;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: white; font-weight: 700; text-decoration: none; }
.brand-mark { display: grid; color: #fff; background: var(--teal); border-radius: 7px; width: 34px; height: 34px; place-items: center; }
.session { display: flex; align-items: center; gap: .85rem; }
.session span { color: #bcd1df; font: .85rem monospace; }
.layout { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 12.8rem minmax(0, 1fr); }
aside { background: var(--navy); padding: 1rem .65rem; }
nav { display: grid; align-content: start; gap: .3rem; }
nav a { text-decoration: none; color: #cedeea; display: block; padding: .47rem .72rem; border-radius: 6px; }
nav a:hover, nav a[aria-current="page"] { color: #fff; background: var(--navy-light); }
nav a[aria-current="page"] { box-shadow: inset -3px 0 #34c2a8; }
main { padding: clamp(1rem, 3vw, 2rem); width: 100%; max-width: 90rem; margin-inline: auto; }
.signin { max-width: 33rem; margin-top: 8vh; }
.page-heading { margin-bottom: 1.2rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.4rem, 3vw, 2rem); }
h2 { font-size: 1.12rem; margin-bottom: .65rem; }
.page-heading p, .muted { color: var(--muted); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: clamp(.75rem, 2vw, 1.3rem); margin-bottom: 1rem; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.metric { display: flex; flex-direction: column; color: var(--muted); text-decoration: none; }
a.metric:hover { border-color: var(--teal); }
.metric strong { color: var(--ink); font-size: 1.8rem; font-weight: 700; }
.status { display: inline-flex; border-radius: 4px; color: #105650; background: var(--teal-light); padding: .05rem .48rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: start; }
th, td { padding: .65rem .8rem; text-align: start; border-bottom: 1px solid #e7edf2; }
th { font-weight: 700; background: #f3f6f9; color: #344b5f; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.row-actions, .actions, .filter, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.actions, .filter, .pagination { margin-block: .8rem; }
.filter input, .filter select { width: auto; min-width: 5rem; max-width: 100%; }
.stack, .stack > div { display: grid; gap: .64rem; }
.stack { max-width: 52rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.2rem; }
label { display: block; font-weight: 600; }
label:has(input[type="checkbox"]) { font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 6px; font: inherit; }
legend { font-weight: 600; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; background: white; border-radius: 6px; padding: .42rem .55rem;
  border: 1px solid #aabaca; color: var(--ink);
}
textarea { min-height: 6rem; resize: vertical; direction: ltr; }
input[type="checkbox"] { accent-color: var(--teal); margin-inline-end: .35rem; }
input:disabled, select:disabled { background: #eef2f5; }
.helptext { color: var(--muted); font-size: .9rem; }
code { display: inline-block; direction: ltr; font-size: .86rem; overflow-wrap: anywhere; }
.notice { border-inline-start: 4px solid var(--teal); border-radius: 5px; background: var(--teal-light); padding: .68rem .75rem; margin-block: .7rem; }
.notice ul { margin: .25rem 0 0; }
.error, .errorlist { color: var(--danger); }
.notice.error { background: #fff2ee; border-color: var(--danger); }
.signin h1 { margin-bottom: 1rem; }
.signin form + form { margin-top: 1.2rem; }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  aside { padding: .4rem .6rem; max-width: 100vw; }
  nav { display: flex; overflow-x: auto; white-space: nowrap; }
  nav a { font-size: .87rem; }
  .metrics { gap: .5rem; }
  .metric { font-size: .81rem; }
}
@media (max-width: 470px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .page-heading { flex-wrap: wrap; }
}
