@import url("/static/dashboard.css");

@font-face {
  font-family: "KSF Inter";
  src: url("inter-cyrillic.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: "KSF Inter";
  src: url("inter-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
  color-scheme: light;
  --ink: #242722;
  --paper: #f3f3ed;
  --card: #fffefa;
  --wash: #efefe8;
  --nickel: #c1c7bb;
  --muted: #575e54;
  --line: #dddfd5;
  --control-line: #878d80;
  --blue: var(--ink);
  --warn: #62451b;
  --green: #385243;
  --radius: 18px;
  --surface-shadow: 0 2px 5px rgb(42 46 33 / 4%), 0 8px 24px -15px rgb(42 46 33 / 14%);
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 "KSF Inter", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
[hidden], .picker, .mobileout { display: none !important; }
body, h1, h2, h3, p { margin: 0; }
a { color: var(--ink); text-underline-offset: .2em; }
button, .btn, input, select, textarea { font: inherit; }
button, .btn {
  min-height: 46px; padding: .7rem 1.18rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-weight: 550; line-height: 1.25;
  text-align: center; text-decoration: none; cursor: pointer;
}
button.secondary, .btn.secondary, .secondary {
  color: var(--ink); border-color: var(--control-line); background: var(--card);
}
@media (hover: hover) {
  button:hover:not(:disabled), .btn:hover { background-color: #41463e; }
  .secondary:hover:not(:disabled) { color: var(--ink); background-color: var(--wash); border-color: var(--muted); }
}
button:active:not(:disabled), .btn:active { opacity: .82; }
button:disabled { cursor: not-allowed; opacity: .56; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: .65rem .8rem;
  border: 1px solid var(--control-line); border-radius: 9px;
  background: #fff; color: var(--ink);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { min-height: 84px; resize: vertical; }
label, .field { display: grid; gap: 6px; font-size: .9rem; font-weight: 550; }
label:has(input[type=checkbox]) { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--ink); }
:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid #344e65; outline-offset: 3px;
  box-shadow: 0 0 0 3px #fff;
}
h1 { font-size: clamp(2.15rem,3.7vw,3.65rem); font-weight: 545; line-height: 1.06; letter-spacing: -.058em; }
h2 { font-size: clamp(1.3rem,1.7vw,1.65rem); font-weight: 570; line-height: 1.22; letter-spacing: -.043em; }
h3 { font-size: 1.04rem; font-weight: 600; line-height: 1.35; letter-spacing: -.022em; }
p { line-height: 1.5; }
.muted, small { color: var(--muted); }
small { font-size: .83rem; }
.skip { position: fixed; left: -2000px; top: 0; z-index: 25; background: var(--paper); padding: 12px; }
.skip:focus { left: 8px; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0,1fr); }
.side {
  display: flex; flex-direction: column; gap: 28px; height: 100dvh;
  padding: 30px 16px 22px; position: sticky; top: 0;
  background: #232621; color: #f4f5ed; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; line-height: 1.1; }
.brand span { font-weight: 550; font-size: .86rem; text-transform: uppercase; letter-spacing: -.022em; }
.brand img { width: 43px; height: 43px; object-fit: contain; flex: none; }
.side .brand { padding: 0 6px; }
.side .brand img { filter: brightness(0) invert(.95); }
.side nav { display: grid; gap: 2px; border-top: 1px solid #45493f; padding-top: 15px; }
.side nav button {
  width: 100%; justify-content: flex-start; text-align: left; font-weight: 480; font-size: .93rem;
  background: transparent; color: #e2e5da; border: 1px solid transparent; border-radius: 10px;
  padding: .7rem .65rem;
}
.side nav button[aria-current=page] { background: #e3e8d9; color: #20241d; font-weight: 625; }
.side nav button:hover:not([aria-current=page]) { background: #373c32; }
.side :focus-visible { outline-color: #e3ebd8; box-shadow: 0 0 0 3px #232621; }
.navico { display: inline-grid; place-items: center; min-width: 23px; font-weight: 600; }
.side .account { margin-top: auto; border-top: 1px solid #45493f; padding: 16px 4px 0; display: grid; gap: 8px; font-size: .86rem; }
.side .account small { color: var(--nickel); }
.side .account button { margin-top: 6px; background: transparent; border-color: #797f72; color: #f4f5ed; }
.side .account button:hover { background: #373c32; }
.workspace { min-width: 0; width: 100%; max-width: 1700px; padding: 0 clamp(16px,3.8vw,68px) 55px; }
.topline { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: .85rem; font-weight: 500; }
.topline input { width: auto; padding: 6px 9px; }
.head { margin: clamp(26px,3.6vw,48px) 0 clamp(20px,2vw,30px); }
.head p { margin-top: 10px; }
.panel, .tile {
  min-width: 0; padding: clamp(18px,2.2vw,32px); border: 0;
  border-radius: var(--radius); background: var(--card); box-shadow: var(--surface-shadow);
}
.panel, .stack { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; align-content: start; }
.panel > p { max-width: 78ch; }
.panel > :is(button, .btn), .stack > :is(button, .btn) { justify-self: start; }
.panel > *, .stack > *, fieldset { min-width: 0; }
.panel + .panel, .grid + .panel, .panel + .grid, .hero + .grid, .grid + .grid { margin-top: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(225px,100%),1fr)); gap: 14px; align-items: stretch; }
.grid > .panel, .stack > .panel + .panel { margin: 0; }
.row, .tabbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero {
  position: relative; display: grid; align-content: center; gap: 14px; min-height: 220px;
  overflow: hidden; isolation: isolate; padding: clamp(22px,3.2vw,48px);
  padding-right: 39%; background: var(--ink); color: var(--paper); border-radius: var(--radius);
}
.hero::after {
  content: ""; position: absolute; inset: 0 0 0 66%; z-index: -1;
  background: #181a19 url("eyelet-collar.webp") center 54% / cover no-repeat;
}
.hero h2 { font-size: 1rem; line-height: 1.3; font-weight: 500; letter-spacing: -.018em; }
.hero strong, .value { display: block; font-size: clamp(2.15rem,4.6vw,4.25rem); font-weight: 500; letter-spacing: -.065em; line-height: 1.04; }
.hero strong span { letter-spacing: -.025em; }
.hero small, .hero .muted { color: var(--nickel); }
.track { overflow: hidden; height: 5px; border-radius: 10px; background: #d5d9d5; max-width: 580px; }
.track > i { display: block; height: 100%; background: var(--ink); }
.hero .track { background: #6b726e; }
.hero .track > i { background: var(--paper); }
.tile { display: grid; align-content: start; gap: 8px; }
.tile > span { color: var(--muted); font-size: .88rem; font-weight: 540; }
.tile > strong { line-height: 1.23; overflow-wrap: anywhere; font-size: 1.24rem; font-weight: 600; letter-spacing: -.035em; }
.panel .grid:has(> .tile) {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(205px, 30%)), 1fr)); gap: 0;
  overflow: hidden; padding: 0 clamp(12px,1.6vw,22px); border-radius: 13px; background: var(--wash);
}
.panel .grid > .tile {
  align-content: space-between; margin: 0 8px; padding: 15px 0;
  background: transparent; border-radius: 0; box-shadow: 0 -1px var(--line);
}
.tile .value { font-size: clamp(1.85rem,3vw,2.75rem); }
.subhead { margin: 30px 0 14px; }
.scroll { min-width: 0; max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 12px 10px; text-align: left; vertical-align: top; }
th { background: var(--wash); color: var(--muted); font-size: .83rem; font-weight: 600; }
th:first-child { border-radius: 9px 0 0 9px; }
th:last-child { border-radius: 0 9px 9px 0; }
tbody tr + tr td { border-top: 1px solid var(--line); }
@media (hover: hover) { tbody tr:hover { background: #f6f6f0; } }
summary { cursor: pointer; font-weight: 580; min-height: 44px; padding: 10px 0; }
summary::marker { color: var(--muted); font-size: .85em; }
details[open] > summary { margin-bottom: 8px; }
details.panel { padding-block: clamp(12px,1.4vw,20px); }
.panel > details:not(.panel) + details { border-top: 1px solid var(--line); padding-top: 6px; }
fieldset { margin: 0; border: 0; border-top: 1px solid var(--line); padding: 12px 0 4px; }
legend { padding: 0 .75em 0 0; font-weight: 620; font-size: .95rem; }
.hint { padding: 14px 16px; border: 0; border-radius: 12px; font-size: .92rem; background: #e7ece3; color: #394737; }
.warning { background: #f4e9d1; color: var(--warn); }
.danger { color: #8c282d; }
.login {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: auto 1fr;
  width: min(92%,960px); margin: clamp(32px,9vh,96px) auto;
  border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--surface-shadow); background: var(--card);
}
.login .brand { margin: 0 clamp(22px,3.3vw,52px); padding: clamp(24px,3vw,40px) 0; border-bottom: 1px solid var(--line); }
.login .brand img { width: 48px; height: 48px; }
.login .brand span { font-size: .98rem; }
.login::after { content: ""; grid-area: 1/2/3/3; background: #242626 url("eyelet-collar.webp") center / cover no-repeat; }
.login .panel { grid-area: 2/1/3/2; border: 0; padding: clamp(25px,3vw,42px) clamp(22px,3.3vw,52px); background: transparent; box-shadow: none; }
.login h1 { font-size: clamp(2rem,3vw,3rem); }
.login form { display: grid; gap: 14px; }
.login form button { margin-top: 3px; }
.login p:empty { display: none; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit,minmax(min(185px,100%),1fr)); }
.status { font-size: .9rem; }
.batchlist, .batchitem { display: grid; gap: 10px; }
.batchitem { padding: 12px 0; border-top: 1px solid var(--line); }
#toast.visible {
  position: fixed; bottom: max(15px,env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); z-index: 30; max-width: min(620px,94vw); width: max-content;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 12px;
  padding: 13px 19px; box-shadow: 0 6px 30px #0003;
}
dialog { border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); max-width: min(500px,94vw); box-shadow: 0 18px 78px #151a173d; }
dialog video { display: block; max-height: 65vh; width: 100%; background: var(--ink); margin: 10px 0; }
dialog::backdrop { background: #121413b8; }
.long { overflow-wrap: anywhere; }
#syncbox:empty { display: none; }
#syncbox { margin: 12px 0; }
.badge { display: inline-block; color: var(--muted); padding: 4px 9px; background: var(--wash); border-radius: 7px; font-size: .79rem; }
.btnlink { background: transparent; color: var(--ink); border: 0; text-decoration: underline; text-underline-offset: .2em; padding: 6px; }
.topline .active-order { padding-inline: 0; color: var(--muted); }
@media (hover: hover) {
  button:is(.btnlink,.staff-name):hover:not(:disabled) { background: transparent; color: var(--ink); text-decoration-thickness: 2px; }
}
.small-gap { gap: 5px; }
@media (max-width: 800px) {
  .layout { display: block; }
  .side {
    height: auto; padding: max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 10px max(14px,env(safe-area-inset-left));
    position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,max-content);
    gap: 10px; align-items: center; overflow: visible;
  }
  .side .brand { gap: 8px; padding: 0; }
  .side .brand img { width: 31px; height: 31px; }
  .side .brand span { font-size: clamp(.66rem,1.8vw,.79rem); }
  .side nav, .side .account { display: none; }
  .picker { display: block !important; width: auto; max-width: min(42vw,260px); min-height: 44px; font-size: .91rem; border-color: #838b7a; color: var(--paper); background: #343a30; }
  .picker option { background: var(--ink); color: var(--paper); }
  .mobileout { display: inline-flex !important; }
  .topline { padding: 8px 0; flex-wrap: wrap; }
  .topline input { max-width: 160px; }
  .workspace { padding-bottom: max(32px,env(safe-area-inset-bottom)); }
}
@media (max-width: 620px) {
  .login { width: min(92%,460px); margin: 22px auto; display: flex; flex-direction: column; }
  .login .brand { margin: 0; padding: 19px 22px; border: 0; }
  .login::after { order: 1; min-height: clamp(100px,22vh,148px); background-position: 50% 52%; }
  .login .panel { order: 2; padding: 24px 22px; }
  .hero { padding: 24px 20px; min-height: 180px; }
  .hero::after { display: none; }
  .row > button, .row > .btn { flex-grow: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Reference quantity and the operator's editable quantity must remain visually distinct. */
.prep-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  margin: 16px 0;
  padding-inline: clamp(16px,2vw,26px);
}
.prep-notice .btnlink { text-align: left; justify-content: flex-start; }
.prep-row {
  display: grid;
  grid-template-columns: minmax(0,1.8fr) minmax(90px,.85fr) minmax(104px,.65fr);
  align-items: center;
  gap: 6px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.prep-row:first-child { padding-top: 4px; }
.prep-row:last-child { border-bottom: 0; }
.prep-row > span { font-weight: 520; overflow-wrap: anywhere; }
.prep-row .remove { grid-column: 3; justify-self: start; }
#prep-parts + .row { margin-top: 12px; }
@media (max-width: 620px) {
  .prep-row {
    grid-template-columns: minmax(0,1fr) minmax(110px,.8fr);
    grid-template-areas: "title title" "reference caption" "reference count";
    align-items: end;
    column-gap: 12px;
  }
  .prep-row > :first-child { grid-area: title; }
  .prep-row > small { grid-area: reference; align-self: center; }
  .prep-row::before { grid-area: caption; content: "Деталей на изделие"; color: var(--muted); font-size: .8rem; }
  .prep-row[data-kind=size]::before { content: "Изделий в заказе"; }
  .prep-row > [name=count] { grid-area: count; }
  .prep-row .remove { grid-column: 1 / -1; }
  .prep-notice { align-items: flex-start; }
}
@supports (container-type: inline-size) {
  .tile { container-type: inline-size; }
  .tile .value { font-size: clamp(1.55rem, 15cqi, 2.65rem); }
}
@media (max-width: 620px) {
  .prep-row { grid-template-columns: minmax(0,1fr) minmax(122px,.8fr); }
}

.bundle-fill,.bundle-line {display:flex;align-items:end;flex-wrap:wrap;gap:12px}
.bundle-fill {padding:14px 0;border-bottom:1px solid var(--line)}
.bundle-fill label {max-width:280px}
.bundle-group {padding:16px 0;border-bottom:1px solid var(--line)}
.bundle-group header {display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.bundle-line {padding:4px 0}
.bundle-line label {width:145px;max-width:100%}
.bundle-line .btnlink,.bundle-group>.btnlink {min-height:44px}
.bundle-mismatch {color:var(--warn)}
#bundle-summary {font-weight:600}
#batch-form fieldset>p {margin-bottom:10px}
@media (max-width:620px) {
  .bundle-line {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .bundle-line label {width:auto;min-width:0}
  .bundle-line .btnlink {grid-column:1/-1;justify-self:start}
}

.staff-name {display:inline;min-height:44px;padding:2px 4px 2px 0;border:0;background:none;color:var(--ink);text-align:left;text-decoration:underline;text-underline-offset:.18em;font:inherit}
.staff-status {display:block;margin-top:3px}
#staff-card {width:min(590px,94vw);max-width:94vw;max-height:85vh;padding:clamp(16px,3vw,28px);overflow:auto}
.staff-card-intro,.leave-row {display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px}
.staff-card-intro h2 {font-size:1.3rem}
.staff-section {margin-top:14px;border-top:1px solid var(--line);padding-top:12px}
#staff-card .stack {gap:12px}
#staff-card .btnlink {min-height:44px}
#staff-card [role=alert]:empty,#office-people-error:empty {display:none}
#staff-card [role=alert]:not(:empty) {margin-top:12px}

.order-card {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:14px}
.order-card h3,.order-card p {overflow-wrap:anywhere}
.order-card p {margin-top:3px;color:var(--muted);font-size:.92rem}
.order-week,.order-crew {display:flex;flex-wrap:wrap;gap:4px 15px}
.order-week label,.order-crew label,.crew-all {display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:7px;min-height:44px}
.order-week input,.order-crew input,.crew-all input {width:18px;min-height:18px;height:18px;flex:none}
.order-crew {max-height:230px;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,225px),1fr))}
.order-line {display:flex;flex-wrap:wrap;align-items:end;gap:10px;padding:7px 0}
.order-operation {border-bottom:1px solid var(--line);padding:10px 0}
.order-operation>.btnlink {justify-self:start}
#new-order fieldset {min-width:0}
.topline .active-order {min-height:44px;max-width:100%;text-align:left;overflow-wrap:anywhere}
@media(max-width:620px){.order-line>label {flex:1 1 130px;min-width:0}}
