:root {
  --bg: #f4f6fa;
  --card: #fff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2b5fb4;
  --line: #e2e6ee;
  --high: #fde8e8;
  --warn: #fff6dc;
  --ok: #e8f6ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
}
.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; }
.top nav { display: flex; gap: 14px; flex: 1; }
.top nav a { opacity: .9; }
.top nav a:hover { opacity: 1; text-decoration: underline; }
.logout { display: flex; align-items: center; gap: 10px; margin: 0; }
.who { opacity: .9; }

main { max-width: 1100px; margin: 0 auto; padding: 20px; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

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

.flash {
  background: #e6efff;
  border: 1px solid #c4d6f5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.stats { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 160px; margin-bottom: 8px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; white-space: nowrap; }
.strong { font-weight: 700; }
.risk-high { background: var(--high); }
.risk-warn { background: var(--warn); }
.risk-ok { background: var(--ok); }
.done td { color: var(--muted); text-decoration: line-through; }
.overdue { color: #b42318; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: #e6efff;
  color: var(--accent);
  vertical-align: middle;
}

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, button { font: inherit; }
input, select {
  padding: 8px 10px;
  border: 1px solid #cdd3df;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
button {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.link {
  background: none;
  color: inherit;
  padding: 0;
  text-decoration: underline;
}
.top button.link { color: #fff; }
button.danger { color: #b42318; }
button.check {
  background: none;
  color: var(--accent);
  font-size: 20px;
  padding: 0 6px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}
.grid-form .wide { grid-column: 1 / -1; }

form.inline { display: inline; }
ul.plain { list-style: none; padding: 0; margin: 0 0 12px; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }
