/* Тот же вид, что у WB Monitor, чтобы кабинеты читались одинаково. */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: #1a1a1a; background: #fafafa;
}
a { color: #6b3fa0; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid #e5e5e5; position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; font-size: 16px; color: #6b3fa0; white-space: nowrap; }
.nav { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: 4px 8px; border-radius: 4px; color: #444; }
.nav a:hover { background: #f0f0f0; }
.nav a.active { background: #6b3fa0; color: #fff; }
.content { padding: 20px; max-width: 1600px; margin: 0 auto; }
h1 { margin: 0 0 12px; font-size: 22px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
.hint, .muted { color: #777; font-size: 13px; }
.ok { color: #2e7d32; }
.bad { color: #c62828; }
.notice { background: #fff8e1; border: 1px solid #ffe082; padding: 8px 12px; border-radius: 4px; margin: 8px 0; }
.error { background: #ffebee; border: 1px solid #ef9a9a; padding: 8px 12px; border-radius: 4px; margin: 8px 0; }
.success { background: #f1f8e9; border: 1px solid #c5e1a5; padding: 8px 12px; border-radius: 4px; margin: 8px 0; }

form.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; margin-bottom: 12px; }
form.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #666; }
input, select { font: inherit; padding: 5px 8px; border: 1px solid #d0d0d0; border-radius: 4px; background: #fff; }
button {
  font: inherit; font-size: 13px; border: 1px solid #d0d0d0; background: #fff; color: #1a1a1a;
  padding: 6px 14px; border-radius: 4px; cursor: pointer;
}
button:hover { background: #f5f5f5; }
button.primary { background: #6b3fa0; color: #fff; border-color: #6b3fa0; }
button.primary:hover { background: #582d85; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #eee; }
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { padding: 6px 10px; text-align: left; border-bottom: 1px solid #eee; vertical-align: top; }
td.num, td.date, table.matrix td, table.matrix th { white-space: nowrap; }
td select { max-width: 220px; }
th { background: #f5f5f5; font-weight: 600; position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.neg { color: #c62828; }
td.wrap { min-width: 280px; color: #555; font-size: 13px; }
td a, td.num a { color: inherit; text-decoration: none; }
td a:hover { color: #6b3fa0; text-decoration: underline; }

/* ДДС по месяцам: первая колонка закреплена, разделы выделены. */
table.matrix th:first-child, table.matrix td:first-child {
  position: sticky; left: 0; background: inherit; z-index: 1; min-width: 240px;
}
table.matrix tr { background: #fff; }
table.matrix tr.section td { background: #f3eef9; font-weight: 600; }
table.matrix tr.total td { background: #f5f5f5; font-weight: 600; border-top: 2px solid #ddd; }
table.matrix td:first-child { padding-left: 22px; }
table.matrix tr.section td:first-child, table.matrix tr.total td:first-child { padding-left: 10px; }
table.matrix td.sum { background: #fafafa; font-weight: 600; }
.pager { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.summary { display: flex; gap: 24px; margin: 8px 0 12px; }
.summary b { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 3px; background: #eee; font-size: 12px; color: #555; }

.logout { margin: 0; }
form.login {
  max-width: 320px; margin: 60px auto; padding: 24px; background: #fff;
  border: 1px solid #eee; border-radius: 6px; display: flex; flex-direction: column; gap: 12px;
}
form.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #666; }
