/* vvv — компоненти (таблиці, панелі, кнопки, форми). Рамка сайту — у chrome.css. */
/* ---------- сітка ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid-2, .grid-3 { display: grid; gap: 14px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack > * + * { margin-top: 14px; }
.section { margin-top: 14px; }

/* ---------- показники ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
a.kpi { display: block; color: var(--ink); transition: border-color .15s; }
a.kpi:hover { border-color: var(--line-2); }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .value.accent { color: var(--accent); }
.kpi .value.dim { color: var(--muted); }
.kpi .value.small-v { font-size: 18px; }
.kpi .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.search { display: flex; gap: 6px; flex: 1; min-width: 0; }
.search input { flex: 1; min-width: 0; }

/* ---------- панелі ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--ink); }
.panel-h .count { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.panel-b { padding: 16px; }
.rows > .row-item { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rows > .row-item:last-child { border-bottom: 0; }
.row-item .t { font-weight: 600; font-size: 15px; color: var(--ink); }
.row-item .m { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.row-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- таблиці ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--surface); padding: 10px 14px; border-bottom: 1px solid var(--line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
tr.total td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--line-2); }
tr.sub td { color: var(--ink-2); padding-top: 7px; padding-bottom: 7px; }
tr.sub td:first-child { padding-left: 32px; white-space: nowrap; }
td .m { color: var(--muted); font-size: 12px; }
td.strong, .strong { font-weight: 600; }

/* ---------- статуси ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 13px;
  font-weight: 600; line-height: 1.7; white-space: nowrap; color: var(--ink-2); background: var(--surface-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--good); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.pill.neutral { color: var(--ink-2); }
.pill.plain::before { content: none; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.dot.good { background: var(--good); } .dot.bad { background: var(--bad); } .dot.warn { background: var(--warn); }
.geo { display: inline-block; min-width: 24px; text-align: center; padding: 0 5px; margin-right: 6px; border-radius: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .03em; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line-2); }
.progress { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.progress.warn > i { background: var(--warn); }
.progress.bad > i { background: var(--bad); }

/* ---------- фільтри, кнопки, форми ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
button.chip { cursor: pointer; font: 600 14px/1.2 var(--text); }
button.chip:hover { opacity: 1; color: var(--ink); }
.chip { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 600; transition: border-color .15s, color .15s; }
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.on { color: var(--ink); background: var(--surface-2); border-color: var(--line-2); }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 10px; max-width: 100%; outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-line); }
input::placeholder { color: var(--muted); }
input[type=date] { color-scheme: dark; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: middle; }
textarea { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px/1 var(--text);
  cursor: pointer; border-radius: 8px; padding: 9px 14px; white-space: nowrap; color: var(--bg); background: var(--ink);
  border: 1px solid var(--ink); transition: opacity .15s, background .15s, border-color .15s; }
.btn:hover, button:hover { opacity: .88; color: var(--bg); }
.btn.ghost, button.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover, button.ghost:hover { color: var(--ink); border-color: var(--muted); opacity: 1; }
.btn.danger, button.danger { background: transparent; color: var(--bad); border-color: rgba(239, 125, 125, .35); }
.btn.danger:hover, button.danger:hover { color: var(--bad); border-color: var(--bad); opacity: 1; }
.btn.sm, button.sm { padding: 7px 11px; font-size: 13px; }
.btn.link, button.link { background: none; border: 0; padding: 0; color: var(--accent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.fields label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fields label.check { flex-direction: row; align-items: center; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 7px; margin: 4px 14px 4px 0; color: var(--ink-2); font-size: 13px; cursor: pointer; }
details > summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 13px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+ "; }
details[open] > summary::before { content: "− "; }

/* ---------- службове ---------- */
.empty { color: var(--muted); text-align: center; padding: 32px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; word-break: break-all; color: var(--ink-2); }
.error { color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
a.tile { display: block; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); transition: border-color .15s; }
a.tile:hover { border-color: var(--line-2); color: var(--ink); }
a.tile b { display: block; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
a.tile span { color: var(--muted); font-size: 13px; }
.note { color: var(--muted); font-size: 12.5px; margin: 14px 2px 0; }
/* ---------- головна ---------- */
.widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.widget { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
  color: var(--ink); transition: border-color .15s; }
.widget:hover { border-color: var(--line-2); color: var(--ink); }
.widget-h { margin-bottom: 16px; }
.widget-h b { display: block; font-size: 19px; font-weight: 700; }
.widget-h span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.widget-n { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.widget-n div span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.widget-n div b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.widget-f { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
  display: flex; align-items: center; gap: 8px; }

@media (max-width: 960px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi .value { font-size: 24px; }
  .hide-sm { display: none; }
  td, th { padding-left: 10px; padding-right: 10px; }
  tr.sub td:first-child { padding-left: 24px; }
}
