* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 Arial, Helvetica, sans-serif; color: #1a1a1a; background: #fff; }
a { color: #0b4f8a; }
header { display: flex; align-items: center; gap: 24px; padding: 0 16px; height: 44px; background: #1f2a36; color: #fff; }
header .brand { font-weight: bold; }
header nav { display: flex; gap: 16px; flex: 1; }
header a { color: #fff; text-decoration: none; }
header a:hover { text-decoration: underline; }
header .user { display: flex; gap: 12px; align-items: center; margin: 0; }
main { padding: 16px; max-width: 1400px; }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 20px 0 8px; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid #d0d4d9; padding: 5px 8px; text-align: left; vertical-align: top; }
th { background: #f0f2f4; font-weight: bold; white-space: nowrap; }
tr:hover td { background: #f7f9fb; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.props { width: auto; min-width: 480px; }
.props th { width: 180px; }
.muted, tr.muted td { color: #777; }
.bad { color: #b00020; font-weight: bold; }
.st-quarantine { color: #8a5a00; }
.st-released { color: #1b6e2e; }
.st-rejected { color: #b00020; }
.count { display: inline-block; min-width: 22px; padding: 0 6px; border: 1px solid #999; text-align: center; font-weight: normal; }
.count.bad { border-color: #b00020; }
input, select, button, .btn { font: inherit; padding: 5px 8px; border: 1px solid #8a9199; background: #fff; border-radius: 0; }
button, .btn { background: #1f2a36; color: #fff; border-color: #1f2a36; cursor: pointer; text-decoration: none; display: inline-block; }
button.link { background: none; border: 0; color: #fff; padding: 0; text-decoration: underline; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.card { border: 1px solid #d0d4d9; padding: 12px; }
.card h1, .card h2 { margin-top: 0; }
.narrow { max-width: 460px; }
.card > div { margin-bottom: 10px; }
.card label { display: block; margin-bottom: 3px; font-weight: bold; }
.card input:not([type=checkbox]), .card select { width: 100%; }
.card input[type=checkbox] { margin-right: 6px; }
.helptext { color: #777; font-size: 12px; }
.errorlist { color: #b00020; margin: 0 0 4px; padding: 0; list-style: none; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 16px 0; }
.msg { border: 1px solid #1b6e2e; padding: 8px; margin: 0 0 12px; }
.msg.error { border-color: #b00020; }
.pager { display: flex; gap: 12px; }
.pick { display: flex; gap: 6px; }
.pick select { flex: 1; }
.pick button { width: 34px; padding: 5px 0; }
.sub { margin-top: 8px; padding: 8px; border: 1px solid #d0d4d9; background: #f7f9fb; }
.sub > label { margin-top: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two > div { margin-top: 8px; }
.card > .two { margin-top: -8px; }
.tabs { display: flex; gap: 0; margin: 0 0 12px; border-bottom: 1px solid #1f2a36; }
.tabs a { padding: 6px 14px; text-decoration: none; color: #1a1a1a; border: 1px solid #d0d4d9; border-bottom: 0; margin-right: 4px; }
.tabs a.on { background: #1f2a36; color: #fff; border-color: #1f2a36; }
input.fact { width: 110px; text-align: right; }
button.danger { background: #b00020; border-color: #b00020; }
button.link.dark { color: #0b4f8a; }
.addline { margin-top: 16px; }
.addline .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 10px; }
.addline .sub label { margin-top: 6px; }
h1 .count { font-size: 13px; vertical-align: middle; }
@media print {
  header, .noprint, .msg { display: none !important; }
  main { padding: 0; }
  a { color: inherit; text-decoration: none; }
}
.props.wide { min-width: 640px; }
.props.wide th { width: auto; }
.card.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.card.inline > div { margin: 0; min-width: 150px; flex: 1; }
.os-issued { color: #8a5a00; }
.os-cooked { color: #0b4f8a; }
.os-closed { color: #1b6e2e; }
.os-cancelled { color: #777; }
header .brand { white-space: nowrap; }
header { gap: 16px; }
header nav { gap: 12px; font-size: 13px; flex-wrap: wrap; }
form.inl { display: inline; margin: 0; }
.os-planned { color: #555; }
@media print {
  input.fact { border: 0; border-bottom: 1px solid #000; background: none; }
  .tabs, form.addline { display: none; }
}
select.sm { max-width: 230px; padding: 3px 4px; }
input.sm { width: 80px; padding: 3px 4px; text-align: right; }
.combo { position: relative; display: inline-block; width: 100%; }
.combo input { width: 100%; }
.combo input.sm { max-width: 230px; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; min-width: 260px; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid #1f2a36; }
.combo-list div { padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-list div:hover, .combo-list div.on { background: #e6edf4; }
.filters .combo { width: auto; min-width: 220px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #e2e6ea; }
th[data-dir=asc]::after { content: " \25B2"; font-size: 10px; }
th[data-dir=desc]::after { content: " \25BC"; font-size: 10px; }
input.tsearch { display: block; width: 280px; margin: 0 0 8px; }
.level-late td:last-child { color: #b00020; font-weight: bold; }
.level-soon td:last-child { color: #8a5a00; font-weight: bold; }
.chart { max-width: 900px; position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .tip { position: absolute; pointer-events: none; background: #1f2a36; color: #fff; padding: 3px 7px; font-size: 12px; white-space: nowrap; }
.keys { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: #555; margin: 4px 0 0; }
.keys i { display: inline-block; width: 22px; height: 0; border-top: 2px solid #0b4f8a; vertical-align: middle; margin-right: 5px; }
.keys i.dash { border-top-style: dashed; }
.keys i.safe { border-top: 1px solid #8a5a00; }
.keys i.box { height: 10px; border: 0; background: #e3e6ea; }
@media print {
  header, .noprint, .filters, form.card, .cols form, .card.inline, .card.addline, .tsearch, .pager, .tabs, .msg, button, .keys { display: none !important; }
  body { font-size: 12px; }
  main { max-width: none; }
  select, input, .combo input { border: 0 !important; background: none; padding: 0; -webkit-appearance: none; appearance: none; }
  input.fact { border-bottom: 1px solid #000 !important; }
  th.sortable::after { content: none !important; }
  tr { break-inside: avoid; }
}
header .lang { gap: 6px; }
header .lang button { text-decoration: none; opacity: .6; }
header .lang button.on { opacity: 1; font-weight: bold; text-decoration: underline; }
.langbar { margin: 0 0 10px; display: flex; gap: 14px; }
.langbar button.on { font-weight: bold; }

table.journal { table-layout: fixed; width: 100%; max-width: none; }
table.journal td { vertical-align: middle; }
table.journal td.k { font-weight: bold; }
.pr { display: inline-flex; align-items: center; gap: 5px; margin: 2px 12px 2px 0; white-space: nowrap; max-width: 100%; }
table.journal td { overflow: hidden; }
table.journal td:last-child { white-space: nowrap; }
.pr > span:first-child { color: #555; }
.pr .v { font-weight: bold; }
.pr input[type=text] { width: 56px; padding: 3px 5px; text-align: right; }
.pr input.plan { color: #9aa3ad; }
.pr input.bad { color: #b00020; border-color: #b00020; font-weight: bold; }
.journal-bar { background: #f0f1f3; padding: 8px; margin: 14px 0 0; }
.wide { min-width: 360px; }
button.big { font-size: 15px; padding: 10px 18px; }
table.sheet .combo input.sm { text-align: left; width: 100%; max-width: 280px; }
table.sheet select[name=new_article] { min-width: 260px; }
#rc-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 50; overflow: auto; padding: 40px 20px; }
#rc-back[hidden] { display: none; }
#rc-box { background: #fff; border: 1px solid #1f2937; padding: 16px 20px; max-width: 1500px; margin: 0 auto; }
.newitem { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
#rows input[type=file] { max-width: 230px; }
.newitem[hidden] { display: none; }

/* ---- оформление v2: панель, крошки, таблицы, телефон ---- */
header { position: relative; flex-wrap: wrap; min-height: 44px; height: auto; }
header .brand { color: #fff; text-decoration: none; font-weight: bold; }
header nav { align-items: center; gap: 4px; font-size: 14px; flex-wrap: nowrap; }
header nav > a, .dd > button.ddb { color: #fff; text-decoration: none; padding: 12px 10px; display: block; background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; cursor: pointer; }
header nav > a:hover, .dd > button.ddb:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
header nav > a.on, .dd.on > button.ddb { border-bottom-color: #fff; font-weight: bold; }
.dd { position: relative; }
.dd-menu { display: none; position: absolute; z-index: 40; left: 0; top: 100%; min-width: 190px; background: #fff; border: 1px solid #1f2a36; }
.dd.open .dd-menu { display: block; }
.dd-menu a { display: block; color: #1a1a1a; padding: 9px 14px; text-decoration: none; border-bottom: 1px solid #e3e6ea; }
.dd-menu a:hover { background: #e8f1fb; }
.dd-menu a.on { font-weight: bold; border-left: 3px solid #0b4f8a; padding-left: 11px; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255, 255, 255, .5); color: #fff; font-size: 20px; line-height: 1; padding: 6px 10px; margin-left: auto; }
.crumbs { padding: 7px 16px; background: #f6f8fa; border-bottom: 1px solid #e3e6ea; color: #5b6572; font-size: 13px; }
.crumbs i { font-style: normal; margin: 0 4px; color: #9aa3ad; }
.crumbs a { color: #0b4f8a; }
.crumbs .leaf { color: #1a1a1a; font-weight: bold; }
th, td { border: 0; border-bottom: 1px solid #e3e6ea; padding: 8px 10px; }
th { background: #eef1f4; color: #3a4350; border-bottom: 2px solid #c9ced4; }
table:not(.props):not(.sheet) tr:nth-child(even) td { background: #f8f9fb; }
tr:hover td, table:not(.props):not(.sheet) tr:hover td { background: #e8f1fb; }
.props th { background: #eef1f4; border-bottom: 1px solid #e3e6ea; }
.tw { margin: 0 0 8px; }
.home { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 0 0 8px; }
.tile { display: block; border: 1px solid #c9ced4; padding: 16px 14px; color: #1a1a1a; text-decoration: none; font-size: 16px; font-weight: bold; background: #fff; }
.tile:hover { background: #e8f1fb; border-color: #0b4f8a; }
.tile small { display: block; font-weight: normal; font-size: 13px; color: #5b6572; margin-top: 4px; }
.tile.first { background: #1f2a36; color: #fff; border-color: #1f2a36; }
.tile.first small { color: #c5ccd6; }
.tile.first:hover { background: #2c3b4c; }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid #0b4f8a; outline-offset: 1px; }
@media (min-width: 1280px) { th { position: sticky; top: 0; z-index: 2; } table.journal th, table.sheet th { position: static; } }
table.journal { min-width: 1320px; }
table.sheet { min-width: 860px; }
.tw { overflow-x: auto; }
h1 .btn { font-size: 14px; font-weight: normal; margin-left: 14px; vertical-align: middle; }
@media (max-width: 899px) {
  header { gap: 8px; padding: 6px 12px; }
  .menu-btn { display: block; }
  header nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; order: 5; }
  header.open nav { display: flex; }
  header nav > a, .dd > button.ddb { padding: 12px 8px; border-bottom: 1px solid rgba(255, 255, 255, .15); text-align: left; width: 100%; }
  .dd-menu { position: static; display: block; border: 0; background: rgba(255, 255, 255, .08); }
  .dd-menu a { color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .12); padding-left: 24px; }
  .dd-menu a.on { border-left: 0; }
  .dd > button.ddb::after { content: ""; }
  header .user { display: none; order: 6; flex-basis: 100%; justify-content: space-between; }
  header.open .user { display: flex; }
  main { padding: 10px; }
  .crumbs { padding: 6px 12px; }
  input, select, button, .btn { min-height: 44px; font-size: 16px; }
  input[type=checkbox], input[type=radio] { min-height: 0; }
  .filters > *, .filters input, .filters select { flex: 1 1 100%; width: 100%; }
  .wide, input.tsearch { min-width: 0; width: 100%; }
  .cols, .two { grid-template-columns: 1fr; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr.hrow, table.cards tr[hidden] { display: none; }
  table.cards tr { border: 1px solid #d0d4d9; margin: 0 0 8px; padding: 6px 10px; background: #fff; }
  table.cards tr:nth-child(even) td, table.cards tr:hover td { background: none; }
  table.cards td { border: 0; padding: 3px 0; text-align: left !important; white-space: normal; }
  table.cards td::before { content: attr(data-label); display: block; color: #6b7380; font-size: 11px; }
  table.cards td:empty { display: none; }
  .home { grid-template-columns: 1fr; }
}
@media print { .crumbs { display: none !important; } }

/* подсчёт с телефона */
.cnt{max-width:520px}
.cnt h1{font-size:20px;margin:10px 0 4px}
.cnt-bar{display:flex;justify-content:space-between;background:#1f2933;color:#fff;padding:8px 10px;font-size:14px}
.cnt-art{border-top:1px solid #d5d9de;margin-top:10px;padding-top:6px}
.cnt-art h2{font-size:15px;margin:4px 0 6px}
.cnt-row{display:grid;grid-template-columns:1fr 120px;gap:8px;align-items:center;padding:5px 0;font-size:15px}
.cnt-row small{display:block;color:#6b7280;font-size:13px}
.cnt-row input{height:42px;font-size:18px;width:100%;box-sizing:border-box;border:1px solid #8a939c;border-radius:0;padding:0 8px}
.cnt-row input.q{text-align:right}
.cnt-new{border:1px dashed #8a939c;padding:6px 8px;margin:6px 0}
.cnt-ck{display:block;font-size:14px;color:#4b5563;padding:2px 0 6px}
.cnt-ck input{width:20px;height:20px;vertical-align:-4px}
.cnt-add{font-size:15px;padding:8px 0}
.cnt-ok{display:block;width:100%;height:52px;font-size:18px;margin-top:14px;background:#1f2933;color:#fff;border:0;border-radius:0}
.cnt-skip{display:block;margin:12px auto;font-size:14px}
.cnt .tile{display:block;margin:8px 0}
form.inline{display:inline;margin-left:10px}
.bulkbar{position:fixed;top:0;left:0;right:0;z-index:100;background:#fff8e1;border-bottom:2px solid #e0c46c;padding:10px 16px;box-shadow:0 2px 6px rgba(0,0,0,.15);display:flex;gap:14px;align-items:center}
.bulkbar[hidden]{display:none}
.envbar{background:#b42318;color:#fff;text-align:center;font-weight:bold;padding:4px;font-size:13px}
