﻿:root {
  --bg: #f5f5f8;
  --surface: #ffffff;
  --surface-soft: #fbfbfd;
  --line: #e1e3ea;
  --line-strong: #c8ccd6;
  --text: #24242b;
  --muted: #70707d;
  --purple: #a73afd;
  --purple-dark: #7f22d9;
  --purple-soft: #f3e8ff;
  --red: #b42318;
  --red-soft: #fff0ef;
  --amber: #946200;
  --amber-soft: #fff8e6;
  --green: #117c58;
  --green-soft: #e8f7f0;
  --blue: #155eef;
  --blue-soft: #eef4ff;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 20, 31, .08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.35 "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, input, select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
button { padding: 8px 12px; cursor: pointer; }
button:hover { border-color: var(--line-strong); background: #fbfbfd; }
button:disabled { color: #adadb8; background: #f2f2f6; cursor: default; }
input, select { padding: 8px 10px; }

.shell { max-width: 1520px; margin: 0 auto; padding: 18px 22px 36px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
h1 { margin: 0; font-size: 26px; line-height: 34px; font-weight: 700; }
.caption { color: var(--muted); font-size: 13px; margin-top: 2px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.ghost { background: transparent; }
.primary { color: #fff; background: var(--purple); border-color: var(--purple); font-weight: 650; }
.primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
.wide { width: 100%; }

.market-tabs { display: flex; gap: 8px; margin-bottom: 12px; overflow-x: auto; }
.market-tabs button { min-height: 40px; border-radius: 999px; white-space: nowrap; }
.market-tabs .active { background: var(--purple-soft); border-color: #ddb7ff; color: var(--purple-dark); font-weight: 700; }
.status-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.status-tabs button { position: relative; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 0; background: transparent; color: #555562; white-space: nowrap; }
.status-tabs button.active { color: var(--text); font-weight: 700; }
.status-tabs button.active:after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); }
.count { color: var(--muted); font-size: 12px; margin-left: 6px; }

.filters { display: grid; grid-template-columns: minmax(280px, 1fr) 210px 190px 160px 180px; gap: 10px; margin-bottom: 12px; align-items: center; }
.search { position: relative; }
.search input { width: 100%; padding-left: 36px; }
.search:before { content: ""; position: absolute; left: 13px; top: 50%; width: 12px; height: 12px; margin-top: -7px; border: 2px solid #8b8b98; border-radius: 50%; }
.search:after { content: ""; position: absolute; left: 25px; top: 22px; width: 8px; height: 2px; background: #8b8b98; transform: rotate(45deg); }
.status-line { min-height: 20px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row { display: grid; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #ececf2; }
.row:first-child { border-top: 0; }
.order-head, .order-row { grid-template-columns: 34px minmax(160px, .75fr) minmax(340px, 1.35fr) 90px minmax(160px, .7fr) minmax(150px, .65fr) minmax(130px, .55fr) minmax(105px, .5fr) minmax(120px, .6fr) 42px; }
.head { min-height: 40px; background: var(--surface-soft); color: var(--muted); font-size: 12px; font-weight: 650; }
.checkbox { width: 18px; height: 18px; min-height: 18px; }
.order-no { font-size: 15px; font-weight: 700; }
.sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.product-cell { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 11px; align-items: center; min-width: 0; }
.photo { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f1f1f4; color: var(--muted); font-size: 11px; text-align: center; }
.product-title { font-weight: 650; overflow-wrap: anywhere; }
.product-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.price { font-weight: 700; white-space: nowrap; }
.menu { width: 36px; padding: 0; font-size: 20px; line-height: 1; }

.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #555562; font-size: 12px; white-space: nowrap; }
.tag.cell { color: var(--amber); border-color: #f0c36d; background: var(--amber-soft); font-weight: 650; }
.tag.ok { color: var(--green); border-color: #afe6ce; background: var(--green-soft); }
.tag.problem { color: var(--red); border-color: #ffc9c2; background: var(--red-soft); }
.tag.wb { color: var(--purple-dark); border-color: #ddb7ff; background: var(--purple-soft); }
.tag.timer { color: var(--blue); border-color: #c7d7fe; background: var(--blue-soft); }

.shipment-list { display: flex; flex-direction: column; gap: 10px; }
.shipment-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.shipment-grid { display: grid; grid-template-columns: minmax(240px, 1.35fr) 76px repeat(5, minmax(112px, .5fr)) minmax(360px, 1.1fr); gap: 12px; align-items: center; }
.shipment-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.qr { width: 66px; height: 66px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: repeating-linear-gradient(45deg,#fff 0,#fff 6px,#f1f1f5 6px,#f1f1f5 12px); font-weight: 700; }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shipment-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.login-overlay { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; background: rgba(244, 244, 248, .94); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 60px rgba(20,20,31,.22); padding: 22px; }
.brand { color: var(--purple-dark); font-weight: 800; font-size: 18px; margin-bottom: 14px; }
.login-card h2 { margin: 0 0 8px; font-size: 22px; }
.login-card p { margin: 0 0 18px; color: var(--muted); }
.login-card label { display: grid; gap: 6px; margin-bottom: 12px; }
.login-error { min-height: 20px; margin-bottom: 10px; color: var(--red); font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(24,24,32,.42); }
.modal { width: min(480px,100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 60px rgba(20,20,31,.28); padding: 18px; }
.modal h2 { margin: 0 0 8px; font-size: 20px; line-height: 26px; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.hidden { display: none !important; }

@media (max-width: 1180px) {
  .filters, .shipment-grid { grid-template-columns: 1fr; }
  .shipment-actions { justify-content: flex-start; }
  .order-head { display: none; }
  .order-row { grid-template-columns: 28px 1fr; align-items: start; }
  .order-row > *:nth-child(n+3) { grid-column: 2; }
}
