/* VOICE: рабочий журнал мебельного производства — точно, спокойно
   IDEA: планшет мастера: расчерченные ведомости, путь заказа от дизайнера до монтажа
   PICTURE: сама система — воронка стадий и ведомость заказов на первом экране
   COLOUR and TYPE: камень #e7e4df, чёрный, кирпич #c8371e, белые листы; Schibsted Grotesk
   LAYOUT: шапка с модулями, под ней ведомость; на телефоне строки складываются в карточки */
:root {
  color-scheme: light dark;
  --bg: light-dark(#e7e4df, #171513);
  --panel: light-dark(#fff, #211e1b);
  --ink: light-dark(#141210, #eee9e3);
  --mut: light-dark(#6b655d, #a39b90);
  --line: light-dark(#d6d1c9, #38332d);
  --brick: #c8371e;
  --brick2: light-dark(#fbe6e1, #3a1e17);
  --ok: light-dark(#2f6b3a, #7fc28b);
  --okb: light-dark(#e3efe3, #1d2c1f);
  --warn: light-dark(#8a5a00, #e7b75a);
  --warnb: light-dark(#f7ecd4, #33280f);
  --info: light-dark(#24557a, #8bb8dc);
  --infob: light-dark(#e2ecf4, #1a2733);
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
  min-width: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.5 "Schibsted Grotesk",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  overflow-x: clip;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
header {
  background: #141210;
  color: #e7e4df;
  padding: 12px max(4vw, 16px) 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.brand b {
  color: var(--brick);
}
.who {
  font-size: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid currentColor;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.sync {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sync i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7fc28b;
  display: inline-block;
}
.sync.off i {
  background: var(--brick);
}
.lo {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  border-radius: 99px;
  padding: 2px 10px;
  font-size: 13px;
  cursor: pointer;
  min-height: 30px;
}
nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  margin-top: 10px;
  scrollbar-width: none;
}
nav a {
  flex: none;
  color: inherit;
  opacity: 0.72;
  text-decoration: none;
  padding: 10px 13px;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  min-height: 44px;
  display: flex;
  align-items: center;
}
nav a:hover {
  opacity: 1;
}
nav a.on {
  background: var(--bg);
  color: var(--ink);
  opacity: 1;
}
main {
  padding: clamp(18px, 3vw, 34px) max(4vw, 16px) 60px;
  max-width: 1360px;
  margin: 0 auto;
}
h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  margin: 0 0 4px;
  text-wrap: balance;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 20px;
  margin: 0 0 12px;
}
h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.sub {
  color: var(--mut);
  margin: 0 0 18px;
}
.bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.bar .grow {
  flex: 1 1 200px;
}
.btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.pri {
  background: var(--brick);
  border-color: var(--brick);
  color: #fff;
}
.btn.sm {
  min-height: 36px;
  padding: 0 10px;
  font-size: 14px;
}
.btn.dang {
  color: var(--brick);
  border-color: var(--brick);
}
.btn.ghost {
  background: transparent;
}
:focus-visible {
  outline: 3px solid var(--brick);
  outline-offset: 2px;
}
input,
select,
textarea {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 16px;
  width: 100%;
}
textarea {
  min-height: 64px;
  resize: vertical;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
}
.grid2e {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}
.kpi .v {
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.kpi .l {
  color: var(--mut);
  font-size: 14px;
  margin-top: 6px;
}
.kpi.alert .v {
  color: var(--brick);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--mut);
  font-size: 13px;
  padding: 8px;
  border-bottom: 2px solid var(--ink);
}
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
td.n,
th.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
td.nw {
  white-space: nowrap;
}
tr.late td:first-child {
  box-shadow: inset 3px 0 var(--brick);
}
tr.click {
  cursor: pointer;
}
tr.click:hover td {
  background: color-mix(in srgb, var(--bg) 55%, transparent);
}
.st {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid transparent;
}
.st.new,
.st.plan,
.st.s-new {
  border-color: var(--line);
}
.st.design,
.st.eng,
.st.s-analysis {
  background: var(--infob);
  color: var(--info);
}
.st.prod,
.st.planned,
.st.s-action {
  background: var(--warnb);
  color: var(--warn);
}
.st.inwork,
.st.work,
.st.s-check {
  background: var(--brick2);
  color: var(--brick);
}
.st.done,
.st.ship,
.st.s-closed {
  background: var(--okb);
  color: var(--ok);
}
.st.closed {
  background: var(--line);
  color: var(--mut);
}
.okt {
  color: var(--ok);
  font-weight: 500;
}
.bad {
  color: var(--brick);
  font-weight: 500;
}
.note {
  font-size: 14px;
  color: var(--mut);
}
.acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.pipe {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  margin-right: 8px;
}
.pipe i {
  width: 16px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
.pipe i.d {
  background: var(--ink);
}
.pipe i.c {
  background: var(--brick);
}
.stage-cell b {
  display: block;
  font-weight: 500;
}
.hb {
  display: grid;
  gap: 8px;
}
.hrow {
  display: grid;
  grid-template-columns: minmax(6em, 13em) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
.track {
  height: 14px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.fill {
  height: 100%;
  background: var(--ink);
  border-radius: 4px;
}
.fill.over,
.fill.r {
  background: var(--brick);
}
.fill.i {
  background: var(--info);
}
.fill.w {
  background: var(--warn);
}
.fill.o {
  background: var(--ok);
}
.vb {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 190px;
  padding-top: 18px;
}
.vb div {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  font-size: 12px;
  color: var(--mut);
  gap: 4px;
}
.vb span.c {
  background: var(--ink);
  width: 70%;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
}
.vb span.c.r {
  background: var(--brick);
}
.vb em {
  font-style: normal;
  color: var(--ink);
  font-weight: 500;
}
.funnel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}
.funnel a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 2px;
}
.funnel a:hover {
  border-color: var(--ink);
}
.funnel .v {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.funnel .l {
  font-size: 14px;
  color: var(--mut);
}
.funnel .w {
  font-size: 13px;
}
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
}
.col {
  background: color-mix(in srgb, var(--panel) 45%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  scroll-snap-align: start;
  display: grid;
  gap: 8px;
  align-content: start;
}
.col h3 {
  display: flex;
  justify-content: space-between;
  margin: 4px 4px 2px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  text-align: left;
  width: 100%;
}
.card:hover {
  border-color: var(--ink);
}
.card.late {
  box-shadow: inset 3px 0 var(--brick);
}
.card .t {
  font-weight: 700;
}
.card .m {
  font-size: 13px;
  color: var(--mut);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}
.spec h3 {
  margin: 0 0 2px;
  font-size: 18px;
}
.spec .m {
  color: var(--mut);
  font-size: 14px;
}
.spec table {
  table-layout: fixed;
}
.spec td.n {
  width: 7.5em;
}
.spec td {
  overflow-wrap: anywhere;
}
.route {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 10px 0;
  font-size: 13px;
}
.route span {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}
.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.filters button {
  flex: none;
  min-height: 36px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0 12px;
  cursor: pointer;
  font-size: 14px;
}
.filters button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.subnav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
  overflow-x: auto;
}
.subnav a {
  padding: 10px 14px;
  text-decoration: none;
  color: var(--mut);
  font-weight: 500;
  flex: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.subnav a.on {
  color: var(--ink);
  box-shadow: inset 0 -3px var(--brick);
}
.banner.ok {
  background: var(--okb);
  color: var(--ok);
}
.banner {
  background: var(--warnb);
  color: var(--warn);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.empty {
  padding: 28px;
  text-align: center;
  color: var(--mut);
}
.load {
  display: grid;
  gap: 10px;
}
.lrow {
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr) 4.5em;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}
dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(700px, 95vw);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 20px 60px #0006;
}
dialog.wide {
  width: min(980px, 96vw);
}
dialog::backdrop {
  background: #0008;
}
.dh {
  padding: 18px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.dh h2 {
  margin: 0;
}
.db {
  padding: 16px 20px;
  max-height: 72vh;
  overflow: auto;
  display: grid;
  gap: 12px;
}
.df {
  padding: 0 20px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.df .sp {
  flex: 1;
}
label {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--mut);
}
label.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
}
label.chk input {
  width: 22px;
  min-height: 22px;
  height: 22px;
}
.row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.row4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 12px;
  margin: 0;
}
legend {
  font-weight: 700;
  padding: 0 6px;
}
.lines {
  display: grid;
  gap: 8px;
}
.line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 6em 44px;
  gap: 6px;
}
.line.m3 {
  grid-template-columns: minmax(0, 2fr) 7em 44px;
}
.blk {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.blk .w2 {
  grid-column: span 2;
}
.blk .w4 {
  grid-column: 1/-1;
}
.why {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.why b {
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  text-align: center;
  padding: 10px 0;
  font-size: 14px;
}
.emp-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.emp-pick label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 12px;
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.emp-pick input {
  width: 18px;
  min-height: 18px;
  height: 18px;
}
.x {
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
}
.tl {
  display: grid;
  gap: 0;
}
.tl div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 12px;
  position: relative;
}
.tl div::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  margin: 6px 5px 0;
}
.tl div.d::before {
  background: var(--ink);
}
.tl div.c::before {
  background: var(--brick);
  box-shadow: 0 0 0 4px var(--brick2);
}
.tl b {
  font-weight: 500;
}
.kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px 18px;
}
.kv div {
  display: grid;
}
.kv span {
  font-size: 13px;
  color: var(--mut);
}
.hist {
  font-size: 14px;
  display: grid;
  gap: 6px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 60;
  max-width: 92vw;
  pointer-events: none;
}
#toast .tst {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 8px;
  max-width: 92vw;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  pointer-events: auto;
  animation: tst-in 0.2s;
}
#toast .tst.error {
  background: #9b2c2c;
  color: #fff;
  border: 1px solid #c75a5a;
}
#toast .tst .x {
  background: none;
  border: 0;
  color: inherit;
  font-size: 16px;
  line-height: 1;
  min-width: 28px;
  min-height: 28px;
  cursor: pointer;
  opacity: 0.85;
}
@keyframes tst-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
#login {
  position: fixed;
  inset: 0;
  background: var(--ink);
  display: none;
  place-items: center;
  z-index: 20;
  padding: 16px;
}
#login.on {
  display: grid;
}
#login form {
  background: var(--panel);
  color: var(--ink);
  border-radius: 16px;
  padding: 28px;
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
}
#login h1 {
  font-size: 28px;
}
#login .err {
  color: var(--brick);
  min-height: 1.4em;
  font-size: 14px;
}
@media (max-width: 900px) {
  .grid2,
  .grid2e {
    grid-template-columns: minmax(0, 1fr);
  }
  .funnel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .row4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  table {
    font-size: 14px;
  }
  .stack thead {
    display: none;
  }
  .stack tr {
    display: grid;
    padding-block: 10px;
    border-bottom: 1px solid var(--line);
  }
  .stack td {
    display: flow-root;
    border: 0;
    padding: 3px 0;
    padding-inline-start: 8em;
    text-align: start;
  }
  .stack td::before {
    content: attr(data-l);
    float: inline-start;
    width: 7.5em;
    margin-inline-start: -8em;
    white-space: normal;
    color: var(--mut);
    font-size: 13px;
  }
  .stack td:empty {
    display: none;
  }
  .acts {
    justify-content: flex-start;
  }
  .row2,
  .row3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .row4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .line {
    grid-template-columns: minmax(0, 1fr) 5em 44px;
  }
  .line .shopsel {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .lrow {
    grid-template-columns: 6.5em minmax(0, 1fr) 4em;
  }
  .funnel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blk {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hrow {
    grid-template-columns: minmax(0, 7em) minmax(0, 1fr) auto;
  }
  .vb {
    height: 150px;
  }
  .vb div {
    font-size: 10px;
  }
  .brand {
    font-size: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #toast .tst {
    animation: none;
  }
}

[hidden] {
  display: none !important;
}
.context-tools {
  margin-block: 12px;
}
.sample-guide {
  background: #fff6de;
  border-left: 4px solid #966c23;
  padding: 12px 16px;
  margin: 12px auto;
  max-width: 1180px;
}
.sample-guide:empty {
  display: none;
}
.sample-guide p {
  margin: 6px 0;
}
.sample-steps {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
#feature {
  max-width: 96vw;
  width: 1200px;
  height: 92dvh;
  padding: 0;
  border: 1px solid var(--line);
}
#feature[open] {
  display: flex;
  flex-direction: column;
}
#feature .dh {
  flex-shrink: 0;
}
#feature-frame {
  border: 0;
  width: 100%;
  flex: 1;
  min-height: 0;
}
@media (max-width: 680px) {
  #feature {
    max-width: 100vw;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  .sample-steps .btn {
    font-size: 13px;
  }
}

/* Реестр заказов */
.order-screen #view {
  max-width: var(--pagew, calc(1206px + 2 * max(4vw, 16px)));
}
.orders-title {
  position: relative;
}
.orders-menu {
  position: absolute;
  right: 0;
  top: 0;
  z-index: 4;
}
.orders-menu summary {
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0 8px;
  height: 38px;
  font-size: 14px;
  color: var(--mut);
  border-radius: 8px;
  list-style: none;
}
.orders-menu summary:hover,
.orders-menu[open] summary {
  background: var(--panel);
}
.orders-menu summary::-webkit-details-marker {
  display: none;
}
.menu-panel {
  position: absolute;
  right: 0;
  top: 42px;
  background: var(--panel);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 260px;
  box-shadow: 0 6px 18px #0002;
  max-height: 75vh;
  overflow: auto;
}
.menu-panel .context-tools {
  display: grid;
  gap: 2px;
  margin: 0;
}
.menu-panel .btn {
  min-height: 34px;
  justify-content: flex-start;
  border: 0;
  padding: 4px 10px;
  font-size: 14px;
  border-radius: 6px;
}
.menu-panel .btn:hover {
  background: var(--bg);
}
.order-screen .bar.filters {
  margin-bottom: 16px;
}
.order-list .acts {
  justify-content: flex-start;
  margin-top: 5px;
}
.order-list td {
  overflow-wrap: anywhere;
}
.order-list .btn.pri {
  white-space: normal;
  line-height: 1.2;
  font-weight: 600;
}
.order-list td:first-child .bad {
  display: block;
}
.oc-order {
  width: 19%;
}
.oc-stage {
  width: 21%;
}
.oc-owner {
  width: 16%;
}
.oc-date {
  width: 8.8%;
}
.order-list th small {
  display: block;
  color: var(--mut);
  font-size: 12px;
  font-weight: 400;
}
.order-list .schedule-date {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.order-list .st {
  white-space: normal;
}
@media (min-width: 901px) {
  .order-list table {
    table-layout: fixed;
  }
  .order-list th.n,
  .order-list td.n {
    padding-inline: 4px;
  }
}
@media (min-width: 901px) and (max-width: 1120px) {
  .order-list .schedule-date {
    font-size: 13px;
  }
  .order-list th small {
    font-size: 10px;
  }
  .order-list .pipe {
    display: flex;
    margin: 0 0 4px;
  }
}
@media (max-width: 900px) {
  .order-list colgroup,
  .order-list thead {
    display: none;
  }
  .order-list tr {
    display: grid;
    padding-block: 12px;
    border-bottom: 1px solid var(--line);
  }
  .order-list td {
    display: flow-root;
    border: 0;
    padding: 4px 0 4px 8em;
    text-align: start;
  }
  .order-list td::before {
    content: attr(data-l);
    float: inline-start;
    width: 7.5em;
    margin-inline-start: -8em;
    color: var(--mut);
    font-size: 13px;
  }
  .order-list td.schedule-date {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 4px 0;
    text-align: end;
  }
  .order-list td.schedule-date::before {
    float: none;
    width: auto;
    margin: 0;
    text-align: start;
    white-space: normal;
  }
  .order-list .pipe {
    display: flex;
    margin: 0 0 4px;
  }
}
@media (max-width: 600px) {
  .order-screen #view {
    padding-top: 15px;
  }
  .order-screen #oq {
    flex-basis: 100%;
  }
}
#derror {
  color: var(--brick);
  margin: 0 20px 10px;
}
#derror:empty {
  display: none;
}
.shiftbar label {
  min-width: 10em;
}
.shiftbar {
  align-items: flex-end;
}
.shiftbar .steps {
  margin-left: auto;
}
.shiftlist .acts {
  justify-content: flex-start;
}
.shiftlist .btn {
  min-height: 36px;
}
.shiftlist .empty {
  padding: 24px;
}
.shiftlist h2 {
  margin-bottom: 4px;
}
.shiftlist td {
  overflow-wrap: anywhere;
}
.shiftlist td:last-child {
  min-width: 125px;
}
#nav {
  scrollbar-width: thin;
}
#nav a {
  padding-inline: 10px;
}
.shiftload summary {
  cursor: pointer;
  font-weight: 600;
}
.shiftload[open] summary {
  margin-bottom: 12px;
}
@media (max-width: 700px) {
  header {
    padding-inline: 10px;
  }
  .shiftbar label {
    flex: 1 1 130px;
  }
  .shiftbar .steps {
    margin-left: 0;
  }
  .who {
    font-size: 12px;
  }
  .df .sp {
    display: none;
  }
  .db {
    max-height: 58dvh;
  }
  .orders-menu {
    position: static;
  }
  .orders-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .bar.filters {
    flex-wrap: wrap;
  }
  .shiftlist td:last-child {
    min-width: 0;
  }
}
.order-number {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
@media (max-width: 700px) {
  #nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 6px;
  }
  #nav a {
    justify-content: center;
    text-align: center;
    padding: 3px;
    min-height: 30px;
    font-size: 13px;
    line-height: 1.1;
    border-radius: 5px;
  }
  header {
    padding-bottom: 4px;
  }
}
.dh {
  justify-content: flex-start;
  align-items: center;
}
.dh #dtitle {
  overflow-wrap: anywhere;
}
.summary-screen #view {
  max-width: var(--pagew, calc(1206px + 2 * max(4vw, 16px)));
}
.summary-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.summary-heading > .btn {
  font-size: 13px;
  min-height: 34px;
}
.summary-heading .sub {
  margin-top: 4px;
}
.summary-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.summary-kpis .kpi {
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.summary-kpis .kpi:hover,
.summary-kpis .kpi:focus-visible {
  border-color: var(--ink);
}
.summary-kpis .v,
.summary-kpis .l {
  display: block;
}
.summary-detail {
  align-items: start;
}
.summary-switch {
  margin: 0 0 12px;
  flex-wrap: wrap;
}
.chart-date {
  max-width: 11.5em;
  margin: 0 0 10px;
}
.summary-bar {
  display: grid;
  grid-template-columns: minmax(7em, 1.2fr) minmax(2em, 2fr) 3.4em;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 4px 0;
  cursor: pointer;
  font-size: 14px;
}
.summary-bar:hover {
  background: var(--bg);
}
.summary-bar > span:last-child {
  text-align: right;
}
.summary-bar .track,
.summary-bar .fill {
  display: block;
}
#material-shortage:focus {
  outline: 2px solid var(--brick);
  outline-offset: 2px;
}
#material-shortage p:last-child {
  margin-bottom: 0;
}
@media (max-width: 800px) {
  .summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-heading {
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
}

.summary-heading .orders-menu {
  position: relative;
  top: auto;
  right: auto;
}
.summary-heading > .orders-menu {
  flex: none;
}

.staff-warning {
  padding: 12px 14px;
  margin: 0 0 16px;
  border-radius: 8px;
  background: var(--warnb);
  color: var(--warn);
  font-size: 14px;
}
.staff-directory .btn,
.staff-page td .btn {
  min-height: 36px;
  padding: 0 10px;
  font-size: 14px;
}
.staff-page .note {
  font-size: 14px;
}
.staff-page .panel > p:last-child {
  margin-bottom: 0;
}
@media (min-width: 761px) {
  .staff-directory td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .staff-directory td:first-child {
    width: 34%;
  }
}

.order-list .schedule-date small.bad,
.kv small.bad {
  display: block;
  font-size: 0.77rem;
  margin-top: 0.2rem;
}

.order-contract {
  min-width: 0;
  border: 1px solid var(--line, #d9e1dd);
  border-radius: 8px;
  margin: 14px 0;
  padding: 8px 12px;
}
.order-contract p {
  margin: 8px 0 2px;
}
.order-extra {
  margin-top: 12px;
}
.order-extra summary {
  cursor: pointer;
}
.order-extra .row2 {
  margin-top: 6px;
}

/* ---------- вкладки раздела ---------- */
/* вкладки раздела переносятся на вторую строку, а не прячутся за краем; на телефоне — прокрутка вбок */
.section-tabs {
  margin: -4px 0 18px;
  flex-wrap: wrap;
  row-gap: 2px;
}
@media (max-width: 700px) {
  .section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}
.section-tabs a {
  white-space: nowrap;
}
/* настройка экранов сотрудника */
.scr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 10px;
}
.scr-grid fieldset {
  padding: 8px 12px;
}
/* карточка заказа */
.stage-strip span.d {
  background: var(--ink);
  color: var(--bg);
}
.stage-strip span.c {
  background: var(--brick);
  color: #fff;
}
.docs {
  margin: 0 0 10px;
  padding-left: 18px;
}
a.btn {
  color: inherit;
  text-decoration: none;
}

/* ---------- «Мои задания» исполнителя: крупно, под телефон ---------- */
.job-title {
  margin: 22px 0 10px;
}
.jobs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 12px;
}
.job {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.job-now {
  border-color: var(--ink);
}
.job-late {
  box-shadow: inset 4px 0 var(--brick);
}
.job-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  font-size: 19px;
}
.job-order {
  font-size: 15px;
}
.job-note {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
}
.job-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.job-acts .btn {
  min-height: 52px;
  font-size: 17px;
  flex: 1 1 140px;
}
.cats {
  display: grid;
  gap: 6px;
}
.cat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.issue-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

/* ---------- наряды и печать ---------- */
.nar-list {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  overflow: auto;
  margin-bottom: 12px;
}
.job-flash {
  outline: 3px solid #c8371f;
  outline-offset: 2px;
}
#printArea {
  display: none;
}
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }
  body.printing > *:not(#printArea) {
    display: none !important;
  }
  body.printing {
    background: #fff;
    padding: 0;
  }
  body.printing #printArea,
  body.printing #printArea :where(*:not(svg, svg *)) {
    all: revert;
  }
  body.printing #printArea {
    display: block;
    color: #000;
    font:
      10.5pt/1.3 Arial,
      sans-serif;
  }
  /* Специфичность выше, чем у «all: revert» выше: иначе правила самого бланка не применяются. Наряд не режется между листами, на лист встаёт два, если помещаются. */
  body.printing #printArea .nar {
    box-sizing: border-box;
    padding: 2mm 0 4mm;
    border-bottom: 1px dashed #888;
    break-inside: avoid;
  }
  body.printing #printArea .nar.sum {
    border: 0;
    break-before: page;
  }
  /* лист с QR для входа: крупный код и адрес, чтобы вешать в цеху */
  body.printing #printArea .qrsheet {
    text-align: center;
    padding-top: 12mm;
  }
  #printArea .qrsheet h1 {
    font-size: 30pt;
    margin: 0 0 4mm;
  }
  #printArea .qrsheet .lead {
    font-size: 16pt;
    margin: 0 0 10mm;
  }
  #printArea .qrsheet figure {
    margin: 0 auto;
    width: 130mm;
  }
  #printArea .qrsheet figure svg {
    width: 130mm;
    height: 130mm;
    display: block;
  }
  #printArea .qrsheet .addr {
    font-size: 20pt;
    font-weight: bold;
    margin: 6mm 0 10mm;
    word-break: break-all;
  }
  #printArea .qrsheet ol {
    display: inline-block;
    text-align: left;
    font-size: 15pt;
    line-height: 1.6;
    margin: 0;
    padding-left: 8mm;
  }

  #printArea .nar header {
    display: flex;
    justify-content: space-between;
    gap: 6mm;
    align-items: flex-start;
  }
  #printArea .nar h1 {
    font-size: 14pt;
    margin: 0 0 1mm;
  }
  #printArea .nar header p {
    margin: 0;
    font-size: 9pt;
  }
  #printArea .nar figure {
    margin: 0;
    text-align: center;
    font-size: 7pt;
  }
  #printArea .nar figure svg {
    width: 25mm;
    height: 25mm;
    display: block;
  }
  #printArea .nar table {
    width: 100%;
    border-collapse: collapse;
    margin: 2mm 0;
  }
  #printArea .nar th,
  #printArea .nar td {
    border: 1px solid #000;
    padding: 1mm 2mm;
    text-align: left;
    vertical-align: top;
  }
  #printArea .nar .kv th {
    width: 27mm;
    font-weight: normal;
    background: #f1f1f1;
  }
  #printArea .nar .kv td {
    width: 50mm;
  }
  #printArea .nar thead th {
    background: #f1f1f1;
  }
  #printArea .nar .n {
    text-align: right;
    white-space: nowrap;
  }
  #printArea .nar .sign {
    width: 32mm;
  }
  #printArea .nar .note {
    font-size: 8.5pt;
  }
  #printArea .nar p {
    margin: 1.5mm 0;
    font-size: 9pt;
  }
  #printArea .nar .line {
    display: inline-block;
    min-width: 40mm;
    border-bottom: 1px solid #000;
  }
  #printArea .nar .line.wide {
    min-width: 120mm;
  }
  #printArea .nar footer {
    display: flex;
    justify-content: space-between;
    gap: 4mm;
    font-size: 9pt;
    margin-top: 3mm;
  }
  #printArea .nar .tot td {
    font-weight: bold;
  }
}
.fund-p,
.tpl-p {
  max-width: 120px;
  text-align: right;
}
.print-menu {
  display: grid;
  gap: 10px;
}
.print-menu .btn.big {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  font-size: 17px;
  text-align: left;
  min-height: 64px;
}
.print-menu .btn.big span {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.75;
}
@media print {
  #printArea .dos {
    font-size: 9.5pt;
  }
  #printArea .dos header {
    display: flex;
    justify-content: space-between;
    gap: 6mm;
    border-bottom: 2px solid #000;
    padding-bottom: 2mm;
    margin-bottom: 3mm;
  }
  #printArea .dos h1 {
    font-size: 15pt;
    margin: 0 0 1mm;
  }
  #printArea .dos h2 {
    font-size: 11pt;
    margin: 5mm 0 1.5mm;
    break-after: avoid;
  }
  #printArea .dos h3 {
    font-size: 10pt;
    margin: 3mm 0 1mm;
  }
  #printArea .dos p {
    margin: 0 0 1mm;
  }
  #printArea .dos figure {
    margin: 0;
    text-align: center;
    font-size: 7pt;
  }
  #printArea .dos figure svg {
    width: 24mm;
    height: 24mm;
    display: block;
  }
  #printArea .dos table {
    width: 100%;
    border-collapse: collapse;
  }
  #printArea .dos th,
  #printArea .dos td {
    border: 1px solid #777;
    padding: 0.8mm 1.5mm;
    text-align: left;
    vertical-align: top;
  }
  #printArea .dos thead th {
    background: #eee;
  }
  #printArea .dos thead {
    display: table-header-group;
  }
  #printArea .dos tr {
    break-inside: avoid;
  }
  #printArea .dos .kv th {
    width: 45mm;
    font-weight: normal;
    background: #f4f4f4;
  }
  #printArea .dos .n {
    text-align: right;
    white-space: nowrap;
  }
  #printArea .dos .bad {
    font-weight: bold;
  }
  #printArea .dos .note {
    font-size: 8pt;
    color: #444;
  }
  #printArea .dos .empty {
    color: #666;
    font-style: italic;
  }
}

/* ---------- сводка: показатели и графики ---------- */
.summary-kpis {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}
.kpi {
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kpi:hover {
  border-color: var(--ink);
}
.kpi .h {
  font-size: 12px;
  color: var(--mut);
}
.summary-charts .panel {
  min-height: 0;
}
.hbars {
  display: grid;
  gap: 10px;
}
.hbar {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 120px;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-height: 32px;
}
.hbar:hover .hl {
  text-decoration: underline;
}
.hbar .ht {
  display: flex;
  height: 18px;
  width: max(var(--w), 4px);
  border-radius: 4px;
  overflow: hidden;
  background: var(--line);
}
.hbar .ht i,
.legend i {
  display: block;
  height: 100%;
}
.s-ok {
  background: var(--chart-ok, var(--ink));
}
.s-bad {
  background: var(--brick);
}
.s-none {
  background: repeating-linear-gradient(
    45deg,
    var(--line),
    var(--line) 3px,
    transparent 3px,
    transparent 6px
  );
  border: 1px solid var(--line);
}
.hbar .hv {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.hbar .hv em {
  font-style: normal;
  font-weight: 400;
  font-size: 13px;
  color: var(--brick);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--mut);
  margin: 14px 0 0;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 14px;
  height: 10px;
  border-radius: 2px;
}
.vbars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 210px;
}
.vbar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  text-align: center;
  gap: 4px;
}
.vbar .vv {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.vbar .vt {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.vbar .vt i {
  display: block;
  width: min(42px, 80%);
  min-height: 2px;
  background: var(--chart-ok, var(--ink));
  border-radius: 4px 4px 0 0;
}
.vbar.bad .vt i,
.vbar.bad .vv {
  background: var(--brick);
}
.vbar.bad .vv {
  background: none;
  color: var(--brick);
}
.vbar .vl {
  font-size: 12px;
  color: var(--mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .hbar {
    grid-template-columns: 96px minmax(0, 1fr) 70px;
  }
  .hbar .hv em {
    display: none;
  }
  .vbar .vl {
    font-size: 10px;
  }
}
/* список заказов: следующий шаг — спокойная кнопка, просрочка под датой не наезжает на соседний столбец */
.btn.next {
  border-color: var(--brick);
  color: var(--brick);
  background: transparent;
}
.btn.next:hover {
  background: var(--brick2);
}
.order-list td.schedule-date small.bad {
  display: block;
  white-space: normal;
  line-height: 1.2;
}

/* ---------- управление операциями: одна строка — одна операция с бригадой ---------- */
.board-order .board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.board-order .board-head .acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.team-table td {
  vertical-align: top;
}
.team-table td:nth-child(3) {
  width: 52%;
}
.member {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 52px 110px auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.member + .member {
  border-top: 1px dashed var(--line);
}
.member .share {
  font-variant-numeric: tabular-nums;
  color: var(--mut);
  text-align: right;
}
.state {
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--line);
  text-align: center;
  white-space: nowrap;
}
.state.ok {
  background: var(--okb);
  color: var(--ok);
}
.state.info {
  background: var(--infob);
  color: var(--info);
}
.state.warn {
  background: var(--warnb);
  color: var(--warn);
}
.state.bad {
  background: var(--brick2);
  color: var(--brick);
}
.acts.sm {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.acts.sm .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.acts.tools {
  justify-content: flex-end;
}
.team-table td small {
  display: block;
}
@media (max-width: 760px) {
  .member {
    grid-template-columns: 1fr auto auto;
  }
  .member .acts {
    grid-column: 1 / -1;
  }
  .acts.tools {
    justify-content: flex-start;
  }
}
.team-table.with-order td:nth-child(4) {
  width: 46%;
}
.team-table.with-order td:nth-child(3) {
  width: auto;
}
/* флажки и переключатели не растягиваются как поля ввода */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0 6px 0 0;
  vertical-align: middle;
  inline-size: 18px;
  block-size: 18px;
}
#shift-override {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}

/* ================= 13.0 · оформление в стиле 1С: боковое меню, панели функций, начальная страница ================= */
:root {
  --bg: light-dark(#fbfaf7, #171513);
  --line: light-dark(#e2ddd3, #38332d);
  --side: light-dark(#f4efe3, #1f1c19);
  --sideon: light-dark(#fff, #2a2622);
  --acc: light-dark(#2f6f57, #8cc7ad);
  --hi: light-dark(#fff4c2, #3a3218);
}
header {
  padding: 0 14px;
  height: 48px;
  display: flex;
  align-items: center;
  background: #1d1b18;
}
header .top {
  width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 14px;
}
.brand {
  font-size: 17px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.crumbs {
  opacity: 0.75;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who {
  margin-left: auto;
  flex-wrap: nowrap;
}
.menu-btn {
  display: none;
  font-size: 18px;
  line-height: 1;
  padding: 2px 10px;
}
.shell {
  display: grid;
  grid-template-columns: var(--sidew, 236px) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100dvh - 48px);
  background: linear-gradient(
    to right,
    var(--side) calc(var(--sidew, 236px) - 1px),
    var(--line) calc(var(--sidew, 236px) - 1px) var(--sidew, 236px),
    transparent var(--sidew, 236px)
  );
}
#side {
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 8px 0 20px;
  position: sticky;
  top: 48px;
  height: calc(100dvh - 48px);
  overflow-y: auto;
  display: block;
  margin: 0;
}
#side a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  min-height: 40px;
  border-radius: 0;
  opacity: 1;
}
#side .sidebtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 9px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  text-align: start;
  cursor: pointer;
}
#side .sidebtn:hover,
#side a:hover {
  background: color-mix(in srgb, var(--sideon) 60%, transparent);
}
#side a.on {
  background: var(--sideon);
  font-weight: 600;
  box-shadow: inset 3px 0 var(--brick);
}
#side .ic {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: light-dark(#d8cfbd, #4a433b);
  flex: none;
}
#side a.on .ic {
  background: var(--brick);
}
#side .cnt {
  margin-left: auto;
  font-size: 11.5px;
  background: var(--brick);
  color: #fff;
  border-radius: 99px;
  padding: 0 7px;
  font-weight: 600;
}
#side .sep {
  height: 1px;
  background: var(--line);
  margin: 8px 16px;
}
.side-foot {
  font-size: 12px;
  color: var(--mut);
  padding: 4px 16px;
}
.side-shade {
  display: none;
}
.shell > main {
  width: 100%;
  margin: 0;
  max-width: 1400px;
  padding: 24px clamp(16px, 2.6vw, 34px) 60px;
}
h1 {
  font-size: clamp(24px, 2.6vw, 30px);
}
.panel h2,
.home h2 {
  color: var(--acc);
}
/* панель функций раздела */
.fpanel {
  columns: 3 260px;
  column-gap: 48px;
  margin-top: 18px;
}
.fgrp {
  break-inside: avoid;
  margin-bottom: 24px;
}
.fgrp h3 {
  font-size: 17px;
  font-weight: 500;
  color: var(--acc);
  margin: 0 0 6px;
}
.fgrp a,
.fgrp .linkbtn {
  display: block;
  padding: 4px 0 4px 18px;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  font-size: 15.5px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.fgrp a::before,
.fgrp .linkbtn::before {
  content: "›";
  position: absolute;
  left: 3px;
  color: var(--brick);
}
.fgrp a:hover,
.fgrp .linkbtn:hover {
  text-decoration: underline;
}
.fgrp a.b {
  font-weight: 700;
}
.fgrp .n {
  color: var(--brick);
  font-size: 12.5px;
  margin-left: 8px;
  font-weight: 600;
}
.fgrp.create .linkbtn {
  font-weight: 600;
}
/* начальная страница */
.home-kpis {
  margin: 14px 0 18px;
}
.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.home h2 {
  font-size: 18px;
  margin-bottom: 10px;
}
.home-board .bar {
  margin-bottom: 10px;
}
.mb-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}
.mboard,
.mlist {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.mboard th,
.mlist th {
  font-size: 12.5px;
  color: var(--mut);
  font-weight: 600;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  background: light-dark(#faf8f3, #24211d);
  text-align: center;
  white-space: nowrap;
}
.mboard td,
.mlist td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}
.mboard .l,
.mlist .l {
  text-align: left;
  white-space: normal;
}
.mboard td.l {
  min-width: 190px;
}
.mboard tr.click {
  cursor: pointer;
}
.mboard tr.click:hover td {
  background: light-dark(#f7f3ea, #26221e);
}
.mboard tr.sel td {
  background: var(--hi);
}
.mboard tr.late td.l b {
  color: var(--brick);
}
.c-ok {
  color: var(--ok);
  font-weight: 700;
}
.c-rv {
  color: var(--info);
  font-weight: 700;
  font-size: 13px;
}
.c-no {
  color: light-dark(#cfc8bb, #5a534a);
}
.c-wk,
.c-ps,
.c-pl,
.c-late {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
}
.c-wk {
  background: #3b7cc4;
}
.c-ps {
  background: #e0a22c;
}
.c-pl {
  border: 2px solid #8f877b;
}
.c-late {
  border: 2px solid var(--brick);
  background: var(--brick2);
}
.home .legend {
  font-size: 12.5px;
  color: var(--mut);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
}
.home .legend i {
  margin-right: 3px;
  border-radius: 50%;
}
.home .legend i.c-pl,
.home .legend i.c-late {
  width: 12px;
  height: 12px;
}
.mdetail {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.mdetail .hd {
  display: flex;
  gap: 8px 20px;
  align-items: center;
  flex-wrap: wrap;
  background: light-dark(#faf3df, #2c2618);
  padding: 8px 10px;
}
.mdetail .acts {
  margin-left: auto;
}
.home-side {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.tgrp {
  margin-bottom: 16px;
}
.tgrp h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mut);
  margin: 0 0 4px;
}
.todo {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding: 6px 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: none;
  cursor: pointer;
  text-align: left;
}
.todo span::before {
  content: "›";
  color: var(--brick);
  margin-right: 8px;
}
.todo:hover span {
  text-decoration: underline;
}
.todo b {
  color: var(--brick);
}
.todo b.zero {
  color: var(--mut);
  font-weight: 400;
}
.qcols {
  columns: 2 220px;
  column-gap: 32px;
}
.qgrp {
  break-inside: avoid;
  margin-bottom: 16px;
}
.qgrp h3 {
  color: var(--acc);
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 4px;
}
.qgrp a {
  display: block;
  padding: 3px 0;
  color: var(--ink);
}
@media (max-width: 1100px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-side {
    border-left: 0;
    padding-left: 0;
    order: -1;
  }
}
@media (max-width: 900px) {
  .menu-btn {
    display: inline-block;
  }
  .shell {
    grid-template-columns: minmax(0, 1fr);
    background: none;
  }
  #side {
    position: fixed;
    left: 0;
    top: 48px;
    width: min(280px, 82vw);
    z-index: 20;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: 4px 0 18px rgba(0, 0, 0, 0.18);
  }
  body.side-open #side {
    transform: none;
  }
  body.side-open .side-shade {
    display: block;
    position: fixed;
    inset: 48px 0 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 19;
  }
  .crumbs {
    display: none;
  }
  .shell > main {
    padding: 16px 12px 50px;
  }
}
@media (max-width: 600px) {
  .who .sync,
  .brand .bsub {
    display: none;
  }
  header .top {
    gap: 8px;
  }
  .brand {
    font-size: 15px;
  }
}
@media print {
  body > header,
  #side,
  .side-shade {
    display: none !important;
  }
  .shell {
    display: block;
  }
}

/* 13.1 · по макету: шапка с поиском, плотная таблица мастера, текущие дела и избранное */
.shell > main {
  max-width: var(--pagew, none);
}
.gsearch {
  position: relative;
  margin-left: auto;
  width: min(340px, 34vw);
}
.gsearch input {
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  background: #fff;
  color: #1d1b18;
  min-height: 32px;
}
#gresults {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-height: 70vh;
  overflow: auto;
  z-index: 30;
  padding: 4px 0;
}
#gresults a,
#gresults button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 7px 12px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
#gresults a:hover,
#gresults button:hover {
  background: var(--hi);
}
#gresults em {
  font-style: normal;
  color: var(--mut);
  font-size: 12px;
  display: block;
}
#gresults .note {
  padding: 6px 12px;
  margin: 0;
}
.who {
  margin-left: 0;
}
.sync span {
  display: none;
}
.bell {
  min-width: 26px;
  height: 26px;
  border-radius: 99px;
  border: 1px solid #6b655d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
}
.bell:empty::before {
  content: "🔔";
  font-size: 12px;
  filter: grayscale(1);
}
.bell b {
  background: var(--brick);
  color: #fff;
  border-radius: 99px;
  padding: 0 7px;
  line-height: 24px;
}
.lo.user {
  border-color: transparent;
}
/* панель функций: избранное */
.frow {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.frow a {
  flex: 0 1 auto;
  width: auto;
}
.star {
  border: 0;
  background: none;
  color: light-dark(#c9c0ae, #6b6257);
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
  margin-left: 2px;
}
.star.on,
.star:hover {
  color: #e0a22c;
}
ol.help {
  margin: 0;
  padding-left: 20px;
}
ol.help li {
  margin: 4px 0;
}
/* рабочее место мастера */
.home {
  grid-template-columns: minmax(0, 1fr) var(--todow, 290px);
}
.home-board h2 {
  margin-bottom: 10px;
}
.mtools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 8px;
}
.mtools .sp {
  flex: 1;
}
.mtools label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--mut);
}
.mtools select {
  font-size: 14px;
  height: 32px;
  width: auto;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  min-height: 32px;
}
.mtools .btn.sm {
  min-height: 32px;
}
details.more {
  position: relative;
}
details.more summary {
  list-style: none;
  cursor: pointer;
}
details.more summary::-webkit-details-marker {
  display: none;
}
details.more .menu {
  position: absolute;
  top: 36px;
  left: 0;
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  min-width: 220px;
  padding: 4px 0;
}
details.more .menu a,
details.more .menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 7px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
}
details.more .menu a:hover,
details.more .menu button:hover {
  background: var(--hi);
}
details.more .menu button.dang {
  color: var(--brick);
}
.mboard td,
.mboard th {
  padding: 6px 8px;
}
.mboard td.no {
  font-weight: 700;
  white-space: nowrap;
}
.mboard th {
  white-space: nowrap;
}
.mboard td.cl {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mboard td.l {
  min-width: 0;
}
.mboard tr.late td {
  box-shadow: none;
}
.mdetail .hd {
  gap: 6px 22px;
}
.linkish {
  border: 0;
  background: none;
  padding: 0;
  color: light-dark(#1f5fae, #8bb8dc);
  cursor: pointer;
  font-weight: 600;
  text-align: left;
}
.linkish:hover {
  text-decoration: underline;
}
.mdetail .tabs {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.mdetail .tabs button {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 5px;
  padding: 2px 10px;
  font-size: 13px;
  cursor: pointer;
}
.mdetail .tabs button.on {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.mdetail .bar.pad {
  padding: 8px 10px;
  margin: 0;
}
.note.pad {
  padding: 8px 10px;
  margin: 0;
}
.mlist .warn {
  color: var(--warn);
}
/* текущие дела */
.todo.tsub {
  padding: 4px 0 4px 16px;
  font-size: 13.5px;
}
.todo.tsub span::before {
  content: "›";
}
.fav-h {
  margin-top: 26px;
}
@media (max-width: 900px) {
  .gsearch {
    width: auto;
    flex: 1;
  }
  .mtools .sp {
    display: none;
  }
}
@media (max-width: 600px) {
  .gsearch input {
    font-size: 13px;
  }
  .lo.user {
    display: none;
  }
  .mboard td.cl {
    max-width: 180px;
  }
}
.mboard th.l {
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
  }
}
.mboard td small {
  display: block;
  font-size: 11px;
  color: var(--mut);
  margin-top: 1px;
  white-space: nowrap;
}
/* 13.3 · размеры таблиц мышью */
body.rz-col,
body.rz-col * {
  cursor: col-resize !important;
}
body.rz-row,
body.rz-row * {
  cursor: row-resize !important;
}
body.rz-drag {
  user-select: none;
}
table.rz-w {
  table-layout: fixed;
  max-width: none;
}
table.rz-w th,
table.rz-w td {
  overflow: hidden;
  text-overflow: ellipsis;
}
table.rz-h tbody td {
  height: var(--rh);
  padding-top: 2px;
  padding-bottom: 2px;
}
th.rz-mark-w {
  box-shadow: inset -3px 0 var(--brick) !important;
}
tr.rz-mark-h td {
  box-shadow: inset 0 -3px var(--brick);
}
#side.rz-mark-r,
.shell > main.rz-mark-r {
  box-shadow: inset -3px 0 var(--brick);
}
.home-side.rz-mark-l {
  box-shadow: inset 3px 0 var(--brick);
}
.mb-wrap.rz-mark-b,
.mdetail.rz-mark-b {
  box-shadow: inset 0 -3px var(--brick);
}
.mb-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}
/* 13.4 · настройка интерфейса */
.setcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 14px 0;
  max-width: 820px;
}
.switch {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch .sw {
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 99px;
  background: light-dark(#cfc8bb, #4a433b);
  position: relative;
  transition: background 0.15s;
  margin-top: 2px;
}
.switch .sw::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
}
.switch input:checked + .sw {
  background: var(--brick);
}
.switch input:checked + .sw::after {
  left: 23px;
}
.switch input:focus-visible + .sw {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}
.setcard ul.help {
  margin: 14px 0 6px;
  padding-left: 20px;
}
.setcard ul.help li {
  margin: 4px 0;
}
#rzBadge {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  background: #1d1b18;
  color: #fff;
  border-radius: 10px;
  padding: 8px 8px 8px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
#rzBadge button {
  background: var(--brick);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 5px 12px;
  font-weight: 600;
  cursor: pointer;
}
body.rz-on table[data-rzk] thead th {
  box-shadow: inset -1px 0 var(--brick2);
}
.setcard .switch {
  color: var(--ink);
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.setcard .acts {
  justify-content: flex-start;
  margin-left: 0;
}

/* ---------- 13.5: график производства ---------- */
.sch-form .bar label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--mut);
}
.sch-form .bar label.chk {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: inherit;
  font-size: 14px;
}
.sch-form input[type="date"],
.sch-form input[type="search"],
.sch-form select {
  min-height: 40px;
  font-size: 15px;
}
.sch-out.busy {
  opacity: 0.55;
  pointer-events: none;
}
.sch-out h2 {
  margin: 22px 0 10px;
  font-size: 18px;
}
.sch-sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.sch-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--mut);
  font-weight: 600;
}
.mlist tr.tot td {
  font-weight: 700;
  background: light-dark(#faf8f3, #24211d);
}
.sch-wrap {
  max-height: 70vh;
  overflow: auto;
}
.sch-tbl td.l {
  min-width: 220px;
  position: sticky;
  left: 0;
  background: var(--panel);
  z-index: 1;
}
.sch-tbl th.l {
  position: sticky;
  left: 0;
  z-index: 3;
}
.sch-tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.sch-tbl td.bad {
  background: light-dark(#fbeaea, #3a2323);
}
.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--acc, inherit);
  cursor: pointer;
  text-align: left;
}
.sch-blocks {
  margin: 0 0 12px;
}
.sch-blocks summary {
  cursor: pointer;
  color: var(--mut);
  font-size: 14px;
  padding: 6px 0;
}
.stack td .btn {
  white-space: normal;
  height: auto;
  text-align: left;
  padding-block: 8px;
}

/* 14.0: QR для входа в программу */
.qrbox {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.qrbox svg {
  width: min(280px, 100%);
  height: auto;
}
.qraddr {
  text-align: center;
  word-break: break-all;
  font-size: 18px;
  margin: 4px 0 10px;
}

/* 13.9: временный пароль после сброса */
.temp-pass {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font:
    600 22px/1.2 ui-monospace,
    Consolas,
    monospace;
  letter-spacing: 1px;
  text-align: center;
}

/* 13.8: заказ на упаковке */
.packb {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 9px;
  background: #1f6f8b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: middle;
  white-space: nowrap;
}

/* 15.6: этап «Готов к отгрузке» на плане мастера */
.packb.ready {
  background: #2f7d4f;
}
.packb.sent {
  background: #6b6258;
}

/* 13.6: новые заказы, переключатель доски, меню действий в списке */
.newb {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 9px;
  background: #c8371f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: middle;
  white-space: nowrap;
}
.boardsw {
  margin-right: 8px;
}
.boardsw button {
  white-space: nowrap;
}
.boardhint {
  margin: 8px 2px;
  line-height: 1.8;
}
.order-flash {
  animation: orderflash 3.6s ease-out;
}
@keyframes orderflash {
  0%,
  65% {
    background: #ffe9a8;
    outline: 3px solid #c8371f;
    outline-offset: -2px;
  }
  100% {
    background: transparent;
    outline: 0 solid transparent;
  }
}
.cardwrap {
  display: grid;
  gap: 4px;
}
.cardwrap > .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 0 2px 4px;
}
.order-list .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
details.more.rowmore .menu {
  min-width: 250px;
  z-index: 30;
}
details.more .menu.up {
  top: auto;
  bottom: 36px;
}
details.more .menu.rt {
  left: auto;
  right: 0;
}

/* 14.1 · телефон: починка */
.rowbtns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* вкладки раздела: затемнённый край показывает, что их можно листать */
.section-tabs.more-r {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent);
}
.section-tabs.more-l {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px);
  mask-image: linear-gradient(90deg, transparent, #000 44px);
}
.section-tabs.more-l.more-r {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent);
}
@media (max-width: 700px) {
  /* меню «Ещё»: нижняя панель на всю ширину, ничего не обрезается, пункты крупные */
  details.more .menu,
  details.more.rowmore .menu,
  details.more .menu.up,
  details.more .menu.rt {
    position: fixed;
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    min-width: 0;
    max-height: 72dvh;
    overflow: auto;
    z-index: 60;
    padding: 6px 0;
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.3);
  }
  details.more[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 59;
  }
  details.more .menu a,
  details.more .menu button {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 16px;
  }
  /* подписи полей в карточках не рвутся посреди слова */
  .stack td,
  .order-list td {
    padding-inline-start: 9.4em;
  }
  .stack td::before,
  .order-list td::before {
    width: 9em;
    margin-inline-start: -9.4em;
  }
}
@media (max-width: 600px) {
  /* шапка: кнопки под палец (не меньше 44 px, шапка остаётся 48 px) */
  header .lo {
    min-height: 40px;
  }
  header .menu-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 22px;
  }
  .bell {
    min-width: 40px;
    height: 40px;
  }
  .gsearch input {
    min-height: 40px;
    font-size: 16px;
  }
  /* поиск: при наборе занимает всю шапку, результаты на всю ширину экрана */
  header .top:has(#gsearch:focus) .brand,
  header .top:has(#gsearch:focus) .who {
    display: none;
  }
  header .top:has(#gsearch:focus) .gsearch {
    flex: 1;
  }
  #gresults {
    position: fixed;
    top: 52px;
    left: 8px;
    right: 8px;
    max-height: calc(100dvh - 64px);
  }
  #gresults a,
  #gresults button {
    padding: 11px 14px;
    font-size: 16px;
  }
  /* сводка: подписи этапов не обрезаются и не налезают на полоски */
  .hbar {
    grid-template-columns: 118px minmax(0, 1fr) 54px;
  }
  .hbar .hl {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.15;
  }
}

/* 14.2 · окно Telegram: плотная вёрстка, кнопки внутри окна, а не стопкой внизу */
.tgbox p {
  margin: 0 0 10px;
  padding: 0;
}
.tgbox h3 {
  margin: 16px 0 6px;
}
.tgbox ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
.tgbox li {
  margin-bottom: 8px;
}
.tgbox .banner {
  margin-bottom: 10px;
}
.tgbox .rowbtns {
  margin: 0 0 10px;
}
.tgbox a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-sizing: border-box;
  text-decoration: none;
}

/* 14.3 · руководитель с телефона: «Утро», нижняя панель, компактный заказ */
.morning,
.tabbar {
  display: none;
}
@media (max-width: 700px) {
  .morning {
    display: block;
    grid-column: 1 / -1;
    order: -2;
  }
  #decide {
    scroll-margin-top: 60px;
  }
  .morning h2 {
    margin: 0 0 10px;
  }
  .morning h3 {
    margin: 14px 0 6px;
    font-size: 15px;
  }
  .mks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .mk {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    min-height: 68px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-align: start;
  }
  .mk b {
    font-size: 26px;
    line-height: 1.1;
  }
  .mk span {
    font-size: 12px;
    line-height: 1.2;
    color: var(--mut);
  }
  .mk.alert b {
    color: var(--brick);
  }
  .burns {
    display: grid;
    gap: 6px;
  }
  .burn {
    display: grid;
    gap: 2px;
    min-height: 48px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--brick);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
    text-align: start;
  }
  .burn b {
    font-size: 15px;
  }
  .burn span {
    font-size: 13px;
    color: var(--brick);
  }
  body.has-tabbar .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 18;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }
  .tabbar a,
  .tabbar button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    border: 0;
    background: none;
    color: var(--mut);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
  }
  .tabbar a.on {
    border-radius: 0;
    background: color-mix(in srgb, var(--brick) 8%, var(--panel));
    color: var(--brick);
    font-weight: 700;
    box-shadow: inset 0 3px var(--brick);
  }
  .tabbar i {
    position: absolute;
    top: 6px;
    left: calc(50% + 14px);
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    box-sizing: border-box;
    background: var(--brick);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    line-height: 18px;
    text-align: center;
  }
  body.has-tabbar .shell > main {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  body.has-tabbar #toast {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 600px) {
  /* пояснения под заголовками свёрнуты до двух строк, касание раскрывает */
  p.sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    cursor: pointer;
  }
  p.sub.open {
    display: block;
  }
  /* заказ в списке: четыре короткие строки вместо таблицы «подпись — значение» */
  .panel.order-list {
    padding: 0;
    overflow: hidden;
  }
  .order-list .stack tbody tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "order order" "stage owner" "plan plan" "acts acts";
    gap: 3px 10px;
    padding: 10px 12px 12px;
  }
  .order-list .stack tbody tr.late {
    border-inline-start: 4px solid var(--brick);
  }
  .order-list .stack tr.late td:first-child {
    box-shadow: none;
  }
  .order-list .stack td {
    padding: 0;
    line-height: 1.3;
  }
  .order-list .stack td::before {
    display: none;
  }
  .order-list .stack td:nth-child(1) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    grid-area: order;
    gap: 0 6px;
  }
  .order-list .stack td:nth-child(1) .note {
    flex-basis: 100%;
  }
  .order-list .stack td:nth-child(3) {
    grid-area: owner;
    align-self: center;
    color: var(--mut);
    font-size: 13px;
    text-align: end;
  }
  .order-list .stack td.stage-cell {
    display: contents;
  }
  .order-list .stage-cell > .st {
    grid-area: stage;
    justify-self: start;
    align-self: center;
  }
  .order-list .stage-cell > .pipe,
  .order-list .stage-cell > .note {
    display: none;
  }
  .order-list .stage-cell > .acts {
    grid-area: acts;
    margin-top: 4px;
  }
  .order-list td.schedule-date {
    display: none;
  }
  .order-list td.is-contract {
    display: block;
    grid-area: plan;
    font-size: 13px;
    text-align: start;
    white-space: normal;
  }
  .order-list td.is-contract::before {
    display: inline;
    float: none;
    width: auto;
    margin: 0;
    content: "Сдача: ";
    color: var(--mut);
  }
  .order-list td.schedule-date.is-contract small.bad {
    display: inline;
    margin-inline-start: 8px;
    white-space: nowrap;
  }
  /* фильтры списка заказов: одна строка, которую можно листать, вместо пяти строк кнопок */
  .bar.filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
}

/* 14.4 · Мой кабинет */
.cab p {
  margin: 0 0 10px;
  padding: 0;
}
.cab h3 {
  margin: 16px 0 6px;
  font-size: 15px;
}
.cab-month {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cab-month b {
  font-size: 17px;
  text-transform: capitalize;
}
.cab-month .btn {
  min-width: 44px;
  min-height: 40px;
}
.cab-sum {
  margin-bottom: 8px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cab-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}
.cab-line:last-child {
  border-bottom: 0;
}
.cab-line.strong {
  font-size: 16px;
}
.cab-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cab-row .note {
  margin-top: 2px;
  font-size: 13px;
}
.cab-side {
  align-self: center;
  font-weight: 600;
  white-space: nowrap;
}
.cab-row.warn .cab-side {
  color: var(--brick);
}
.cab-go {
  margin-top: 16px;
}

/* 14.7 · таблицы карточками на телефоне: заголовок, пары «подпись — значение» в два столбца, кнопки во всю ширину */
@media (max-width: 600px) {
  .stack.tcards tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--line) 16%, var(--panel));
  }
  .stack.tcards tbody tr.late {
    border-inline-start: 4px solid var(--brick);
  }
  .stack.tcards tr.late td:first-child {
    box-shadow: none;
  }
  .stack.tcards td {
    display: block;
    width: auto !important; /* у ячеек таблиц заданы проценты ширины, в карточке они не нужны */
    grid-column: auto;
    padding: 0;
    line-height: 1.35;
    text-align: start;
    white-space: normal;
  }
  .stack.tcards td::before {
    display: block;
    float: none;
    width: auto;
    margin: 0 0 1px;
    font-size: 12px;
  }
  .stack.tcards td:first-child,
  .stack.tcards td[data-w] {
    grid-column: 1 / -1;
  }
  .stack.tcards td:first-child::before {
    display: none;
  }
  .stack.tcards td[data-l=""]::before {
    display: none;
  }
  .stack.tcards td .btn {
    min-height: 40px;
  }
  /* исполнители смены: имя — доля — статус в одну строку, кнопки под ними */
  .team-table .member {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 4px 8px;
  }
  .team-table .member .who {
    display: block;
    margin: 0;
    font-size: inherit;
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .team-table .member .acts {
    grid-column: 1 / -1;
  }
  .team-table .acts.tools {
    justify-content: flex-start;
  }
  .team-table .acts .btn {
    flex: 1 1 auto;
  }
}

/* 14.7 · как фонд заказа делится между операциями и людьми */
.split-table {
  width: 100%;
}
.split-table .split-op td {
  background: color-mix(in srgb, var(--line) 22%, var(--panel));
  border-top: 1px solid var(--line);
}
.split-table .split-person td {
  color: var(--mut);
  font-size: 0.93em;
  padding-block: 4px;
}
.split-table .split-person td:first-child {
  padding-inline-start: 22px;
}
.split-table tfoot td {
  border-top: 2px solid var(--line);
  padding-top: 8px;
}
.split-table th.n,
.split-table td.n {
  text-align: end;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .split-table th,
  .split-table td {
    padding-inline: 4px;
  }
  .split-table td:last-child {
    font-size: 12px;
    white-space: normal;
  }
}

/* 14.7 · обновление программы из браузера */
.upd-notes {
  white-space: pre-wrap;
  max-height: 14em;
  overflow: auto;
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--line) 16%, var(--panel));
}

/* 14.8 · окно обязательной смены пароля нельзя закрыть кнопкой «В раздел»; панель «Ждут утверждения фонда» */
#dlg[data-forced] #dclose {
  display: none;
}
.panel.warn {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warnb) 55%, var(--panel));
}
.panel.warn h2 {
  color: var(--warn);
}

/* 14.8 · крупные суммы в показателях не раздвигают страницу на телефоне */
@media (max-width: 600px) {
  .kpi .v {
    font-size: clamp(18px, 5.4vw, 28px);
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ---------- 15.0: поручения ---------- */
.dir-list {
  display: grid;
  gap: 10px;
}
.dir-hd {
  margin: 20px 0 8px;
  font-size: 17px;
}
.dir-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 8px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}
.dir-card.report {
  border-left-color: var(--warn);
}
.dir-card.done {
  border-left-color: var(--ok);
}
.dir-card.declined,
.dir-card.overdue {
  border-left-color: var(--brick);
}
.dir-card.canceled {
  border-left-color: var(--line);
  opacity: 0.75;
}
.dir-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}
.dir-t {
  font-size: 16px;
}
.dir-st {
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--infob);
  color: var(--info);
  white-space: nowrap;
}
.dir-st.ok {
  background: var(--okb);
  color: var(--ok);
}
.dir-st.warn {
  background: var(--warnb);
  color: var(--warn);
}
.dir-st.bad {
  background: var(--brick2);
  color: var(--brick);
}
.dir-st.mut {
  background: var(--line);
  color: var(--mut);
}
.dir-m {
  font-size: 14px;
  color: var(--mut);
}
.dir-n {
  margin: 0;
  white-space: pre-wrap;
}
.dir-card .acts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dir-card .dir-h summary,
.dir-closed summary {
  cursor: pointer;
  color: var(--mut);
  font-size: 14px;
}
.dir-closed {
  margin-top: 18px;
}
.dir-closed .dir-list {
  margin-top: 8px;
}
.dir-form .bar label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  color: var(--mut);
}
.dir-form select {
  min-height: 40px;
  font-size: 15px;
}
.dir-stats {
  display: grid;
  gap: 18px;
}
.dir-tbl td,
.dir-tbl th {
  text-align: right;
}
.dir-tbl td.l,
.dir-tbl th.l {
  text-align: left;
}
.dir-tbl tr.me td {
  background: var(--infob);
}
.dir-tbl .warnt {
  color: var(--warn);
  font-weight: 500;
}
.dir-ord {
  margin: 4px 0;
  font-size: 14px;
}

/* Очистка данных (15.1) */
.cl-groups {
  display: grid;
  gap: 10px;
}
.cl-groups h3 {
  margin: 4px 0 0;
  font-size: 16px;
}
.cl-g,
.cl-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.cl-g input,
.cl-row input {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
}
.cl-t {
  display: grid;
  gap: 2px;
}
.cl-n {
  display: block;
  font-size: 13px;
  color: var(--mut, #6b6b6b);
}
.cl-list {
  max-height: 55vh;
  overflow: auto;
}
.cl-sum {
  display: grid;
  gap: 8px;
  border-left: 4px solid var(--bad, #c8371e);
}
.cl-sum p {
  margin: 0;
}
.cl-last {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.cl-ul {
  margin: 6px 0 10px 18px;
  padding: 0;
}

/* Расчётные листы (15.3) */
.ps-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
}
.ps-upload input {
  max-width: 100%;
}
.ps-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ps-row.dup {
  background: var(--warnb);
}
.ps-check input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
}
.ps-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.ps-file {
  overflow-wrap: anywhere;
}
.ps-main select {
  width: 100%;
  max-width: 420px;
}
.ps-badge {
  font-size: 13px;
}
.ps-badge.ok,
.ps-tg.ok {
  color: var(--ok);
}
.ps-badge.warn,
.ps-tg.warn {
  color: var(--warn);
}
.ps-badge.bad,
.ps-tg.bad {
  color: var(--bad, #c8371e);
}
.ps-ul {
  margin: 6px 0 10px 18px;
  padding: 0;
}

/* 15.9: ссылка подключения Telegram */
.tg-link {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}
