:root {
  color-scheme: light;
  --ink: #13211b;
  --muted: #65736c;
  --line: #dce5df;
  --surface: #ffffff;
  --canvas: #f3f7f4;
  --brand: #176b51;
  --brand-dark: #0f4d3a;
  --accent: #e7f3ec;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
a { color: var(--brand); }
.topbar { min-height: 68px; padding: 0 5vw; display: flex; align-items: center; gap: 2rem; background: #102f25; color: white; }
.brand { color: white; text-decoration: none; font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.topbar nav { display: flex; flex: 1; gap: 1.2rem; flex-wrap: wrap; }
.topbar nav a, .topbar .link-button { color: #e8f5ee; text-decoration: none; }
.container { width: min(1180px, 92vw); margin: 2.5rem auto; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
h1 { margin: .1rem 0; font-size: clamp(1.8rem, 3vw, 2.7rem); }
h2 { margin-top: 0; }
.eyebrow { margin: 0; color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; }
.card, .login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; box-shadow: 0 12px 34px rgba(25, 50, 39, .06); margin-bottom: 1.4rem; }
.login-card { width: min(430px, 100%); margin: 9vh auto; padding: 2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.stat-card { display: flex; flex-direction: column; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; color: var(--muted); text-decoration: none; }
.stat-card span { color: var(--ink); font-size: 2.1rem; font-weight: 800; }
.actions { display: flex; gap: .7rem; flex-wrap: wrap; }
button, .button { border: 0; border-radius: 10px; padding: .72rem 1rem; font: inherit; font-weight: 750; cursor: pointer; text-decoration: none; display: inline-block; }
.primary { color: white; background: var(--brand); }
.primary:hover { background: var(--brand-dark); }
.secondary { color: var(--ink); background: var(--accent); }
.link-button { padding: 0; background: transparent; text-decoration: underline; font-weight: 600; }
.stacked-form { display: grid; gap: .7rem; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid p { margin: 0; }
.form-grid .full-width { grid-column: 1 / -1; }
label { display: block; font-weight: 700; margin-bottom: .35rem; }
input, select, textarea { width: 100%; border: 1px solid #bdcbc3; border-radius: 9px; background: white; padding: .7rem .75rem; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid #cce7da; border-color: var(--brand); }
.errorlist, .error { color: #9c2d2d; }
.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: .7rem; align-items: center; white-space: nowrap; }
.message { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--accent); }
.map-placeholder { border-style: dashed; }

@media (max-width: 850px) {
  .topbar { align-items: flex-start; padding-block: 1rem; flex-wrap: wrap; gap: .8rem 1.3rem; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
}
