
:root {
  --bg: #f6f7f9; --card: #fff; --line: #e3e6ea; --text: #1c2024;
  --muted: #6b7280; --accent: #2b6cb0; --pos: #1a7f4b; --neg: #c0392b;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

header { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
header .wrap { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
header nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
header nav a { padding: 6px 12px; border-radius: 6px; color: var(--muted); text-decoration: none; }
header nav a:hover { background: var(--bg); }
header nav a.on { background: var(--accent); color: #fff; }

.view-badge { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.view-badge span { background: #fdf3e0; color: #8a5a00; padding: 4px 10px; border-radius: 6px; font-weight: 600; }

h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 32px 0 12px; }
a { color: var(--accent); }
main { padding-bottom: 64px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; background: #e6f4ea; color: #1a7f4b; }
.flash.err { background: #fdecea; color: var(--neg); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.card b { font-size: 21px; }
.card.bad b { color: var(--neg); }

table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { background: #fafbfc; font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { background: #fafbfc; font-weight: 600; border-bottom: 0; border-top: 2px solid var(--line); }
.num { text-align: right; white-space: nowrap; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: #b7791f; }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.mt { margin-top: 28px; }

.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 18px; }
.row-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.row-form .grow { flex: 1 1 200px; }

input[type=text], input[type=date], input[type=password], select {
  font: inherit; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 7px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
table.edit input[type=text], table.edit select { min-width: 120px; }

button { font: inherit; cursor: pointer; border-radius: 7px; }
button.primary { background: var(--accent); color: #fff; border: 0; padding: 8px 16px; }
button.primary:hover { filter: brightness(1.08); }
button.link { background: none; border: 0; color: var(--accent); padding: 4px; text-decoration: underline; }
button.danger { color: var(--neg); }
button.danger:not(.link) { background: #fff; border: 1px solid var(--neg); padding: 8px 16px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.check { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.check input { width: auto; margin: 0; }

@media (max-width: 640px) {
  th, td { padding: 8px 8px; font-size: 14px; }
  .row-form label, .row-form .grow { flex: 1 1 100%; }
}
