:root {
  --ink: #16202a;
  --muted: #5d6b7a;
  --line: #dfe5ec;
  --bg: #f4f6f9;
  --card: #fff;
  --accent: #0a6b4f;
  --accent-dark: #085440;
  --danger: #b3261e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.topbar { background: var(--accent); color: #fff; padding: 14px 0; margin-bottom: 28px; }
.topbar a { color: #fff; text-decoration: none; }
.bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.brand { font-weight: 600; letter-spacing: .2px; }
.tag { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .6px; }
nav { display: flex; align-items: center; gap: 16px; }
nav a:hover { text-decoration: underline; }
main { padding-bottom: 40px; }
footer { padding: 20px 0 40px; font-size: 13px; }

h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.error { background: #fdecea; border-left: 3px solid var(--danger); color: #8c1d18;
         padding: 10px 14px; border-radius: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
        padding: 20px; margin-bottom: 20px; }
.narrow { max-width: 420px; margin: 40px auto; }

label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 5px; background: #fff;
  font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }
small.muted { font-weight: 400; }

button, .btn {
  display: inline-block; padding: 9px 18px; border: 0; border-radius: 5px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
button:hover, .btn:hover { background: var(--accent-dark); }
button.primary { padding: 12px 28px; font-size: 16px; }
button.danger { background: var(--danger); }
.btn-secondary { background: #fff; color: var(--muted); border: 1px solid var(--line);
                 padding: 9px 18px; border-radius: 5px; text-decoration: none; }
.linkish { background: none; color: #fff; padding: 0; text-decoration: underline; font-weight: 400; }
.linkish:hover { background: none; }
form.inline { display: inline; margin: 0; }

fieldset { border: 0; border-top: 1px solid var(--line); padding: 18px 0 4px; margin: 0 0 8px; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-weight: 600; font-size: 14px; color: var(--ink); padding: 0 8px 0 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.pillar-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 720px) { .pillar-picker { grid-template-columns: 1fr; } }
.pillar-option { display: flex; align-items: flex-start; gap: 10px; margin: 0;
  border: 1px solid var(--line); border-radius: 6px; padding: 12px;
  color: var(--ink); font-weight: 400; cursor: pointer; }
.pillar-option:hover { border-color: var(--accent); }
.pillar-option input { width: auto; margin: 2px 0 0; flex: none; }
.pillar-option:has(input:checked) { border-color: var(--accent); background: #f0f7f4; }

.filters { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: flex-end; }
.filters label { flex: 1 1 160px; }
.filter-actions { display: flex; gap: 8px; margin-bottom: 14px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
@media (max-width: 720px) { .stat-row { grid-template-columns: 1fr; } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.stat .n { display: block; font-size: 30px; font-weight: 600; line-height: 1.1; }
.stat .l { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
     color: var(--muted); border-bottom: 1px solid var(--line); padding: 0 10px 8px 0; }
td { padding: 9px 10px 9px 0; border-bottom: 1px solid #f0f3f6; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.bar-col { width: 30%; }
.bar { display: block; height: 8px; background: var(--accent); border-radius: 4px; min-width: 2px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

dl.kv { display: grid; grid-template-columns: 220px 1fr; gap: 8px 16px; margin: 0; }
@media (max-width: 720px) { dl.kv { grid-template-columns: 1fr; gap: 2px 0; } }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; }

.file-list { list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.file-list li { padding: 3px 0; }
.file-list .too-big { color: var(--danger); }
input[type=file] { padding: 8px; background: #fafbfc; }

ul.attachments { list-style: none; padding: 0; margin: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
ul.attachments li { font-size: 13px; word-break: break-word; }
ul.attachments img { display: block; width: 100%; height: 130px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: #fafbfc; }
