/* BN_COUNTERS_VERSION_2 */
:root {--bg:#f4f6f9;--card:#fff;--text:#06122b;--muted:#64748b;--line:#d7dde8;--dark:#071226;--soft:#eef2f7;--shirt:#e8f0ff;--shorts:#fff1e6;--ok:#16a34a;}
*{box-sizing:border-box} body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
header{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--line);padding:12px 18px;display:flex;justify-content:space-between;gap:16px;align-items:center}
.brand{font-size:18px;font-weight:900} .sub{font-size:12px;color:var(--muted);margin-top:3px} main{max-width:1640px;margin:0 auto;padding:14px}
button{border:0;border-radius:8px;padding:9px 12px;background:var(--dark);color:#fff;font-weight:800;cursor:pointer} select{border:1px solid var(--line);border-radius:8px;padding:9px 10px;background:#fff}
.toolbar{display:flex;gap:8px;flex-wrap:wrap;align-items:center} .soft-btn{background:#e9edf5;color:#06122b} .reset-btn{background:#dc2626;color:#fff}
.city-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px} .city-tab{background:#fff;color:#06122b;border:1px solid var(--line)} .city-tab.active{background:#06122b;color:#fff}
.stats{display:grid;grid-template-columns:repeat(10,minmax(135px,1fr));gap:10px;margin-bottom:14px}.stat.wide{grid-column:span 2}.progress{height:8px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin-top:8px}.progress i{display:block;height:100%;border-radius:999px;transition:width .2s,background .2s}.stat small{display:block;color:var(--muted);font-size:11px;margin-top:3px} .stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px} .stat span{font-size:12px;color:var(--muted)} .stat b{display:block;font-size:24px;margin-top:4px}
.grid{display:flex;flex-direction:column;gap:16px} .card{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden;box-shadow:0 2px 12px rgba(15,23,42,.05)}
.form-top{padding:14px;display:grid;grid-template-columns:minmax(260px,1fr) 260px;gap:16px;border-bottom:1px solid var(--line)} h1{margin:0 0 8px;font-size:24px} .meta{display:flex;flex-wrap:wrap;gap:10px;color:var(--muted);font-size:13px} .qty{font-size:26px;font-weight:900;margin-top:10px} .preview{background:#fafafa;border:1px solid var(--line);border-radius:12px;padding:8px;display:flex;align-items:center;justify-content:center;min-height:150px} .preview img{max-height:170px;max-width:100%;object-fit:contain}
.table-section{padding:12px 14px 16px} .table-head{display:flex;justify-content:space-between;gap:12px;align-items:center;background:var(--soft);border:1px solid var(--line);border-radius:10px 10px 0 0;padding:10px} .table-title{font-weight:900} .actions{display:flex;gap:8px;flex-wrap:wrap}
.table-wrap{overflow:auto;border:1px solid var(--line);border-top:0} table{width:100%;border-collapse:collapse;font-size:13px;min-width:1450px} th,td{border-bottom:1px solid var(--line);padding:7px 6px;text-align:left;vertical-align:middle} th{background:#fbfcfe;font-size:12px;color:#334155;position:sticky;top:0;z-index:1} .group-shirt{background:var(--shirt)} .group-shorts{background:var(--shorts)} .check{width:18px;height:18px;cursor:pointer} .status-cell{text-align:center} .size-cell{font-weight:800;white-space:nowrap} .number-cell{font-weight:900;white-space:nowrap} .index-cell{color:var(--muted);white-space:nowrap} .defect{width:110px;border:1px solid var(--line);border-radius:7px;padding:6px;background:#fff} .empty{padding:20px;background:#fff;border:1px solid var(--line);border-radius:12px}
@media(max-width:1200px){.stats{grid-template-columns:repeat(4,1fr)} .form-top{grid-template-columns:1fr}} @media(max-width:700px){header{align-items:flex-start;flex-direction:column} .toolbar,select,button{width:100%} main{padding:10px} .stats{grid-template-columns:repeat(2,1fr)} h1{font-size:20px}}

/* Финальная структура отчета */
.stats{position:sticky;top:70px;z-index:18;background:var(--bg);padding:8px 0 10px;border-bottom:1px solid var(--line);grid-template-columns:repeat(12,minmax(120px,1fr));}
.main-total{grid-column:span 3;border:2px solid #d7dde8;box-shadow:0 4px 14px rgba(15,23,42,.08)}
.stat-group-title{display:flex;align-items:center;justify-content:center;background:#06122b;color:#fff;border-radius:12px;padding:10px;font-weight:900;font-size:13px;min-height:58px;text-align:center}
.muted-title{background:#64748b}
table{min-width:1780px}.master-row th{text-align:center;padding:6px}.master-check{outline:2px solid rgba(37,99,235,.12)}
th{white-space:normal;line-height:1.2}.status-cell{text-align:center;min-width:82px}.defect{width:110px}
@media(max-width:1200px){.stats{grid-template-columns:repeat(4,1fr);top:92px}.main-total{grid-column:span 4}}
@media(max-width:700px){.stats{grid-template-columns:repeat(2,1fr);top:132px}.main-total{grid-column:span 2}.stat-group-title{grid-column:span 2}}


/* SVG-style fixed top report */
.stats{
  position:sticky;
  top:70px;
  z-index:18;
  background:var(--bg);
  padding:10px 0 12px;
  border-bottom:1px solid var(--line);
  display:grid;
  grid-template-columns:repeat(4,minmax(270px,1fr));
  gap:12px;
}
.svg-report-card{
  background:#fff;
  border:2px solid #aeb8c6;
  border-radius:26px;
  padding:14px;
  box-shadow:0 2px 10px rgba(15,23,42,.05);
  min-height:176px;
}
.svg-report-card.report-total{
  grid-column:span 2;
}
.svg-report-title{
  text-align:center;
  font-size:18px;
  line-height:1.1;
  font-weight:900;
  color:#a7b0bd;
  text-transform:uppercase;
  letter-spacing:.03em;
  margin-bottom:12px;
}
.svg-report-main{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:96px;
  border:3px dashed #aeb8c6;
  border-radius:22px;
  padding:12px;
  text-align:center;
}
.svg-report-main b{
  font-size:34px;
  line-height:1;
  color:#5b9b2d;
  font-weight:900;
}
.svg-report-main span{
  margin-top:7px;
  color:#64748b;
  font-size:12px;
  font-weight:700;
}
.svg-report-pair{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.svg-report-box{
  border:3px dashed #aeb8c6;
  border-radius:22px;
  min-height:104px;
  padding:12px 10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.svg-report-label{
  font-size:13px;
  font-weight:900;
  color:#a7b0bd;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:8px;
  text-align:center;
}
.svg-report-value{
  font-size:34px;
  line-height:1;
  font-weight:900;
  color:#5b9b2d;
}
.svg-progress{
  height:10px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin-top:10px;
}
.svg-progress i{
  display:block;
  height:100%;
  border-radius:999px;
  transition:width .2s,background .2s;
}
@media(max-width:1300px){
  .stats{grid-template-columns:repeat(2,minmax(260px,1fr));top:92px;}
  .svg-report-card.report-total{grid-column:span 2;}
}
@media(max-width:700px){
  .stats{grid-template-columns:1fr;top:132px;}
  .svg-report-card.report-total{grid-column:span 1;}
  .svg-report-pair{grid-template-columns:1fr 1fr;}
  .svg-report-value,.svg-report-main b{font-size:28px;}
}


/* compact top report and smaller table controls */
.stats{
  position:sticky;
  top:70px;
  z-index:18;
  background:var(--bg);
  padding:6px 0 8px;
  border-bottom:1px solid var(--line);
  display:grid;
  grid-template-columns:1.25fr 1.25fr repeat(4,1fr);
  gap:8px;
  margin-bottom:10px;
}
.top-total,.compact-stat{
  background:#fff;
  border:1px solid #cfd8e6;
  border-radius:14px;
  min-height:68px;
  padding:8px 10px;
  box-shadow:0 1px 6px rgba(15,23,42,.04);
}
.top-total span,.compact-stat span{display:block;color:#5d6b82;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-total b,.compact-stat b{display:block;font-size:22px;line-height:1.05;margin-top:3px;color:#06122b;font-weight:900;white-space:nowrap}
.top-total small,.compact-stat small{display:block;color:#64748b;font-size:10px;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.compact-main b{color:#5b9b2d}.city-done-box b{font-size:20px;color:#06122b}.mini-progress{height:6px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin-top:5px}.mini-progress i{display:block;height:100%;border-radius:999px;transition:width .2s,background .2s}
.check{width:14px!important;height:14px!important}.master-check{width:15px!important;height:15px!important}.status-cell{min-width:58px!important;text-align:center}.defect{width:86px!important;padding:4px 6px!important;font-size:12px}.table-wrap table{min-width:1160px!important}th,td{padding:5px 5px!important}th{font-size:11px!important}.master-row th{padding:4px!important}.form-top{grid-template-columns:minmax(260px,1fr) 230px}.preview{min-height:130px}.preview img{max-height:145px}
@media(max-width:1300px){.stats{grid-template-columns:repeat(3,1fr);top:92px}}
@media(max-width:780px){.stats{grid-template-columns:repeat(2,1fr);top:132px}.top-total b,.compact-stat b{font-size:18px}.city-done-box b{font-size:17px}}

.bulk-control{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;line-height:1}
.bulk-control span{font-size:10px;font-weight:600;color:#475569;white-space:nowrap}
.bulk-control .master-check{width:14px!important;height:14px!important;margin:0}


/* FINAL: верхний отчет снова в стиле SVG-блоков */
.stats{
  position:sticky!important;
  top:70px!important;
  z-index:18!important;
  background:var(--bg)!important;
  padding:8px 0 10px!important;
  border-bottom:1px solid var(--line)!important;
  display:grid!important;
  grid-template-columns:1.35fr 1fr repeat(4,1fr)!important;
  gap:8px!important;
  margin-bottom:10px!important;
}
.svg-report-card{
  background:#fff!important;
  border:2px solid #aeb8c6!important;
  border-radius:20px!important;
  padding:7px!important;
  min-height:76px!important;
  box-shadow:0 1px 8px rgba(15,23,42,.05)!important;
}
.svg-report-title{
  text-align:center!important;
  font-size:10px!important;
  line-height:1.05!important;
  font-weight:900!important;
  color:#a6afbd!important;
  text-transform:uppercase!important;
  letter-spacing:.035em!important;
  margin-bottom:5px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.svg-report-main{
  min-height:48px!important;
  border:2px dashed #aeb8c6!important;
  border-radius:15px!important;
  padding:5px 7px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}
.svg-report-main b{
  font-size:20px!important;
  line-height:1!important;
  color:#5b9b2d!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
.svg-report-main span{
  margin-top:3px!important;
  color:#64748b!important;
  font-size:9px!important;
  font-weight:800!important;
  text-transform:uppercase!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:100%!important;
}
.svg-report-pair{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:6px!important;
}
.svg-report-box{
  min-height:48px!important;
  border:2px dashed #aeb8c6!important;
  border-radius:15px!important;
  padding:5px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  text-align:center!important;
}
.svg-report-label{
  font-size:8px!important;
  line-height:1!important;
  font-weight:900!important;
  color:#a6afbd!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
  margin-bottom:4px!important;
  white-space:nowrap!important;
}
.svg-report-value{
  font-size:20px!important;
  line-height:1!important;
  font-weight:900!important;
  color:#5b9b2d!important;
}
.svg-progress{
  width:100%!important;
  height:5px!important;
  background:#e5e7eb!important;
  border-radius:999px!important;
  overflow:hidden!important;
  margin-top:4px!important;
}
.svg-progress i{display:block!important;height:100%!important;border-radius:999px!important;transition:width .2s,background .2s!important;}
.top-total,.compact-stat,.compact-main,.city-done-box{all:unset;}
@media(max-width:1300px){.stats{grid-template-columns:repeat(3,1fr)!important;top:92px!important}}
@media(max-width:780px){.stats{grid-template-columns:repeat(2,1fr)!important;top:132px!important}.svg-report-main b,.svg-report-value{font-size:18px!important}}


/* FINAL PROGRESS FRAME REPORT */
.stats{
  position:sticky!important;
  top:70px!important;
  z-index:30!important;
  display:block!important;
  background:var(--bg)!important;
  padding:8px 0 10px!important;
  border-bottom:1px solid var(--line)!important;
  margin-bottom:12px!important;
}
.global-progress-card{
  --pct:0;
  --progress-color:#dc2626;
  width:100%;
  min-height:76px;
  border-radius:20px;
  padding:3px;
  background:
    conic-gradient(var(--progress-color) calc(var(--pct)*1%), #d7dde8 0);
  box-shadow:0 0 0 rgba(22,163,74,.0);
  animation:softFramePulse 2.8s ease-in-out infinite;
}
.global-progress-inner{
  min-height:70px;
  border-radius:17px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:12px 18px;
  border:1px solid rgba(174,184,198,.45);
}
.global-progress-title{
  font-size:13px;
  font-weight:900;
  color:#8b96a6;
  text-transform:uppercase;
  letter-spacing:.04em;
  white-space:nowrap;
}
.global-progress-value{
  font-size:32px;
  line-height:1;
  font-weight:900;
  color:#06122b;
  white-space:nowrap;
}
.global-progress-sub{
  font-size:12px;
  font-weight:800;
  color:#64748b;
  white-space:nowrap;
  text-align:right;
}
.stats-row{
  display:grid;
  grid-template-columns:1.05fr repeat(4,1fr);
  gap:8px;
  margin-top:8px;
}
.stage-mini-card,.city-mini-card{
  min-height:64px;
  background:#fff;
  border:2px solid #aeb8c6;
  border-radius:18px;
  padding:8px 10px;
  box-shadow:0 1px 7px rgba(15,23,42,.05);
}
.stage-mini-title{
  font-size:10px;
  line-height:1;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.04em;
  font-weight:900;
  color:#9aa4b3;
  margin-bottom:6px;
}
.stage-mini-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}
.stage-mini-grid>div{
  border:2px dashed #c1cad8;
  border-radius:14px;
  min-height:38px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:4px;
}
.stage-mini-grid span,.city-mini-sub{
  font-size:9px;
  font-weight:800;
  color:#8b96a6;
  text-transform:uppercase;
  letter-spacing:.03em;
}
.stage-mini-grid b,.city-mini-value{
  font-size:22px;
  line-height:1;
  font-weight:900;
  color:#5b9b2d;
  margin-top:2px;
}
.city-mini-card{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
}
.city-mini-card.ready{
  border-color:#16a34a;
  box-shadow:0 0 0 2px rgba(22,163,74,.12),0 0 14px rgba(22,163,74,.18);
}
.form-card.form-ready{
  border-color:#16a34a!important;
  box-shadow:0 0 0 2px rgba(22,163,74,.13),0 4px 18px rgba(22,163,74,.18)!important;
}
.form-title-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ready-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid #16a34a;
  color:#15803d;
  background:#ecfdf5;
  border-radius:999px;
  padding:5px 11px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}
@keyframes softFramePulse{
  0%,100%{filter:brightness(1);box-shadow:0 0 0 rgba(91,155,45,0)}
  50%{filter:brightness(1.04);box-shadow:0 0 18px rgba(91,155,45,.18)}
}
@media(max-width:1200px){
  .stats{top:92px!important}
  .stats-row{grid-template-columns:repeat(2,1fr)}
  .city-mini-card{grid-column:span 2}
}
@media(max-width:760px){
  .stats{top:132px!important}
  .global-progress-inner{flex-direction:column;align-items:flex-start;gap:4px;padding:10px 12px}
  .global-progress-value{font-size:24px}
  .global-progress-sub{text-align:left}
  .stats-row{grid-template-columns:1fr}
  .city-mini-card{grid-column:span 1}
}

/* Регистрация сотрудника и журнал действий */
.worker-badge{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border:1px solid #d7dce5;border-radius:999px;background:#fff;font-size:12px;font-weight:800;color:#202938;white-space:nowrap}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:9999;display:none;align-items:center;justify-content:center;padding:20px}
.modal-backdrop.show{display:flex}
.modal-card{width:min(460px,100%);background:#fff;border-radius:18px;border:1px solid #d7dce5;box-shadow:0 20px 60px rgba(15,23,42,.22);padding:22px;color:#111827}
.modal-card h2{margin:0 0 8px;font-size:24px}
.modal-card p{margin:0 0 16px;color:#64748b;font-size:14px}
.modal-card label{display:block;font-size:13px;font-weight:800;margin:12px 0 6px;color:#374151}
.modal-card input,.modal-card select{width:100%;margin-top:6px;border:1px solid #d7dce5;border-radius:10px;padding:11px 12px;font-size:15px;background:#fff}
.modal-card button{margin-top:14px;border:0;border-radius:10px;padding:11px 14px;background:#111827;color:#fff;font-weight:900;cursor:pointer}
.modal-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
.modal-head h2{margin:0}.modal-head button{margin:0;background:#eef1f6;color:#111827}
.audit-card{width:min(920px,96vw);max-height:86vh;display:flex;flex-direction:column}.audit-body{overflow:auto;padding-right:4px}
.audit-row{border:1px solid #e5e7eb;border-radius:12px;padding:10px 12px;margin-bottom:8px;background:#fafafa}.audit-row b{display:block;font-size:12px;color:#111827}.audit-row span{display:block;font-size:12px;color:#475569;margin-top:2px}.audit-row p{font-size:13px;font-weight:900;margin:6px 0 2px;color:#111827}.audit-row small{font-size:12px;color:#64748b}
.check.locked-check,
.master-check:disabled{
  opacity:.72;
  cursor:not-allowed;
  filter:none;
  outline:1px solid #64748b;
  outline-offset:1px;
  background:#f1f5f9;
}
.locked-bulk span{opacity:.82;color:#334155;font-weight:900}
.worker-hint{
  font-size:12px;
  color:#6b7280;
}

.audit-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.audit-actions button{margin:0;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#111827;padding:7px 10px;font-size:12px;font-weight:900;cursor:pointer}
.audit-actions button:hover{background:#eef2f7}
.audit-actions button[data-audit-undo]{border-color:#f59e0b;color:#92400e}
.audit-actions button[data-audit-redo]{border-color:#16a34a;color:#166534}

.boss-password-row input{border-color:#ef4444;background:#fff7f7;}
.worker-badge{white-space:nowrap;}


/* === CITY TABS CLEAN + LOWER STATS CARD PATCH === */
.city-tabs{align-items:stretch;gap:10px;margin-bottom:14px}
.city-tab{
  min-width:132px;
  min-height:58px;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:16px;
  font-weight:950;
  line-height:1.05;
}
.city-tab .city-two-line-progress,
.city-tab .city-shipped-count{display:none!important}
.stats-row{grid-template-columns:1.35fr repeat(4,1fr)!important;align-items:stretch}
.city-summary-card{
  min-height:78px;
  padding:10px 14px;
  justify-content:center;
  gap:6px;
}
.city-summary-title{
  font-size:18px;
  line-height:1;
  font-weight:950;
  text-align:center;
  color:#06122b;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:4px;
}
.city-summary-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  line-height:1.05;
}
.city-summary-line span{
  min-width:82px;
  text-align:right;
  font-size:11px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.city-summary-line b{
  min-width:96px;
  text-align:left;
  font-size:21px;
  font-weight:950;
  color:#15803d;
}
@media(max-width:1200px){.stats-row{grid-template-columns:repeat(2,1fr)!important}.city-summary-card{grid-column:span 2}.city-tab{min-width:118px;font-size:15px}}
@media(max-width:700px){.stats-row{grid-template-columns:1fr!important}.city-summary-card{grid-column:span 1}.city-tab{min-width:calc(50% - 5px);font-size:14px}.city-summary-line{justify-content:space-between}.city-summary-line span{text-align:left}.city-summary-line b{text-align:right}}

/* BN compact counters */
.bn-panel{margin:0 14px 12px;padding:12px;border:1px solid #d7dde8;border-radius:14px;background:#f8fafc}
.bn-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.bn-panel-head b{display:block;font-size:15px;color:#0f172a}
.bn-panel-head span{display:block;margin-top:2px;font-size:12px;color:#64748b;font-weight:700}
.bn-panel-head small{font-size:12px;color:#334155;font-weight:800;text-align:right;line-height:1.35}
.bn-grid{display:grid;grid-template-columns:repeat(2,minmax(280px,1fr));gap:10px}
.bn-item{background:#fff;border:1px solid #d7dde8;border-radius:12px;padding:10px}
.bn-item-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}
.bn-item-head b{font-size:14px;color:#111827}
.bn-item-head span{font-size:12px;font-weight:900;color:#475569;background:#eef2f7;border-radius:999px;padding:4px 8px;white-space:nowrap}
.bn-counters{display:grid;gap:7px}
.bn-counter{display:grid;grid-template-columns:86px 30px 58px 30px 48px;align-items:center;gap:5px}
.bn-counter-label{font-size:12px;font-weight:900;color:#334155}
.bn-counter button,.bn-all-btn{height:28px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;font-weight:900;cursor:pointer;color:#0f172a}
.bn-counter button:hover:not(:disabled){background:#eef2f7}
.bn-counter input{height:28px;border:1px solid #cbd5e1;border-radius:8px;padding:3px 6px;text-align:center;font-weight:900;background:#fff;color:#0f172a}
.bn-counter input::-webkit-outer-spin-button,.bn-counter input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.bn-counter input[type=number]{-moz-appearance:textfield}
.bn-counter-locked{opacity:.55}
.bn-counter button:disabled,.bn-counter input:disabled{cursor:not-allowed;background:#f1f5f9}
.bn-status-line{display:flex;gap:10px;flex-wrap:wrap;margin-top:8px;font-size:12px;color:#475569;font-weight:800}
.bn-status-line b{color:#0f172a}
@media(max-width:900px){.bn-grid{grid-template-columns:1fr}.bn-panel-head{display:block}.bn-panel-head small{display:block;text-align:left;margin-top:6px}.bn-counter{grid-template-columns:78px 28px 54px 28px 44px}}

/* BN inline counters inside the main table */
.bn-table-row td{background:#f8fafc!important}
.bn-table-row:hover td{background:#f1f5f9!important}
.bn-chip{display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd5e1;background:#eaf0f8;color:#0f172a;border-radius:999px;padding:3px 8px;font-size:12px;font-weight:900;white-space:nowrap}
.bn-inline-counter{display:grid;grid-template-columns:22px 42px 22px;gap:2px;align-items:center;justify-content:center;min-width:90px}
.bn-inline-counter button{height:24px;width:22px;padding:0;border-radius:7px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-size:13px;font-weight:900;line-height:1;cursor:pointer}
.bn-inline-counter button:hover:not(:disabled){background:#eef2f7}
.bn-inline-input{height:24px;width:42px;border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:#0f172a;text-align:center;font-size:12px;font-weight:900;padding:2px 3px}
.bn-inline-input::-webkit-outer-spin-button,.bn-inline-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.bn-inline-input[type=number]{-moz-appearance:textfield}
.bn-inline-counter.bn-counter-locked{opacity:.55}
.bn-inline-counter button:disabled,.bn-inline-counter input:disabled{cursor:not-allowed;background:#f1f5f9;color:#94a3b8}
.table-wrap table{min-width:1680px!important}
@media(max-width:780px){.bn-inline-counter{grid-template-columns:20px 38px 20px;min-width:82px}.bn-inline-input{width:38px}.bn-inline-counter button{width:20px}}


/* === TRACK REPORT V4 === */
.track-report-card{
  background:transparent!important;
  padding:0!important;
  min-height:auto!important;
  border-radius:28px!important;
  box-shadow:none!important;
  animation:none!important;
}
.track-report-inner{
  position:relative;
  min-height:188px;
  border-radius:30px;
  background:linear-gradient(180deg,#ffffff 0%,#fbfcfe 100%);
  overflow:hidden;
  padding:0;
  border:2px solid #d7dde8;
}
.track-core{
  position:absolute;
  inset:82px 260px;
  border-radius:999px;
  background:#ffffff;
  border:2px solid #d7dde8;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  z-index:8;
  box-shadow:0 6px 20px rgba(15,23,42,.07);
}
.track-core .global-progress-title{white-space:normal;text-align:center;margin-bottom:6px}
.track-core .global-progress-value{font-size:40px;margin-bottom:4px}
.track-core .global-progress-sub{text-align:center;white-space:normal}
.track-shell{
  position:absolute;
  inset:var(--track-inset);
  border-radius:999px;
  border:3px solid var(--track-color);
  background:var(--track-bg);
  z-index:1;
  overflow:hidden;
}
.track-shell::before,.track-shell::after{
  content:'';
  position:absolute;
  top:0;bottom:0;
  width:calc(var(--track-pct,0) * 0.5%);
  background:var(--track-fill);
  z-index:1;
}
.track-shell::before{right:50%;border-radius:999px 0 0 999px}
.track-shell::after{left:50%;border-radius:0 999px 999px 0}
.track-shell .track-label,
.track-shell .track-count{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:2;
  font-size:11px;
  font-weight:900;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.track-shell .track-label{left:18px;color:var(--track-text)}
.track-shell .track-count{right:18px;color:var(--track-text)}
.track-design{--track-color:#ec4899;--track-fill:rgba(236,72,153,.23);--track-bg:rgba(236,72,153,.06);--track-text:#9d174d}
.track-printed{--track-color:#f97316;--track-fill:rgba(249,115,22,.22);--track-bg:rgba(249,115,22,.06);--track-text:#9a3412}
.track-sewn{--track-color:#2563eb;--track-fill:rgba(37,99,235,.20);--track-bg:rgba(37,99,235,.06);--track-text:#1d4ed8}
.track-packed{--track-color:#8b5cf6;--track-fill:rgba(139,92,246,.20);--track-bg:rgba(139,92,246,.06);--track-text:#6d28d9}
.track-shipped{--track-color:#16a34a;--track-fill:rgba(22,163,74,.20);--track-bg:rgba(22,163,74,.06);--track-text:#166534}

.stats-row{grid-template-columns:1.25fr repeat(5,1fr)!important}
.stage-mini-card.stage-design{border-color:#f3a5ca;background:linear-gradient(180deg,#fff7fb 0%,#fff 100%)}
.stage-mini-card.stage-printed{border-color:#fdba74;background:linear-gradient(180deg,#fff8f2 0%,#fff 100%)}
.stage-mini-card.stage-sewn{border-color:#93c5fd;background:linear-gradient(180deg,#f4f8ff 0%,#fff 100%)}
.stage-mini-card.stage-packed{border-color:#c4b5fd;background:linear-gradient(180deg,#f8f5ff 0%,#fff 100%)}
.stage-mini-card.stage-shipped{border-color:#86efac;background:linear-gradient(180deg,#f3fff7 0%,#fff 100%)}
.stage-mini-card.stage-design .stage-mini-title{color:#be185d}
.stage-mini-card.stage-printed .stage-mini-title{color:#c2410c}
.stage-mini-card.stage-sewn .stage-mini-title{color:#1d4ed8}
.stage-mini-card.stage-packed .stage-mini-title{color:#7c3aed}
.stage-mini-card.stage-shipped .stage-mini-title{color:#15803d}
.stage-mini-card.stage-design .stage-mini-grid>div{border-color:#f9c5dd}
.stage-mini-card.stage-printed .stage-mini-grid>div{border-color:#fed7aa}
.stage-mini-card.stage-sewn .stage-mini-grid>div{border-color:#bfdbfe}
.stage-mini-card.stage-packed .stage-mini-grid>div{border-color:#ddd6fe}
.stage-mini-card.stage-shipped .stage-mini-grid>div{border-color:#bbf7d0}
.city-summary-card{
  align-items:flex-start!important;
  text-align:left!important;
  padding:12px 18px!important;
}
.city-summary-title{
  width:100%;
  text-align:left!important;
  margin-bottom:8px!important;
}
.city-summary-line{
  width:100%;
  justify-content:flex-start!important;
  gap:12px!important;
}
.city-summary-line span{
  min-width:94px!important;
  text-align:left!important;
}
.city-summary-line b{
  min-width:0!important;
  text-align:left!important;
}
@media(max-width:1400px){
  .track-core{inset:82px 200px}
}
@media(max-width:1200px){
  .stats-row{grid-template-columns:repeat(2,1fr)!important}
  .city-summary-card{grid-column:span 2}
  .track-core{inset:84px 140px}
}
@media(max-width:900px){
  .track-report-inner{min-height:220px}
  .track-core{inset:110px 36px 22px 36px}
  .track-shell{border-width:2px}
  .track-shell .track-label,.track-shell .track-count{font-size:10px}
  .track-shell .track-label{left:12px}
  .track-shell .track-count{right:12px}
}
@media(max-width:700px){
  .stats-row{grid-template-columns:1fr!important}
  .city-summary-card{grid-column:span 1}
  .track-report-inner{min-height:250px}
  .track-core .global-progress-value{font-size:30px}
}


/* === TRACK REPORT V5: clean rings, no side text === */
.track-report-inner{
  min-height:104px!important;
  border-radius:32px!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.track-shell{
  overflow:hidden!important;
  border-width:3px!important;
  box-shadow:none!important;
}
.track-shell::before,.track-shell::after{
  top:3px!important;
  bottom:3px!important;
}
.track-shell .track-label,.track-shell .track-count{display:none!important}
.track-core{
  inset:16px 24px!important;
  border-radius:28px!important;
  border:2px solid #d7dde8!important;
  box-shadow:none!important;
  z-index:10!important;
  background:#ffffff!important;
}
.track-core .global-progress-title{
  font-size:15px!important;
  line-height:1.05!important;
  margin-bottom:6px!important;
  color:#111827!important;
}
.track-core .global-progress-value{
  font-size:18px!important;
  line-height:1!important;
  margin-bottom:4px!important;
  color:#111827!important;
}
.track-core .global-progress-sub{
  font-size:12px!important;
  line-height:1!important;
  color:#111827!important;
}
@media(max-width:1200px){
  .track-core{inset:16px 18px!important}
}
@media(max-width:700px){
  .track-report-inner{min-height:116px!important}
  .track-core{inset:14px 14px!important}
  .track-core .global-progress-title{font-size:13px!important}
  .track-core .global-progress-value{font-size:16px!important}
  .track-core .global-progress-sub{font-size:11px!important}
}


/* === TRACK REPORT V6: show all 5 visible rings === */
.track-report-inner{
  min-height:110px!important;
  border-radius:34px!important;
}
.track-shell{
  border-width:3px!important;
  border-style:solid!important;
}
.track-shell::before,.track-shell::after{
  top:3px!important;
  bottom:3px!important;
}
.track-core{
  inset:34px 40px!important;
  border-radius:24px!important;
}
@media(max-width:1200px){
  .track-core{inset:34px 26px!important}
}
@media(max-width:700px){
  .track-report-inner{min-height:118px!important}
  .track-core{inset:34px 14px!important}
}


/* === TRACK REPORT V7 SVG === */
.svg-track-report{
  background:transparent!important;
  min-height:auto!important;
  padding:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  animation:none!important;
}
.progress-svg{
  display:block;
  width:100%;
  height:auto;
}
.track-base{
  stroke:#d3d8e0;
  stroke-width:2.2;
  fill:none;
}
.track-progress{
  stroke-width:2.2;
  fill:none;
}
.track-center-fill{
  fill:#ffffff;
  stroke:none;
}
.track-design-line{stroke:#ec4899;}
.track-printed-line{stroke:#f97316;}
.track-sewn-line{stroke:#2563eb;}
.track-packed-line{stroke:#8b5cf6;}
.track-shipped-line{stroke:#22c55e;}
.svg-title{
  font-family:Arial,Helvetica,sans-serif;
  font-size:12px;
  font-weight:900;
  fill:#06122b;
  letter-spacing:.04em;
}
.svg-value{
  font-family:Arial,Helvetica,sans-serif;
  font-size:13px;
  font-weight:900;
  fill:#06122b;
}
.svg-sub{
  font-family:Arial,Helvetica,sans-serif;
  font-size:10px;
  font-weight:800;
  fill:#06122b;
}


/* === ROW HOVER + CHECKED ROW V8 === */
.table-wrap tbody tr > td{
  transition:background-color .12s ease, box-shadow .12s ease;
}

/* 1. Наведение на любую ячейку строки */
.table-wrap tbody tr:hover > td{
  background:#eef6ff!important;
}

/* 2. Наведение именно на чекбокс — строка ярче */
.table-wrap tbody tr:has(.check:hover) > td{
  background:#dbeafe!important;
  box-shadow:inset 0 0 0 9999px rgba(37,99,235,.035);
}/* Зелёная строка + наведение на чекбокс — ещё ярче */
.table-wrap tbody tr.row-has-check:has(.check:hover) > td,
.table-wrap tbody tr:has(.check:checked):has(.check:hover) > td{
  background:#bbf7d0!important;
  box-shadow:inset 0 0 0 9999px rgba(22,163,74,.045);
}

.check:hover{
  outline:3px solid rgba(37,99,235,.22);
  outline-offset:2px;
}


/* === NO PERSISTENT GREEN V9 === */
/* Постоянный зелёный фон для отмеченных строк отключён.
   Остаются только подсветки при наведении. */
.table-wrap tbody tr.row-has-check > td{
  background:transparent!important;
}
.table-wrap tbody tr.bn-table-row.row-has-check > td{
  background:#f8fafc!important;
}
.table-wrap tbody tr.row-has-check:hover > td,
.table-wrap tbody tr:has(.check:checked):hover > td{
  background:#eef6ff!important;
}
.table-wrap tbody tr.row-has-check:has(.check:hover) > td,
.table-wrap tbody tr:has(.check:checked):has(.check:hover) > td{
  background:#dbeafe!important;
  box-shadow:inset 0 0 0 9999px rgba(37,99,235,.035);
}


/* === COLLAPSIBLE FORM CARDS V10 === */
.collapse-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  box-shadow:0 2px 10px rgba(15,23,42,.04);
}
.collapse-toolbar b{display:block;font-size:14px;font-weight:950;color:#06122b;}
.collapse-toolbar span{display:block;margin-top:2px;font-size:12px;font-weight:800;color:#64748b;}
.collapse-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap;}
.collapse-btn{
  background:#eef2f7;
  color:#06122b;
  border:1px solid #cbd5e1;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.collapse-btn:hover{background:#dbeafe;}
.form-card .collapsible-body{display:block;}
.form-card.is-collapsed .collapsible-body{display:none;}
.form-card.is-collapsed .form-top{border-bottom:0;}
.form-card.is-collapsed .preview{min-height:86px;}
.form-card.is-collapsed .preview img{max-height:92px;}
.form-card.is-collapsed .qty{font-size:22px;}
.form-card.is-collapsed{box-shadow:0 1px 8px rgba(15,23,42,.04);}
@media(max-width:700px){
  .collapse-toolbar{align-items:stretch;flex-direction:column;}
  .collapse-toolbar-actions,.collapse-toolbar-actions button{width:100%;}
  .form-title-row .collapse-btn{width:auto;}
}


/* === CUT STAGE V11 === */
.stage-mini-card.stage-cut{
  border-color:#67e8f9;
  background:linear-gradient(180deg,#ecfeff 0%,#fff 100%);
}
.stage-mini-card.stage-cut .stage-mini-title{color:#0891b2}
.stage-mini-card.stage-cut .stage-mini-grid>div{border-color:#a5f3fc}
.track-cut-line{stroke:#06b6d4;}
.table-wrap table{min-width:1680px!important}
@media(max-width:1200px){
  .stats-row{grid-template-columns:repeat(2,1fr)!important}
}


/* === MATERIAL ACCOUNTING V12 === */
.material-card{
  width:min(1120px,96vw);
  max-height:88vh;
  display:flex;
  flex-direction:column;
}
.material-card .material-body{
  overflow:auto;
  padding-right:4px;
}
.material-summary{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,1fr));
  gap:10px;
  margin:10px 0 14px;
}
.material-summary>div{
  border:1px solid #d7dce5;
  border-radius:14px;
  background:#f8fafc;
  padding:10px 12px;
}
.material-summary span{
  display:block;
  font-size:12px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:6px;
}
.material-summary b{
  display:inline-block;
  margin-right:12px;
  font-size:18px;
  color:#06122b;
}
.material-table-wrap{
  border:1px solid #d7dce5;
  border-radius:14px;
  overflow:auto;
}
.material-table{
  width:100%;
  min-width:860px;
  border-collapse:collapse;
  font-size:13px;
}
.material-table th{
  background:#f1f5f9;
  color:#334155;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.material-table td,.material-table th{
  padding:9px 10px;
  border-bottom:1px solid #e5e7eb;
  vertical-align:middle;
}
.material-table td:first-child b{
  display:block;
  font-size:13px;
  color:#0f172a;
}
.material-table td:first-child small{
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:11px;
}
.material-input{
  width:110px;
  height:34px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  padding:6px 8px;
  font-size:14px;
  font-weight:800;
  color:#0f172a;
  background:#fff;
}
.material-comment{
  width:100%;
  min-width:220px;
  font-weight:600;
}
@media(max-width:700px){
  .material-summary{grid-template-columns:1fr}
  .material-summary b{display:block;margin:4px 0 0}
}

/* V13: дорожка/статистика больше не закреплены, прокручиваются вместе со страницей */
.stats,
.svg-track-report,
.global-progress-card,
.track-report-fixed{
  position:static!important;
  top:auto!important;
  z-index:auto!important;
}

/* V13: мини-чат справа */
.mini-chat{position:fixed;right:16px;bottom:16px;width:320px;max-width:calc(100vw - 32px);background:#fff;border:1px solid #d8dde6;border-radius:16px;box-shadow:0 12px 40px rgba(15,23,42,.22);z-index:9998;overflow:hidden;display:flex;flex-direction:column;max-height:520px}
.mini-chat.collapsed{height:auto}.mini-chat.collapsed .mini-chat-body,.mini-chat.collapsed .mini-chat-form{display:none}
.mini-chat-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;background:#0f172a;color:#fff;font-weight:900}
.mini-chat-head button{background:#fff;color:#0f172a;border:0;border-radius:8px;padding:5px 8px;font-weight:900;cursor:pointer}
.mini-chat-body{padding:10px;overflow:auto;display:flex;flex-direction:column;gap:8px;min-height:210px;max-height:360px;background:#f8fafc}
.chat-msg{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:8px 9px;font-size:13px}
.chat-msg b{display:block;font-size:12px;color:#0f172a}.chat-msg small{display:block;color:#64748b;font-size:11px;margin-top:2px}.chat-msg p{margin:5px 0 0;color:#111827;white-space:pre-wrap;word-break:break-word}
.mini-chat-form{display:flex;gap:6px;padding:10px;background:#fff;border-top:1px solid #e5e7eb}.mini-chat-form input{flex:1;border:1px solid #d8dde6;border-radius:10px;padding:9px}.mini-chat-form button{border:0;border-radius:10px;background:#0f172a;color:#fff;font-weight:900;padding:9px 11px;cursor:pointer}
@media(max-width:760px){.mini-chat{right:8px;left:8px;width:auto;bottom:8px;max-height:420px}}


/* V14 compact fixed stats + improved chat */
.stats{position:sticky!important;top:66px!important;z-index:18!important;background:var(--bg)!important;padding:6px 0 7px!important;border-bottom:1px solid var(--line)!important}
.stats-row{gap:8px!important;align-items:stretch!important}
.stage-mini-card,.city-summary-card{min-height:54px!important;padding:7px 10px!important;border-radius:13px!important}
.stage-mini-title{font-size:10.5px!important;line-height:1!important;margin-bottom:4px!important;letter-spacing:.05em!important}
.stage-mini-grid{gap:5px!important}
.stage-mini-grid>div{min-height:31px!important;padding:2px 5px!important;border-radius:11px!important}
.stage-mini-grid span,.city-mini-sub{font-size:8.5px!important;line-height:1!important}
.stage-mini-grid b,.city-mini-value{font-size:22px!important;line-height:1!important;margin-top:1px!important}
.city-summary-title{margin-bottom:5px!important;font-size:15px!important;line-height:1!important}.city-summary-line{line-height:1.05!important;margin-top:2px!important}.city-summary-line span{font-size:10px!important}.city-summary-line b{font-size:18px!important}
.mini-chat{right:16px!important;bottom:16px!important;width:340px!important;height:420px;max-height:calc(100vh - 28px)!important;resize:none!important;overflow:visible!important}
.mini-chat.collapsed{height:auto!important}.mini-chat-resize{position:absolute;left:0;right:0;top:-6px;height:12px;cursor:ns-resize;z-index:2}.mini-chat-resize:before{content:"";display:block;width:58px;height:4px;background:#cbd5e1;border-radius:99px;margin:4px auto 0}.chat-resizing{user-select:none;cursor:ns-resize!important}
.mini-chat-body{flex:1!important;min-height:0!important;max-height:none!important}.mini-chat-form{align-items:flex-end}.mini-chat-form textarea{flex:1;border:1px solid #d8dde6;border-radius:10px;padding:8px 9px;resize:none;min-height:40px;max-height:96px;font-family:inherit;font-size:13px;line-height:1.25}.chat-typing{min-height:18px;padding:0 10px 6px;background:#f8fafc;color:#64748b;font-size:11px;font-weight:800;font-style:italic}.chat-reply-box{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:7px 10px;background:#eef6ff;border-bottom:1px solid #dbeafe}.chat-reply-box div{min-width:0}.chat-reply-box b{display:block;font-size:11px;color:#1d4ed8}.chat-reply-box span{display:block;font-size:11px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-reply-box button{border:0;background:#1d4ed8;color:#fff;border-radius:8px;font-weight:900;cursor:pointer;width:24px;height:24px}.chat-quote{border-left:3px solid #93c5fd;background:#f1f7ff;border-radius:8px;padding:5px 7px;margin-top:6px}.chat-quote b{font-size:11px;color:#1d4ed8}.chat-quote span{display:block;font-size:12px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-reply-btn{margin-top:6px;border:0;background:#eef2ff;color:#3730a3;border-radius:8px;font-size:11px;font-weight:900;padding:4px 7px;cursor:pointer}
@media(max-width:760px){.mini-chat{right:8px!important;left:8px!important;width:auto!important;bottom:8px!important;height:380px}.stats{top:118px!important}}


/* === V16: sticky stats row, track scrolls below, all statistic blocks in one line === */
.stats{
  position:static!important;
  top:auto!important;
  z-index:auto!important;
  display:block!important;
  background:transparent!important;
  padding:0 0 10px!important;
  border-bottom:1px solid var(--line)!important;
  margin-bottom:14px!important;
}
.stats-row{
  position:sticky!important;
  top:64px!important;
  z-index:25!important;
  display:grid!important;
  grid-template-columns:minmax(210px,1.18fr) repeat(6,minmax(112px,.94fr))!important;
  gap:7px!important;
  align-items:stretch!important;
  background:var(--bg)!important;
  padding:8px 0!important;
  margin:0!important;
  border-bottom:1px solid rgba(203,213,225,.7)!important;
}
.svg-track-report{
  position:static!important;
  margin-top:10px!important;
  margin-bottom:4px!important;
}
.stage-mini-card,.city-summary-card{
  min-height:74px!important;
  padding:8px 10px!important;
  border-radius:13px!important;
}
.stage-mini-title{
  font-size:11px!important;
  margin-bottom:4px!important;
  line-height:1!important;
}
.stage-mini-grid{
  gap:5px!important;
}
.stage-mini-grid>div{
  min-height:36px!important;
  padding:3px 4px!important;
  border-radius:10px!important;
}
.stage-mini-grid span,.city-summary-line span{
  font-size:9px!important;
  line-height:1!important;
}
.stage-mini-grid b,.city-summary-line b{
  font-size:20px!important;
  line-height:1!important;
}
.city-summary-card{
  padding:8px 12px!important;
}
.city-summary-title{
  font-size:18px!important;
  margin-bottom:5px!important;
  line-height:1!important;
}
.city-summary-line{
  gap:8px!important;
  line-height:1.05!important;
  margin-top:3px!important;
}
.city-summary-line span{
  min-width:74px!important;
}
@media(max-width:1300px){
  .stats-row{
    top:86px!important;
    overflow-x:auto!important;
    grid-template-columns:210px repeat(6,126px)!important;
    padding-bottom:9px!important;
  }
}
@media(max-width:760px){
  .stats-row{
    top:118px!important;
    grid-template-columns:200px repeat(6,120px)!important;
  }
  .stage-mini-card,.city-summary-card{min-height:72px!important}
}


/* === V17: stats fixed, track scrolls, materials grouped by DDL === */
.stats{
  position:sticky!important;
  top:64px!important;
  z-index:50!important;
  display:block!important;
  background:var(--bg)!important;
  padding:6px 0 7px!important;
  border-bottom:1px solid rgba(203,213,225,.9)!important;
  margin-bottom:8px!important;
}
.stats-row{
  position:static!important;
  top:auto!important;
  z-index:auto!important;
  display:grid!important;
  grid-template-columns:minmax(210px,1.18fr) repeat(6,minmax(112px,.94fr))!important;
  gap:7px!important;
  align-items:stretch!important;
  background:transparent!important;
  padding:0!important;
  margin:0!important;
  border-bottom:0!important;
}
.global-track-scroll{
  position:static!important;
  margin:8px 0 14px!important;
  padding:0!important;
}
.global-track-scroll .svg-track-report{
  position:static!important;
  margin:0!important;
}
.material-ddl-group{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  margin-bottom:10px;
  overflow:hidden;
}
.material-ddl-group summary{
  cursor:pointer;
  list-style:none;
  display:grid;
  grid-template-columns:1.2fr .85fr .95fr 1.3fr;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  background:#f8fafc;
  border-bottom:1px solid transparent;
  font-weight:900;
}
.material-ddl-group[open] summary{border-bottom-color:var(--line)}
.material-ddl-group summary::-webkit-details-marker{display:none}
.material-ddl-group summary:before{content:'▸';color:#64748b;margin-right:6px}
.material-ddl-group[open] summary:before{content:'▾'}
.material-group-city{font-size:16px;color:#06122b;text-transform:uppercase}
.material-group-ddl{color:#dc2626;font-size:13px}
.material-group-count,.material-group-total{font-size:12px;color:#475569}
@media(max-width:1100px){
  .stats{top:90px!important}
  .stats-row{grid-template-columns:repeat(2,1fr)!important}
  .material-ddl-group summary{grid-template-columns:1fr;gap:4px}
}
@media(max-width:700px){.stats{top:116px!important}.stats-row{grid-template-columns:1fr!important}}


/* V18 messenger chat: sides + attachments */
.mini-chat-body{background:#0f172a!important;padding:12px!important;gap:10px!important}
.chat-msg{background:transparent!important;border:0!important;padding:0!important;display:flex!important;width:100%!important}
.chat-msg.mine{justify-content:flex-end!important}.chat-msg.theirs{justify-content:flex-start!important}
.chat-bubble{max-width:82%;border-radius:16px;padding:8px 10px;font-size:13px;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.chat-msg.mine .chat-bubble{background:#2563eb;color:#fff;border-bottom-right-radius:6px}.chat-msg.theirs .chat-bubble{background:#1e293b;color:#e5e7eb;border-bottom-left-radius:6px}
.chat-meta{display:flex;gap:8px;align-items:baseline;margin-bottom:4px}.chat-meta b{font-size:11px!important;color:inherit!important;opacity:.92}.chat-meta small{font-size:10px!important;color:inherit!important;opacity:.65;margin:0!important}.chat-bubble p{margin:4px 0 0!important;color:inherit!important;white-space:pre-wrap;word-break:break-word}
.chat-msg.mine .chat-reply-btn{color:#dbeafe;background:rgba(255,255,255,.14)}.chat-msg.theirs .chat-reply-btn{color:#bfdbfe;background:rgba(255,255,255,.08)}
.chat-quote{border-left:3px solid rgba(255,255,255,.45)!important;background:rgba(255,255,255,.10)!important;border-radius:9px!important;padding:5px 7px!important;margin:3px 0 6px!important}.chat-quote b,.chat-quote span{color:inherit!important;opacity:.85}
.chat-file{display:block;margin-top:7px;color:inherit;text-decoration:none}.chat-file img{display:block;max-width:220px;max-height:180px;border-radius:10px;border:1px solid rgba(255,255,255,.18);object-fit:cover}.chat-file span{display:block;font-size:11px;opacity:.75;margin-top:4px}
.chat-attach-preview{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:7px 10px;background:#eef2ff;border-top:1px solid #dbeafe}.chat-attach-preview div{display:flex;align-items:center;gap:8px;min-width:0}.chat-attach-preview img{width:36px;height:36px;object-fit:cover;border-radius:8px}.chat-attach-preview span{font-size:12px;color:#334155;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-attach-preview button{border:0;background:#1d4ed8;color:#fff;border-radius:8px;font-weight:900;width:24px;height:24px;cursor:pointer}
.chat-attach-btn{background:#e5e7eb!important;color:#0f172a!important;padding:8px 9px!important;min-width:38px}


/* V19 chat stickers, no screenshots */
.chat-attach-btn,.chat-attach-preview{display:none!important}
.chat-sticker-btn{background:#e5e7eb!important;color:#0f172a!important;padding:8px 9px!important;min-width:38px}
.chat-sticker-panel{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;padding:8px 10px;background:#111827;border-top:1px solid rgba(255,255,255,.08)}
.chat-sticker-panel[hidden]{display:none!important}
.chat-sticker-panel button{border:1px solid rgba(255,255,255,.12);background:#1e293b;color:#fff;border-radius:10px;font-size:20px;line-height:1;padding:8px 0;cursor:pointer;transition:.12s}
.chat-sticker-panel button:hover{transform:translateY(-1px);background:#334155}
@media(max-width:760px){.chat-sticker-panel{grid-template-columns:repeat(4,1fr)}}

/* V20 light messenger chat + read marks + reactions */
.mini-chat{background:#fff!important;border-color:#e5e7eb!important}
.mini-chat-head{background:#fff!important;color:#111827!important;border-bottom:1px solid #e5e7eb!important}
.mini-chat-head button{background:#f3f4f6!important;color:#111827!important}
.mini-chat-body{background:#fff!important;padding:12px!important}
.chat-typing{background:#fff!important;color:#64748b!important}
.chat-msg.mine{justify-content:flex-end!important}.chat-msg.theirs{justify-content:flex-start!important}
.chat-bubble{box-shadow:0 1px 5px rgba(15,23,42,.08)!important;color:#2e2e2e!important}
.chat-msg.mine .chat-bubble{background:#FCDBBD!important;color:#2e2e2e!important;border-bottom-right-radius:6px!important}
.chat-msg.theirs .chat-bubble{background:#f5f7fa!important;color:#2e2e2e!important;border-bottom-left-radius:6px!important}
.chat-meta b{color:#111827!important}.chat-meta small{color:#6b7280!important;opacity:1!important}.chat-bubble p{color:#2e2e2e!important}
.chat-quote{border-left:3px solid #f4a261!important;background:#fff4ea!important;color:#2e2e2e!important}
.chat-quote b{color:#9a4d12!important}.chat-quote span{color:#4b5563!important}
.mini-chat-form{background:#fff!important;border-top:1px solid #e5e7eb!important}
.mini-chat-form textarea{background:#fff!important;border-color:#e5e7eb!important;color:#111827!important}
.mini-chat-form textarea:focus{outline:none!important;border-color:#FCDBBD!important;box-shadow:0 0 0 3px rgba(252,219,189,.35)!important}
.chat-sticker-panel{background:#fff!important;border-top:1px solid #e5e7eb!important}
.chat-sticker-panel button{background:#f5f7fa!important;color:#111827!important;border-color:#e5e7eb!important}
.chat-sticker-panel button:hover{background:#FCDBBD!important}
.chat-read-mark{font-weight:900;color:#2563eb;margin-left:4px}
.chat-actions-row{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin-top:6px}
.chat-msg.theirs .chat-actions-row{justify-content:flex-start}
.chat-like-btn{border:0;background:rgba(255,255,255,.55);color:#475569;border-radius:999px;font-size:11px;font-weight:900;padding:4px 8px;cursor:pointer}
.chat-msg.theirs .chat-like-btn{background:#fff;color:#475569;border:1px solid #e5e7eb}
.chat-like-btn.active{background:#FCDBBD!important;color:#111827!important;border-color:#f4a261!important}
.chat-reply-btn{margin-top:0!important}

/* V21 chat reply/reaction visibility fix */
.chat-actions-row{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  margin-top:8px!important;
}
.chat-reply-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:24px!important;
  padding:5px 10px!important;
  border:1px solid #e3a977!important;
  border-radius:999px!important;
  background:#fff4ea!important;
  color:#7c3f10!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1!important;
  opacity:1!important;
  text-shadow:none!important;
  box-shadow:0 1px 2px rgba(15,23,42,.08)!important;
}
.chat-reply-btn:hover{
  background:#FCDBBD!important;
  border-color:#d88c4f!important;
}
.chat-like-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:28px!important;
  min-height:24px!important;
  padding:4px 7px!important;
  border:1px solid #e5e7eb!important;
  border-radius:999px!important;
  background:#ffffff!important;
  color:#111827!important;
  font-size:13px!important;
  font-weight:900!important;
  opacity:1!important;
  box-shadow:0 1px 2px rgba(15,23,42,.08)!important;
}
.chat-like-btn.active,
.chat-like-btn:hover{
  background:#fff4ea!important;
  border-color:#e3a977!important;
}
.chat-msg.mine .chat-reply-btn,
.chat-msg.theirs .chat-reply-btn{
  color:#7c3f10!important;
  background:#fff4ea!important;
}

/* v22: поставки отдельными вкладками */
.city-tab{white-space:nowrap;}
.city-tabs{overflow-x:auto;}
.city-summary-title{font-size:20px;}


/* === V23 ROLES COLORS === */
.worker-badge,
#workerBadge,
.user-badge,
.role-badge{
  border:2px solid var(--role-color, #64748b) !important;
  color:var(--role-color, #64748b) !important;
  background:color-mix(in srgb, var(--role-color, #64748b) 12%, white) !important;
  font-weight:900;
}
.role-locked{
  opacity:.55 !important;
  filter:grayscale(.45) contrast(1.2);
  cursor:not-allowed !important;
}
.role-locked-button{
  opacity:.5 !important;
  cursor:not-allowed !important;
}
.role-password-row input,
#rolePassword,
#bossPassword{
  border-color:#dc2626 !important;
  background:#fff7f7 !important;
}
body[data-role="Директор"] input[type="checkbox"]{
  opacity:.7;
}


/* === V24 ACTIVE DELIVERY STAGE BARS === */
.stats{
  position:sticky!important;
  top:64px!important;
  z-index:40!important;
  background:var(--bg)!important;
  padding:8px 0 8px!important;
  border-bottom:1px solid var(--line)!important;
}
.stats-row.active-stats-row{
  display:grid!important;
  grid-template-columns:1.25fr repeat(6,minmax(118px,1fr))!important;
  gap:8px!important;
  align-items:stretch!important;
}
.stage-mini-card{
  min-width:0!important;
  min-height:70px!important;
  padding:7px 8px!important;
}
.stage-mini-title{
  font-size:11px!important;
  line-height:1!important;
  letter-spacing:.045em!important;
}
.stage-mini-grid{gap:5px!important}
.stage-mini-grid>div{min-height:38px!important;padding:4px!important}
.stage-mini-grid span{font-size:8.5px!important}
.stage-mini-grid b{font-size:18px!important;white-space:nowrap!important}
.stage-mini-card.ready{box-shadow:0 0 0 2px rgba(22,163,74,.14),0 0 14px rgba(22,163,74,.12)!important}
.active-delivery-scroll{
  margin:10px 0 14px!important;
  position:relative!important;
  z-index:1!important;
}
.active-delivery-progress{
  background:#fff;
  border:1px solid #d8dde6;
  border-radius:18px;
  padding:14px 16px;
  box-shadow:0 3px 14px rgba(15,23,42,.06);
}
.active-delivery-head{
  display:flex;
  justify-content:space-between;
  gap:16px;
  align-items:flex-start;
  margin-bottom:12px;
}
.active-delivery-title{
  font-size:22px;
  line-height:1;
  font-weight:950;
  color:#06122b;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.active-delivery-meta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:8px;
  font-size:12px;
  font-weight:900;
  color:#64748b;
  text-transform:uppercase;
}
.active-delivery-meta b{color:#15803d;font-size:15px;margin-left:4px}
.active-delivery-percent{
  min-width:82px;
  text-align:right;
  font-size:32px;
  line-height:1;
  font-weight:950;
  color:#15803d;
}
.active-stage-lines{
  display:grid;
  grid-template-columns:repeat(2,minmax(220px,1fr));
  gap:10px 16px;
}
.active-stage-line{--bar-color:#64748b;--bar-bg:#eef2f7}
.active-stage-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:5px;
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.active-stage-head b{color:var(--bar-color)}
.active-stage-head span{color:#06122b;white-space:nowrap}
.active-stage-bar{
  height:12px;
  border-radius:999px;
  background:var(--bar-bg);
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.06);
}
.active-stage-bar i{
  display:block;
  height:100%;
  width:0;
  border-radius:999px;
  background:var(--bar-color);
  transition:width .25s ease;
}
.line-design{--bar-color:#ec4899;--bar-bg:rgba(236,72,153,.12)}
.line-printed{--bar-color:#f97316;--bar-bg:rgba(249,115,22,.13)}
.line-cut{--bar-color:#06b6d4;--bar-bg:rgba(6,182,212,.13)}
.line-sewn{--bar-color:#2563eb;--bar-bg:rgba(37,99,235,.12)}
.line-packed{--bar-color:#8b5cf6;--bar-bg:rgba(139,92,246,.13)}
.line-shipped{--bar-color:#16a34a;--bar-bg:rgba(22,163,74,.13)}
.active-stage-line.ready .active-stage-bar{box-shadow:0 0 0 1px rgba(22,163,74,.18),0 0 10px rgba(22,163,74,.12)}
.svg-track-report,.global-progress-card,.track-report-card{display:none!important}
@media(max-width:1280px){
  .stats-row.active-stats-row{grid-template-columns:repeat(2,minmax(220px,1fr))!important}
  .city-summary-card{grid-column:auto!important}
  .active-stage-lines{grid-template-columns:1fr}
}
@media(max-width:760px){
  .stats{top:116px!important}
  .stats-row.active-stats-row{grid-template-columns:1fr!important}
  .active-delivery-head{flex-direction:column;gap:8px}
  .active-delivery-percent{text-align:left;font-size:26px}
  .active-delivery-title{font-size:18px}
}


/* === V25 COMPACT HEADER GLOBAL PROGRESS === */
header{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  padding:8px 12px!important;
}
header > div:first-child{
  flex:0 0 255px!important;
  min-width:230px!important;
}
.brand{font-size:18px!important;line-height:1!important;white-space:nowrap!important}
.sub{font-size:11px!important;line-height:1.15!important;max-width:250px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
#statusFilter{display:none!important}
.top-overall-progress{
  flex:1 1 auto!important;
  min-width:240px!important;
  display:grid!important;
  grid-template-columns:minmax(180px,1fr) 120px!important;
  align-items:center!important;
  gap:10px!important;
}
.top-stage-lines{
  display:flex!important;
  flex-direction:column!important;
  gap:3px!important;
  width:100%!important;
}
.top-stage-line{
  height:5px!important;
  border-radius:999px!important;
  background:#e6ebf2!important;
  overflow:hidden!important;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.04)!important;
}
.top-stage-line i{
  display:block!important;
  height:100%!important;
  border-radius:999px!important;
  width:0;
  transition:width .28s ease!important;
}
.top-line-design i{background:#ec4899!important}
.top-line-printed i{background:#f97316!important}
.top-line-cut i{background:#06b6d4!important}
.top-line-sewn i{background:#2563eb!important}
.top-line-packed i{background:#8b5cf6!important}
.top-line-shipped i{background:#16a34a!important}
.top-stage-total{
  text-align:center!important;
  border-left:1px solid #d7dde8!important;
  padding-left:10px!important;
  color:#06122b!important;
  white-space:nowrap!important;
}
.top-stage-total b{display:block!important;font-size:14px!important;line-height:1.05!important;font-weight:950!important}
.top-stage-total span{display:block!important;margin-top:2px!important;font-size:12px!important;line-height:1!important;font-weight:900!important;color:#06122b!important}
.toolbar{
  flex:0 0 auto!important;
  margin-left:auto!important;
  gap:6px!important;
}
.toolbar button,.toolbar .worker-badge{padding:8px 10px!important;font-size:12px!important;white-space:nowrap!important}
.active-delivery-meta span{white-space:nowrap!important}
@media(max-width:1100px){
  header{flex-wrap:wrap!important;align-items:flex-start!important}
  header > div:first-child{flex:1 1 100%!important}
  .top-overall-progress{order:2;flex:1 1 100%!important;grid-template-columns:minmax(180px,1fr) 100px!important}
  .toolbar{order:3;width:100%!important;justify-content:flex-start!important}
}
@media(max-width:700px){
  .top-overall-progress{grid-template-columns:1fr!important;gap:4px!important}
  .top-stage-total{text-align:left!important;border-left:0!important;padding-left:0!important;display:flex!important;gap:10px!important;align-items:center!important}
  .top-stage-total span{margin-top:0!important}
}


/* === V26: remove duplicated city card + SVG-like active progress panel === */
.stats-row.v26-no-city-card{
  grid-template-columns:repeat(6,minmax(130px,1fr))!important;
}
.stats-row.v26-no-city-card .city-summary-card{display:none!important;}
.active-delivery-scroll{
  margin:8px 0 14px!important;
}
.active-delivery-progress.v26-progress-panel{
  background:#fff!important;
  border:1px solid #d8dde6!important;
  border-radius:18px!important;
  padding:14px 16px 13px!important;
  box-shadow:0 4px 18px rgba(15,23,42,.07)!important;
}
.v26-progress-panel .active-delivery-head{
  display:flex!important;
  justify-content:space-between!important;
  gap:14px!important;
  align-items:flex-start!important;
  margin-bottom:12px!important;
}
.v26-progress-panel .active-delivery-title{
  font-size:24px!important;
  line-height:1!important;
  font-weight:950!important;
  color:#06122b!important;
  text-transform:uppercase!important;
  letter-spacing:.02em!important;
}
.v26-progress-panel .active-delivery-meta{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px 14px!important;
  margin-top:8px!important;
  font-size:11px!important;
  font-weight:950!important;
  color:#64748b!important;
  text-transform:uppercase!important;
  line-height:1.1!important;
}
.v26-progress-panel .active-delivery-meta b{
  color:#15803d!important;
  font-size:14px!important;
  margin-left:4px!important;
}
.v26-progress-panel .active-delivery-percent{
  min-width:76px!important;
  text-align:right!important;
  font-size:34px!important;
  line-height:1!important;
  font-weight:950!important;
  color:#15803d!important;
}
.v26-progress-panel .active-stage-lines{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:9px 16px!important;
}
.v26-progress-panel .active-stage-line{
  --bar-color:#64748b;
  --bar-bg:#eef2f7;
  display:grid!important;
  grid-template-columns:128px minmax(120px,1fr) 104px!important;
  align-items:center!important;
  gap:10px!important;
}
.v26-progress-panel .active-stage-label{
  font-size:13px!important;
  line-height:1!important;
  font-weight:950!important;
  text-transform:uppercase!important;
  color:var(--bar-color)!important;
  white-space:nowrap!important;
}
.v26-progress-panel .active-stage-value{
  text-align:right!important;
  font-size:12px!important;
  line-height:1!important;
  font-weight:950!important;
  color:#06122b!important;
  white-space:nowrap!important;
}
.v26-progress-panel .active-stage-bar{
  height:12px!important;
  border-radius:999px!important;
  background:var(--bar-bg)!important;
  overflow:hidden!important;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.06)!important;
}
.v26-progress-panel .active-stage-bar i{
  display:block!important;
  height:100%!important;
  border-radius:999px!important;
  background:var(--bar-color)!important;
  width:0;
  transition:width .55s cubic-bezier(.2,.8,.2,1)!important;
  animation:v26BarGrow .55s cubic-bezier(.2,.8,.2,1) both!important;
}
.v26-progress-panel .line-design{--bar-color:#ec4899;--bar-bg:rgba(236,72,153,.13)}
.v26-progress-panel .line-printed{--bar-color:#f97316;--bar-bg:rgba(249,115,22,.14)}
.v26-progress-panel .line-cut{--bar-color:#06b6d4;--bar-bg:rgba(6,182,212,.14)}
.v26-progress-panel .line-sewn{--bar-color:#2563eb;--bar-bg:rgba(37,99,235,.13)}
.v26-progress-panel .line-packed{--bar-color:#8b5cf6;--bar-bg:rgba(139,92,246,.14)}
.v26-progress-panel .line-shipped{--bar-color:#16a34a;--bar-bg:rgba(22,163,74,.14)}
.v26-progress-panel .active-stage-line.ready .active-stage-bar{
  box-shadow:0 0 0 1px rgba(22,163,74,.18),0 0 10px rgba(22,163,74,.14)!important;
}
.v26-progress-panel .active-stage-line.ready .active-stage-bar i{
  animation:v26BarGrow .55s cubic-bezier(.2,.8,.2,1) both, v26ReadyPulse .9s ease-out .55s 1!important;
}
@keyframes v26BarGrow{from{transform:scaleX(0);transform-origin:left center}to{transform:scaleX(1);transform-origin:left center}}
@keyframes v26ReadyPulse{0%{filter:brightness(1);box-shadow:0 0 0 rgba(22,163,74,0)}35%{filter:brightness(1.15);box-shadow:0 0 12px rgba(22,163,74,.38)}100%{filter:brightness(1);box-shadow:0 0 0 rgba(22,163,74,0)}}
@media(max-width:1280px){
  .stats-row.v26-no-city-card{grid-template-columns:repeat(3,minmax(170px,1fr))!important}
  .v26-progress-panel .active-stage-lines{grid-template-columns:1fr!important}
}
@media(max-width:760px){
  .stats-row.v26-no-city-card{grid-template-columns:1fr!important}
  .v26-progress-panel .active-delivery-head{flex-direction:column!important;gap:8px!important}
  .v26-progress-panel .active-delivery-percent{text-align:left!important;font-size:28px!important}
  .v26-progress-panel .active-stage-line{grid-template-columns:96px minmax(100px,1fr) 88px!important;gap:7px!important}
  .v26-progress-panel .active-stage-label{font-size:11px!important}
  .v26-progress-panel .active-stage-value{font-size:11px!important}
}


/* === V27 STICKY CURRENT CITY BADGE === */
.sticky-city-badge{
  position:fixed;
  left:16px;
  top:72px;
  z-index:9998;
  padding:8px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(216,221,230,.95);
  box-shadow:0 10px 28px rgba(15,23,42,.14);
  color:#111827;
  font-size:15px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  opacity:0;
  transform:translateY(-8px);
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
}
.sticky-city-badge.is-visible{
  opacity:1;
  transform:translateY(0);
}
#statusFilter{display:none!important;}
@media(max-width:700px){
  .sticky-city-badge{left:10px;top:64px;font-size:13px;max-width:calc(100vw - 20px);overflow:hidden;text-overflow:ellipsis;}
}

/* === V28: green check instead of ГОТОВО === */
.ready-check{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin-left:6px!important;
  color:#16a34a!important;
  font-weight:950!important;
  font-size:18px!important;
  line-height:1!important;
  vertical-align:middle!important;
  white-space:nowrap!important;
}
.active-stage-value .ready-check{font-size:18px!important;margin-left:5px!important;}
.stage-mini-title .ready-check{font-size:16px!important;margin-left:5px!important;}


/* === V29 CHAT SIDE ALIGN + EMOJI PANEL FIX === */
.mini-chat-body{
  background:#fff!important;
  padding:12px!important;
  gap:10px!important;
  display:flex!important;
  flex-direction:column!important;
}
.chat-msg{
  background:transparent!important;
  border:0!important;
  padding:0!important;
  display:flex!important;
  width:100%!important;
  box-shadow:none!important;
}
.chat-msg.mine{justify-content:flex-end!important;}
.chat-msg.theirs{justify-content:flex-start!important;}
.chat-bubble{
  width:fit-content!important;
  max-width:78%!important;
  min-width:150px!important;
  border-radius:16px!important;
  padding:9px 10px!important;
  display:flex!important;
  flex-direction:column!important;
  box-shadow:0 2px 10px rgba(15,23,42,.08)!important;
}
.chat-msg.mine .chat-bubble{
  margin-left:auto!important;
  margin-right:0!important;
  background:#FCDBBD!important;
  color:#2e2e2e!important;
  border-bottom-right-radius:6px!important;
}
.chat-msg.theirs .chat-bubble{
  margin-left:0!important;
  margin-right:auto!important;
  background:#f5f7fa!important;
  color:#2e2e2e!important;
  border-bottom-left-radius:6px!important;
}
.chat-meta{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  align-items:start!important;
  margin-bottom:5px!important;
}
.chat-meta b{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:normal!important;
  font-size:11px!important;
  line-height:1.15!important;
  color:#111827!important;
}
.chat-meta small{
  white-space:nowrap!important;
  text-align:right!important;
  font-size:10px!important;
  color:#64748b!important;
  margin:0!important;
}
.chat-bubble p{
  margin:4px 0 0!important;
  color:#2e2e2e!important;
  white-space:pre-wrap!important;
  word-break:break-word!important;
  line-height:1.25!important;
}
.chat-actions-row{
  margin-top:8px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
}
.chat-msg.theirs .chat-actions-row{justify-content:flex-start!important;}
.chat-reply-btn{
  color:#7c3f10!important;
  background:#fff4ea!important;
  border:1px solid #e3a977!important;
  border-radius:999px!important;
  padding:5px 10px!important;
  min-height:24px!important;
  font-size:11px!important;
  font-weight:900!important;
}
.chat-like-btn{
  background:#fff!important;
  border:1px solid #e5e7eb!important;
  border-radius:999px!important;
  color:#111827!important;
  min-width:30px!important;
  min-height:26px!important;
  padding:4px 7px!important;
}
.chat-like-btn.active,.chat-like-btn:hover{background:#fff4ea!important;border-color:#e3a977!important;}
.chat-sticker-panel{
  background:#fff!important;
  border-top:1px solid #e5e7eb!important;
  padding:10px!important;
  display:block!important;
  max-height:230px!important;
  overflow:auto!important;
}
.chat-sticker-panel[hidden]{display:none!important;}
.sticker-group{margin-bottom:10px;}
.sticker-group:last-child{margin-bottom:0;}
.sticker-group>span{
  display:block;
  margin:0 0 6px;
  font-size:10px;
  line-height:1;
  color:#64748b;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.sticker-group>div{
  display:grid;
  grid-template-columns:repeat(8,1fr);
  gap:6px;
}
.chat-sticker-panel button{
  border:1px solid #e5e7eb!important;
  background:#f8fafc!important;
  color:#111827!important;
  border-radius:10px!important;
  font-size:20px!important;
  line-height:1!important;
  padding:8px 0!important;
  cursor:pointer!important;
}
.chat-sticker-panel button:hover{background:#FCDBBD!important;border-color:#e3a977!important;transform:translateY(-1px);}
@media(max-width:760px){
  .chat-bubble{max-width:84%!important;}
  .sticker-group>div{grid-template-columns:repeat(5,1fr);}
}


/* === V30 TELEGRAM-LIKE CHAT FINAL OVERRIDE === */
:root{--chat-own:#FCDBBD;--chat-bg:#ffffff;--chat-other:#f5f7fa;--chat-line:#e5e7eb;--chat-text:#222;--chat-muted:#6b7280;--chat-accent:#e3a977;}
.mini-chat{
  width:380px!important;
  max-width:calc(100vw - 32px)!important;
  background:var(--chat-bg)!important;
  border:1px solid var(--chat-line)!important;
  border-radius:18px!important;
  box-shadow:0 18px 50px rgba(15,23,42,.22)!important;
  overflow:hidden!important;
}
.mini-chat-head{
  min-height:46px!important;
  padding:10px 12px!important;
  background:#fff!important;
  color:#111827!important;
  border-bottom:1px solid var(--chat-line)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
}
.mini-chat-head span{font-size:14px!important;font-weight:900!important;color:#111827!important;}
.mini-chat-head button{
  background:#f3f4f6!important;
  color:#111827!important;
  border:1px solid #e5e7eb!important;
  border-radius:999px!important;
  padding:6px 11px!important;
  font-size:12px!important;
  font-weight:900!important;
  position:relative!important;
}
.chat-unread-badge{
  position:absolute!important;
  top:-7px!important;
  right:-7px!important;
  min-width:19px!important;
  height:19px!important;
  padding:0 5px!important;
  border-radius:999px!important;
  background:#ef4444!important;
  color:#fff!important;
  font-size:11px!important;
  line-height:19px!important;
  font-weight:950!important;
  box-shadow:0 2px 8px rgba(239,68,68,.35)!important;
}
.mini-chat-body{
  background:#fff!important;
  padding:12px 10px!important;
  gap:7px!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:auto!important;
  scroll-behavior:smooth!important;
}
.chat-msg{
  display:flex!important;
  width:100%!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  box-shadow:none!important;
}
.chat-msg.mine{justify-content:flex-end!important;}
.chat-msg.theirs{justify-content:flex-start!important;}
.chat-bubble{
  position:relative!important;
  width:auto!important;
  min-width:96px!important;
  max-width:76%!important;
  padding:7px 9px 6px!important;
  border-radius:16px!important;
  color:var(--chat-text)!important;
  box-shadow:0 1px 2px rgba(15,23,42,.10)!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
.chat-msg.mine .chat-bubble{
  margin-left:auto!important;
  margin-right:0!important;
  background:var(--chat-own)!important;
  border-bottom-right-radius:5px!important;
}
.chat-msg.theirs .chat-bubble{
  margin-left:0!important;
  margin-right:auto!important;
  background:var(--chat-other)!important;
  border:1px solid rgba(229,231,235,.9)!important;
  border-bottom-left-radius:5px!important;
}
.chat-meta{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
  margin:0 0 3px!important;
  min-width:0!important;
}
.chat-meta b{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:11px!important;
  line-height:1.15!important;
  color:#374151!important;
  font-weight:900!important;
  max-width:190px!important;
}
.chat-meta small{
  flex:0 0 auto!important;
  margin:0!important;
  color:var(--chat-muted)!important;
  font-size:10px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
.chat-read-mark{color:#2563eb!important;font-weight:950!important;margin-left:3px!important;}
.chat-bubble p{
  margin:3px 0 0!important;
  color:var(--chat-text)!important;
  font-size:13px!important;
  line-height:1.3!important;
  white-space:pre-wrap!important;
  word-break:break-word!important;
}
.chat-bubble p:only-child{margin-top:0!important;}
.chat-quote{
  margin:3px 0 5px!important;
  padding:5px 7px!important;
  border-left:3px solid var(--chat-accent)!important;
  border-radius:9px!important;
  background:rgba(255,244,234,.88)!important;
  color:#2e2e2e!important;
}
.chat-quote b{display:block!important;font-size:10px!important;color:#9a4d12!important;margin-bottom:1px!important;}
.chat-quote span{display:block!important;font-size:11px!important;color:#4b5563!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;}
.chat-actions-row{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  margin-top:6px!important;
  justify-content:flex-end!important;
  opacity:.72!important;
  transition:opacity .15s ease!important;
}
.chat-msg.theirs .chat-actions-row{justify-content:flex-start!important;}
.chat-bubble:hover .chat-actions-row{opacity:1!important;}
.chat-reply-btn{
  border:0!important;
  background:transparent!important;
  color:#8a4b16!important;
  padding:2px 4px!important;
  min-height:0!important;
  font-size:11px!important;
  line-height:1.2!important;
  font-weight:900!important;
  text-decoration:none!important;
  cursor:pointer!important;
}
.chat-reply-btn:hover{text-decoration:underline!important;}
.chat-like-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:3px!important;
  min-width:24px!important;
  height:24px!important;
  padding:0 7px!important;
  border-radius:999px!important;
  border:1px solid rgba(227,169,119,.55)!important;
  background:rgba(255,255,255,.72)!important;
  color:#111827!important;
  font-size:12px!important;
  line-height:1!important;
  cursor:pointer!important;
}
.chat-like-btn.active,.chat-like-btn:hover{background:#fff4ea!important;border-color:#e3a977!important;}
.chat-reply-box{
  background:#fff7ed!important;
  border-top:1px solid #fed7aa!important;
  border-bottom:1px solid #fed7aa!important;
  padding:7px 10px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:8px!important;
}
.chat-reply-box[hidden]{display:none!important;}
.chat-reply-box b{font-size:11px!important;color:#9a4d12!important;display:block!important;}
.chat-reply-box span{font-size:12px!important;color:#4b5563!important;display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:270px!important;}
.chat-reply-box button{border:0!important;background:#9a4d12!important;color:#fff!important;border-radius:999px!important;width:22px!important;height:22px!important;font-weight:900!important;}
.chat-typing{
  min-height:18px!important;
  padding:0 12px 4px!important;
  background:#fff!important;
  color:#64748b!important;
  font-size:12px!important;
  font-style:italic!important;
}
.mini-chat-form{
  display:grid!important;
  grid-template-columns:36px 1fr 38px!important;
  gap:7px!important;
  align-items:end!important;
  padding:9px!important;
  background:#fff!important;
  border-top:1px solid var(--chat-line)!important;
}
.mini-chat-form textarea{
  min-height:38px!important;
  max-height:110px!important;
  resize:none!important;
  border:1px solid #e5e7eb!important;
  border-radius:18px!important;
  background:#fff!important;
  color:#111827!important;
  padding:9px 12px!important;
  font-size:13px!important;
  line-height:1.25!important;
}
.mini-chat-form textarea:focus{outline:none!important;border-color:#FCDBBD!important;box-shadow:0 0 0 3px rgba(252,219,189,.35)!important;}
.chat-sticker-btn,.mini-chat-form button[type="submit"]{
  width:36px!important;
  height:36px!important;
  min-width:36px!important;
  padding:0!important;
  border-radius:50%!important;
  border:1px solid #e5e7eb!important;
  background:#f8fafc!important;
  color:#111827!important;
  font-size:16px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.mini-chat-form button[type="submit"]{background:#FCDBBD!important;border-color:#e3a977!important;font-weight:950!important;}
.chat-sticker-panel{
  background:#fff!important;
  border-top:1px solid #e5e7eb!important;
  padding:10px!important;
  max-height:235px!important;
  overflow:auto!important;
}
.chat-sticker-panel[hidden]{display:none!important;}
.sticker-group{margin-bottom:10px!important;}
.sticker-group>span{display:block!important;margin:0 0 6px!important;font-size:10px!important;color:#64748b!important;font-weight:900!important;text-transform:uppercase!important;letter-spacing:.04em!important;}
.sticker-group>div{display:grid!important;grid-template-columns:repeat(8,1fr)!important;gap:6px!important;}
.chat-sticker-panel button{border:1px solid #e5e7eb!important;background:#f8fafc!important;color:#111827!important;border-radius:10px!important;font-size:20px!important;line-height:1!important;padding:8px 0!important;cursor:pointer!important;}
.chat-sticker-panel button:hover{background:#FCDBBD!important;border-color:#e3a977!important;transform:translateY(-1px)!important;}
@media(max-width:760px){.mini-chat{right:8px!important;left:8px!important;width:auto!important}.chat-bubble{max-width:84%!important}.sticker-group>div{grid-template-columns:repeat(5,1fr)!important}}

/* === V31 COMPACT COLLAPSIBLE CHAT STRIP === */
.mini-chat{
  width:300px!important;
  height:390px!important;
  max-height:calc(100vh - 24px)!important;
  right:12px!important;
  bottom:12px!important;
  border-radius:14px!important;
  overflow:hidden!important;
}
.mini-chat-head{
  min-height:38px!important;
  padding:7px 9px!important;
  gap:6px!important;
}
.mini-chat-head span{
  font-size:12px!important;
  line-height:1!important;
}
.mini-chat-head button{
  padding:5px 8px!important;
  font-size:11px!important;
  border-radius:8px!important;
}
.mini-chat-body{
  padding:8px!important;
  gap:7px!important;
}
.chat-bubble{
  max-width:82%!important;
  padding:7px 8px!important;
  border-radius:13px!important;
}
.chat-meta b{font-size:10.5px!important;}
.chat-meta small{font-size:9.5px!important;}
.chat-bubble p{font-size:12px!important;line-height:1.25!important;}
.chat-actions-row{margin-top:5px!important;gap:5px!important;}
.chat-reply-btn,.chat-like-btn{font-size:10px!important;padding:4px 6px!important;border-radius:8px!important;}
.mini-chat-form{padding:7px!important;gap:5px!important;}
.mini-chat-form textarea{font-size:12px!important;min-height:34px!important;max-height:72px!important;padding:7px 8px!important;}
.chat-sticker-btn,.mini-chat-form button[type="submit"]{width:32px!important;height:32px!important;min-width:32px!important;padding:0!important;font-size:14px!important;}
.chat-sticker-panel{max-height:145px!important;overflow:auto!important;padding:7px!important;}

.mini-chat.collapsed{
  width:210px!important;
  height:34px!important;
  min-height:34px!important;
  max-height:34px!important;
  border-radius:999px!important;
  bottom:10px!important;
  right:12px!important;
  overflow:visible!important;
}
.mini-chat.collapsed .mini-chat-head{
  height:34px!important;
  min-height:34px!important;
  padding:0 6px 0 12px!important;
  border:0!important;
  border-radius:999px!important;
  box-shadow:0 8px 24px rgba(15,23,42,.18)!important;
}
.mini-chat.collapsed .mini-chat-head span{
  font-size:12px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.mini-chat.collapsed .mini-chat-head button{
  height:24px!important;
  padding:0 8px!important;
  font-size:10.5px!important;
  border-radius:999px!important;
}
.mini-chat.collapsed .mini-chat-resize,
.mini-chat.collapsed .mini-chat-body,
.mini-chat.collapsed .mini-chat-form,
.mini-chat.collapsed .chat-reply-box,
.mini-chat.collapsed .chat-typing,
.mini-chat.collapsed .chat-sticker-panel,
.mini-chat.collapsed .chat-attach-preview{
  display:none!important;
}
.mini-chat.collapsed .chat-unread-badge{
  position:absolute!important;
  top:-7px!important;
  right:-7px!important;
  transform:none!important;
}
@media(max-width:760px){
  .mini-chat{width:300px!important;left:auto!important;right:8px!important;height:370px!important;}
  .mini-chat.collapsed{left:auto!important;right:8px!important;width:196px!important;height:34px!important;}
}

/* === V38: deliveries in compact left sidebar === */
.app-layout{
  width:min(100%, 1880px);
  margin:0 auto;
  display:grid;
  grid-template-columns:196px minmax(0,1fr);
  gap:14px;
  padding:14px;
  align-items:start;
}
.app-layout main{
  max-width:none!important;
  width:100%;
  min-width:0;
  margin:0!important;
  padding:0!important;
}
.delivery-sidebar{
  position:sticky;
  top:72px;
  z-index:19;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  box-shadow:0 4px 16px rgba(15,23,42,.06);
  max-height:calc(100vh - 86px);
  overflow:hidden;
}
.delivery-sidebar-title{
  padding:3px 7px 9px;
  color:#64748b;
  font-size:11px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.delivery-sidebar .city-tabs{
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  gap:6px!important;
  margin:0!important;
  max-height:calc(100vh - 132px);
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-right:2px;
  scrollbar-width:thin;
}
.delivery-sidebar .city-tab{
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  padding:9px 10px!important;
  display:block!important;
  text-align:left!important;
  border-radius:10px!important;
  line-height:1.1!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
.city-tab-name{
  display:block;
  color:inherit;
  font-size:13px;
  font-weight:950;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.city-tab-delivery{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.city-tab.active .city-tab-delivery{color:rgba(255,255,255,.72)}
@media(max-width:1100px){
  .app-layout{grid-template-columns:174px minmax(0,1fr);gap:10px;padding:10px}
  .delivery-sidebar{top:126px;max-height:calc(100vh - 138px)}
  .delivery-sidebar .city-tabs{max-height:calc(100vh - 184px)}
}
@media(max-width:700px){
  .app-layout{display:block;padding:10px}
  .delivery-sidebar{position:relative;top:auto;max-height:none;margin-bottom:10px;padding:8px}
  .delivery-sidebar .city-tabs{
    max-height:none;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    overflow:visible!important;
  }
  .delivery-sidebar .city-tab{width:100%!important}
}


/* === V40: soft orange highlight for selected city === */
.delivery-sidebar .city-tab.active{
  background:#FFE7C2!important;
  color:#4A3A22!important;
  border-color:#F5A623!important;
  border-left:4px solid #F5A623!important;
  box-shadow:0 4px 12px rgba(245,166,35,.18)!important;
}
.delivery-sidebar .city-tab.active .city-tab-delivery{
  color:#7A5A2A!important;
}
.delivery-sidebar .city-tab.active::before{
  content:'';
  display:block;
  width:28px;
  height:3px;
  margin:0 0 6px;
  border-radius:999px;
  background:#F5A623;
  opacity:.9;
}
.delivery-sidebar .city-tab:hover{
  background:#FFF2DE;
  border-color:#FFD79A;
}

/* V41: логотип в верхнем левом углу без смещения остального интерфейса */
.header-brand-wrap{
  flex:0 0 196px;
  width:196px;
  min-width:196px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  overflow:hidden;
}
.header-logo{
  display:block;
  width:190px;
  max-width:100%;
  height:35px;
  object-fit:contain;
  object-position:left center;
}
@media(max-width:900px){
  .header-brand-wrap{flex-basis:150px;width:150px;min-width:150px}
  .header-logo{width:146px;height:30px}
}
@media(max-width:620px){
  .header-brand-wrap{flex-basis:118px;width:118px;min-width:118px}
  .header-logo{width:116px;height:27px}
}


/* V43: логотип в два раза меньше, SVG встроен в HTML */
.header-brand-wrap{flex:0 0 102px!important;width:102px!important;min-width:102px!important;}
.header-logo{display:block!important;width:96px!important;height:18px!important;max-width:96px!important;flex:none!important;}
@media(max-width:900px){.header-brand-wrap{flex-basis:88px!important;width:88px!important;min-width:88px!important}.header-logo{width:82px!important;height:16px!important}}
@media(max-width:620px){.header-brand-wrap{flex-basis:72px!important;width:72px!important;min-width:72px!important}.header-logo{width:68px!important;height:14px!important}}


/* === V44: данные и статус внутри карточки поставки === */
.city-tab-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:6px;
  min-width:0;
}
.city-tab-top .city-tab-name{flex:1;min-width:0}
.delivery-status{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:20px;
  padding:3px 6px;
  border-radius:999px;
  font-size:9px;
  line-height:1;
  font-weight:950;
  white-space:nowrap;
  border:1px solid transparent;
}
.delivery-status.planned{background:#f1f5f9;color:#64748b;border-color:#e2e8f0}
.delivery-status.working{background:#fff1dc;color:#a85b00;border-color:#ffd59a}
.delivery-status.shipped{background:#dcfce7;color:#166534;border-color:#86efac}
.city-tab-meta{
  display:grid;
  grid-template-columns:1fr auto;
  gap:3px 8px;
  margin-top:7px;
  padding-top:6px;
  border-top:1px solid rgba(100,116,139,.16);
  color:#64748b;
  font-size:9px;
  line-height:1.2;
  font-weight:800;
}
.city-tab-meta span:first-child{grid-column:1 / -1}
.city-tab-meta b{color:#334155;font-size:10px}
.delivery-sidebar .city-tab.active .city-tab-meta{border-top-color:rgba(245,166,35,.28);color:#7A5A2A}
.delivery-sidebar .city-tab.active .city-tab-meta b{color:#4A3A22}
.delivery-sidebar .city-tab.active .delivery-status.planned{background:rgba(255,255,255,.52)}
@media(max-width:1100px){
  .delivery-status{font-size:8px;padding:3px 5px}
  .city-tab-meta{grid-template-columns:1fr;font-size:8px}
  .city-tab-meta span:first-child{grid-column:auto}
}
@media(max-width:700px){
  .city-tab-meta{grid-template-columns:1fr auto}
  .city-tab-meta span:first-child{grid-column:1 / -1}
}


/* === V45: более воздушные карточки поставок === */
.delivery-sidebar .city-tabs{
  gap:14px!important;
  padding:2px 3px 4px 0!important;
}
.delivery-sidebar .city-tab{
  background:#fff!important;
  padding:12px 13px!important;
  border:1px solid #dbe2ea!important;
  border-radius:12px!important;
  box-shadow:0 2px 8px rgba(15,23,42,.04)!important;
}
.delivery-sidebar .city-tab:hover{
  background:#fffaf3!important;
  border-color:#f5c47f!important;
  box-shadow:0 4px 12px rgba(15,23,42,.07)!important;
}
.delivery-sidebar .city-tab.active{
  background:#fff!important;
  color:#253041!important;
  border:1px solid #f5a623!important;
  border-left:4px solid #f5a623!important;
  box-shadow:0 5px 14px rgba(245,166,35,.13)!important;
}
.delivery-sidebar .city-tab.active::before{display:none!important}
.city-tab-top{align-items:center;gap:8px}
.city-tab-name{
  font-size:13px!important;
  line-height:1.25!important;
  color:#172033!important;
}
.city-tab-dot,.meta-dot{color:#a8b1bf;font-weight:700}
.city-tab-delivery{display:none!important}
.delivery-status{
  min-height:18px!important;
  padding:2px 6px!important;
  font-size:8px!important;
  line-height:1!important;
}
.city-tab-meta{
  display:flex!important;
  align-items:center;
  gap:5px!important;
  margin-top:7px!important;
  padding-top:0!important;
  border-top:0!important;
  color:#64748b!important;
  font-size:9px!important;
  line-height:1.2!important;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.city-tab-meta b{font-size:9px!important;color:#334155!important}
.delivery-sidebar .city-tab.active .city-tab-meta,
.delivery-sidebar .city-tab.active .city-tab-meta b{color:#6f552d!important}
@media(max-width:1100px){
  .delivery-sidebar .city-tabs{gap:10px!important}
  .delivery-sidebar .city-tab{padding:10px 10px!important}
  .city-tab-name{font-size:12px!important}
  .city-tab-meta{font-size:8px!important;gap:4px!important}
  .city-tab-meta b{font-size:8px!important}
}

/* === V53: компактная таблица без горизонтального ползунка === */
.table-wrap{
  overflow-x:hidden!important;
  overflow-y:visible!important;
}
.table-wrap table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
/* Первые три колонки только по содержимому */
.table-wrap thead tr:first-child th:nth-child(1),
.table-wrap tbody td.index-cell{
  width:30px!important;
  min-width:30px!important;
  max-width:30px!important;
}
.table-wrap thead tr:first-child th:nth-child(2),
.table-wrap tbody td.size-cell{
  width:54px!important;
  min-width:54px!important;
  max-width:54px!important;
}
.table-wrap thead tr:first-child th:nth-child(3),
.table-wrap tbody td.number-cell{
  width:86px!important;
  min-width:86px!important;
  max-width:86px!important;
}
.table-wrap th,
.table-wrap td{
  padding-left:3px!important;
  padding-right:3px!important;
}
.table-wrap tbody td.index-cell,
.table-wrap tbody td.size-cell,
.table-wrap tbody td.number-cell{
  text-align:left!important;
}
.table-wrap td.status-cell{
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  padding-left:2px!important;
  padding-right:2px!important;
  text-align:center!important;
}
/* Размер галочек не меняем */
.table-wrap input.check{
  width:14px!important;
  height:14px!important;
}
.table-wrap input.master-check{
  width:15px!important;
  height:15px!important;
}
/* БН не раздувает колонку номера */
.table-wrap .bn-chip{
  white-space:nowrap!important;
  font-size:11px!important;
  padding:3px 6px!important;
}

/* === V54: цвет доступных галочек по участку === */
body input[type="checkbox"]:not(.role-locked):not(:disabled),
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled),
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled){
  accent-color: var(--current-role-color, #2563eb) !important;
}

/* Недоступные участки остаются нейтральными */
body input[type="checkbox"].role-locked,
body input[type="checkbox"]:disabled{
  accent-color:#b8c0cc !important;
}

/* === V55: явный цвет чекбоксов по участку, включая пустое состояние === */
body input[type="checkbox"].check:not(.role-locked):not(:disabled),
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled),
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled){
  -webkit-appearance:none !important;
  appearance:none !important;
  box-sizing:border-box !important;
  border:1.5px solid var(--current-role-color, #2563eb) !important;
  border-radius:2px !important;
  background:#fff !important;
  position:relative !important;
  vertical-align:middle !important;
  cursor:pointer !important;
}

body input[type="checkbox"].check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled):checked{
  background:var(--current-role-color, #2563eb) !important;
  border-color:var(--current-role-color, #2563eb) !important;
}

body input[type="checkbox"].check:not(.role-locked):not(:disabled):checked::after,
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled):checked::after,
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled):checked::after{
  content:"";
  position:absolute;
  left:50%;
  top:46%;
  width:35%;
  height:60%;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:translate(-50%,-55%) rotate(45deg);
}

body input[type="checkbox"].role-locked,
body input[type="checkbox"]:disabled{
  -webkit-appearance:none !important;
  appearance:none !important;
  box-sizing:border-box !important;
  border:1.5px solid #b8c0cc !important;
  border-radius:2px !important;
  background:#eef1f5 !important;
  position:relative !important;
  vertical-align:middle !important;
  cursor:not-allowed !important;
}

body input[type="checkbox"].role-locked:checked,
body input[type="checkbox"]:disabled:checked{
  background:#c9d0d9 !important;
}

body input[type="checkbox"].role-locked:checked::after,
body input[type="checkbox"]:disabled:checked::after{
  content:"";
  position:absolute;
  left:50%;
  top:46%;
  width:35%;
  height:60%;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:translate(-50%,-55%) rotate(45deg);
}


/* === V56: единый цвет участка для бейджа и доступных галочек === */
.worker-badge::before{
  content:"";
  width:9px;
  height:9px;
  border-radius:50%;
  flex:0 0 9px;
  background:var(--role-color, var(--current-role-color, #64748b));
  box-shadow:0 0 0 3px color-mix(in srgb, var(--role-color, #64748b) 18%, transparent);
}
body input[type="checkbox"].check:not(.role-locked):not(:disabled),
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled),
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled){
  border-color:var(--checkbox-role-color, var(--current-role-color, #2563eb)) !important;
}
body input[type="checkbox"].check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled):checked{
  background:var(--checkbox-role-color, var(--current-role-color, #2563eb)) !important;
  border-color:var(--checkbox-role-color, var(--current-role-color, #2563eb)) !important;
}
/* Закреплённый город удалён */
.sticky-city-badge{display:none !important;}


/* === V57: финальная привязка цветов участков и исправление панели === */
:root{
  --section-design:#ec4899;
  --section-print:#f97316;
  --section-cut:#06b6d4;
  --section-sewn:#2563eb;
  --section-packed:#8b5cf6;
  --section-shipped:#16a34a;
}

/* Логотип всегда виден, файл лежит в assets/logo-mts.svg */
.header-brand-wrap{
  flex:0 0 108px!important;
  width:108px!important;
  min-width:108px!important;
  overflow:visible!important;
}
.header-logo{
  display:block!important;
  width:104px!important;
  height:auto!important;
  max-width:104px!important;
  max-height:34px!important;
  object-fit:contain!important;
  visibility:visible!important;
  opacity:1!important;
}

/* Закреплённый город удаляем полностью, а не просто прячем за очередным слоем CSS */
#stickyCityBadge,
.sticky-city-badge,
[data-sticky-city]{display:none!important;visibility:hidden!important;height:0!important;margin:0!important;padding:0!important;}

/* Полные названия городов и поставок */
.app-layout{
  grid-template-columns:255px minmax(0,1fr)!important;
}
.delivery-sidebar{
  width:255px!important;
  min-width:255px!important;
  max-width:255px!important;
}
.delivery-sidebar .city-tab{
  overflow:visible!important;
  padding:10px 11px!important;
}
.city-tab-top{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:start!important;
  gap:7px!important;
}
.city-tab-name{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  overflow-wrap:anywhere!important;
  font-size:11px!important;
  line-height:1.18!important;
}
.city-tab-meta{
  white-space:normal!important;
  overflow:visible!important;
  text-overflow:clip!important;
  flex-wrap:wrap!important;
  row-gap:2px!important;
  font-size:8px!important;
}
.delivery-status{
  flex:0 0 auto!important;
  white-space:nowrap!important;
  font-size:8px!important;
}

/* Каждый этап сохраняет собственный цвет. Доступный участок яркий, остальные бледные. */
body input[type="checkbox"].check,
body input[type="checkbox"].js-check,
body input[type="checkbox"].master-check{
  -webkit-appearance:none!important;
  appearance:none!important;
  box-sizing:border-box!important;
  border-radius:2px!important;
  position:relative!important;
  vertical-align:middle!important;
}
body input[type="checkbox"].check:not(.role-locked):not(:disabled),
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled),
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled){
  border:1.5px solid var(--stage-color, var(--current-role-color, #2563eb))!important;
  background:#fff!important;
  cursor:pointer!important;
  opacity:1!important;
}
body input[type="checkbox"].check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].js-check:not(.role-locked):not(:disabled):checked,
body input[type="checkbox"].master-check:not(.role-locked):not(:disabled):checked{
  background:var(--stage-color, var(--current-role-color, #2563eb))!important;
  border-color:var(--stage-color, var(--current-role-color, #2563eb))!important;
}
body input[type="checkbox"].role-locked,
body input[type="checkbox"]:disabled{
  border:1.5px solid color-mix(in srgb, var(--stage-color, #94a3b8) 38%, white)!important;
  background:color-mix(in srgb, var(--stage-color, #94a3b8) 10%, white)!important;
  opacity:1!important;
  cursor:not-allowed!important;
}
body input[type="checkbox"].role-locked:checked,
body input[type="checkbox"]:disabled:checked{
  background:color-mix(in srgb, var(--stage-color, #94a3b8) 38%, white)!important;
  border-color:color-mix(in srgb, var(--stage-color, #94a3b8) 48%, white)!important;
}
body input[type="checkbox"]:checked::after{
  content:""!important;
  position:absolute!important;
  left:50%!important;
  top:46%!important;
  width:35%!important;
  height:60%!important;
  border:solid #fff!important;
  border-width:0 2px 2px 0!important;
  transform:translate(-50%,-55%) rotate(45deg)!important;
}

.worker-badge{
  border-color:var(--role-color, #64748b)!important;
  color:var(--role-color, #64748b)!important;
  background:color-mix(in srgb, var(--role-color, #64748b) 9%, white)!important;
}
.worker-badge::before{
  background:var(--role-color, #64748b)!important;
}

@media(max-width:900px){
  .app-layout{grid-template-columns:225px minmax(0,1fr)!important;}
  .delivery-sidebar{width:225px!important;min-width:225px!important;max-width:225px!important;}
  .header-brand-wrap{flex-basis:92px!important;width:92px!important;min-width:92px!important;}
  .header-logo{width:88px!important;max-width:88px!important;}
}

/* V58: надежный PNG-логотип вместо SVG, который сервер не отдавал */
.header-brand-wrap{display:flex!important;align-items:center!important;justify-content:flex-start!important;overflow:visible!important;}
.header-logo{display:block!important;width:auto!important;height:28px!important;max-width:118px!important;object-fit:contain!important;flex:0 0 auto!important;}
@media(max-width:900px){.header-logo{height:24px!important;max-width:102px!important;}}
@media(max-width:620px){.header-logo{height:21px!important;max-width:90px!important;}}


/* === SHIPMENT A4 V60 === */
.shipment-card{width:min(560px,96vw)}
.shipment-card #shipmentPrintBtn{width:100%;font-size:15px}
@media(max-width:700px){.shipment-card{width:100%}}
