:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #2f5bea; --warn-bg: #fff6e0; --warn: #8a5a00; --err: #b3261e;
  --watch: #2f5bea; --new: #0f8a4a; --noise: #8b8f99; --other: #c4c8d0;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
code, .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 8px 12px; border-radius: 6px; }
.warn-text { color: var(--warn); } .err { color: var(--err); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
       background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; }
.top nav a { margin-right: 16px; font-weight: 500; }
.top .brand { font-weight: 700; color: var(--ink); }
.who { display: flex; gap: 10px; align-items: center; color: var(--muted); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
form.inline { display: inline; }

button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; }

.head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; min-width: 150px; }
.kpi b { display: block; font-size: 22px; } .kpi span { color: var(--muted); font-size: 12px; }
.kpi.bad { border-color: var(--err); } .kpi.bad b { color: var(--err); }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.grid th, .grid td { padding: 7px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); }
.grid tr.click { cursor: pointer; } .grid tr.click:hover { background: #f2f5ff; }
.grid tr.hl td { background: #effaf3; }
.num { text-align: right !important; white-space: nowrap; }
td.text { max-width: 380px; }
table.kv th { text-align: left; color: var(--muted); font-weight: 500; padding: 3px 14px 3px 0; vertical-align: top; white-space: nowrap; }
table.kv td { padding: 3px 0; }

.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-left: 4px; color: #fff; vertical-align: 1px; }
.tag.watch { background: var(--watch); } .tag.new { background: var(--new); } .tag.noise { background: var(--noise); }
.tag.other { background: var(--other); color: #333; }

.st { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef0f4; white-space: nowrap; }
.st-new { background: #e8eefc; color: #2443a8; } .st-not_ours { background: #eef0f4; color: #555; }
.st-copy { background: #fde8e7; color: #a3231b; } .st-filed { background: #fff1d6; color: #8a5a00; }
.st-waiting { background: #f3e9ff; color: #6436a8; } .st-removed { background: #e3f6ea; color: #13703c; }
.st-refused { background: #2b2f38; color: #fff; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--card); border: 1px solid var(--line);
           border-radius: 8px; padding: 10px; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.filters label.chk { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.filters select { max-width: 260px; }
.reset { font-size: 12px; align-self: center; }
.exports { font-size: 13px; }
.pager { display: flex; gap: 16px; justify-content: center; margin: 14px 0; }

.thumb { object-fit: cover; border-radius: 4px; background: #e9ecf1; display: block; }
.thumb.sm { width: 48px; height: 64px; } .thumb.md { width: 72px; height: 96px; } .thumb.lg { width: 240px; height: 320px; }
.thumb.none { display: flex; align-items: center; justify-content: center; text-align: center; font-size: 10px; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mini { display: flex; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px; color: var(--ink); }
.mini:hover { text-decoration: none; border-color: var(--accent); }
.mini .adv { font-weight: 600; font-size: 13px; }

.card-head { display: flex; gap: 20px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.card-head video { width: 280px; max-height: 500px; background: #000; border-radius: 6px; }
.card-head .info { flex: 1; min-width: 280px; }
.adv-line { margin: 2px 0 6px; font-weight: 600; }

.status-form { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.status-form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.status-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.status-form label.st-choice { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; padding: 5px 10px; border-radius: 16px; cursor: pointer; border: 1px solid transparent; }
.st-choice:has(input:checked) { border-color: currentColor; font-weight: 600; }
ul.files { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 28px; }

.login { max-width: 360px; margin: 80px auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

@media (max-width: 720px) {
  .grid.list th:nth-child(n+6), .grid.list td:nth-child(n+6) { display: none; }
  .thumb.lg { width: 100%; height: auto; aspect-ratio: 3/4; }
  .card-head video { width: 100%; }
}
.ev { padding: 8px 12px; border-radius: 6px; }
.ev-ok { background: #e3f6ea; color: #13703c; } .ev-wait { background: #e8eefc; color: #2443a8; }
.ev-err { background: #fde8e7; color: #a3231b; }
.noise-form button { font-size: 11px; color: var(--noise); }
.filters-line { margin: 8px 0 12px; }
