:root {
  --navy-950: #14223a;
  --navy-900: #1b2d4b;
  --navy-800: #244063;
  --blue-700: #2864dc;
  --blue-600: #3478ef;
  --blue-100: #eaf2ff;
  --blue-50: #f4f8ff;
  --green-700: #187451;
  --green-100: #e4f5ed;
  --red-700: #b42318;
  --red-100: #fce8e6;
  --amber-700: #8a5700;
  --amber-100: #fff1d1;
  --ink: #192334;
  --muted: #687386;
  --line: #dfe4ec;
  --line-dark: #cfd6e1;
  --surface: #ffffff;
  --canvas: #f4f6f9;
  --shadow: 0 10px 30px rgba(27, 45, 75, 0.07);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 258px;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 20px;
  background: linear-gradient(180deg, var(--navy-950), var(--navy-900));
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
  font: 700 22px Georgia, serif;
}
.brand strong { display: block; font-size: 18px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 1px; color: #aebbd0; font-size: 11px; }
.main-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 38px; }
.nav-caption {
  margin: 24px 13px 5px;
  color: #8494ac;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.nav-item {
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #cbd5e4;
  text-decoration: none;
}
.nav-item.is-active { background: rgba(255,255,255,.1); color: #fff; }
.nav-item:focus-visible, .nav-subitem:focus-visible {
  outline: 2px solid #8fb4ff;
  outline-offset: 2px;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.nav-item.is-disabled { opacity: .58; }
.nav-item small { color: #8293ab; font-size: 10px; }
.nav-icon { width: 21px; color: #8fb4ff; font-size: 17px; text-align: center; }
.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  background: rgba(255,255,255,.05);
}
.sidebar-help strong { font-size: 12px; }
.sidebar-help span { color: #aebbd0; font-size: 11px; line-height: 1.45; }

.workspace { display: flex; min-height: 100vh; margin-left: 258px; flex-direction: column; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  gap: 14px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}
.topbar > div:not(.topbar-status) { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-kicker { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.topbar strong { font-size: 14px; }
.topbar-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #31b47a; box-shadow: 0 0 0 3px #dcf6ea; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.document-menu-trigger { white-space: nowrap; }
.document-menu-trigger kbd { margin-left: 5px; font: 700 9px "SFMono-Regular", Consolas, monospace; }
.topbar > .topbar-user { display: flex; flex-direction: row; align-items: center; gap: 9px; margin-left: auto; padding-left: 5px; line-height: normal; }
.topbar-user > a { display: flex; max-width: 210px; flex-direction: column; color: var(--navy-900); line-height: 1.15; text-decoration: none; }
.topbar-user > a strong, .topbar-user > a small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user > a small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.logout-form { margin: 0; }
.main-content { width: min(1200px, calc(100% - 56px)); margin: 0 auto; padding: 36px 0 56px; flex: 1; }
.main-content:focus { outline: none; }
.main-content:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 5px; border-radius: 8px; }
.app-footer {
  display: flex;
  width: min(1200px, calc(100% - 56px));
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  margin: 0 auto;
  padding: 18px 0 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.app-footer a { color: var(--blue-700); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.checkbox-card { display: flex; align-items: flex-start; gap: 10px; min-height: 68px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.checkbox-card:hover { border-color: var(--blue-600); background: var(--blue-100); }
.checkbox-card input { width: auto; min-height: 0; margin-top: 3px; }
.checkbox-card span { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.checkbox-card strong { color: var(--navy-950); font-size: 11px; }
.checkbox-card small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.permission-section { margin-top: 12px; }
.audit-table { min-width: 1050px; }
.audit-table td:first-child { white-space: nowrap; }
.compact-filter-bar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; padding: 14px; }
.compact-filter-bar .field { min-width: min(100%, 360px); }

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 20%, rgba(52,120,239,.16), transparent 34%),
    linear-gradient(145deg, #eef3fb, #f8fafc 58%, #edf2f8);
}
.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px 18px;
}
.auth-card { width: min(440px, 100%); padding: 34px; }
.auth-brand {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--navy-900), var(--blue-700));
  color: #fff;
  box-shadow: 0 10px 24px rgba(40,100,220,.2);
  font: 700 28px Georgia, serif;
}
.auth-card h1 { font-size: 30px; }
.auth-card .page-lead { margin-bottom: 22px; }
.auth-card .alert { margin: 15px 0; }
.auth-form { display: grid; gap: 17px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit:disabled { cursor: not-allowed; opacity: .56; transform: none; }
.auth-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.password-change-form { max-width: 820px; }

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}
.eyebrow { margin: 0 0 5px; color: var(--blue-700); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy-950); font-size: clamp(27px, 3vw, 36px); line-height: 1.2; letter-spacing: -.025em; }
.page-lead { max-width: 700px; margin: 8px 0 0; color: var(--muted); }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 650;
  text-decoration: none;
  transition: .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button kbd { padding: 2px 6px; border: 1px solid rgba(255,255,255,.5); border-bottom-width: 2px; border-radius: 5px; background: rgba(255,255,255,.14); color: inherit; font: 700 9px "SFMono-Regular", Consolas, monospace; }
.button-primary { border-color: var(--blue-700); background: var(--blue-700); color: #fff; box-shadow: 0 5px 13px rgba(40,100,220,.18); }
.button-primary:hover { background: #1f57c8; }
.button-secondary { border-color: var(--line-dark); background: #fff; color: var(--navy-900); }
.button-secondary:hover, .button-quiet:hover { border-color: #aeb9ca; background: #f8fafc; }
.button-warning { border-color: #d39a28; background: #fff8e8; color: #825405; }
.button-warning:hover { border-color: #bd8210; background: #ffefc9; }
.button-quiet { min-height: 36px; padding: 7px 12px; border-color: var(--line); background: #fff; color: var(--navy-900); font-size: 13px; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; white-space: nowrap; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu-popover { position: absolute; z-index: 50; top: calc(100% + 7px); right: 0; min-width: 205px; padding: 6px; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.export-menu-popover button { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--navy-900); cursor: pointer; font: inherit; text-align: left; }
.export-menu-popover button:hover { background: var(--blue-50); }
.export-menu-popover small { color: var(--muted); }
.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy-800);
  text-decoration: none;
}
.text-link { color: var(--blue-700); font-size: 13px; font-weight: 600; text-decoration: none; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 15px; padding: 14px; }
.search-form { display: flex; align-items: center; gap: 9px; flex: 1; }
.search-box {
  display: flex;
  width: min(470px, 100%);
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
}
.search-box:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); }
.result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.toolbar-select { min-height: 42px; padding: 0 32px 0 10px; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; color: var(--ink); outline: 0; }
.toolbar-select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.receipt-filter-form { flex-wrap: wrap; }
.filter-select { display: flex; flex-direction: column; gap: 3px; }
.filter-select > span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.filter-select .toolbar-select { min-width: 180px; }
.filter-select:first-of-type .toolbar-select { width: min(310px, 100%); }

.organization-list { display: flex; flex-direction: column; gap: 10px; }
.catalog-folders { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.catalog-folder { display: grid; min-width: 0; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 14px; }
.catalog-folder-link { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; text-decoration: none; }
.catalog-folder .card-actions { justify-content: flex-end; }
.catalog-folder-link > span:last-child { display: flex; min-width: 0; flex-direction: column; }
.catalog-folder-link strong { overflow: hidden; color: var(--navy-900); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-folder-link small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-folder-icon { color: #e6a829; font-size: 25px; }
.nomenclature-browser { display: grid; grid-template-columns: 285px minmax(0,1fr); align-items: start; gap: 14px; }
.nomenclature-contents { min-width: 0; }
.catalog-tree { position: sticky; top: 86px; max-height: calc(100vh - 105px); overflow: auto; padding: 13px 10px 15px; }
.catalog-tree-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 7px 10px; border-bottom: 1px solid var(--line); }
.catalog-tree-heading strong { color: var(--navy-900); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.catalog-tree-heading a { color: var(--blue-700); font-size: 10px; font-weight: 700; text-decoration: none; }
.catalog-tree-node { margin-top: 3px; }
.catalog-tree-node summary { display: grid; grid-template-columns: 14px 20px minmax(0,1fr); align-items: center; gap: 4px; min-height: 34px; padding: 4px 6px; border-radius: 7px; cursor: pointer; list-style: none; }
.catalog-tree-node summary::-webkit-details-marker { display: none; }
.catalog-tree-node summary:hover { background: var(--blue-50); }
.catalog-tree-node summary a { overflow: hidden; color: var(--navy-900); font-size: 11px; font-weight: 700; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.tree-chevron { color: var(--muted); font-size: 16px; transition: transform .14s ease; }
.catalog-tree-node[open] > summary .tree-chevron { transform: rotate(90deg); }
.tree-folder-icon { color: #e6a829; font-size: 16px; }
.catalog-tree-children { margin-left: 13px; padding-left: 7px; border-left: 1px solid var(--line); }
.catalog-tree-item { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 4px; min-height: 31px; padding: 4px 7px; border-radius: 6px; text-decoration: none; }
.catalog-tree-item:hover { background: var(--blue-50); }
.catalog-tree-item > span { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 5px; background: #edf3ff; color: var(--blue-700); font-size: 8px; font-weight: 800; }
.catalog-tree-item strong { overflow: hidden; color: #435067; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.catalog-tree-root-items { padding-top: 4px; }
.catalog-items { display: flex; flex-direction: column; gap: 9px; }
.catalog-item { display: grid; grid-template-columns: 42px minmax(0,1fr) minmax(130px,auto) auto; align-items: center; gap: 16px; padding: 16px; scroll-margin-top: 90px; }
.catalog-item:target { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100), var(--shadow); }
.catalog-item.is-archived { opacity: .7; }
.catalog-item-kind { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: var(--blue-50); color: var(--blue-700); font-size: 14px; font-weight: 800; }
.catalog-item-copy { min-width: 0; }
.catalog-item-copy h2 { overflow: hidden; margin: 0; color: var(--navy-950); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-price { display: flex; flex-direction: column; align-items: flex-end; }
.catalog-price strong { color: var(--navy-950); font-size: 15px; white-space: nowrap; }
.catalog-price small { color: var(--muted); font-size: 9px; }
.catalog-price span { margin-top: 4px; color: var(--navy-700); font-size: 10px; font-weight: 700; white-space: nowrap; }
.compact-form { width: min(760px, 100%); margin: 0 auto; }
.units-table { padding: 20px; }
.warehouse-list { display: flex; flex-direction: column; gap: 10px; }
.warehouse-card { display: grid; grid-template-columns: 46px minmax(0,1fr) minmax(140px,auto) auto; align-items: center; gap: 16px; padding: 18px; }
.warehouse-card.is-archived { opacity: .7; }
.warehouse-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 11px; background: #eef3ff; color: var(--blue-700); font-size: 20px; }
.warehouse-copy { min-width: 0; }
.warehouse-copy h2 { margin: 0; color: var(--navy-950); font-size: 15px; }
.warehouse-copy > p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.warehouse-address { margin-top: 7px; color: #465267; font-size: 11px; }
.warehouse-responsible { display: flex; flex-direction: column; align-items: flex-end; }
.warehouse-responsible small { color: var(--muted); font-size: 9px; }
.warehouse-responsible span { font-size: 11px; font-weight: 650; }
.warehouse-card .card-actions form { margin: 0; }
.organization-card {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(27,45,75,.035);
  transition: .16s ease;
}
.organization-card:hover { border-color: #bdc8d8; box-shadow: var(--shadow); }
.organization-card.is-archived { opacity: .72; }
.organization-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid #cedcf4;
  border-radius: 12px;
  background: var(--blue-50);
  color: var(--blue-700);
  font: 700 21px Georgia, serif;
}
.card-title-line { display: flex; align-items: center; gap: 9px; }
.organization-summary h2 { margin: 0; font-size: 16px; }
.organization-summary h2 a { color: var(--navy-950); text-decoration: none; }
.organization-summary > p { margin: 3px 0 8px; color: var(--muted); font-size: 12px; }
.requisites-inline { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; }
.requisites-inline small { margin-right: 3px; color: var(--muted); font-size: 10px; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--green-100); color: var(--green-700); }
.badge-muted { background: #edf0f4; color: #626e7e; }
.badge-primary { background: var(--blue-100); color: var(--blue-700); }
.badge-danger { background: var(--red-100); color: var(--red-700); }
.card-actions { display: flex; align-items: center; gap: 7px; }
.empty-state { padding: 60px 25px; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 12px 0 5px; font-size: 23px; }
.empty-state p { margin: 0 auto 20px; color: var(--muted); }
.empty-icon { margin: 0 auto; display: grid; width: 56px; height: 56px; place-items: center; border-radius: 16px; background: var(--blue-100); color: var(--blue-700); font-size: 26px; }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 10px; }
.alert-success { border-color: #addbc6; background: var(--green-100); color: #125f42; }
.alert-error { border-color: #efb4ae; background: var(--red-100); color: var(--red-700); }
.alert-warning { border-color: #e5c16c; background: var(--amber-100); color: var(--amber-700); }
.error-summary { display: flex; flex-direction: column; }
.error-summary ul { margin: 7px 0 0; padding-left: 20px; }
.error-summary li { margin-top: 2px; font-size: 11px; }
.lookup-panel { margin-bottom: 18px; padding: 22px; }
.lookup-heading { display: flex; align-items: flex-start; gap: 12px; }
.lookup-icon {
  display: grid;
  flex: 0 0 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 21px;
  font-weight: 700;
}
.lookup-heading h2 { margin: 0; color: var(--navy-900); font-size: 17px; }
.lookup-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.lookup-search { display: flex; align-items: stretch; gap: 9px; margin-top: 17px; }
.lookup-search label { flex: 1; }
.lookup-search input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
}
.lookup-search input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.lookup-search .button:disabled { cursor: wait; opacity: .72; transform: none; }
.lookup-message { min-height: 19px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.lookup-message.is-error { color: var(--red-700); font-weight: 600; }
.lookup-message.is-success { color: var(--green-700); }
.lookup-message.is-empty { color: var(--amber-700); }
.lookup-results { display: flex; flex-direction: column; gap: 8px; margin-top: 3px; }
.lookup-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.lookup-result.is-warning { border-color: #e7c77d; background: #fffaf0; }
.lookup-result-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lookup-result-title strong { color: var(--navy-950); font-size: 13px; }
.badge-warning { background: var(--amber-100); color: var(--amber-700); }
.lookup-result-requisites { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 5px; color: #4d596c; font-size: 11px; }
.lookup-result-copy p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.lookup-result-copy small { display: block; margin-top: 4px; color: #8791a0; font-size: 9px; }
.lookup-source { margin: 13px 0 0; padding-top: 11px; border-top: 1px solid #edf0f4; color: var(--muted); font-size: 10px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--blue-700); text-decoration: none; }
.detail-heading {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 17px;
  margin-bottom: 24px;
}
.organization-avatar-large { width: 62px; height: 62px; border-radius: 16px; font-size: 27px; }
.title-with-badge { display: flex; align-items: center; gap: 10px; }
.detail-heading p { margin: 5px 0 0; color: var(--muted); }
.detail-actions { display: flex; gap: 8px; }
.action-menu { position: relative; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu-popover { position: absolute; z-index: 10; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px; border: 1px solid var(--line-dark); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.action-menu-popover a, .action-menu-popover button, .action-menu-popover span { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--navy-900); font: inherit; text-align: left; text-decoration: none; white-space: nowrap; }
.action-menu-popover a:hover, .action-menu-popover button:hover { background: var(--blue-50); cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-card { padding: 22px; }
.detail-card h2 { margin: 0 0 15px; color: var(--navy-900); font-size: 15px; }
.detail-card dl { margin: 0; }
.detail-card dl > div { display: grid; grid-template-columns: minmax(130px,.8fr) 1.4fr; gap: 18px; padding: 9px 0; border-top: 1px solid #edf0f4; }
.detail-card dt { color: var(--muted); font-size: 12px; }
.detail-card dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.record-meta { margin: 18px 4px 0; color: var(--muted); font-size: 11px; }
.tax-history { margin-top: 14px; padding: 22px; }
.tax-history h2 { margin: 0 0 15px; color: var(--navy-900); font-size: 15px; }
.table-scroll { overflow-x: auto; }
.tax-history table { width: 100%; border-collapse: collapse; }
.tax-history th, .tax-history td { padding: 10px 12px; border-top: 1px solid #edf0f4; text-align: left; }
.tax-history th { color: var(--muted); font-size: 11px; font-weight: 700; }
.tax-history td { font-size: 12px; }
.bank-accounts-section { margin-top: 14px; padding: 22px; scroll-margin-top: 90px; }
.bank-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.bank-section-heading h2 { margin: 0; color: var(--navy-900); font-size: 17px; }
.bank-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.bank-empty { display: flex; flex-direction: column; align-items: flex-start; padding: 20px; border: 1px dashed var(--line-dark); border-radius: 10px; background: #fbfcfe; }
.bank-empty strong { color: var(--navy-900); font-size: 13px; }
.bank-empty span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.bank-account-list { display: flex; flex-direction: column; gap: 9px; }
.bank-account-card { display: grid; grid-template-columns: minmax(240px, 1.1fr) minmax(330px, 1.5fr) auto; align-items: center; gap: 20px; padding: 17px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.bank-account-card.is-archived { opacity: .7; }
.bank-account-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.bank-account-title strong { color: var(--navy-950); font-size: 13px; }
.bank-account-number { margin-top: 7px; color: var(--navy-900); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 14px; font-weight: 700; letter-spacing: .025em; }
.bank-account-main p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.division-address { margin-top: 10px; color: var(--navy-900); font-size: 13px; font-weight: 650; line-height: 1.5; }
.bank-account-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px 16px; margin: 0; }
.bank-account-details > div { min-width: 0; }
.bank-account-details dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.bank-account-details dd { margin: 1px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 600; }
.bank-account-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.bank-account-actions form { margin: 0; }
.bank-account-actions form .button { width: 100%; }
.bank-account-form { width: min(930px, 100%); margin: 0 auto; }
.bank-flags { justify-content: center; gap: 13px; }
.bank-flags .copy-check { margin: 0; }
.bank-bik-search { display: flex; align-items: stretch; gap: 7px; }
.bank-bik-search input { min-width: 0; }
.bank-bik-search .button { min-height: 42px; padding-inline: 12px; white-space: nowrap; }
[data-bank-lookup-message].is-success { color: var(--green-700); font-weight: 600; }
[data-bank-lookup-message].is-error { color: var(--red-700); font-weight: 600; }
[data-bank-lookup-message].is-warning { color: var(--amber-700); font-weight: 600; }

.form-page-heading { align-items: start; }
.form-layout { display: grid; grid-template-columns: 205px minmax(0,1fr); align-items: start; gap: 18px; }
.form-nav { position: sticky; top: 92px; display: flex; flex-direction: column; padding: 16px 10px; }
.form-nav strong { padding: 3px 9px 10px; color: var(--muted); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.form-nav a { padding: 9px; border-radius: 7px; color: var(--navy-800); font-size: 12px; font-weight: 600; text-decoration: none; }
.form-nav a:hover { background: var(--blue-50); color: var(--blue-700); }
.organization-form { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.form-section { padding: 25px; scroll-margin-top: 90px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.section-number { display: grid; flex: 0 0 32px; height: 32px; place-items: center; border-radius: 9px; background: var(--blue-100); color: var(--blue-700); font-size: 13px; font-weight: 800; }
.section-heading h2 { margin: 1px 0 2px; color: var(--navy-900); font-size: 17px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.subsection-title { margin: 23px 0 13px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--navy-800); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.subsection-title:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 17px; }
.field-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.field-grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.field-full { grid-column: 1 / -1; }
.field-two-thirds { grid-column: span 2; }
.field-span-2 { grid-column: span 2; }
.field-span-3 { grid-column: span 3; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.field > span, .field > label:not(.copy-check), .field legend { color: #374154; font-size: 12px; font-weight: 700; }
.field legend { margin-bottom: 8px; }
.field > small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.address-suggest-field { position: relative; }
.address-suggestions { position: absolute; z-index: 40; top: calc(100% - 1px); right: 0; left: 0; max-height: 310px; overflow-y: auto; border: 1px solid var(--line-dark); border-radius: 9px; background: #fff; box-shadow: 0 14px 35px rgba(19, 36, 59, .18); }
.address-suggestion { display: flex; flex-direction: column; gap: 3px; padding: 11px 13px; border-top: 1px solid var(--line); cursor: pointer; }
.address-suggestion:first-child { border-top: 0; }
.address-suggestion:hover, .address-suggestion.is-active { background: var(--blue-50); }
.address-suggestion strong { color: var(--navy-900); font-size: 12px; line-height: 1.4; }
.address-suggestion small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.address-suggest-status { min-height: 14px; }
.address-suggest-status.is-confirmed { color: var(--green-700); font-weight: 650; }
.address-suggest-status.is-warning { color: var(--amber-700); font-weight: 600; }
.address-suggest-status.is-error { color: var(--red-700); font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: .15s ease;
}
.field input { height: 42px; padding: 0 11px; }
.field select { height: 42px; padding: 0 34px 0 11px; }
.field textarea { min-height: 70px; padding: 10px 11px; line-height: 1.45; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.field.is-autofilled input, .field.is-autofilled textarea {
  border-color: #58a982;
  background: #f2fbf7;
  box-shadow: 0 0 0 3px var(--green-100);
}
.field input::placeholder, .field textarea::placeholder { color: #a5aebb; }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { border-color: #dd655c; background: #fffafa; }
.field.is-readonly textarea { background: #f2f5f8; color: #4c596b; }
.field-error { color: var(--red-700) !important; font-size: 11px !important; font-weight: 600 !important; }
.required { color: var(--red-700) !important; }
.code-input { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important; letter-spacing: .025em; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.choice-card { position: relative; display: flex; min-height: 67px; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid var(--line-dark); border-radius: 10px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-600); }
.choice-card input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue-700); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card strong { color: var(--navy-900); font-size: 12px; }
.choice-card small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid var(--line-dark); border-radius: 9px; background: var(--blue-50); cursor: pointer; }
.checkbox-field input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--blue-700); }
.checkbox-field > span { display: flex; flex-direction: column; gap: 2px; }
.checkbox-field strong { color: var(--navy-900); font-size: 12px; }
.checkbox-field small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.copy-check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin-top: -4px; color: var(--navy-800); cursor: pointer; font-size: 11px; }
.copy-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue-700); }
.organization-primary-setting { padding: 13px 14px; border: 1px solid #cbdaf4; border-radius: 10px; background: var(--blue-50); }
.organization-primary-setting .copy-check { margin: 0; font-size: 12px; font-weight: 700; }
.is-hidden { display: none !important; }
.form-actions { position: sticky; z-index: 10; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; box-shadow: 0 12px 34px rgba(20,34,58,.16); }
.form-actions > div { display: flex; flex-direction: column; }
.form-actions > div:last-child { flex-direction: row; gap: 8px; }
.form-actions strong { font-size: 12px; }
.form-actions span { color: var(--muted); font-size: 10px; }

.receipt-list { display: flex; flex-direction: column; gap: 10px; }
.receipt-keyboard-hint { display: flex; justify-content: flex-end; gap: 16px; margin: -2px 3px 10px; color: var(--muted); font-size: 10px; }
.receipt-keyboard-hint span { display: flex; align-items: center; gap: 4px; }
.receipt-keyboard-hint kbd { min-width: 22px; padding: 2px 5px; border: 1px solid #cbd2dd; border-bottom-width: 2px; border-radius: 5px; background: #fff; color: #536075; font: 700 9px "SFMono-Regular", Consolas, monospace; text-align: center; }
.receipt-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto auto; align-items: center; gap: 16px; padding: 18px; }
.receipt-card:focus { outline: none; }
.receipt-card.is-keyboard-current { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px var(--blue-100), var(--shadow); }
[data-keyboard-item]:focus { outline: none; }
[data-keyboard-item].is-keyboard-current {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: inset 3px 0 0 var(--blue-600), var(--shadow);
}
.document-table [data-keyboard-item].is-keyboard-current { background: var(--blue-50); }
.receipt-card.is-deletion-marked { border-style: dashed; background: #fafafa; opacity: .76; }
.receipt-card.is-deletion-marked.is-keyboard-current { border-style: solid; opacity: 1; }
.receipt-document-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 12px; background: #eef3ff; color: var(--blue-700); font-size: 12px; font-weight: 850; letter-spacing: .03em; }
.sale-document-icon { background: linear-gradient(145deg, #e9f8f0, #ccebdc); color: #18724b; }
.receipt-document-icon-large { width: 62px; height: 62px; border-radius: 16px; font-size: 15px; }
.receipt-card-copy { min-width: 0; }
.receipt-card-copy h2 { margin: 0; font-size: 15px; }
.receipt-card-copy h2 a { color: var(--navy-950); text-decoration: none; }
.receipt-card-copy > p { margin: 4px 0 8px; color: var(--muted); font-size: 11px; }
.receipt-card-total { display: flex; min-width: 155px; flex-direction: column; align-items: flex-end; }
.receipt-card-total small, .receipt-card-total span { color: var(--muted); font-size: 9px; }
.receipt-card-total strong { color: var(--navy-950); font-size: 16px; }
.document-lifecycle-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: -10px 0 14px;
  padding: 16px 18px;
}
.document-lifecycle-panel h2 { margin: 0; color: var(--navy-900); font-size: 13px; }
.document-lifecycle-panel p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.document-lifecycle-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.document-lifecycle-actions form { margin: 0; }
.document-lifecycle-actions .button { min-height: 37px; padding: 7px 12px; font-size: 11px; }
.trial-balance-toolbar { align-items: flex-start; flex-direction: column; }
.report-period-shortcuts { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 10px; }
.report-period-shortcuts a { color: var(--blue-700); font-weight: 650; text-decoration: none; }
.report-period-shortcuts a:hover { text-decoration: underline; }
.receipt-lines-section { margin-top: 14px; padding: 22px; }
.receipt-line-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.receipt-line-actions kbd, .receipt-lines-editor kbd { min-width: 29px; padding: 2px 6px; border: 1px solid #c9d0dc; border-bottom-width: 2px; border-radius: 5px; background: #f7f9fc; color: #536075; font: 700 9px "SFMono-Regular", Consolas, monospace; text-align: center; }
.receipt-line-actions .button kbd { margin-left: 2px; background: rgba(255,255,255,.75); }
.document-table { width: 100%; border-collapse: collapse; }
.document-table th, .document-table td { padding: 10px 9px; border-top: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.document-table th { color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.document-table td { font-size: 11px; }
.table-secondary { display: block; margin-top: 3px; color: var(--muted); font-weight: 400; }
.document-table tbody tr:hover { background: #fbfcfe; }
.document-table .number-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt-view-table { min-width: 880px; }
.receipt-edit-table { min-width: 1120px; }
.receipt-edit-table th:nth-child(1) { width: 38px; }
.receipt-edit-table th:nth-child(2) { width: 290px; }
.receipt-edit-table th:nth-child(3) { width: 115px; }
.receipt-edit-table th:nth-child(4) { width: 60px; }
.receipt-edit-table th:nth-child(5) { width: 125px; }
.receipt-edit-table th:nth-child(6) { width: 125px; }
.table-field { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.table-field input, .table-field select { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); font-size: 11px; }
.table-field select { padding-right: 25px; }
.table-field input:focus, .table-field select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100); }
.table-field select.is-expanded-picker { height: auto; min-height: 120px; padding: 4px; }
.table-field.is-invalid input, .table-field.is-invalid select { border-color: #dd655c; background: #fffafa; }
.table-field .field-error { max-width: 280px; font-size: 9px !important; line-height: 1.25; }
.unit-cell { display: inline-block; min-width: 30px; color: var(--navy-800); font-weight: 700; text-align: center; }
.line-total-cell { color: var(--navy-950); font-weight: 750; }
.receipt-remove-line { width: 32px; height: 32px; color: var(--red-700); font-size: 18px; }
.receipt-vat-flag { align-self: end; padding-bottom: 3px; }
.receipt-vat-flag .copy-check { margin: 0; }
.receipt-totals { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.receipt-totals > div { display: flex; min-width: 150px; flex-direction: column; align-items: flex-end; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.receipt-totals span { color: var(--muted); font-size: 9px; }
.receipt-totals strong { color: var(--navy-900); font-size: 15px; font-variant-numeric: tabular-nums; }
.receipt-totals .receipt-grand-total { min-width: 205px; border-color: #b9ccef; background: var(--blue-50); }
.receipt-totals .receipt-grand-total strong { color: var(--blue-700); font-size: 18px; }
.receipt-comment { margin-top: 14px; padding: 22px; }
.receipt-comment h2 { margin: 0 0 8px; color: var(--navy-900); font-size: 15px; }
.receipt-comment p { margin: 0; color: #465267; font-size: 12px; }
.quick-item-dialog { width: min(680px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px rgba(17, 31, 52, .28); }
.quick-item-dialog::backdrop { background: rgba(16, 28, 47, .52); backdrop-filter: blur(2px); }
.document-exit-dialog { width: min(440px, calc(100% - 28px)); padding: 24px; }
.document-exit-dialog .quick-dialog-heading { margin-bottom: 0; }
.document-exit-dialog .quick-dialog-actions { justify-content: flex-end; }
.quick-item-form { padding: 24px; }
.quick-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.quick-dialog-heading h2 { margin: 0; color: var(--navy-950); font-size: 23px; }
.quick-dialog-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.quick-item-message { margin-bottom: 17px; }
.quick-item-message[hidden] { display: none; }
.quick-item-vat { padding-top: 4px; }
.quick-item-vat .copy-check { margin: 0; }
.quick-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.quick-dialog-actions > div { display: flex; gap: 8px; }
.document-menu-dialog { width: min(680px, calc(100vw - 32px)); padding: 22px; border: 0; border-radius: var(--radius); box-shadow: 0 24px 70px rgba(15, 29, 52, .28); }
.document-menu-dialog::backdrop { background: rgba(15, 29, 52, .45); }
.document-menu-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.document-menu-heading h2 { margin: 3px 0 0; }
.document-menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.document-menu-grid a { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--navy-950); text-decoration: none; }
.document-menu-grid a:hover, .document-menu-grid a:focus { border-color: var(--blue-600); background: var(--blue-50); outline: none; }
.document-menu-grid span { color: var(--muted); font-size: 12px; }
.document-menu-dialog kbd { padding: 2px 5px; border: 1px solid #cbd2dd; border-bottom-width: 2px; border-radius: 5px; background: #f7f9fc; color: #536075; font: 700 9px "SFMono-Regular", Consolas, monospace; }

@media (max-width: 1050px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .menu-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(15,25,41,.42); }
  .workspace { margin-left: 0; }
  .menu-button { display: block; }
  .form-layout { grid-template-columns: 1fr; }
  .form-nav { position: static; display: none; }
  .main-content { width: min(100% - 36px, 1100px); }
  .receipt-card { grid-template-columns: 48px minmax(0,1fr) auto; }
  .receipt-card .card-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .warehouse-card { grid-template-columns: 46px minmax(0,1fr) auto; }
  .warehouse-responsible { grid-column: 2; align-items: flex-start; }
  .warehouse-card .card-actions { grid-column: 3; grid-row: 1 / 3; flex-direction: column; }
  .topbar-status { display: none; }
  .document-menu-trigger { margin-left: auto; }
}

@media (max-width: 760px) {
  .topbar { height: auto; min-height: 66px; padding: 10px 16px; }
  .document-menu-trigger { display: none; }
  .topbar-user > a { max-width: 140px; }
  .topbar-user .button { min-height: 34px; padding: 6px 9px; }
  .auth-card { padding: 26px 21px; }
  .main-content { width: min(100% - 24px, 700px); padding-top: 24px; }
  .app-footer { width: min(100% - 24px, 700px); flex-direction: column; }
  .page-heading, .detail-heading { align-items: stretch; }
  .page-heading { flex-direction: column; }
  .page-heading > .button { width: 100%; }
  .heading-actions { flex-direction: column; width: 100%; }
  .heading-actions .button { width: 100%; }
  .lookup-panel { padding: 18px 15px; }
  .lookup-search { flex-direction: column; }
  .lookup-result { grid-template-columns: 1fr; }
  .lookup-result .button { width: 100%; }
  .list-toolbar, .search-form { align-items: stretch; }
  .list-toolbar { flex-direction: column; }
  .search-form { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .toolbar-select { width: 100%; }
  .filter-select { width: 100%; }
  .filter-select .toolbar-select, .filter-select:first-of-type .toolbar-select { width: 100%; }
  .organization-card { grid-template-columns: 42px minmax(0,1fr); padding: 15px; }
  .catalog-folders { grid-template-columns: 1fr; }
  .nomenclature-browser { grid-template-columns: 1fr; }
  .catalog-tree { position: static; max-height: 360px; }
  .catalog-item { grid-template-columns: 42px minmax(0,1fr); }
  .catalog-price { align-items: flex-start; grid-column: 2; }
  .catalog-item .card-actions { grid-column: 1 / -1; }
  .organization-avatar { width: 42px; height: 42px; }
  .card-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .detail-heading { grid-template-columns: auto 1fr; }
  .detail-actions { grid-column: 1 / -1; flex-wrap: wrap; }
  .document-lifecycle-panel { align-items: stretch; flex-direction: column; margin-top: -6px; }
  .document-lifecycle-actions { justify-content: stretch; }
  .document-lifecycle-actions form, .document-lifecycle-actions .button { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .bank-section-heading { align-items: stretch; flex-direction: column; }
  .bank-section-heading .button { width: 100%; }
  .bank-account-card { grid-template-columns: 1fr; }
  .bank-account-details { grid-template-columns: 1fr 1fr; }
  .bank-account-actions .button { width: 100%; }
  .bank-bik-search { flex-direction: column; }
  .field-grid, .field-grid-2, .field-grid-3, .field-grid-4, .choice-row { grid-template-columns: 1fr; }
  .field-full, .field-two-thirds, .field-span-2, .field-span-3 { grid-column: auto; }
  .form-section { padding: 20px 16px; }
  .form-actions { position: static; flex-direction: column; align-items: stretch; }
  .form-actions > div:last-child { flex-direction: column-reverse; }
  .title-with-badge { flex-wrap: wrap; }
  .receipt-card { grid-template-columns: 42px minmax(0,1fr); padding: 15px; }
  .receipt-card-total { grid-column: 2; align-items: flex-start; }
  .receipt-card .card-actions { grid-column: 1 / -1; }
  .receipt-keyboard-hint { align-items: flex-end; flex-direction: column; gap: 4px; }
  .warehouse-card { grid-template-columns: 42px minmax(0,1fr); padding: 15px; }
  .warehouse-responsible { grid-column: 2; }
  .warehouse-card .card-actions { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
  .receipt-totals { flex-direction: column; }
  .receipt-totals > div, .receipt-totals .receipt-grand-total { min-width: 0; align-items: flex-start; }
  .receipt-line-actions { flex-direction: column; }
  .receipt-line-actions .button { width: 100%; }
  .quick-item-form { padding: 19px 15px; }
  .quick-dialog-actions { align-items: stretch; flex-direction: column; }
  .quick-dialog-actions > div { flex-direction: column-reverse; }
  .quick-dialog-actions .button { width: 100%; }
  .document-menu-grid { grid-template-columns: 1fr; }
}

@media print {
    body.export-print-mode { background: #fff; }
    body.export-print-mode .sidebar, body.export-print-mode .topbar, body.export-print-mode .app-footer,
    body.export-print-mode .menu-backdrop, body.export-print-mode dialog,
    body.export-print-mode .detail-actions, body.export-print-mode .card-actions,
    body.export-print-mode form, body.export-print-mode button { display: none !important; }
    body.export-print-mode .app-shell, body.export-print-mode .workspace { display: block; min-height: 0; }
    body.export-print-mode .main-content { width: 100%; max-width: none; padding: 0; }
    body.export-print-mode .panel { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-subitem { display: block; margin: -2px 10px 2px 46px; padding: 6px 10px; color: #aebbd0; text-decoration: none; font-size: .82rem; border-radius: 8px; }
.nav-subitem:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.account-indent { color: var(--muted); margin-left: 12px; }
.table-note { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.accounting-report-table th { white-space: nowrap; }
.cash-payment-icon { background: #fff1df; color: #9a5416; }
.purpose-cell { min-width: 280px; max-width: 520px; white-space: normal; line-height: 1.45; }
.money-in { color: #26734d; white-space: nowrap; }
.money-out { color: #a34735; white-space: nowrap; }
.file-drop-field { display: grid; place-items: center; gap: 8px; min-height: 190px; padding: 28px; border: 2px dashed var(--line); border-radius: 16px; background: var(--canvas); text-align: center; cursor: pointer; }
.file-drop-field:hover { border-color: var(--blue-600); background: var(--blue-50); }
.file-drop-field input { width: min(520px, 100%); }
.file-drop-icon { font-size: 2rem; color: var(--blue-700); }
.instruction-list { margin: 14px 0 20px; padding-left: 24px; line-height: 1.7; }

.hr-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.hr-summary-card { display: flex; min-height: 118px; flex-direction: column; justify-content: center; padding: 20px; }
.hr-summary-card span { color: var(--muted); font-size: 10px; }
.hr-summary-card strong { margin: 5px 0; color: var(--navy-950); font-size: 22px; font-variant-numeric: tabular-nums; }
.hr-summary-card a { color: var(--blue-700); font-size: 10px; font-weight: 700; text-decoration: none; }
.hr-catalog { margin-bottom: 14px; }
.report-catalog-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 15px; min-height: 112px; padding: 20px; color: inherit; text-decoration: none; }
.report-catalog-card:hover { border-color: #a8bde3; transform: translateY(-1px); }
.report-catalog-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 13px; background: var(--blue-100); color: var(--blue-700); font-size: 12px; font-weight: 850; }
.report-catalog-card h2 { margin: 0 0 5px; color: var(--navy-950); font-size: 15px; }
.report-catalog-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.employee-children-table { min-width: 1150px; }
.employee-children-table input, .payroll-edit-table input, .payroll-edit-table select, [data-payment-lines] input, [data-payment-lines] select { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; }
.employee-children-table td:nth-child(1) { min-width: 250px; }
.employee-children-table td:nth-child(4) { min-width: 160px; }
.employee-children-table td:nth-child(5) { min-width: 170px; }
.employee-children-table td:nth-child(5) input + input { margin-top: 5px; }
.compact-check { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 10px; }
.compact-check input { width: auto; min-height: 0; }
.calculated-field { justify-content: flex-end; }
.calculated-field strong { display: flex; min-height: 42px; align-items: center; color: var(--navy-950); font-size: 20px; }
.payroll-edit-table { min-width: 1250px; }
.payroll-edit-table th:first-child { min-width: 260px; }
.compact-empty { min-height: 160px; }
.empty-inline { margin: 0; padding: 20px; color: var(--muted); }
[data-payment-bank][hidden], [data-payment-cash][hidden] { display: none; }

.opening-balance-table[data-opening-general-table] { min-width: 1650px; }
.opening-balance-table[data-opening-general-table] th:nth-child(2) { min-width: 220px; }
.opening-balance-table[data-opening-general-table] th:nth-child(5),
.opening-balance-table[data-opening-general-table] th:nth-child(6),
.opening-balance-table[data-opening-general-table] th:nth-child(7) { min-width: 180px; }
.opening-balance-table[data-opening-general-table] th:nth-child(9) { min-width: 210px; }
.opening-balance-table[data-opening-specialized-table] { min-width: 760px; }
.opening-balance-table[data-opening-specialized-table] th:nth-child(1) { width: 56px; }
.opening-balance-table[data-opening-specialized-table] th:nth-child(2) { width: 42%; min-width: 300px; }
.opening-balance-table[data-opening-specialized-table] th:nth-child(3) { width: 130px; }
.opening-balance-table[data-opening-specialized-table] th:nth-child(4) { width: 170px; }
.opening-balance-table[data-opening-specialized-table] th:nth-child(5) { width: 44px; }
.opening-select-popover {
  position: fixed;
  z-index: 80;
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 29, 52, .24);
}
.opening-select-option {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.opening-select-option:hover,
.opening-select-option.is-active {
  background: var(--blue-100);
  color: var(--blue-800);
}
.opening-select-option:focus {
  outline: 2px solid var(--blue-600);
  outline-offset: -2px;
}
.month-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.month-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px 12px; padding: 16px; }
.month-card > div { display: flex; align-items: center; gap: 10px; }
.month-card h2 { margin: 0; font-size: 13px; }
.month-card small, .month-card .text-link { grid-column: 1 / -1; font-size: 10px; }
.month-card.is-closed { border-color: #abd8c3; background: #f4fcf8; }
.month-card.is-selected { border-color: var(--blue-600); box-shadow: 0 0 0 2px var(--blue-100), var(--shadow); }
.month-number { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; background: #eef2f8; color: var(--navy-900); font-size: 11px; font-weight: 800; }
.closing-action-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; padding: 20px; }
.closing-action-panel h2 { margin: 2px 0 4px; font-size: 19px; }
.closing-action-panel p:not(.eyebrow) { margin: 0; color: var(--muted); }
.closing-action-panel form { margin: 0; }
.closing-checks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-bottom: 12px; }
.closing-check { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 7px 10px; padding: 16px; }
.closing-check h3 { margin: 0; font-size: 12px; }
.closing-check p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.closing-check .text-link { grid-column: 1 / -1; font-size: 10px; }
.closing-run-form { display: flex; align-items: flex-end; justify-content: flex-end; gap: 12px; padding: 18px; }
.closing-run-form .field { width: min(100%, 440px); }
.report-catalog { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.report-card { display: grid; grid-template-columns: 72px minmax(0,1fr); align-items: center; gap: 16px; padding: 21px; }
.report-card-icon { display: grid; width: 72px; height: 58px; place-items: center; border-radius: 12px; background: var(--blue-100); color: var(--blue-700); font-size: 11px; font-weight: 850; }
.report-card h2 { margin: 2px 0 5px; font-size: 16px; }
.report-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.report-card .button { grid-column: 2; justify-self: start; min-height: 36px; }
.regulated-print-header { margin: 0 0 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.regulated-print-header h1 { margin: 0 0 5px; font-size: 18px; }
.regulated-print-header p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.regulated-print-header dl { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin: 11px 0 0; }
.regulated-print-header dl > div { display: flex; gap: 6px; }
.regulated-print-header dt { color: var(--muted); }
.regulated-print-header dd { margin: 0; font-weight: 650; }
.regulated-report-sheet { background: #fff; }
.reconciliation-sheet { padding: 24px; }
.reconciliation-header { margin-bottom: 18px; text-align: center; }
.reconciliation-header h1 { margin: 0 0 5px; font-size: 20px; }
.reconciliation-header p { margin: 3px 0; }
.reconciliation-intro { margin: 0 0 14px; }
.reconciliation-table { min-width: 1120px; }
.reconciliation-table th { text-align: center; }
.reconciliation-table th:first-child, .reconciliation-table td:first-child { width: 38px; text-align: center; }
.reconciliation-table td:nth-child(3), .reconciliation-table td:nth-child(7) { min-width: 250px; }
.reconciliation-conclusion { margin-top: 18px; line-height: 1.55; }
.reconciliation-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 36px; }
.reconciliation-signatures p { margin: 28px 0 8px; white-space: nowrap; }
.reconciliation-signatures small { color: var(--muted); }
.reconciliation-counterparty-option { align-self: end; min-height: 40px; padding-bottom: 8px; }
.vat-book-table { min-width: 2100px; }
.vat-book-table tfoot th { padding: 11px 9px; border-top: 2px solid var(--line-dark); background: #f5f7fa; }
.financial-form-table { min-width: 760px; }
.financial-form-table .is-report-total td,
.document-table .is-report-total td { background: #f4f6f9; font-weight: 800; }
.vat-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 14px; }
.vat-summary-card { display: flex; flex-direction: column; padding: 18px; }
.vat-summary-card span { color: var(--muted); font-size: 10px; }
.vat-summary-card strong { margin: 5px 0 2px; color: var(--navy-950); font-size: 19px; }
.vat-summary-card small { color: var(--muted); font-size: 9px; }
.vat-summary-card.is-result { border-color: #9fcdb8; background: var(--green-100); }
.report-book-links { margin: 14px 0; }

.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.summary-card { display: flex; min-height: 92px; flex-direction: column; justify-content: center; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.summary-card span { color: var(--muted); font-size: 10px; }
.summary-card strong { margin-top: 6px; color: var(--navy-950); font-size: 19px; font-variant-numeric: tabular-nums; }
.input-action-row { display: flex; align-items: stretch; gap: 7px; }
.input-action-row input { min-width: 0; flex: 1; }
.text-danger { color: #a34735 !important; }
.report-form-header .detail-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.report-form-header strong { display: block; line-height: 1.45; }
.report-lines { min-width: 720px; }
.report-lines td:first-child { width: 90px; }
.timesheet-grid { min-width: 2600px; font-size: 9px; }
.timesheet-grid th, .timesheet-grid td { min-width: 72px; padding: 5px 4px; text-align: center; }
.timesheet-grid th small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.timesheet-grid .timesheet-employee { position: sticky; left: 0; z-index: 2; min-width: 245px; max-width: 245px; background: #fff; text-align: left; }
.timesheet-grid thead .timesheet-employee { z-index: 3; background: #f4f6f9; }
.timesheet-grid .timesheet-employee small { display: block; margin-top: 3px; color: var(--muted); white-space: normal; }
.timesheet-grid .is-weekend { background: #f7f8fb; }
.timesheet-grid select, .timesheet-grid input { width: 100%; min-height: 29px; padding: 3px; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; text-align: center; }
.timesheet-grid input { margin-top: 3px; }

@media (max-width: 1050px) {
  .hr-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .month-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .closing-checks { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .vat-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .hr-summary-grid { grid-template-columns: 1fr; }
  .month-grid, .closing-checks, .report-catalog, .vat-summary-grid, .summary-grid { grid-template-columns: 1fr; }
  .closing-action-panel, .closing-run-form { align-items: stretch; flex-direction: column; }
  .closing-action-panel .heading-actions, .closing-run-form .field, .closing-run-form .button { width: 100%; }
  .report-card { grid-template-columns: 58px minmax(0,1fr); padding: 17px; }
  .report-card-icon { width: 58px; }
  .permission-grid { grid-template-columns: 1fr; }
  .compact-filter-bar { align-items: stretch; flex-direction: column; }
}

@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; color: #000; font-size: 9pt; }
  .sidebar, .topbar, .app-footer, .report-screen-heading, .report-screen-toolbar, .no-print,
  .report-screen-warning, .report-book-links, .breadcrumbs, .no-print { display: none !important; }
  .workspace { margin: 0; }
  .main-content { width: 100%; max-width: none; padding: 10mm; }
  .regulated-print-header { display: block; padding: 0 0 8mm; border: 0; box-shadow: none; }
  .panel, .regulated-report-sheet { break-inside: avoid; border: 0; box-shadow: none; }
  .receipt-lines-section { margin: 0 0 8mm; padding: 0; }
  .table-scroll { overflow: visible; }
  .document-table, .vat-book-table, .financial-form-table { min-width: 0; font-size: 7pt; }
  .document-table th, .document-table td { padding: 3px 4px; border: 1px solid #777; }
  .reconciliation-sheet { padding: 0; }
  .reconciliation-table { min-width: 0; font-size: 6.5pt; }
  .reconciliation-table td:nth-child(3), .reconciliation-table td:nth-child(7) { min-width: 0; }
  .reconciliation-signatures { break-inside: avoid; }
  .bank-section-heading { margin-bottom: 5mm; }
  .alert-success, .alert-error { border: 1px solid #777; background: #fff; color: #000; }
}
.table-actions form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: .15rem;
}

.input-compact {
    width: 12rem;
    min-height: 2.25rem;
    padding: .35rem .55rem;
}
.bank-transactions-table { min-width: 1320px; }
.bank-counterparty-form { display: flex; min-width: 320px; align-items: center; gap: 7px; }
.bank-counterparty-form label { min-width: 0; flex: 1; }
.bank-counterparty-form select { width: 100%; min-height: 36px; }
.bank-counterparty-heading { border-color: #9ebce2; background: var(--blue-50); }

.button-danger {
    background: #a32727;
    border-color: #a32727;
    color: #fff;
}

.button-danger:hover {
    background: #861f1f;
    border-color: #861f1f;
}

.danger-zone {
    border: 1px solid #d9a0a0;
    box-shadow: inset .25rem 0 0 #a32727;
}

.verification-code-input {
    font: 700 24px/1.2 "SFMono-Regular", Consolas, monospace;
    letter-spacing: .16em;
    text-align: center;
}

.security-status-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 22px;
}

.security-status-panel h2 { margin: 10px 0 4px; }
.security-status-panel p { margin: 0; color: var(--muted); }
.security-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.security-actions-grid .form-section { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.security-actions-grid .button { align-self: flex-start; margin-top: auto; }
.totp-enrollment-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(320px, 1.15fr); gap: 20px; align-items: stretch; }
.totp-qr-card, .totp-manual-setup { padding: 18px; border: 1px solid var(--line-dark); border-radius: 12px; background: #fff; }
.totp-qr-card { display: flex; flex-direction: column; gap: 16px; align-items: center; text-align: center; }
.totp-qr-card h3, .totp-manual-setup h3 { margin: 0 0 8px; }
.totp-qr-card p { margin: 6px 0 0; }
.totp-qr-code {
    display: grid;
    place-items: center;
    width: 244px;
    min-height: 244px;
    padding: 12px;
    border: 1px solid var(--line-dark);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
}
.totp-qr-code canvas, .totp-qr-code img { display: block; max-width: 100%; height: auto !important; }
.totp-qr-code.is-error { border-color: #d9a0a0; background: #fff5f5; color: #861f1f; }
.totp-manual-setup { min-width: 0; }
.setup-steps { display: grid; gap: 8px; padding-left: 22px; }
.totp-secret {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    background: var(--blue-50);
}
.totp-secret span { color: var(--muted); font-size: 11px; }
.totp-secret code { font-size: clamp(15px, 2.4vw, 21px); font-weight: 800; letter-spacing: .08em; word-break: break-all; }
.breakable-code { display: block; margin-top: 10px; padding: 12px; overflow-wrap: anywhere; background: #f5f7fa; }
.recovery-codes-panel { margin-bottom: 18px; padding: 24px; border-color: #9fcdb8; background: var(--green-100); }
.recovery-code-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.recovery-code-list code { padding: 9px 12px; border: 1px solid #9fcdb8; border-radius: 7px; background: #fff; font-weight: 800; text-align: center; }

@media (max-width: 760px) {
    .security-actions-grid, .recovery-code-list, .totp-enrollment-grid { grid-template-columns: 1fr; }
    .totp-qr-code { width: min(244px, 100%); min-height: 0; aspect-ratio: 1; }
}
