/* naudo — собственная тема: тёмный сайдбар, светлая рабочая область, дашборд.
   Компонентные классы (btn/chip/card/table/modal/ac/...) сохранены для всех модулей. */
:root {
  --side-bg: #15171c;
  --side-bg2: #1d2027;
  --side-text: #aeb4bd;
  --bg: #f5f5f3;
  --card: #ffffff;
  --text: #16181d;
  --muted: #8a8f98;
  --border: #e8e8e5;
  --green: #169b62;
  --green-dark: #117a4d;
  --green-soft: #ddf3e7;
  --green-soft-text: #137a4c;
  --yellow-soft: #fdf0d3;
  --yellow-soft-text: #9a6c00;
  --blue-soft: #ddeafd;
  --blue-soft-text: #1f5fae;
  --red-soft: #fde1e1;
  --red-soft-text: #c0392b;
  --purple-soft: #ece4fb;
  --purple-soft-text: #6d44c4;
  --gray-soft: #ededeb;
  --gray-soft-text: #666;
  --orange: #f5a000;
  --black: #101114;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(20, 22, 26, .05);
  --side-w: 236px;
  --side-w-min: 64px;
  --font: "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 12px; font-weight: 650; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
kbd {
  background: #f0f0ee; border: 1px solid #ddd; border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; font-family: inherit; font-size: 12px; color: #555;
}
code { background: #f0f0ee; border-radius: 5px; padding: 1px 6px; font-size: 12.5px; }

/* ================= ОБОЛОЧКА ================= */
.shell { display: flex; min-height: 100vh; }

/* ---------- сайдбар ---------- */
.sidebar {
  width: var(--side-w); flex: none;
  background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: width .18s ease;
}
.side-logo {
  color: #fff; font-weight: 800; font-size: 19px; letter-spacing: 3px;
  padding: 22px 22px 18px; white-space: nowrap; overflow: hidden;
}
.side-nav { flex: 1; padding: 4px 12px; overflow-y: auto; scrollbar-width: thin; }
.snav {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px; border-radius: 10px;
  font-weight: 550; color: var(--side-text); white-space: nowrap;
  transition: background .12s, color .12s;
}
.snav:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.snav.active { color: #fff; background: var(--side-bg2); }
.snav-ic { width: 19px; height: 19px; flex: none; display: inline-flex; }
.snav-ic svg { width: 19px; height: 19px; }
.snav-lbl { overflow: hidden; text-overflow: ellipsis; }
.subnav { margin: 2px 0 8px; padding-left: 30px; display: flex; flex-direction: column; }
.subnav a {
  padding: 6px 12px; border-radius: 8px; font-size: 13.5px; color: #8b919b;
  position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.subnav a:hover { color: #fff; }
.subnav a.active { color: #fff; font-weight: 600; }
.subnav a.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
}
.subnav a.active { padding-left: 14px; }

.side-bottom { padding: 10px 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-company {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--side-bg2); border: 0; border-radius: 12px;
  padding: 9px 11px; color: #fff; font: inherit; cursor: pointer; text-align: left;
}
.side-company:hover { background: #23262e; }
.side-company-meta { flex: 1; min-width: 0; }
.side-company-name {
  display: block; font-weight: 650; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-company-sub {
  display: block; font-size: 11px; color: #8b919b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-collapse {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; border-radius: 10px; margin-top: 8px;
  padding: 9px 12px; color: var(--side-text); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap;
}
.side-collapse:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side-collapse svg { transition: transform .18s; flex: none; }

/* свёрнутый сайдбар */
.side-min .sidebar { width: var(--side-w-min); }
.side-min .side-logo { padding: 22px 0 18px; text-align: center; font-size: 15px; letter-spacing: 0; }
.side-min .snav { justify-content: center; padding: 10px 0; }
.side-min .snav-lbl, .side-min .subnav, .side-min .side-company-meta, .side-min .side-company > svg { display: none; }
.side-min .side-company { justify-content: center; padding: 8px 0; background: none; }
.side-min .side-collapse { justify-content: center; padding: 9px 0; }
.side-min .side-collapse svg { transform: rotate(180deg); }

/* ---------- рабочая область ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mainbar {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 28px 10px;
}
.mainbar-title { margin: 0; flex: none; font-size: 23px; }
.gsearch { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.gsearch input {
  width: 100%; padding: 10px 44px 10px 38px;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--card); font: inherit; color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.gsearch input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 155, 98, .12); }
.gsearch::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2.4"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>') no-repeat center / contain;
}
.gsearch kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.mainbar-right { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.mbtn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font: inherit; font-weight: 570; color: #444; cursor: pointer;
  transition: border-color .15s;
}
.mbtn:hover { border-color: #bbb; }
.mbtn-icon { padding: 9px 11px; position: relative; }
.bell-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e0533d; color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--bg);
}
.company-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 999px;
  padding: 5px 14px 5px 6px; font: inherit; font-weight: 620; color: var(--text); cursor: pointer;
}
.company-chip:hover { border-color: #bbb; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--green); color: #fff; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
.avatar-dark { background: #2e323b; color: #fff; }

/* ---------- дропдауны ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px;
  background: #fff; color: var(--text); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .16); border: 1px solid var(--border);
  padding: 6px; display: none; z-index: 100;
}
.dropdown.open .dropdown-menu { display: block; }
.drop-up .dropdown-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; min-width: 220px; }
.menu-wide { min-width: 320px; }
.dropdown-item {
  display: block; padding: 9px 12px; border-radius: 8px; font-weight: 500; cursor: pointer;
  background: none; border: 0; width: 100%; text-align: left; font-family: inherit; font-size: 14px;
  color: var(--text);
}
.dropdown-item:hover { background: #f4f4f2; }
.dropdown-item.current { font-weight: 700; }
.dropdown-item.current::after { content: " ✓"; color: var(--green); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-note { padding: 12px; color: var(--muted); font-size: 13px; }
.drop-doc { display: block; }
.drop-doc-main { display: block; }
.drop-doc-sub { display: block; font-size: 12px; color: var(--muted); }

/* ---------- баннеры ---------- */
.banner { padding: 10px 28px; font-weight: 550; }
.banner-success { background: var(--green-soft); color: var(--green-soft-text); }
.banner-error { background: var(--red-soft); color: var(--red-soft-text); }
.banner-warning { background: var(--orange); color: #3d2900; }
.banner a { text-decoration: underline; }

/* ---------- страница ---------- */
.page { padding: 8px 28px 48px; width: 100%; max-width: 1680px; flex: 1; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 19px; }
.page-head .spacer { flex: 1; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid #ececea; padding: 20px;
}
.card + .card { margin-top: 16px; }

/* ================= КОМПОНЕНТЫ ================= */

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border-radius: 999px; padding: 9px 20px;
  font: inherit; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: all .15s; white-space: nowrap;
  background: #fff; color: var(--text); text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--black); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2a2c33; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: var(--green-dark); }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: #2a2c33; }
.btn-outline { border-color: #d6d6d2; }
.btn-outline:hover { border-color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red-soft-text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { padding: 8px 10px; border-radius: 10px; }

.btn-split { display: inline-flex; }
.btn-split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,.35); padding: 9px 12px; }

/* ---------- чипы / пилюли ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 620;
}
.chip-green { background: var(--green-soft); color: var(--green-soft-text); }
.chip-yellow { background: var(--yellow-soft); color: var(--yellow-soft-text); }
.chip-blue { background: var(--blue-soft); color: var(--blue-soft-text); }
.chip-red { background: var(--red-soft); color: var(--red-soft-text); }
.chip-gray { background: var(--gray-soft); color: var(--gray-soft-text); }
.chip-purple { background: var(--purple-soft); color: var(--purple-soft-text); }

/* чипы-фильтры типов (дашборд) */
.fchips { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip {
  border: 1.5px solid #dcdcd8; border-radius: 999px; padding: 7px 16px;
  font-weight: 560; font-size: 13.5px; background: #fff; color: #444;
  cursor: pointer; text-decoration: none; display: inline-block; transition: all .13s;
}
.fchip:hover { border-color: #999; }
.fchip.active { background: var(--black); border-color: var(--black); color: #fff; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid #d6d6d2; border-radius: 999px; padding: 7px 16px;
  font-weight: 550; cursor: pointer; background: #fff; font-size: 13.5px;
  transition: all .15s; text-decoration: none; display: inline-block;
}
.pill:hover { border-color: var(--text); }
.pill.active { background: var(--green-soft); border-color: var(--green-soft); color: var(--green-soft-text); }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 2px; margin: -4px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; font-weight: 570; color: #444; border-radius: 999px; font-size: 14px; }
.tabs a:hover { background: #e9e9e6; }
.tabs a.active { background: var(--black); color: #fff; }

/* ---------- KPI-карточки ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid #ececea; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 23px; font-weight: 760; letter-spacing: -.3px; white-space: nowrap; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta .pct-up { color: var(--green-soft-text); }
.kpi-delta .pct-down { color: var(--red-soft-text); }
.kpi-delta .pct-warn { color: var(--yellow-soft-text); }
.kpi-delta span.cap { color: var(--muted); font-weight: 500; }
.kpi-spark { flex: none; }
.kpi-spark svg { display: block; }

/* ---------- срок оплаты в таблице ---------- */
.due-over { color: var(--red-soft-text); font-weight: 600; font-size: 12px; }
.due-soon { color: var(--yellow-soft-text); font-weight: 600; font-size: 12px; }

/* ---------- дашборд: сетка с правой колонкой ---------- */
.dash { display: grid; grid-template-columns: 1fr 308px; gap: 16px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rail .card { padding: 16px 18px; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rail-head h3 { margin: 0; font-size: 14.5px; }
.rail-head select { width: auto; padding: 5px 28px 5px 10px; font-size: 12.5px; border-radius: 8px; }
.legend { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.legend-row .legend-val { margin-left: auto; font-weight: 650; white-space: nowrap; }
.rail-list { display: flex; flex-direction: column; }
.rail-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0ed; }
.rail-item:last-child { border-bottom: 0; }
.rail-item-main { min-width: 0; }
.rail-item-title { font-weight: 620; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item-sub { font-size: 11.5px; color: var(--muted); }
.rail-item-amt { text-align: right; font-weight: 650; font-size: 13px; white-space: nowrap; }
.rail-item-amt .sub { font-weight: 500; }
.rail-foot { margin-top: 10px; }
.rail-foot .btn { width: 100%; }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafaf8; }
.table .num { text-align: right; white-space: nowrap; }
.table .doc-type { font-size: 12px; color: var(--muted); }
.table .doc-number { font-weight: 650; }
.table .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.table a.rowlink { font-weight: 650; }
.table a.rowlink:hover { text-decoration: underline; }

/* ---------- формы ---------- */
label.field { display: block; margin-bottom: 13px; }
label.field > span, .field-label {
  display: block; font-size: 12.5px; font-weight: 600; color: #555; margin-bottom: 5px;
}
.req::after { content: " *"; color: #d33; }
input[type=text], input[type=email], input[type=date], input[type=number],
input[type=password], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--text); outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); }
input.invalid, select.invalid { border-color: #d33; }
textarea { resize: vertical; min-height: 70px; }
.input-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input-hint.ok { color: var(--green-soft-text); }
.input-hint.err { color: var(--red-soft-text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.char-counter { float: right; font-size: 12px; color: var(--muted); font-weight: 400; }

.seg { display: inline-flex; background: #efefec; border-radius: 999px; padding: 4px; }
.seg button {
  border: 0; background: none; padding: 8px 18px; border-radius: 999px;
  font: inherit; font-weight: 600; cursor: pointer; color: #555;
}
.seg button.active { background: var(--green); color: #fff; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cfcfcb; border-radius: 999px; transition: .15s; cursor: pointer; }
.switch .slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .15s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- модалка ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 15, 15, .45); z-index: 200;
  display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 640px;
  padding: 26px 28px; position: relative; box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal-close {
  position: absolute; top: 18px; right: 18px; border: 0; background: none;
  font-size: 26px; line-height: 1; cursor: pointer; color: #333; padding: 4px;
}
.modal h2 { margin-bottom: 18px; }
.modal-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.modal-tabs button {
  border: 0; background: none; padding: 9px 2px; font: inherit; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.modal-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.help-grid { display: grid; grid-template-columns: 60px 1fr; gap: 6px 10px; align-items: center; }

/* ---------- автокомплит ---------- */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 150;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14); max-height: 280px; overflow-y: auto; display: none;
}
.ac-list.open { display: block; }
.ac-item { padding: 10px 14px; cursor: pointer; }
.ac-item:hover, .ac-item.hover { background: #f4f4f2; }
.ac-item .ac-sub { font-size: 12px; color: var(--muted); }

/* ---------- редактор документа ---------- */
.doc-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.doc-paper { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #ececea; padding: 28px; }
.doc-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.doc-side .card { padding: 16px; }
.doc-head { display: flex; gap: 20px; justify-content: space-between; margin-bottom: 22px; }
.doc-logo {
  width: 150px; height: 86px; border: 1.5px dashed #d6d6d2; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  font-size: 12.5px; overflow: hidden; flex: none;
}
.doc-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.doc-meta { min-width: 290px; }
.doc-meta .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.doc-meta .row > span:first-child { font-size: 13px; color: #555; font-weight: 600; }
.doc-meta input { width: 160px; padding: 7px 10px; }
.party-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 22px; }
.party h3 { border-bottom: 1px solid var(--text); padding-bottom: 7px; margin-bottom: 12px; font-size: 14.5px; }
.party .party-box { border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; }
.party .party-box .name { font-weight: 700; }
.party .party-box .sub { font-size: 12.5px; color: var(--muted); }

.lines { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.lines thead th {
  background: var(--black); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 9px 10px; text-align: left;
}
.lines thead th:first-child { border-radius: 8px 0 0 8px; }
.lines thead th:last-child { border-radius: 0 8px 8px 0; text-align: right; }
.lines td { padding: 7px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines td input, .lines td select { padding: 8px 9px; }
.lines td.line-total { text-align: right; font-weight: 650; white-space: nowrap; padding-top: 15px; }
.lines .line-pos { color: var(--muted); padding-top: 15px; width: 24px; }
.lines .line-del { width: 34px; padding-top: 11px; }
.line-del button { border: 0; background: none; cursor: pointer; color: #c33; font-size: 17px; padding: 4px; }
.add-row {
  display: inline-flex; align-items: center; gap: 8px; border: 0; background: none;
  color: var(--green-soft-text); font: inherit; font-weight: 650; cursor: pointer; padding: 8px 4px;
}
.doc-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin: 14px 0 18px; }
.doc-totals .trow { display: flex; gap: 26px; font-size: 14px; }
.doc-totals .trow span:last-child { min-width: 110px; text-align: right; }
.doc-totals .grand { font-size: 17px; font-weight: 750; }
.amount-words { font-size: 12.5px; color: var(--muted); text-align: right; }
.vat-note { font-size: 12.5px; color: var(--muted); text-align: right; }
.doc-footnote { text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; }

.timeline { margin-top: 16px; }
.timeline .ev { display: flex; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #f0f0ed; }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev-icon { width: 30px; height: 30px; border-radius: 8px; background: #f1f1ee;
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }
.timeline .ev-title { font-weight: 600; }
.timeline .ev-sub { font-size: 12px; color: var(--muted); }

/* ---------- разное ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search { position: relative; }
.search input { padding-left: 36px; min-width: 230px; }
.search::before {
  content: ""; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2.4"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>') no-repeat center / contain;
}
.daterange { display: flex; align-items: center; gap: 8px; }
.daterange input { width: 140px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { font-size: 38px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.w100 { width: 100%; }

/* пагинация */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.pager .pager-size { display: flex; align-items: center; gap: 8px; margin-right: auto; color: var(--muted); font-size: 13px; }
.pager .pager-size select { width: auto; padding: 6px 28px 6px 10px; }
.pager a, .pager span.cur, .pager span.dots {
  min-width: 34px; height: 34px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 600;
}
.pager span.cur { background: var(--green-soft); color: var(--green-soft-text); }
.pager span.dots { color: var(--muted); }
.pager a:hover { background: #e9e9e6; }
.pager a.disabled { opacity: .35; pointer-events: none; }

@media (max-width: 1280px) {
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-side { position: static; }
  .party-grid, .form-grid, .grid2 { grid-template-columns: 1fr; }
  .gsearch { display: none; }
}
@media print {
  .sidebar, .mainbar, .banner, .doc-side { display: none !important; }
  body { background: #fff; }
}
