:root {
  --bg: #eef1ea;
  --surface: #ffffff;
  --surface-2: #e4e9dc;
  --surface-3: #dbe2d1;
  --border: #c9d1bd;
  --border-soft: #dbe2d1;
  --text: #1a2016;
  --text-muted: #5c6656;
  --text-faint: #8a9280;
  --accent: #7a4a2e;
  --accent-strong: #5e3720;
  --accent-soft: #f0e3d9;
  --accent-contrast: #fff8f2;
  --good: #2e7d4e;
  --good-soft: #e2f0e6;
  --warn: #a8791f;
  --warn-soft: #f6ecd3;
  --bad: #a83b3b;
  --bad-soft: #f6dede;
  --shadow: 0 1px 2px rgba(30, 35, 20, .06), 0 4px 14px rgba(30, 35, 20, .05);
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text); margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.5;
}
h1, h2, h3 { margin: 0; }
.mono { font-variant-numeric: tabular-nums; }
a { color: var(--accent-strong); }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 820px) { .shell { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--border-soft); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 20px; min-width: 0;
}
.brand { font-size: 18px; font-weight: 700; }
.brand .tag { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.who-badge {
  font-size: 12px; color: var(--text-muted); background: var(--surface-2); border-radius: 20px;
  padding: 5px 12px; display: inline-block;
}
nav { display: flex; flex-direction: column; gap: 2px; }
nav .group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin: 12px 4px 4px; }
.nav-link {
  display: block; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text); text-decoration: none;
}
.nav-link:hover { background: var(--surface-2); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border-soft); padding-top: 12px; }
.sidebar-foot form { margin-top: 6px; }
.sidebar-foot button.link-btn, .sidebar-foot a.link-btn {
  background: none; border: none; padding: 0; color: var(--accent-strong); cursor: pointer; font-size: 12px;
  text-decoration: underline; display: inline-block;
}

main { padding: 28px 34px 60px; max-width: 1100px; min-width: 0; }
@media (max-width: 820px) { main { padding: 20px 16px 48px; } }

.screen-head { margin-bottom: 20px; }
.screen-head h2 { font-size: 24px; font-weight: 700; }
.screen-sub { color: var(--text-muted); font-size: 13.5px; max-width: 60ch; margin-top: 4px; }

.panel { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { padding: 14px 20px; border-bottom: 1px solid var(--border-soft); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 0; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.field .hint { font-size: 11.5px; color: var(--text-faint); }
input[type=text], input[type=number], input[type=date], input[type=password], select, textarea {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 7px;
  padding: 9px 11px; font-size: 14px; font-family: inherit; width: 100%;
}
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.checkbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checkbox-list label { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 400;
  color: var(--text); padding: 8px 4px; min-height: 44px; box-sizing: border-box; cursor: pointer; }
.checkbox-list input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); }

.btn { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast); border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--accent-strong); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--surface-3); color: var(--text-muted); }

.empty-state { padding: 30px 20px; text-align: center; color: var(--text-muted); }
.callout { border-radius: 9px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.good { background: var(--good-soft); color: var(--good); }
.callout.info { background: var(--surface-2); color: var(--text-muted); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px 16px; }
.stat .label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat .sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.bar { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }

.errorlist { color: var(--bad); list-style: none; padding: 0; margin: 4px 0; font-size: 12.5px; }
.login-shell { max-width: 360px; margin: 80px auto; padding: 0 16px; }
