:root {
  --bg: #0e1013;
  --panel: #15181d;
  --panel-2: #1b1f25;
  --line: #2a2f37;
  --text: #e9ecef;
  --muted: #9aa3ad;
  --lime: #d4ff3f;
  --lime-dim: #9fbf2f;
  --warn: #ff8a5c;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ol, ul { list-style: none; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.muted { color: var(--muted); }
.k { font: 500 12px var(--mono); color: var(--lime-dim); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 2px; cursor: pointer; font: 700 13px var(--mono); white-space: nowrap; transition: background-color .15s, box-shadow .15s, color .15s; }
.btn--lime { background: var(--lime); color: var(--bg); }
.btn--lime:hover { background: #e6ff8a; }
.btn--line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn--line:hover { box-shadow: inset 0 0 0 1px var(--lime); color: var(--lime); }
.btn--warn { background: transparent; box-shadow: inset 0 0 0 1px #5a3426; color: var(--warn); }
.btn--warn:hover { background: rgba(255, 138, 92, .08); }
.btn--sm { height: 36px; padding: 0 12px; font-size: 12px; }
.btn--block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; border-radius: 2px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: min(400px, 100%); border: 1px solid var(--line); background: var(--panel); padding: 32px 28px 26px; position: relative; }
.login__card::before { content: ""; position: absolute; left: -2px; top: -2px; width: 14px; height: 14px; border: 2px solid var(--lime); border-right: 0; border-bottom: 0; }
.login h1 { font: 800 28px/1.1 var(--mono); letter-spacing: -.04em; margin-top: 14px; }
.login .muted { margin: 8px 0 22px; }
.err { color: var(--warn); font: 500 12px var(--mono); margin: -4px 0 12px; }
.err:empty { display: none; }
.hint { margin-top: 14px; font: 400 12px var(--mono); color: var(--muted); text-align: center; }
.back { display: block; text-align: center; margin-top: 8px; font: 500 12px var(--mono); color: var(--lime); }

.f { display: block; margin-bottom: 12px; min-width: 0; }
.f > span { display: block; font: 500 11px var(--mono); color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.f input, .f select, .f textarea { width: 100%; border: 0; border-radius: 2px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); padding: 10px 12px; font-size: 14px; resize: vertical; }
.f select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--lime) 50%), linear-gradient(135deg, var(--lime) 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--lime); }

/* bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px clamp(12px, 2vw, 24px); background: rgba(14, 16, 19, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.logo { display: flex; align-items: center; gap: 8px; color: var(--lime); font: 800 17px var(--mono); letter-spacing: -.03em; flex: none; }
.logo span { color: var(--text); }
.logo i { font-style: normal; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.tabs { display: flex; border: 1px solid var(--line); flex: none; }
.tabs button { border: 0; background: none; color: var(--muted); font: 500 13px var(--mono); padding: 7px 12px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.tabs button + button { border-left: 1px solid var(--line); }
.tabs button.is-on { background: var(--lime); color: var(--bg); }
.badge { font-size: 11px; background: var(--warn); color: var(--bg); padding: 0 6px; border-radius: 2px; }
.search { flex: 1; max-width: 360px; margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); height: 36px; padding: 0 10px; font-family: var(--mono); }
.search:focus-within { border-color: var(--lime); }
.search span { color: var(--lime); }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font: 500 13px var(--mono); }
.menu { position: relative; }
.menu__list { position: absolute; right: 0; top: 42px; background: var(--panel-2); border: 1px solid var(--line); min-width: 210px; padding: 4px; z-index: 20; }
.menu__list a, .menu__list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; font: 500 13px var(--mono); cursor: pointer; }
.menu__list a:hover, .menu__list button:hover { background: var(--bg); color: var(--lime); }

/* kpi */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.kpi { padding: 12px clamp(12px, 2vw, 24px); min-width: 0; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi__t { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi__v { font: 800 24px/1.3 var(--mono); letter-spacing: -.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi__v.is-warn { color: var(--warn); }
.kpi__v.is-lime { color: var(--lime); }

.view { padding: 14px clamp(12px, 2vw, 24px) 32px; }
.lead { font: 400 13px var(--mono); color: var(--muted); margin-bottom: 14px; max-width: 90ch; }

/* filters */
.filters { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.stagef, .masterf { display: flex; flex-wrap: wrap; gap: 4px; }
.stagef button, .masterf button { border: 0; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 500 12px var(--mono); padding: 6px 10px; cursor: pointer; border-radius: 2px; }
.stagef button b { color: var(--text); font-weight: 700; margin-left: 4px; }
.stagef button.is-on, .masterf button.is-on { box-shadow: inset 0 0 0 1.5px var(--lime); color: var(--lime); }
.stagef button.is-on b { color: var(--lime); }

/* split */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); gap: 14px; align-items: start; }
.olist { border: 1px solid var(--line); min-width: 0; }
.orow { display: grid; grid-template-columns: 74px minmax(0, 1.5fr) minmax(0, 1fr) 96px 92px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background-color .12s; width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-top: 0; }
.orow:last-child { border-bottom: 0; }
.orow:hover { background: var(--panel); }
.orow.is-on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--lime); }
.orow.is-flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { background: rgba(212, 255, 63, .14); } }
.orow > * { min-width: 0; }
.orow__num { font: 800 14px var(--mono); }
.orow__dev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__dev small, .orow__cl small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__cl { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orow__due { font: 500 12px var(--mono); color: var(--muted); text-align: right; }
.orow__due.is-late { color: var(--warn); }
.pill { display: inline-block; font: 500 11px var(--mono); padding: 3px 7px; border-radius: 2px; white-space: nowrap; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.pill.s-new { color: var(--bg); background: #7fb2ff; box-shadow: none; }
.pill.s-accepted, .pill.s-diag { color: var(--text); }
.pill.s-parts { color: var(--warn); box-shadow: inset 0 0 0 1px #5a3426; }
.pill.s-repair { color: var(--lime); box-shadow: inset 0 0 0 1px var(--lime-dim); }
.pill.s-ready { background: var(--lime); color: var(--bg); box-shadow: none; }
.pill.s-cancel { text-decoration: line-through; }
.empty { padding: 40px 20px; text-align: center; font: 400 13px var(--mono); color: var(--muted); }

/* detail */
.detail { border: 1px solid var(--line); background: var(--panel); position: sticky; top: 70px; max-height: calc(100vh - 84px); overflow-y: auto; min-width: 0; }
.d__head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d__num { font: 800 26px/1 var(--mono); letter-spacing: -.04em; }
.d__meta { font: 400 12px var(--mono); color: var(--muted); margin-top: 6px; }
.d__close { display: none; }
.d__body { padding: 14px 18px 18px; }
.flow { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.flow button { border: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font: 500 12px var(--mono); padding: 7px 9px; cursor: pointer; border-radius: 2px; }
.flow button.is-done { color: var(--text); box-shadow: inset 0 0 0 1px var(--lime-dim); }
.flow button.is-now { background: var(--lime); color: var(--bg); box-shadow: none; font-weight: 700; }
.flow button.is-cancel { margin-left: auto; color: var(--warn); }
.flow button:hover:not(.is-now) { box-shadow: inset 0 0 0 1px var(--lime); }
.g2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.box { border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; margin-bottom: 12px; }
.box__t { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.box b { font-weight: 600; }
.links { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.links a { font: 500 12px var(--mono); padding: 5px 9px; box-shadow: inset 0 0 0 1px var(--line); border-radius: 2px; }
.links a:hover { box-shadow: inset 0 0 0 1px var(--lime); color: var(--lime); }
.d__h { font: 700 12px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 16px 0 8px; }
.note-add { display: flex; gap: 6px; margin-bottom: 10px; }
.note-add input { flex: 1; min-width: 0; height: 36px; border: 0; border-radius: 2px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); padding: 0 10px; font-size: 13px; }
.note-add input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--lime); }
.tl { border-left: 1px solid var(--line); padding-left: 12px; margin-left: 4px; display: grid; gap: 8px; font-size: 13px; }
.tl time { display: block; font: 400 11px var(--mono); color: var(--muted); }
.tl .is-stage { color: var(--lime-dim); font-family: var(--mono); font-size: 12px; }
.d__foot { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); }
.overdue { font: 500 12px var(--mono); color: var(--warn); background: rgba(255, 138, 92, .08); border: 1px solid #5a3426; padding: 7px 10px; margin-bottom: 12px; }

/* parts */
.parts { border: 1px solid var(--line); }
.prt { display: grid; grid-template-columns: 74px minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prt:last-child { border-bottom: 0; }
.prt > * { min-width: 0; }
.prt__part b { font: 700 14px var(--mono); }
.prt__part small { display: block; color: var(--muted); font-size: 12px; }
.prt__act { display: flex; gap: 6px; align-items: center; }

/* team */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); }
.mcard { padding: 20px; min-width: 0; }
.mcard + .mcard { border-left: 1px solid var(--line); }
.mcard h3 { font: 800 20px var(--mono); letter-spacing: -.03em; }
.mcard p { color: var(--muted); font-size: 13px; }
.mcard dl { margin-top: 16px; border-top: 1px dashed var(--line); }
.mcard dl div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font: 500 13px var(--mono); }
.mcard dt { color: var(--muted); }
.bars { display: flex; height: 6px; margin-top: 14px; gap: 2px; }
.bars i { display: block; height: 100%; }

.snack { position: fixed; left: 50%; bottom: 20px; z-index: 40; transform: translate(-50%, 16px); opacity: 0; background: var(--lime); color: var(--bg); padding: 10px 16px; font: 700 13px var(--mono); transition: opacity .25s, transform .25s var(--ease); pointer-events: none; max-width: calc(100% - 32px); }
.snack.is-on { opacity: 1; transform: translate(-50%, 0); }

/* квитанция для печати */
.receipt { display: none; }
@media print {
  body { background: #fff; color: #000; }
  body > *:not(.receipt) { display: none !important; }
  .receipt { display: block !important; font: 12px/1.5 var(--mono); color: #000; padding: 10mm; }
  .receipt h1 { font-size: 20px; margin-bottom: 6px; }
  .receipt table { width: 100%; border-collapse: collapse; margin: 12px 0; }
  .receipt td { border-bottom: 1px dashed #999; padding: 6px 0; vertical-align: top; }
  .receipt td:last-child { text-align: right; }
  .receipt .sign { margin-top: 28px; display: flex; justify-content: space-between; }
}

@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .detail { position: fixed; inset: 0; z-index: 30; max-height: none; top: 0; border: 0; animation: up .25s var(--ease); }
  @keyframes up { from { transform: translateY(16px); opacity: 0; } }
  .detail:empty { display: none; }
  .d__close { display: grid; place-items: center; }
  .team { grid-template-columns: minmax(0, 1fr); }
  .mcard + .mcard { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 8px; }
  .logo i { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .tabs button { padding: 7px 9px; font-size: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-left: 0 !important; border-top: 1px solid var(--line); }
  .kpi:nth-child(-n+2) { border-top: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .kpi__v { font-size: 20px; }
  .stagef { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .stagef::-webkit-scrollbar { display: none; }
  .stagef button { flex: none; }
  .orow { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .orow__cl, .orow__due { display: none; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .prt { grid-template-columns: 64px minmax(0, 1fr); }
  .prt__act { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
