:root {
  --ink: #1b2430; --muted: #66707d; --line: #dde2e8; --bg: #f5f6f8; --panel: #fff;
  --brand: #1f4e79; --brand-ink: #fff; --accent: #e8f0f8; --ok: #1d7a46; --warn: #a15c00; --bad: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
.side { width: 220px; background: #14283b; color: #cfd9e3; padding: 20px 14px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { color: #fff; font-size: 20px; font-weight: 700; display: block; margin-bottom: 24px; } .brand small { display: block; font-size: 11px; font-weight: 400; color: #8fa3b7; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side nav a { color: #cfd9e3; padding: 7px 10px; border-radius: 6px; } .side nav a:hover { background: #22405c; text-decoration: none; }
.logout { font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
button.link { background: none; border: 0; color: #9fc3e6; cursor: pointer; font: inherit; }
main { flex: 1; padding: 28px 36px; min-width: 0; max-width: 1500px; }
h1 { font-size: 24px; margin: 0; } h2 { font-size: 17px; margin: 28px 0 10px; }
.muted { color: var(--muted); margin: 2px 0 0; } .count { color: var(--muted); font-weight: 400; font-size: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; } .actions form { margin: 0; } .actions.wrap { flex-wrap: wrap; margin-top: 14px; }
.btn { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.btn:hover { background: var(--accent); text-decoration: none; } .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); } .btn.primary:hover { background: #17405f; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 12px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; } table.data tbody tr:hover { background: #fafcff; }
table.data tfoot td { font-weight: 700; background: #fafbfc; border-top: 2px solid var(--line); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 24px !important; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: end; } .filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 3px; } .filters label.inline { flex-direction: row; align-items: center; }
input, select { padding: 7px 9px; border: 1px solid #c8cfd8; border-radius: 6px; font: inherit; background: #fff; }
input[type=search] { min-width: 280px; }
.form .field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; } .form .field label { font-weight: 600; } .field small { color: var(--muted); } .errorlist { color: var(--bad); list-style: none; padding: 0; margin: 0; }
.card-form { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; max-width: 560px; } .card-form input, .card-form select { width: 100%; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; } .stat span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; } .stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat a { color: inherit; } .stat a:hover { text-decoration: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; color: var(--ink); } .card:hover { border-color: var(--brand); text-decoration: none; } .card h3 { margin: 0 0 6px; color: var(--brand); } .card p { margin: 0; color: var(--muted); }
.pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 10px; background: #e6eaee; text-transform: uppercase; letter-spacing: .03em; vertical-align: middle; }
.pill.active, .pill.posted { background: #dff3e8; color: var(--ok); } .pill.disposed { background: #eceff3; color: var(--muted); } .pill.draft, .pill.written_off { background: #fdebd0; color: var(--warn); }
.msg { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; background: var(--accent); border: 1px solid #c5d8ec; } .msg.success { background: #e3f4ea; border-color: #b8dfc8; } .msg.error { background: #fbe4e2; border-color: #f0b8b3; color: var(--bad); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }
.split { display: flex; gap: 30px; align-items: flex-start; flex-wrap: wrap; } .split > div:first-child { flex: 1; min-width: 320px; }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0; } .facts dt { color: var(--muted); } .facts dd { margin: 0; }
.qr { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; } .qr svg { width: 150px; height: 150px; display: block; } .qr small { display: block; font-weight: 700; }
.timeline { list-style: none; padding: 0 0 0 16px; border-left: 2px solid var(--line); margin: 0; } .timeline li { position: relative; padding: 4px 0 12px 14px; display: flex; gap: 14px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); } .timeline time { color: var(--muted); width: 90px; flex-shrink: 0; } .timeline span { color: var(--muted); }
.steps { display: flex; gap: 16px; list-style: none; padding: 0; color: var(--muted); } .steps li.on { color: var(--brand); font-weight: 700; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.label { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px dashed #9aa5b1; border-radius: 6px; padding: 8px; break-inside: avoid; } .label svg { width: 84px; height: 84px; flex-shrink: 0; } .label div { display: flex; flex-direction: column; font-size: 12px; } .label b { font-size: 14px; }
ul.plain { margin: 0; padding-left: 16px; }
.login { max-width: 340px; margin: 12vh auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 28px; } .login input { width: 100%; } .login .btn { width: 100%; }
body.print { display: block; background: #fff; } body.print main { padding: 24px; max-width: none; }
@media print {
  .side, .no-print { display: none !important; } body { background: #fff; display: block; } main { padding: 0; }
  .table-wrap { border: 0; } table.data { font-size: 10px; } table.data th, table.data td { padding: 3px 5px; }
  .labels { grid-template-columns: repeat(3, 1fr); gap: 6px; } @page { size: A4 landscape; margin: 12mm; }
}
