:root {
  --bg: #f5f6f8;
  --card: #fff;
  --text: #1c1f24;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #1f5f4a;
  --accent-text: #fff;
  --red: #b42318;
  --green: #1f7a3d;
  --r: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 24px 0 12px; }
.card h2 { margin-top: 0; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.red { color: var(--red); }
.green { color: var(--green); }
.nowrap { white-space: nowrap; }

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top__in { max-width: 1120px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
nav { display: flex; gap: 18px; align-items: center; }
nav a { color: var(--muted); text-decoration: none; }
nav a.on { color: var(--text); font-weight: 600; }
nav form { margin: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 16px 16px 48px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 6px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link.red { color: var(--red); }
form.inline { display: inline; margin-left: 10px; }
.danger { margin-top: 24px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, textarea, select { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.hint { font-size: 12px; }
.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 16px; align-items: start; }
.grid .wide { grid-column: span 2; }
.grid .actions, .grid .check { grid-column: 1 / -1; }
.card > form + form, .card > input + form { margin-top: 12px; }
.paid { border-top: 1px solid var(--line); padding-top: 12px; }
.paid .check { margin: 6px 0; }
.actions { margin-top: 8px; }

.table { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.card .table { margin-top: 12px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--muted); }
.tag { margin-left: 8px; font-size: 12px; color: var(--muted); }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; background: #e8f3ec; color: var(--green); }
.flash--error { background: #fdecea; color: var(--red); }
.log { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.log li { padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li:last-child { border-bottom: 0; }
.log--error { color: var(--red); }
.log--warn { color: #9a5b00; }

.login { max-width: 360px; margin: 10vh auto; }
.login form { display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .wide { grid-column: 1 / -1; }
}
