:root{
  --bg:#f4f7fb;
  --bg-soft:#f8fbff;
  --card:#ffffff;
  --card-soft:#fbfdff;
  --line:#dbe4ef;
  --line-soft:#eaf0f6;
  --text:#10233f;
  --muted:#66758b;

  --blue:#2563eb;
  --blue-hover:#1d4ed8;
  --blue-soft:#eef4ff;

  --green:#16a34a;
  --green-hover:#128847;

  --red:#dc2626;
  --red-soft:#fff4f4;

  --slate:#475569;
  --slate-hover:#334155;

  --shadow:0 8px 30px rgba(15,23,42,.06);
  --shadow-soft:0 4px 18px rgba(15,23,42,.04);

  --radius:18px;
  --radius-md:14px;
  --radius-sm:12px;

  --font:Inter,Arial,sans-serif;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
}

body{
  font-family:var(--font);
  font-size:14px;
  line-height:1.45;
  color:var(--text);
  background:
    radial-gradient(circle at top left, #fafdff 0%, transparent 28%),
    linear-gradient(180deg,#f9fbff 0%, #f3f6fb 100%);
}

.wrap{
  max-width:1440px;
  margin:0 auto;
  padding:24px;
}

.hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:20px;
}

.hero-copy h1{
  margin:0 0 6px;
  font-size:34px;
  line-height:1.08;
  letter-spacing:-0.03em;
  font-weight:800;
}

.hero-copy p{
  margin:0;
  max-width:780px;
  color:var(--muted);
  font-size:15px;
}

.hero-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  padding:8px 12px;
  border-radius:999px;
  background:var(--blue-soft);
  color:var(--blue);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.page-shell{
  display:grid;
  grid-template-columns:minmax(0, 1.8fr) 360px;
  gap:18px;
  align-items:start;
}

.main-column,
.side-column{
  display:grid;
  gap:18px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}

.side-card{
  position:sticky;
  top:16px;
}

.side-column .side-card:nth-child(2){
  top:132px;
}

.side-column .side-card:nth-child(3){
  top:248px;
}

.side-column .side-card:nth-child(4){
  top:364px;
}

.card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.card h2{
  margin:0;
  font-size:20px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:-0.02em;
}

.card-desc{
  margin:5px 0 0;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}

.section{
  margin-top:0;
}

.stack{
  display:grid;
  gap:12px;
}

.subcard{
  background:var(--card-soft);
  border:1px solid var(--line-soft);
  border-radius:16px;
  padding:14px;
}

.subcard-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.subcard h3{
  margin:0;
  font-size:15px;
  font-weight:800;
  line-height:1.2;
}

.chip{
  display:inline-flex;
  align-items:center;
  padding:4px 9px;
  border-radius:999px;
  background:#f1f5f9;
  color:#334155;
  font-size:11px;
  font-weight:800;
}

.form-grid{
  display:grid;
  gap:12px;
}

.form-grid.two-col{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.form-grid.three-col{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.field{
  margin:0;
}

.field label{
  display:block;
  margin:0 0 6px;
  color:#334155;
  font-size:12px;
  font-weight:800;
}

input,select,textarea{
  width:100%;
  min-height:42px;
  padding:10px 12px;
  border:1px solid #d3dce8;
  border-radius:var(--radius-sm);
  background:#fff;
  color:var(--text);
  font:inherit;
  outline:none;
  transition:border-color .15s, box-shadow .15s, background .15s;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#8db5ff;
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}

select[multiple]{
  min-height:116px;
  padding:8px;
}

button{
  width:auto;
  min-height:40px;
  border:0;
  border-radius:12px;
  background:var(--blue);
  color:#fff;
  font:inherit;
  font-weight:800;
  padding:10px 14px;
  cursor:pointer;
  transition:background .15s, transform .06s, box-shadow .15s;
  box-shadow:0 2px 0 rgba(0,0,0,.04);
}

button:hover{
  background:var(--blue-hover);
}

button:active{
  transform:translateY(1px);
}

button.block{
  width:100%;
}

button.secondary{
  background:var(--slate);
}

button.secondary:hover{
  background:var(--slate-hover);
}

button.ghost{
  background:#fff;
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:none;
}

button.ghost:hover{
  background:#f8fafc;
}

button.success{
  background:var(--green);
}

button.success:hover{
  background:var(--green-hover);
}

button.danger{
  background:#fff;
  color:var(--red);
  border:1px solid rgba(220,38,38,.18);
  box-shadow:none;
}

button.danger:hover{
  background:var(--red-soft);
}

button.btn-small{
  min-height:34px;
  padding:7px 10px;
  font-size:12px;
  line-height:1.2;
}

.row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.actions-row{
  margin-top:12px;
}

.actions-row > *{
  flex:0 0 auto;
}

.action-buttons > *{
  flex:1 1 220px;
}

.action-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-top:14px;
  padding:16px;
  border:1px solid #d8e5ff;
  border-radius:16px;
  background:linear-gradient(180deg,#f8fbff 0%, #f2f7ff 100%);
}

.action-title{
  font-size:14px;
  font-weight:800;
  margin-bottom:4px;
}

.action-desc{
  color:var(--muted);
  font-size:13px;
  max-width:620px;
}

.muted{
  color:var(--muted);
  font-size:12px;
}

.compact-note{
  margin-top:8px;
  color:var(--muted);
  font-size:12px;
}

.status-note{
  padding:10px 12px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--line-soft);
}

.stats{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}

.stat{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 14px;
  background:#fcfdff;
  box-shadow:var(--shadow-soft);
}

.stat .label{
  margin-bottom:4px;
  color:var(--muted);
  font-size:12px;
}

.stat b{
  display:block;
  font-size:20px;
  line-height:1.1;
  font-weight:800;
}

.help-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}

.help-list li{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line-soft);
  border-radius:14px;
  background:#fbfdff;
  transition:border-color .15s, background .15s;
}

.step-check{
  width:22px;
  height:22px;
  min-width:22px;
  border-radius:999px;
  border:2px solid #cbd5e1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
  color:transparent;
  background:#fff;
}

li.done{
  border-color:#cfe9d8;
  background:#f7fdf9;
}

li.done .step-check{
  background:var(--green);
  border-color:var(--green);
  color:#fff;
}

.step-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.step-title{
  font-size:13px;
  font-weight:800;
}

.step-desc{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.data-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px;
}

.table-wrap{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:auto;
  background:#fff;
  max-height:560px;
}

.table-wrap table{
  width:max-content;
  min-width:100%;
}

.table-wrap.small{
  max-height:320px;
}

table{
  width:100%;
  border-collapse:collapse;
  table-layout:auto;
}

th,td{
  border-bottom:1px solid var(--line-soft);
  padding:8px 10px;
  text-align:left;
  vertical-align:top;
  font-size:12px;
  line-height:1.3;
  white-space:nowrap;
  word-break:normal;
}

th{
  position:sticky;
  top:0;
  z-index:2;
  background:#f8fbff;
  color:#1d2f4a;
  font-weight:800;
  border-bottom:1px solid var(--line);
}

tr:hover td{
  background:#fbfdff;
}

pre{
  margin:0;
  padding:14px;
  min-height:180px;
  max-height:320px;
  overflow:auto;
  border-radius:14px;
  background:#0f1728;
  color:#dbe7ff;
  font-size:12px;
  line-height:1.45;
  white-space:pre-wrap;
  word-break:break-word;
}

.actions-inline{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.48);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:1000;
  padding:20px;
}

.modal-backdrop.show{
  display:flex;
}

.modal{
  width:min(1200px, 96vw);
  max-height:88vh;
  overflow:auto;
  background:#fff;
  border-radius:20px;
  border:1px solid var(--line);
  box-shadow:0 30px 80px rgba(15,23,42,.25);
  padding:18px;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.modal-title{
  margin:0;
  font-size:20px;
  font-weight:800;
}

.modal-subtitle{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

@media (max-width: 1180px){
  .page-shell{
    grid-template-columns:1fr;
  }

  .side-card{
    position:static;
  }

  .data-grid,
  .form-grid.two-col,
  .form-grid.three-col{
    grid-template-columns:1fr;
  }

  .action-panel{
    flex-direction:column;
    align-items:stretch;
  }
}

@media (max-width: 760px){
  .wrap{
    padding:16px;
  }

  .hero{
    flex-direction:column;
    align-items:flex-start;
  }

  .hero-copy h1{
    font-size:28px;
  }

  .card{
    padding:16px;
  }

  .stats{
    grid-template-columns:1fr 1fr;
  }

  .row{
    flex-direction:column;
  }

  .actions-row > *,
  .action-buttons > *{
    width:100%;
    flex:1 1 auto;
  }
}

/* Детальные таблицы в модальных окнах */
.modal,
.modal-dialog,
.modal-card,
.sheet,
.drawer,
.popup,
.overlay-card{
  max-width:min(1400px, 96vw);
}

.modal .table-wrap,
.modal-card .table-wrap,
.sheet .table-wrap,
.drawer .table-wrap,
.popup .table-wrap,
.overlay-card .table-wrap{
  overflow:auto;
  max-height:75vh;
}

.modal .table-wrap table,
.modal-card .table-wrap table,
.sheet .table-wrap table,
.drawer .table-wrap table,
.popup .table-wrap table,
.overlay-card .table-wrap table{
  width:100%;
  min-width:1200px;
  table-layout:fixed;
}

.modal th,
.modal td,
.modal-card th,
.modal-card td,
.sheet th,
.sheet td,
.drawer th,
.drawer td,
.popup th,
.popup td,
.overlay-card th,
.overlay-card td{
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
  vertical-align:top;
  line-height:1.35;
}

.modal th:nth-child(1),
.modal td:nth-child(1),
.modal-card th:nth-child(1),
.modal-card td:nth-child(1),
.sheet th:nth-child(1),
.sheet td:nth-child(1){
  min-width:160px;
}

.modal th:nth-child(2),
.modal td:nth-child(2),
.modal-card th:nth-child(2),
.modal-card td:nth-child(2),
.sheet th:nth-child(2),
.sheet td:nth-child(2){
  min-width:140px;
}

.modal th:nth-child(3),
.modal td:nth-child(3),
.modal-card th:nth-child(3),
.modal-card td:nth-child(3),
.sheet th:nth-child(3),
.sheet td:nth-child(3){
  min-width:260px;
}

/* ===== Липкая верхняя панель ===== */
.app-topbar{
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(248,250,252,.96);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

.app-topbar-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex-wrap:wrap;
}

.app-topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.app-topbar .compact-select,
.app-topbar .compact-input{
  min-width:220px;
  height:42px;
}

.system-mini{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.system-pill{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:8px 12px;
  font-size:12px;
  color:var(--muted);
}

.system-pill b{
  display:block;
  font-size:15px;
  color:var(--text);
  margin-top:2px;
}

/* ===== Правый сайдбар компактнее ===== */
.sidebar-stack,
.right-rail,
.side-panels{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sidebar-stack .card,
.right-rail .card,
.side-panels .card{
  padding:14px 16px;
}

.status-json,
.log-json,
pre.status-box,
pre.log-box{
  max-height:260px;
  overflow:auto;
  font-size:12px;
  line-height:1.45;
}

/* ===== Таблицы: шире, спокойнее, без каши ===== */
.table-wrap{
  overflow:auto;
  max-width:100%;
}

.table-wrap table{
  width:max-content;
  min-width:100%;
  table-layout:auto;
}

th, td{
  padding:8px 10px;
  font-size:12px;
  line-height:1.35;
  vertical-align:top;
}

th{
  position: sticky;
  top: 0;
  z-index: 2;
  background:#f8fafc;
}

td.wrap, th.wrap{
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

td.nowrap, th.nowrap{
  white-space:nowrap;
}

.table-planned th:nth-child(1),
.table-planned td:nth-child(1){
  min-width:170px;
}

.table-planned th:nth-child(2),
.table-planned td:nth-child(2){
  min-width:130px;
}

.table-planned th:nth-child(3),
.table-planned td:nth-child(3){
  min-width:260px;
}

.table-planned th:nth-child(4),
.table-planned td:nth-child(4){
  min-width:140px;
}

.table-planned th:nth-child(5),
.table-planned td:nth-child(5){
  min-width:140px;
}

.table-reco th,
.table-reco td{
  min-width:92px;
}

.table-reco th:nth-child(2),
.table-reco td:nth-child(2){
  min-width:220px;
}

.table-reco th:nth-child(3),
.table-reco td:nth-child(3){
  min-width:120px;
}

/* ===== Кнопки спокойнее ===== */
.btn,
button{
  min-height:40px;
  padding:8px 14px;
  border-radius:12px;
  font-weight:600;
}

.btn-sm{
  min-height:34px;
  padding:6px 10px;
  border-radius:10px;
  font-size:12px;
}

/* ===== Адаптив ===== */
@media (max-width: 1280px){
  .app-topbar{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* Ошибка в обязательном поле */
.field-error,
select.field-error,
input.field-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
  background: #fff7f7 !important;
}

.field-error-text {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: #b91c1c;
  font-weight: 600;
}

/* ===== Поставки Ozon ===== */
.supplies-section {
  margin-bottom: 18px;
}

.supplies-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.supplies-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.supplies-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
}

.supplies-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.supply-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.supply-card.is-open {
  box-shadow: 0 8px 24px rgba(15,23,42,.08);
}

.supply-top {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, .8fr) minmax(120px, .9fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
}

.supply-main {
  min-width: 0;
}

.supply-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.supply-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  word-break: break-word;
}

.supply-col {
  min-width: 0;
}

.supply-col-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 3px;
}

.supply-col-value {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.supply-open-btn {
  white-space: nowrap;
}

.supply-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.supply-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #eef2ff;
  color: #3730a3;
}

.supply-badge.ok {
  background: #ecfdf5;
  color: #166534;
}

.supply-badge.warn {
  background: #fff7ed;
  color: #9a3412;
}

.supply-badge.muted {
  background: #f1f5f9;
  color: #475569;
}

.supply-body {
  display: none;
  border-top: 1px solid rgba(15,23,42,.08);
  padding: 14px;
  background: #fcfcfd;
}

.supply-card.is-open .supply-body {
  display: block;
}

.supply-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.supply-panel {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.supply-panel h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #0f172a;
}

.supply-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.supply-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px dashed rgba(15,23,42,.08);
}

.supply-list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.supply-list-text {
  font-size: 13px;
  color: #0f172a;
  line-height: 1.4;
  word-break: break-word;
}

.supply-list-note {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  line-height: 1.35;
}

.supply-qty {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(15,23,42,.14);
  border-radius: 12px;
  background: #fafafa;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .supply-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .supply-top {
    grid-template-columns: 1fr;
  }

  .supply-body-grid {
    grid-template-columns: 1fr;
  }
}

.supplies-toolbar {
  margin-bottom: 12px;
}

.supplies-store-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 420px;
}

.supplies-store-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.supplies-store-box select {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.supplies-store-note {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.act-date-editor {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
}

.act-date-editor.is-open {
  display: block;
}

.act-date-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.act-date-editor input[type="date"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.act-date-editor-note {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.supply-actions-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.plan-date-editor {
  display: none;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
}

.plan-date-editor.is-open {
  display: block;
}

.plan-date-editor-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.plan-date-editor input[type="date"] {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
}

.plan-date-editor-note {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.supply-actions-grid .btn-small,
.supply-actions-grid .ghost {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ===== Рабочий кабинет ===== */
.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.workspace-main,
.workspace-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.workspace-side {
  position: sticky;
  top: 16px;
}

.workspace-hero {
  padding: 16px 18px;
}

.workspace-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.workspace-hero h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.workspace-hero p {
  margin: 6px 0 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.workspace-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-quick .ghost,
.workspace-quick .btn-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.workspace-shell .card,
.workspace-shell section,
.workspace-shell .section {
  scroll-margin-top: 14px;
}

.workspace-shell table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.workspace-shell th,
.workspace-shell td {
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: top;
  word-break: break-word;
}

.workspace-shell th {
  white-space: normal;
}

.workspace-shell .supply-card .supply-top {
  grid-template-columns: minmax(220px, 1.5fr) minmax(90px, .7fr) minmax(140px, 1fr) minmax(140px, 1fr) auto;
}

.workspace-shell .supplies-section {
  margin-bottom: 0;
}

.workspace-compact-note {
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-side {
    position: static;
  }
}

@media (max-width: 860px) {
  .workspace-shell .supply-card .supply-top {
    grid-template-columns: 1fr;
  }
}

.workspace-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.workspace-summary-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.workspace-summary-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.workspace-summary-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.workspace-summary-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.workspace-statusline {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.workspace-statusline b {
  color: #0f172a;
}

@media (max-width: 1100px) {
  .workspace-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .workspace-summary {
    grid-template-columns: 1fr;
  }
}

/* ===== Верхняя аналитика ===== */
.analytics-overview {
  padding: 16px 18px;
}

.analytics-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.analytics-overview h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.analytics-overview p {
  margin: 6px 0 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.analytics-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-count-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.analytics-count-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.analytics-count-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.analytics-count-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.analytics-preview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.analytics-preview-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.analytics-preview-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #0f172a;
}

.analytics-preview-card .table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 12px;
}

.analytics-preview-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analytics-preview-card th,
.analytics-preview-card td {
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: top;
  word-break: break-word;
}

.analytics-preview-card th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.analytics-preview-empty {
  padding: 16px;
  border: 1px dashed rgba(15,23,42,.12);
  border-radius: 12px;
  background: #fafafa;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .analytics-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .analytics-counts {
    grid-template-columns: 1fr;
  }
}

.analytics-overview {
  padding: 16px 18px;
  margin-bottom: 16px;
}

.analytics-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.analytics-overview h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.analytics-overview p {
  margin: 6px 0 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.analytics-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.analytics-count-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.analytics-count-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.analytics-count-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.analytics-count-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.analytics-preview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.analytics-preview-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.analytics-preview-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #0f172a;
}

.analytics-preview-card .table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 12px;
}

.analytics-preview-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analytics-preview-card th,
.analytics-preview-card td {
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: top;
  word-break: break-word;
}

.analytics-preview-card th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.analytics-preview-empty {
  padding: 16px;
  border: 1px dashed rgba(15,23,42,.12);
  border-radius: 12px;
  background: #fafafa;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .analytics-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .analytics-counts {
    grid-template-columns: 1fr;
  }
}

/* ===== Рабочая верхняя аналитика ===== */
.ops-overview {
  margin-top: 14px;
  padding: 16px 18px;
}

.ops-overview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ops-overview h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.ops-overview p {
  margin: 6px 0 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.ops-overview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ops-overview-actions .ghost,
.ops-overview-actions .btn-small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.ops-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ops-count-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.ops-count-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}

.ops-count-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.ops-count-note {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}

.ops-statusline {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.ops-preview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.ops-preview-card {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.ops-preview-card h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #0f172a;
}

.ops-preview-card .table-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 12px;
}

.ops-preview-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ops-preview-card th,
.ops-preview-card td {
  padding: 6px 8px;
  line-height: 1.35;
  vertical-align: top;
  word-break: break-word;
}

.ops-preview-card th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
}

.ops-empty {
  padding: 16px;
  border: 1px dashed rgba(15,23,42,.12);
  border-radius: 12px;
  background: #fafafa;
  color: #64748b;
  font-size: 13px;
}

@media (max-width: 1100px) {
  .ops-counts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ops-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ops-counts {
    grid-template-columns: 1fr;
  }
}
