/* RU: Дизайн-набор «Панель управления» для сгенерированных бизнес-приложений: светлая тема, синий акцент
       #2563eb, боковая навигация, таблицы, формы с подсветкой ошибок, канбан статусов. На ширине телефона
       (до 760 px) меню уходит за кнопку «☰», таблицы превращаются в карточки строк, канбан листается вбок.
       Шрифты системные: приложение работает без внешних сервисов, в том числе без Google Fonts.
   EN: The "Dashboard" design kit for generated business apps: light theme, blue accent #2563eb, side navigation,
       tables, forms with error highlighting, status kanban. At phone width (≤ 760 px) the menu hides behind "☰",
       tables turn into row cards and the kanban scrolls sideways. System fonts: the app needs no external
       services, Google Fonts included. */

:root {
  --bg: #f5f7fb; --surface: #fff; --surface2: #f8fafc; --line: #e3e8ef; --line2: #eef2f7;
  --fg: #0f172a; --fg2: #334155; --mut: #64748b; --faint: #94a3b8;
  --acc: #2563eb; --acc-h: #1d4ed8; --acc-bg: #eff6ff; --acc-line: #bfdbfe;
  --bad: #dc2626; --bad-bg: #fef2f2; --ok: #047857; --ok-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb;
  --r: 10px; --r-lg: 14px;
  --sh: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --sh-lg: 0 10px 30px rgba(15, 23, 42, .12);
  --side: 248px;
  color-scheme: light;
}

/* RU: Цвета статусов из модели (gray … slate): --c — текст и полоса, --b — фон плашки.
   EN: Model status colours (gray … slate): --c is text and bar colour, --b the badge background. */
.st-gray { --c: #475569; --b: #f1f5f9; } .st-blue { --c: #1d4ed8; --b: #dbeafe; }
.st-indigo { --c: #4338ca; --b: #e0e7ff; } .st-violet { --c: #6d28d9; --b: #ede9fe; }
.st-amber { --c: #b45309; --b: #fef3c7; } .st-orange { --c: #c2410c; --b: #ffedd5; }
.st-green { --c: #047857; --b: #d1fae5; } .st-teal { --c: #0f766e; --b: #ccfbf1; }
.st-red { --c: #b91c1c; --b: #fee2e2; } .st-slate { --c: #334155; --b: #e2e8f0; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 650; }
.mut { color: var(--mut); } .sm { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--acc-line); outline-offset: 2px; }

/* ------------------------------------------------------------------ каркас / shell */
.nav-open { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; overflow-y: auto;
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 12px; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; min-width: 0; }
.brand-link:hover { text-decoration: none; }
.brand-name { font-size: 15px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.logo {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; font-weight: 800; font-size: 16px;
}
.brand.big { justify-content: flex-start; padding: 0 0 18px; }
.brand.big .logo { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; }
.brand.big .brand-name { font-size: 17px; }
.burger { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 4px; }
.nav-i {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--fg2);
  font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-i:hover { background: var(--surface2); text-decoration: none; color: var(--fg); }
.nav-i.on { background: var(--acc-bg); color: var(--acc-h); font-weight: 600; }
.nav-i .ic { width: 22px; text-align: center; font-size: 15px; flex: 0 0 auto; }
.me {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px;
  border-top: 1px solid var(--line);
}
.avatar {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--acc-bg); color: var(--acc-h);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.me-t { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.me-t b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-t span { font-size: 12px; color: var(--mut); }
.me form { margin: 0; }

.main { padding: 24px 28px 48px; min-width: 0; max-width: 1480px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.top-t { min-width: 0; }
.top h1 { font-size: 23px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.top .sub { margin: 4px 0 0; color: var(--mut); }
.top-a { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.top-a form { margin: 0; }
.crumbs { font-size: 13px; color: var(--mut); margin-bottom: 4px; }
.crumbs a { color: var(--mut); }
.flash {
  background: var(--ok-bg); color: var(--ok); border: 1px solid #a7f3d0; border-radius: var(--r);
  padding: 10px 14px; margin-bottom: 16px; font-weight: 500;
}
.note { color: var(--mut); font-size: 13px; background: var(--surface2); border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; margin: 14px 0 0; }

/* ------------------------------------------------------------------ элементы / controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface2); border-color: #cbd5e1; text-decoration: none; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
.btn.pri:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn.danger { color: var(--bad); border-color: #fecaca; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn.ghost:hover { background: var(--surface2); color: var(--fg); }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.in {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--fg); font: inherit; transition: border-color .12s, box-shadow .12s;
}
.in::placeholder { color: var(--faint); }
.in:hover { border-color: #cbd5e1; }
.in:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px #dbeafe; }
select.in { padding-right: 30px; appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center; }
textarea.in { min-height: 96px; resize: vertical; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px;
  background: var(--b, #f1f5f9); color: var(--c, #475569); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip {
  border: 1px solid var(--acc-line); background: var(--acc-bg); color: var(--acc-h); border-radius: 999px;
  padding: 3px 10px; font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.chip:hover { background: #dbeafe; }
.alert { border-radius: var(--r); padding: 11px 14px; margin-bottom: 16px; }
.alert.bad { background: var(--bad-bg); color: #991b1b; border: 1px solid #fecaca; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert a { color: inherit; text-decoration: underline; }

/* ------------------------------------------------------------------ карточки / cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh); min-width: 0; }
.card + .card, .cardgrid + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { margin: 0; }
.narrow { max-width: 560px; }
.empty { text-align: center; padding: 36px 16px; color: var(--mut); display: flex; flex-direction: column; gap: 4px; align-items: center; }
.empty b { color: var(--fg); font-size: 15px; }

/* ------------------------------------------------------------------ обзор / dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; color: var(--fg); box-shadow: var(--sh);
}
.kpi:hover { border-color: var(--acc-line); text-decoration: none; }
.kpi-ic { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; background: var(--acc-bg); display: grid; place-items: center; font-size: 19px; }
.kpi b { font-size: 22px; line-height: 1.1; }
.kpi span:last-child { color: var(--mut); font-size: 13px; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.dash .card + .card { margin-top: 0; }
.bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--line2); gap: 2px; }
.seg { background: var(--c); min-width: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.leg { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); }
.leg:hover { text-decoration: none; }
.leg b { font-size: 13px; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); }
.recent li:first-child { border-top: 0; }
.recent a { display: flex; flex-direction: column; min-width: 0; color: var(--fg); }
.recent a span { color: var(--mut); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ список / list */
.list-card { padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.toolbar .flt { flex: 0 1 200px; min-width: 150px; display: flex; align-items: center; gap: 6px; color: var(--mut); font-size: 13px; }
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 2px 10px; color: var(--mut); font-size: 13px; flex-wrap: wrap; }
.list-meta b { color: var(--fg); }
.seg-sw { display: inline-flex; background: #eef2f7; border-radius: 9px; padding: 3px; gap: 2px; }
.seg-sw a { padding: 5px 12px; border-radius: 7px; color: var(--fg2); font-weight: 500; }
.seg-sw a:hover { text-decoration: none; background: rgba(255, 255, 255, .6); }
.seg-sw a.on { background: #fff; color: var(--fg); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); font-weight: 600; }
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--mut); background: var(--surface2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl th a { color: inherit; }
.tbl th a:hover { color: var(--fg); text-decoration: none; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; background: var(--surface2); border-top: 1px solid var(--line); padding: 10px 12px; }
.rowlink { color: var(--acc-h); }
.rowlink.strong { font-weight: 600; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 2px 0; color: var(--mut); font-size: 13px; }
.pg { display: flex; gap: 4px; flex-wrap: wrap; }
.pg a, .pg .gap { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--fg); padding: 0 8px; }
.pg a:hover { text-decoration: none; border-color: var(--acc-line); }
.pg a.on { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.pg .gap { border-color: transparent; background: transparent; }

/* ------------------------------------------------------------------ канбан / kanban */
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: #f1f5f9; border-radius: 12px; padding: 10px; min-height: 220px; display: flex; flex-direction: column; gap: 10px; border: 2px dashed transparent; transition: border-color .12s, background .12s; }
.kb-col.over { border-color: var(--acc); background: var(--acc-bg); }
.kb-col.no { opacity: .55; }
.kb-col header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.kb-col header b { font-size: 12.5px; color: var(--mut); background: #fff; border-radius: 999px; padding: 0 8px; }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: var(--sh); }
.kb-card[draggable="true"] { cursor: grab; }
.kb-card.drag { opacity: .45; }
.kb-t { font-weight: 650; color: var(--fg); }
.kb-m { color: var(--mut); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.kb-a { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.kb-a form { margin: 0; }
.kb-empty { color: var(--faint); font-size: 13px; text-align: center; margin: 12px 0; }

/* ------------------------------------------------------------------ форма / form */
.form { padding: 20px 22px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px 18px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld.wide { grid-column: 1 / -1; }
.fld > label { font-size: 13.5px; font-weight: 550; color: var(--fg2); }
.req { color: var(--bad); }
.hint { font-size: 12.5px; color: var(--mut); }
.msg { font-size: 12.5px; color: var(--bad); font-weight: 500; }
.fld.err .in { border-color: var(--bad); box-shadow: 0 0 0 3px #fee2e2; background: #fffafa; }
.fld.err > label { color: #991b1b; }
.in-wrap { position: relative; }
.in-wrap .in { padding-right: 32px; }
.suf { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--mut); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 9px; min-height: 40px; font-weight: 550; color: var(--fg2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--acc); margin: 0; }
.form-a { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line2); }

/* ------------------------------------------------------------------ карточка записи / record card */
.cardgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 16px; align-items: start; }
.side-col { display: flex; flex-direction: column; gap: 16px; }
.side-col .card + .card { margin-top: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.stamp { color: var(--faint); font-size: 12.5px; margin: 16px 0 0; }
.moves { display: flex; flex-direction: column; gap: 10px; }
.mv-b { display: flex; flex-wrap: wrap; gap: 8px; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist li { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-top: 1px dashed var(--line); }
.hist li:first-child { border-top: 0; padding-top: 0; }
.hist small { color: var(--mut); font-size: 12.5px; }

/* ------------------------------------------------------------------ отчёты и ошибки / reports and errors */
.reps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.reps .card + .card { margin-top: 0; }
.rep { display: flex; flex-direction: column; gap: 4px; color: var(--fg); }
.rep:hover { border-color: var(--acc-line); text-decoration: none; }
.rep span { color: var(--mut); font-size: 13px; }
.card .toolbar + .tw, .card .mut + .tw, .card .toolbar + .empty { margin-top: 14px; }
.err-card { text-align: center; margin: 24px auto; }
.err-card .code { font-size: 44px; font-weight: 800; color: var(--acc); line-height: 1; margin-bottom: 8px; }

/* ------------------------------------------------------------------ вход / sign-in */
body.bare { background: radial-gradient(1200px 500px at 50% -10%, #dbeafe 0%, transparent 60%), var(--bg); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--sh-lg); }
.login-card h1 { font-size: 22px; margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.pw { position: relative; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--acc); font: inherit; font-size: 13px; cursor: pointer; padding: 4px 6px; }
.demo { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-h { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); margin-bottom: 10px; }
.demo-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.demo-g form { margin: 0; }
.demo-btn { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 1px; border: 1px solid var(--line); background: var(--surface2); border-radius: 10px; padding: 9px 11px; cursor: pointer; font: inherit; color: var(--fg); }
.demo-btn:hover { border-color: var(--acc-line); background: var(--acc-bg); }
.demo-btn span { font-size: 12px; color: var(--mut); }

/* ------------------------------------------------------------------ печать / print */
body.print { background: #e5e7eb; }
.print-bar { display: flex; gap: 8px; justify-content: center; padding: 14px; }
.paper { background: #fff; color: #111; width: min(800px, calc(100% - 24px)); margin: 0 auto 32px; padding: 36px 40px; box-shadow: var(--sh-lg); font: 13px/1.5 Georgia, "Times New Roman", serif; }
.paper h1 { font-size: 20px; margin: 18px 0 14px; text-align: center; letter-spacing: .02em; }
.paper h2 { font-size: 14px; margin: 18px 0 6px; }
.paper-h { display: flex; justify-content: space-between; gap: 12px; border-bottom: 2px solid #111; padding-bottom: 8px; font-size: 12px; color: #444; }
.paper-h div { display: flex; flex-direction: column; }
.paper-h b { color: #111; font-size: 14px; }
.ptbl { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.ptbl th, .ptbl td { border: 1px solid #555; padding: 5px 8px; text-align: left; vertical-align: top; }
.ptbl.pkv th { width: 34%; background: #f5f5f5; font-weight: 600; }
.ptbl thead th { background: #f5f5f5; }
.ptbl .num, .ptbl td.num { text-align: right; white-space: nowrap; }
.ptbl tfoot td { font-weight: 700; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.sign div { border-top: 1px solid #333; padding-top: 4px; font-size: 11.5px; color: #444; }

@media print {
  @page { size: A4; margin: 14mm; }
  body, body.print { background: #fff; }
  .print-bar, .side, .top-a, .toolbar, .pager, .seg-sw, .moves, .flash { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .paper { box-shadow: none; margin: 0; width: auto; padding: 0; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
  a { color: inherit; }
}

/* ------------------------------------------------------------------ телефон / phone (≤ 760 px) */
@media (max-width: 760px) {
  .shell { display: block; }
  .side {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: column; gap: 0; padding: 8px 12px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow: visible;
  }
  .brand { padding: 2px 0; min-height: 40px; }
  .burger { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; cursor: pointer; border: 1px solid var(--line); }
  .burger span, .burger span::before, .burger span::after { display: block; width: 18px; height: 2px; background: var(--fg); border-radius: 2px; position: relative; content: ""; }
  .burger span::before { position: absolute; top: -6px; } .burger span::after { position: absolute; top: 6px; }
  .nav, .me { display: none; }
  .nav-open:checked ~ .shell .nav { display: flex; padding: 6px 0 4px; max-height: calc(100vh - 140px); overflow-y: auto; }
  .nav-open:checked ~ .shell .me { display: flex; padding-bottom: 6px; }
  .main { padding: 16px 16px 40px; }
  .top { align-items: flex-start; }
  .top h1 { font-size: 20px; }
  .top-a { width: 100%; }
  .top-a .btn, .top-a form { flex: 1 1 auto; }
  .top-a form .btn { width: 100%; }
  .card, .form { padding: 14px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; column-gap: 10px; }
  .kpi-ic { width: 34px; height: 34px; font-size: 16px; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .flt { flex: 1 1 140px; }
  /* RU: Таблица → карточки строк: подпись колонки берётся из data-label, горизонтальной прокрутки нет.
     EN: Table → row cards: the column caption comes from data-label, no horizontal scrolling. */
  .tw { border: 0; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: #fff; padding: 4px 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 6px 12px; text-align: right; }
  .tbl td::before { content: attr(data-label); color: var(--mut); font-size: 12.5px; text-align: left; flex: 0 0 auto; max-width: 45%; }
  /* RU: Первая ячейка — заголовок карточки строки (заголовок записи или №), без подписи.
     EN: The first cell is the row card title (record title or id), without a caption. */
  .tbl tbody td:first-child { justify-content: flex-start; text-align: left; font-size: 15px; font-weight: 600; padding-top: 8px; }
  .tbl tbody td:first-child::before { display: none; }
  .tbl .num { text-align: right; }
  .tbl tbody tr:hover td { background: transparent; }
  .tbl tfoot { display: block; }
  .tbl tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; border: 1px solid var(--line);
    border-radius: var(--r); background: var(--surface2); padding: 4px 0; }
  .tbl tfoot td { display: block; width: auto; flex: 0 1 auto; border: 0; background: transparent; }
  .kb { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .kb-col { scroll-snap-align: start; }
  .cardgrid { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .form-a .btn { flex: 1 1 auto; }
  .login-card { padding: 22px 18px; }
  .paper { padding: 20px 16px; }
  .sign { gap: 16px; }
}
