:root {
  color-scheme: light;
  --text: #17263a;
  --sub: #54657b;
  --line: #d6dde5;
  --paper: #fff;
  --bg: #f4f6f9;
  --gold: #ffbf40;
  --active: #fff0c9;
  --blue: #245685;
  font:
    15px/1.45 "Segoe UI",
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
.action {
  cursor: pointer;
  background: white;
  border: 1px solid #bdc9d6;
  border-radius: 6px;
  padding: 0.48rem 0.8rem;
  font-weight: 550;
  min-height: 36px;
}
button:hover {
  background: #f1f5f8;
  border-color: #94a4b8;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
input,
select,
textarea {
  border: 1px solid #bec9d5;
  border-radius: 5px;
  padding: 0.46rem 0.6rem;
  background: white;
  min-width: 0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #7ba8d5;
  outline-offset: 1px;
}
a {
  color: var(--blue);
}
.primary {
  background: var(--gold);
  border-color: #eaaa25;
  color: #242014;
}
.primary:hover {
  background: #f2af27;
}
.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
}
aside {
  border-right: 1px solid var(--line);
  background: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 17px;
  font-size: 23px;
  font-weight: 720;
  letter-spacing: -0.7px;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.nav {
  padding: 10px 9px;
  display: grid;
  gap: 3px;
}
.nav a {
  color: var(--text);
  font-size: 14px;
  font-weight: 570;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  text-decoration: none;
  border-radius: 6px;
}
.nav a:hover {
  background: var(--bg);
}
.nav a.selected {
  background: var(--active);
  color: #4b3308;
}
.ico {
  height: 20px;
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sidebottom {
  margin: auto 10px 15px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.flat {
  border-color: transparent;
  background: transparent;
  color: var(--blue);
}
.zone {
  min-width: 0;
}
.topbar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 11px 24px;
  min-height: 59px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.topbar select {
  max-width: min(420px, 65vw);
  font-weight: 550;
}
.topbar .spacer,
.between {
  margin-left: auto;
}
.mobilemenu {
  display: none;
}
.page {
  padding: 23px clamp(14px, 2.1vw, 34px) 40px;
  max-width: 1800px;
  margin: auto;
}
.title,
.sectionhead,
.tools,
.fields,
.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.title {
  margin-bottom: 20px;
}
.title h1 {
  margin: 0 auto 0 0;
}
.title h1,
.sectionhead h2 {
  letter-spacing: -0.55px;
}
h1 {
  font-size: clamp(25px, 2.5vw, 36px);
  line-height: 1.17;
}
h2 {
  font-size: 20px;
  margin: 0;
}
h3 {
  font-size: 16px;
  margin: 12px 0;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}
.sectionhead {
  justify-content: space-between;
  margin-bottom: 12px;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.metric .ico {
  color: #946417;
  margin-top: 3px;
}
.metric:first-child {
  background: #fffaec;
  border-color: #e7ca83;
}
.metric span {
  display: block;
  color: var(--sub);
  font-size: 13px;
  font-weight: 600;
}
.metric strong {
  display: block;
  font-size: clamp(20px, 1.9vw, 30px);
  letter-spacing: -0.8px;
  overflow-wrap: anywhere;
}
.dashmid {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(215px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.quick {
  display: grid;
  gap: 9px;
  align-content: start;
}
.quick button {
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px;
}
.home-metric, .home-day {color:inherit;text-decoration:none}
.home-metric small {display:block;margin-top:3px;color:var(--sub)}
.home-metric:hover,.home-command:hover {border-color:#b68a3d}
.home-command {display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border:1px solid var(--line);border-radius:8px;text-decoration:none;color:inherit;font-weight:600;background:white}
.home-command.primary {background:var(--gold);border-color:#eaaa25}
.home-shortcuts {display:flex;flex-wrap:wrap;gap:5px 16px}
.home-bars {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:clamp(3px,1vw,12px);margin-top:12px}
.home-day {display:grid;grid-template-rows:122px auto auto;text-align:center;min-width:0;border-radius:4px}
.home-day:hover,.home-day:focus-visible {background:#fff7e6}
.home-plot {position:relative;display:block;margin:4px 0}
.home-plot::after {content:"";position:absolute;left:0;right:0;top:var(--zero);border-top:1px solid #75828a}
.home-plot i {position:absolute;left:20%;width:60%;border-radius:3px;background:#d9921e}
.home-plot i.negative {background:#ad5542}
.home-day b {font-size:12px;white-space:nowrap}
.home-day time {font-size:12px;color:var(--sub)}
.home-detail {margin-bottom:16px}
.home-detail .tools {align-items:center}
.gridwrap {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #e1e6ec;
  vertical-align: middle;
}
th {
  background: #f0f3f6;
  color: #41536a;
  font-weight: 620;
  white-space: nowrap;
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.doclink {
  color: var(--blue);
  font-weight: 620;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  font-size: 12px;
  white-space: nowrap;
  color: #206142;
  background: #dbf1e4;
  padding: 2px 8px;
  border-radius: 4px;
}
.badge.draft {
  color: #70541a;
  background: #fff0ce;
}
.badge.archive {
  background: #e8edf5;
  color: #465768;
}
.empty {
  color: var(--sub);
  text-align: center;
  padding: 25px 10px;
}
.muted,
small {
  color: var(--sub);
}
.tools,
.fields {
  margin-bottom: 14px;
  align-items: end;
}
.fields label,
.tools label,
.login label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}
.fields input,
.fields select {
  width: 100%;
}
.fields label {
  flex: 1;
  min-width: 140px;
}
.rowline {
  margin: 14px 0;
}
.editor {
  display: grid;
  gap: 15px;
}
.editor .panel {
  padding: 16px;
}
.editrows input[type="number"] {
  width: 100px;
}
.editrows td:first-child {
  min-width: 160px;
}
.picker {
  position: relative;
  max-width: 700px;
}
.picker input {
  width: 100%;
}
.picks {
  display: grid;
  max-height: 210px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: white;
}
.picks:empty {
  border: 0;
}
.picks button {
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.tfoot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  gap: 8px;
}
.error {
  color: #983d26;
  background: #fff2eb;
  border: 1px solid #edc3b9;
  padding: 12px;
  border-radius: 6px;
  white-space: pre-line;
}
.login {
  max-width: 445px;
  margin: 12vh auto;
  padding: 24px;
}
.login .brand {
  padding: 0;
}
.login h1 {
  font-size: 23px;
  margin: 24px 0 16px;
}
.login form {
  display: grid;
  gap: 12px;
}
.login .flat {
  margin-top: 12px;
}
.mono {
  font-family: Consolas, monospace;
  font-size: 13px;
  overflow: auto;
  max-height: 50vh;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.block {
  display: block;
  width: 100%;
}
#notice {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #25364c;
  color: white;
  border-radius: 7px;
  padding: 11px 16px;
  z-index: 20;
  max-width: 90vw;
}
.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 96vw;
  color: var(--text);
}
.modal::backdrop {
  background: #1b2b4090;
}
.screenprint {
  display: none;
}
@media (max-width: 980px) {
  .shell {
    grid-template-columns: 168px minmax(0, 1fr);
  }
  .brand {
    font-size: 20px;
    padding: 16px 10px;
  }
  .nav a {
    padding: 9px 7px;
  }
  .page {
    padding: 18px 12px;
  }
  .summary {
    gap: 7px;
  }
  .metric {
    padding: 12px;
  }
  .metric .ico {
    display: none;
  }
  .dashmid {
    gap: 10px;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .shell aside {
    display: none;
  }
  .shell.menu aside {
    display: flex;
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    height: calc(100dvh - 56px);
    width: 245px;
    z-index: 9;
    box-shadow: 12px 0 32px #28364b35;
  }
  .mobilemenu {
    display: inline-flex;
  }
  .topbar {
    padding: 8px;
    gap: 6px;
    min-height: 56px;
  }
  .shoplabel {
    display: none;
  }
  .topbar select {
    max-width: calc(100vw - 120px);
    flex: 1;
  }
  .topbar .install {
    font-size: 0;
  }
  .topbar .install::after {
    content: "↓";
    font-size: 18px;
  }
  .summary {
    grid-template-columns: 1fr 1fr;
  }
  .dashmid {
    display: block;
  }
  .quick {
    margin-top: 10px;
  }
  .quick button {
    padding: 8px;
  }
  .page {
    padding: 16px 10px;
  }
  .panel {
    padding: 12px;
  }
  .title {
    gap: 7px;
    margin-bottom: 13px;
  }
  .title h1 {
    width: 100%;
  }
  .sectionhead h2,
  h2 {
    font-size: 18px;
  }
  .fields label {
    min-width: 120px;
  }
  .home-day {grid-template-rows:96px auto auto}
  td,
  th {
    padding: 7px;
  }
  .login {
    margin: 6vh 10px;
  }
  .login .brand {
    display: flex;
  }
  .tools button {
    font-size: 14px;
  }
}
@media screen and (max-width: 720px) {
  .movement-table, .movement-table tbody, .movement-table tr {
    display: block;
  }
  .movement-table thead {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  .movement-table tr {
    padding: .6rem 0;
    border-bottom: 1px solid #d5dadf;
  }
  .movement-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 42%) 1fr;
    gap: .5rem;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: .2rem .4rem;
  }
  .movement-table td::before {
    content: attr(data-label);
    color: #53636b;
  }
}
@media print {
  body {
    background: white;
  }
  .shell {
    display: block;
  }
  .shell aside,
  .topbar,
  .tools,
  .title button,
  .noPrint,
  #notice,
  .nav {
    display: none !important;
  }
  .page {
    padding: 0;
    max-width: none;
  }
  .panel {
    border: 0;
    padding: 0;
  }
  .gridwrap {
    overflow: visible;
  }
  .screenprint {
    display: block;
  }
  button {
    border: 0 !important;
  }
  .badge {
    color: black;
  }
  table {
    font-size: 10pt;
  }
  thead {
    display: table-header-group;
  }
}

.nav {
  overflow-y: auto;
  min-height: 0;
}
.sidebottom {
  flex: none;
}
.title,
.topbar {
  overflow-wrap: anywhere;
}

.worktabs {
  display: none;
}
@media (min-width: 721px) {
  .workspace {
    display: block;
  }
  .workspace aside {
    display: none;
  }
  .workspace .mobilemenu {
    display: inline-flex;
  }
  .workspace.menu aside {
    display: flex;
    position: fixed;
    left: 8px;
    top: 60px;
    height: min(85dvh, 780px);
    width: 222px;
    z-index: 11;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 24px #17263a20;
  }
  .workspace .worktabs {
    display: flex;
    gap: 3px;
    align-items: end;
    border-bottom: 1px solid #c5cdd7;
    padding: 8px clamp(14px, 2.1vw, 34px) 0;
    background: white;
    min-height: 44px;
  }
  .worktabs a,
  .worktabs summary {
    display: block;
    color: var(--text);
    text-decoration: none;
    padding: 7px clamp(8px, 1vw, 18px);
    font-size: 14px;
    cursor: pointer;
    background: #f3f5f7;
    border: 1px solid #d5dce3;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
  }
  .worktabs [aria-current="page"] {
    background: #ffedbe;
    border-color: #e4c47f;
    box-shadow: inset 0 -2px #c38b24;
    font-weight: 650;
  }
  .worktabs details {
    position: relative;
  }
  .worktabs details > div {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 190px;
    background: white;
    box-shadow: 0 6px 16px #28364b26;
    padding: 4px;
    z-index: 6;
    border: 1px solid var(--line);
  }
  .worktabs details > div a {
    background: white;
    border: 0;
    border-radius: 3px;
  }
  .worktabs a:hover,
  .worktabs summary:hover {
    background: #ffefc9;
  }
  .workspace .page {
    padding-top: 16px;
  }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  #install {
    display: none;
  }
}

.source-tree {
  margin-top: 12px;
  max-height: 65vh;
  overflow: auto;
  font: 13px/1.5 ui-monospace, Consolas, monospace;
}
.source-tree summary {
  cursor: pointer;
  padding: 3px 0;
  overflow-wrap: anywhere;
}
.source-children {
  padding-left: 12px;
  border-left: 1px solid #ccd5d5;
}
.source-value {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  padding: 2px 0;
  overflow-wrap: anywhere;
}
.source-value span {white-space: pre-wrap}
.shift-fields { display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px 18px;margin:12px 0 20px }
.shift-fields dt { color:#53636b;font-size:.86rem }
.shift-fields dd { margin:2px 0 0;font-weight:600;overflow-wrap:anywhere }
.shift-detail { scroll-margin-top:12px }

.local-draft-row {display:grid;grid-template-columns: minmax(0,1fr) auto;align-items:center;gap:4px 12px;padding:10px 0;border-bottom:1px solid var(--line)}
.local-draft-row .doclink,.local-draft-row small {grid-column:1;overflow-wrap:anywhere;justify-self:start}
.local-draft-row>button:not(.doclink) {grid-column:2;grid-row:1/3}
.draft-preview {grid-column:1/-1}
.editor-local-status {display:block;margin:4px 0 12px;color:#425c54}

@media screen and (max-width:720px) {
  .home-docs,.home-docs tbody {display:block}
  .home-docs thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .home-docs tr {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,auto);gap:3px 8px;padding:8px 0;border-bottom:1px solid var(--line)}
  .home-docs td {padding:0;border:0;white-space:normal;overflow-wrap:anywhere}
  .home-docs td:nth-child(3) {grid-area:1/1;font-weight:600}
  .home-docs td:nth-child(4) {grid-area:1/2;font-weight:600}
  .home-docs td:nth-child(2) {grid-area:2/1}
  .home-docs td:nth-child(5) {grid-area:2/2;text-align:right}
  .home-docs td:first-child {grid-area:3/1/4/-1;color:var(--sub);font-size:12px}
}

.stock-report .paging[hidden],.stock-report [hidden] {display:none}
.stock-report .stock-asof,.stock-report .stock-zone {color:var(--sub)}
.stock-report .paging {justify-content:center;margin-top:12px}
.stock-report .more {margin-top:12px}
@media screen and (max-width:720px) {
  .stock-report table,.stock-report tbody {display:block}
  .stock-report thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .stock-report tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px;border-bottom:1px solid var(--line);padding:10px 0}
  .stock-report td {display:block;padding:0;border:0;text-align:left;overflow-wrap:anywhere;white-space:normal}
  .stock-report td:first-child {grid-column:1/-1;font-weight:600}
  .stock-report td:not(:first-child)::before {content:attr(data-label);display:block;color:var(--sub);font-size:12px}
}

.picker-mode {display:flex;align-items:center;gap:7px;margin:9px 0}
.picker-mode input {width:auto}
.pick-dialog {width:min(410px,94vw);padding:18px}
.pick-dialog h2 {margin-top:0}
.pick-dialog .fields {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pick-dialog input,.pick-dialog select {max-width:100%;width:100%}
.pick-dialog [hidden] {display:none}
.pick-dialog .pick-code,.pick-dialog .picked-name {overflow-wrap:anywhere}
.pick-dialog .tools {margin:16px 0 0}
.picker-status:empty {display:none}
.picker-status {margin:6px 0;color:#315b49;overflow-wrap:anywhere}
.picker-status.error {color:#893a24}

.inventory-scan {border:1px solid var(--line);border-radius:6px;margin:12px 0;padding:8px 12px}
.inventory-scan .tools,.inventory-scan-status {margin:4px 0}
.inventory-scan-status {overflow-wrap:anywhere}
.inventory-sheet .differences {font-weight:600}
.inventory-missing {padding:8px 0}
.inventory-choice {width:min(420px,94vw);padding:16px}
.inventory-choice select {width:100%;max-width:100%}
@media screen and (max-width:720px) {
  .inventory-sheet table,.inventory-sheet tbody {display:block}
  .inventory-sheet thead {display:block}
  .inventory-sheet thead th:not(:first-child) {display:none}
  .inventory-sheet thead tr {display:block;padding:0}
  .inventory-sheet thead th:first-child::after {content:"Отметить все товары по отбору";margin-left:8px}
  .inventory-sheet tbody tr {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 9px;border-bottom:1px solid var(--line);padding:9px 0;align-items:start}
  .inventory-sheet td {display:block;padding:0;border:0;text-align:left;overflow-wrap:anywhere;white-space:normal}
  .inventory-sheet td:first-child {grid-column:3;grid-row:1;text-align:right}
  .inventory-sheet td:nth-child(2) {grid-column:1/3;grid-row:1;font-weight:600}
  .inventory-sheet td:nth-child(3),.inventory-sheet td:nth-child(4) {grid-row:2}
  .inventory-sheet td:nth-child(n+5) {grid-row:3}
  .inventory-sheet td:nth-child(n+3)::before {display:block;color:var(--sub);font-size:12px}
  .inventory-sheet td:nth-child(3)::before {content:"Ед. изм."}
  .inventory-sheet td:nth-child(4)::before {content:"Цена"}
  .inventory-sheet td:nth-child(5)::before {content:"Учёт"}
  .inventory-sheet td:nth-child(6)::before {content:"Факт"}
  .inventory-sheet td:nth-child(7)::before {content:"Отклонение"}
  .inventory-sheet td .fact {max-width:100%}
}

.staff-calendar {overflow:auto}
.staff-calendar table {width:100%;table-layout:fixed}
.staff-calendar th,.staff-calendar td {vertical-align:top;white-space:normal;overflow-wrap:anywhere}
.staff-span {display:block;background:#e4f2e9;border-left:3px solid #3b805e;padding:5px;margin:2px 0}
.staff-span.incomplete {background:#fff0d9;border-color:#ac7226}
.staff-span.long {background:#ffe5de;border-color:#b95139}
.staff-span small {display:block}
.staff-report [hidden] {display:none}
@media screen and (max-width:720px) {
  .staff-calendar table,.staff-calendar tbody,.staff-calendar tr,.staff-calendar th,.staff-calendar td,.staff-table,.staff-table tbody {display:block}
  .staff-calendar thead,.staff-table thead,.staff-calendar td:empty {display:none}
  .staff-calendar td::before {content:attr(data-day);color:var(--sub)}
  .staff-table tr {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px;border-bottom:1px solid var(--line);padding:8px 0}
  .staff-table td {display:block;border:0;padding:0;white-space:normal;overflow-wrap:anywhere}
  .staff-table td::before {display:block;content:attr(data-label);font-size:12px;color:var(--sub)}
}
.journal-labels {margin:8px 0}
.gridwrap .home-docs input[type=checkbox] {width:17px;height:17px;min-height:0;vertical-align:middle;margin:0 8px 0 0}
.editor [hidden] {display:none!important}
@media screen and (max-width:720px){
  .editrows.revaluation,.editrows.revaluation tbody{display:block;width:100%}
  .editrows.revaluation thead{display:none}
  .editrows.revaluation tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 10px;border-bottom:1px solid var(--line);padding:10px 0}
  .editrows.revaluation td{display:block;min-width:0;border:0;padding:0;white-space:normal}
  .editrows.revaluation td:first-child{grid-column:1;grid-row:1;font-weight:600;overflow-wrap:anywhere;min-width:0}
  .editrows.revaluation td:last-child{grid-column:2;grid-row:1;text-align:right}
  .editrows.revaluation td:not(:first-child):not(:last-child)::before{content:attr(data-label);display:block;font-size:12px;color:var(--sub)}
  .editrows.revaluation input[type=number]{width:100%;min-width:0}
}

.catalog-absent{display:inline-block;margin:.15em .3em;padding:.1em .45em;border:1px solid #aa814b;border-radius:.35em;color:#704311;background:#fff2db;font-size:.78em;white-space:nowrap}

.link-shop{display:flex;align-items:center;gap:.6em;margin:.4em 0}.link-shop input[type=checkbox]{width:auto;margin:0}
