:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --accent: #2456d3; --accent-text: #ffffff; --changed: #fff3c4; --changed-line: #e9c74a;
  --danger: #b42318; --ok: #157f3b; --chip: #eef1f6;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header.top { background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 16px; display: flex; align-items: center; gap: 18px; height: 52px; position: sticky; top: 0; z-index: 5; }
header.top .brand { font-weight: 700; font-size: 16px; color: var(--text); }
header.top nav { display: flex; gap: 14px; flex: 1; }
header.top .me { display: flex; gap: 12px; align-items: center; color: var(--muted); }
main { padding: 16px; max-width: 1500px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.flash { background: #e8f3ec; border: 1px solid #b7dfc4; color: var(--ok); padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; }
.flash.warn { background: var(--changed); border-color: var(--changed-line); color: #6b4f00; }
.error { color: var(--danger); margin: 8px 0; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff; color: var(--text); max-width: 100%; }
textarea { width: 100%; min-height: 90px; }
button, .btn { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 6px; padding: 6px 12px; cursor: pointer; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.danger { color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.filters .check { flex-direction: row; align-items: center; gap: 4px; padding-bottom: 7px; color: var(--text); font-size: 13px; }
.filters input[name=q] { width: 260px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
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; background: #fafbfc; white-space: nowrap; }
tr.changed td { background: var(--changed); }
tr.changed td:first-child { box-shadow: inset 4px 0 0 var(--changed-line); }
tbody tr:hover td { background: #f3f6fc; }
tr.changed:hover td { background: #ffeca3; }
tr.inactive td { color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.chip { display: inline-block; background: var(--chip); border-radius: 10px; padding: 0 8px; font-size: 12px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.warn { background: var(--changed); border: 1px solid var(--changed-line); }
.chip.miss { background: #fff1e6; color: #9a4a00; border: 1px solid #f3cfa8; }
.chip.bad { background: #fde7e5; color: var(--danger); }
.contacts div { line-height: 1.6; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 12px 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.changes-box { background: var(--changed); border: 1px solid var(--changed-line); border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.changes-box li { margin: 4px 0; }
.form-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.form-row label { font-size: 12px; color: var(--muted); }
.inline { display: inline; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 16px; right: 16px; background: var(--text); color: #fff; padding: 8px 14px; border-radius: 6px; opacity: 0; transition: opacity .2s; }
.toast.show { opacity: .92; }
.login { max-width: 360px; margin: 10vh auto; }
.login input { width: 100%; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } header.top nav { display: none; } .filters input[name=q] { width: 100%; } }
