:root {
  --bg: #f6f7f9; --card: #ffffff; --line: #e3e6eb; --fg: #16202e; --muted: #667085;
  --acc: #1f5eff; --acc-soft: #eaf0ff; --ok: #12805c; --bad: #c4321c; --tag: #f1f3f6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 8px; } h2 { font-size: 15px; margin: 0 0 10px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fg); font-size: 16px; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--acc); color: #fff; display: grid; place-items: center; font-size: 14px; }
.top nav { display: flex; gap: 18px; align-items: center; }
.top nav a { color: var(--muted); font-weight: 500; }
.top nav a.on { color: var(--fg); }
.inline { display: inline; }
button.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }

main { max-width: 900px; margin: 0 auto; padding: 20px 16px 40px; }
main.wide { max-width: 1400px; }
.foot { max-width: 1400px; margin: 0 auto; padding: 0 16px 24px; color: var(--muted); font-size: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 16px; }
.narrow { max-width: 400px; margin: 60px auto; }
.muted { color: var(--muted); } .small { font-size: 12px; } .err, .bad { color: var(--bad); } .ok { color: var(--ok); }
.nowrap { white-space: nowrap; } .num { text-align: right; font-variant-numeric: tabular-nums; }

label { display: block; margin: 0 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
label.row { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--fg); }
input, select { width: 100%; min-width: 0; margin-top: 3px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--fg); font: inherit; }
input:focus, select:focus { outline: 2px solid var(--acc-soft); border-color: var(--acc); }
input[type=checkbox] { width: auto; margin: 0; }
button, .btn { display: inline-block; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--fg); cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: #c9ced6; }
button.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
button.block { width: 100%; margin-top: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpis b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.kpis span { color: var(--muted); font-size: 12.5px; }

.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.filters { position: sticky; top: 64px; }
.fhead { display: flex; justify-content: space-between; align-items: baseline; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.two label, .layout > * { min-width: 0; }
.hint { margin: -6px 0 10px; color: var(--muted); font-size: 11.5px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip { padding: 3px 9px; border-radius: 999px; background: var(--tag); color: var(--fg); font-size: 12px; }
.chip:hover { background: var(--acc-soft); text-decoration: none; }

.rhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.rhead p { margin: 0; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.off { opacity: .55; }
.table.compact td { padding: 4px 6px; }
.name { font-weight: 600; color: var(--fg); }
.meta { color: var(--muted); font-size: 12.5px; }
.purpose { color: #3d4757; font-size: 12.5px; margin-top: 4px; max-width: 70ch; }
.tag { display: inline-block; background: var(--tag); border-radius: 6px; padding: 1px 7px; font-size: 12px; white-space: nowrap; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

.facts { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 16px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.purpose-full { white-space: pre-line; max-width: 75ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .table th:nth-child(2), .table td:nth-child(2) { display: none; }
}
@media (max-width: 520px) {
  .top { padding: 10px 16px; }
  .facts { grid-template-columns: 1fr; }
  .rhead { flex-wrap: wrap; }
}
.invite-url { width: 100%; }
.invite-url input { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
tr.fresh td { background: var(--acc-soft); }
button.link.bad { color: var(--bad); }
