:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", sans-serif;
  color: #172b3a;
  background: #f4f7f9;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #176b87;
  --blue-dark: #10566e;
  --border: #d8e1e6;
  --muted: #5a6c77;
}

* { box-sizing: border-box; }

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

a { color: var(--blue-dark); }

.container { width: min(1440px, calc(100% - 40px)); margin: 0 auto; }

.site-header { background: #fff; border-bottom: 1px solid var(--border); }

.header-content {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { color: #173b4c; font-size: 1.1rem; font-weight: 700; text-decoration: none; }

nav { display: flex; gap: 22px; }

nav a { text-decoration: none; font-weight: 600; }

main.container { padding-top: 24px; padding-bottom: 56px; }

.eyebrow, .muted { color: var(--muted); }

.eyebrow { margin: 0 0 8px; font-size: .88rem; }

h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 3vw, 2rem); }

h2 { margin: 0; font-size: 1.1rem; }

.page-heading, .table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0;
}

.muted { margin: 0; }

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button-primary { color: #fff; background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button-secondary { color: #233c4a; background: #fff; border-color: var(--border); }

.filter-panel, .form-card {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: end;
  gap: 14px;
}

label { display: grid; gap: 6px; font-weight: 600; }

input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #b7c6ce;
  border-radius: 5px;
  color: inherit;
  font: inherit;
}

input:focus { outline: 3px solid #b8dce8; border-color: var(--blue); }
input:disabled { background: #f2f5f6; color: #52646e; }

.filter-actions, .form-actions { display: flex; align-items: end; gap: 8px; }
.table-heading { margin-top: 26px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; }

table { width: 100%; border-collapse: collapse; text-align: left; }

th, td { padding: 11px 13px; border-bottom: 1px solid #e6ecef; vertical-align: top; }
th { background: #f7f9fa; color: #415762; font-size: .86rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; white-space: nowrap; }
.actions { white-space: nowrap; }
.actions form { display: inline; margin-left: 10px; }
.link-button { padding: 0; border: 0; color: var(--blue-dark); background: none; font: inherit; text-decoration: underline; cursor: pointer; }
.danger-link { color: #a32626; }
.empty-state { padding: 30px; color: var(--muted); text-align: center; }

.form-card { width: min(560px, 100%); display: grid; gap: 8px; }
.form-card label:not(:first-of-type) { margin-top: 8px; }
.form-actions { margin-top: 12px; }
.back-link { display: inline-block; margin: 10px 0 18px; }

.message { padding: 12px 14px; border-radius: 6px; }
.message-success { color: #135b37; background: #e5f5eb; }
.message-error { color: #812525; background: #fff0ef; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 900px) {
  .filter-panel { grid-template-columns: 1fr auto; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 24px, 1440px); }
  .header-content, .page-heading { align-items: flex-start; flex-direction: column; }
  .header-content { padding: 14px 0; }
  nav { gap: 16px; }
  .filter-panel { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
}
