/* The new administration (/admin2/), look of the approved mock-up docs/admin-mockup/index.html. */
:root {
  --orange: #f67500; --orange-soft: #fff3e8; --teal: #1cb5ad; --teal-dark: #0f958e; --teal-soft: #e6f6f5;
  --green: #2b9a3e; --green-soft: #eaf6ec; --red: #d93025; --red-soft: #fdecea; --blue: #2f6fd6; --blue-soft: #eaf1fd;
  --violet: #7b5bd6; --violet-soft: #f1edfc; --yellow-soft: #fff8e1; --yellow: #a36b00;
  --bg: #f3f5f7; --card: #fff; --text: #1f2a33; --muted: #66727c; --line: #e3e8eb; --side: #1f2a33;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,32,.05), 0 4px 14px rgba(16,24,32,.05);
  --top-h: 63px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 'Open Sans', Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); font-weight: 400; }

/* ---- shell: menu on the left, top bar ---- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: #c9d2d8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #44525c transparent; }
.brand-row { display: flex; align-items: center; padding: 18px 10px 14px 18px; gap: 6px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; flex: 1; }
.brand-text { white-space: nowrap; }
.side-pin { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: #8a99a3; cursor: pointer; }
.side-pin:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-pin .icon { width: 17px; height: 17px; }
.side-pin span { display: grid; place-items: center; }
.side-pin .when-folded, .side-collapsed .side-pin .when-open { display: none; }
.side-collapsed .side-pin .when-folded { display: grid; }
.brand b { font-size: 17px; letter-spacing: .01em; }
.brand small { display: block; font-size: 11px; color: #8a99a3; text-transform: uppercase; letter-spacing: .08em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--orange); display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.nav { padding: 6px 10px 16px; flex: 1; }
.nav h6 { margin: 16px 10px 6px; font-size: 11px; font-weight: 700; color: #7b8a94; text-transform: uppercase; letter-spacing: .08em; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(246,117,0,.16); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.nav a.active .icon { color: var(--orange); }
.nav .count { margin-left: auto; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { padding: 12px 18px 16px; border-top: 1px solid #2f3c45; font-size: 12.5px; display: grid; gap: 6px; }
.side-foot a { color: #9fb0ba; display: flex; gap: 8px; align-items: center; }
.side-foot a:hover { color: #fff; }
.side-foot .icon { width: 16px; height: 16px; }
.side-shade { display: none; }
.side-foot a span { white-space: nowrap; }

/* the menu folded to icons (button in the menu or the key "["): it opens over the page while the mouse is on it */
@media (min-width: 861px) {
  .side-collapsed .app { grid-template-columns: 64px minmax(0, 1fr); }
  .side-collapsed .side { z-index: 40; width: 64px; overflow-x: hidden; transition: width .15s ease, box-shadow .15s ease; }
  .side-collapsed .side.peek { width: 248px; box-shadow: 10px 0 34px rgba(16,24,32,.28); }
  .side-collapsed .side:not(.peek) .brand-row { padding: 18px 0 14px; justify-content: center; }
  .side-collapsed .side:not(.peek) .brand { flex: none; }
  .side-collapsed .side:not(.peek) .brand-text,
  .side-collapsed .side:not(.peek) .side-pin,
  .side-collapsed .side:not(.peek) .nav a > span:not(.count),
  .side-collapsed .side:not(.peek) .side-foot a span { display: none; }
  .side-collapsed .side:not(.peek) .nav { padding: 6px 8px 16px; }
  .side-collapsed .side:not(.peek) .nav h6 { height: 1px; margin: 10px 6px; font-size: 0; background: #2f3c45; }
  .side-collapsed .side:not(.peek) .nav a { justify-content: center; padding: 8px 0; }
  .side-collapsed .side:not(.peek) .nav .count { position: absolute; top: 1px; right: 4px; margin: 0; font-size: 9.5px; padding: 0 5px; line-height: 15px; }
  .side-collapsed .side:not(.peek) .side-foot { padding: 12px 0 16px; justify-items: center; }
}

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; height: var(--top-h); padding: 0 28px; background: rgba(243,245,247,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.burger { display: none; border: 0; background: #fff; border-radius: 8px; width: 38px; height: 38px; box-shadow: var(--shadow); cursor: pointer; place-items: center; }
.search { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--muted); }
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.search input { border: 0; outline: none; flex: 1; min-width: 0; background: none; color: var(--text); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--muted); font-family: inherit; }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* ---- pages ---- */
.page { padding: 22px 28px 40px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 13px; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #c9d2d8; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { background: #e56d00; }
.btn .icon { width: 16px; height: 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty { display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px; color: var(--muted); }
.empty .icon { color: var(--green); }

/* ---- dashboard ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; display: grid; gap: 4px; align-content: start; transition: box-shadow .15s; }
a.kpi:hover { box-shadow: 0 1px 2px rgba(16,24,32,.06), 0 8px 24px rgba(16,24,32,.09); }
.kpi .label { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; line-height: 1.2; }
.kpi .note { font-size: 12.5px; color: var(--muted); }
.kpi .up { color: var(--green); font-weight: 600; }
.kpi .down { color: var(--red); font-weight: 600; }
.kpi .dot { width: 8px; height: 8px; border-radius: 50%; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.grid-2.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 15px; }
.panel-h a { color: var(--teal-dark); font-size: 13px; font-weight: 600; }
.panel-more { margin: 0; padding: 10px 18px 14px; font-size: 13px; }
.panel-more a { color: var(--teal-dark); font-weight: 600; }

.mini { width: 100%; border-collapse: collapse; }
.mini td { padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mini tr:last-child td { border-bottom: 0; }
.mini tr:hover td { background: #fafbfc; }
.mini a:hover b, .mini .num a:hover { color: var(--teal-dark); }
.mini .num { font-weight: 700; white-space: nowrap; width: 1%; }
.mini .num span, .mini .who span { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.mini .who b { display: block; }
.mini .state { white-space: nowrap; }
.mini .money { text-align: right; font-weight: 700; white-space: nowrap; }
.mini tr.hidden-item b { color: var(--muted); }

.alerts { padding: 6px 0; }
.alert { display: flex; gap: 12px; padding: 10px 18px; align-items: flex-start; }
a.alert:hover { background: #fafbfc; }
.alert .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert .ic.red { background: var(--red-soft); color: var(--red); }
.alert .ic.yellow { background: var(--yellow-soft); color: var(--yellow); }
.alert .ic.teal { background: var(--teal-soft); color: var(--teal-dark); }
.alert .ic.green { background: var(--green-soft); color: var(--green); }
.alert b { display: block; font-size: 13.5px; }
.alert > span > span { color: var(--muted); font-size: 12.5px; }
.alert a { color: var(--teal-dark); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 18px 18px; }
.quick .btn { justify-content: flex-start; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-new { background: var(--blue-soft); color: var(--blue); }
.b-ordered { background: var(--violet-soft); color: var(--violet); }
.b-stock { background: var(--yellow-soft); color: var(--yellow); }
.b-ready { background: var(--teal-soft); color: var(--teal-dark); }
.b-sent { background: var(--green-soft); color: var(--green); }
.b-done { background: #eef1f3; color: var(--muted); }
.b-cancel { background: var(--red-soft); color: var(--red); }
.b-paid { background: var(--green-soft); color: var(--green); }
.b-unpaid { background: var(--orange-soft); color: #a04d00; }

/* ---- messages ---- */
.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.filter-note { margin: -4px 0 12px; color: var(--muted); font-size: 13px; }
.filter-note a { color: var(--teal-dark); font-weight: 600; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: var(--side); color: #fff; font-weight: 600; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.error { background: var(--red); }
.small { font-size: 12.5px; }
.r { text-align: right; }
.back { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #fff; box-shadow: var(--shadow); font-size: 18px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--teal-dark); font-weight: 600; font-size: 12px; cursor: pointer; text-transform: none; letter-spacing: 0; }

/* ---- order list ---- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; background: #eef1f3; border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg a:hover { color: var(--text); }
.seg a.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg a i { font-style: normal; font-weight: 700; color: var(--orange); margin-left: 5px; }
.select { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 0 0 0 10px; background: #fff; font-size: 13px; color: var(--muted); }
.select .icon { width: 16px; height: 16px; }
.select select { border: 0; background: none; padding: 7px 10px 7px 0; outline: none; color: var(--text); max-width: 220px; cursor: pointer; }
.toolbar .filter-search { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; min-width: 240px; color: var(--muted); background: #fff; }
.toolbar .filter-search:focus-within { border-color: var(--teal); }
.toolbar .filter-search input { border: 0; outline: none; flex: 1; min-width: 0; background: none; color: var(--text); }
.bulk { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px; margin-bottom: 12px; border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.bulk a { color: var(--teal-dark); font-weight: 600; }
.bulk .bulk-on { display: none; align-items: center; gap: 10px; width: 100%; }
.bulk.on { background: var(--side); color: #fff; }
.bulk.on .bulk-idle { display: none; }
.bulk.on .bulk-on { display: flex; }
.bulk .clear { margin-left: auto; border: 0; background: none; color: #9fb0ba; cursor: pointer; }
.bulk .clear:hover { color: #fff; }

.orders { width: 100%; border-collapse: separate; border-spacing: 0; }
.orders > thead th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: var(--top-h); z-index: 2; }
.orders > thead th.r { text-align: right; }
.orders > thead th:first-child { border-top-left-radius: var(--radius); }
.orders > thead th:last-child { border-top-right-radius: var(--radius); }
.orders > tbody > tr > td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.orders > tbody > tr:last-child > td { border-bottom: 0; }
.orders tr.row { cursor: pointer; }
.orders tr.row:hover > td { background: #fafbfc; }
.orders tr.row.selected > td { background: #f2f9f9; }
.orders tr.row.open > td { background: var(--orange-soft); border-bottom-color: transparent; }
.orders .c-check { width: 36px; }
.orders .c-id { white-space: nowrap; }
.orders .id { display: block; font-weight: 700; font-size: 15px; }
.orders .c-id span, .orders .who > span:not(.note-flag) { display: block; color: var(--muted); font-size: 12.5px; }
.orders .who b { font-weight: 700; }
.orders .note-flag { color: var(--yellow); vertical-align: -3px; }
.orders .note-flag .icon { width: 15px; height: 15px; }
.orders .money { font-weight: 700; text-align: right; white-space: nowrap; }
.orders .c-pay, .orders .c-items { white-space: nowrap; font-size: 13px; }
.orders .c-pay .badge { margin-top: 3px; }
.orders .ship { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.orders .ship small { display: block; color: var(--muted); font-size: 11.5px; }
.ship-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #eef1f3; color: var(--muted); flex: none; }
.ship-ic .icon { width: 16px; height: 16px; }
.orders input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.more { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.more:hover { background: #eef1f3; color: var(--text); }
.orders tr.row .more .icon { transition: transform .15s; }
.orders tr.row.open .more .icon { transform: rotate(180deg); }
.orders td.empty { text-align: center; padding: 28px; display: table-cell; }
.complete input[type=date] { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; margin-right: 6px; }
.orders.complete tr.row { cursor: default; }
.form-foot { display: flex; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }

/* ---- order detail ---- */
.orders > tbody > tr.detail > td { padding: 0; background: var(--orange-soft); border-bottom: 1px solid var(--line); }
.detail-loading { padding: 16px; color: var(--muted); }
.orders .detail-in { margin: 0 12px 14px; box-shadow: var(--shadow); border-radius: 10px; }
.detail-in { background: #fff; border-radius: var(--radius); display: grid; grid-template-columns: minmax(0, 1fr) 310px; cursor: default; }
.items { border-right: 1px solid var(--line); min-width: 0; }
.items table { width: 100%; border-collapse: collapse; }
.items th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--line); font-weight: 700; background: #fafbfc; }
.items th.r { text-align: right; }
.items td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.items tbody tr.line:nth-child(even) > td { background: #fbfcfc; }
.items .thumb { width: 52px; height: 39px; border-radius: 6px; object-fit: contain; background: #f3f5f7; display: block; }
.items .name { min-width: 160px; width: 100%; }
.items .name > b { display: block; line-height: 1.3; font-size: 14px; }
.items .code { display: block; font-size: 12px; margin-top: 2px; }
.items .code a { color: var(--teal-dark); font-weight: 600; }
.items .code a.muted { color: var(--muted); font-weight: 400; }
.nowrap { white-space: nowrap; }
.items .qty { width: 58px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 4px 5px 8px; text-align: center; font-weight: 700; }
.items .qty.many { background: var(--yellow-soft); border-color: #f0dca0; }
.items select { border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; background: #fff; max-width: 110px; }
.items .price { font-weight: 700; white-space: nowrap; }
.items .price small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.items .price-input { width: 72px; border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; text-align: right; font-weight: 700; }
.items tr.is-off > td:not(.state-cell) { opacity: .5; }
.items tr.is-off .name b { text-decoration: line-through; }
.items .ship-line td { background: #fafbfc; }
.items .sum td { border-bottom: 0; font-weight: 700; }
.items .sum .total { color: var(--orange); font-size: 17px; white-space: nowrap; }
.items .small { font-size: 11.5px; font-weight: 400; }
/* line states (the furthest flag of a line): colour pair used by the pills, the state button and its menu */
.st-nove { --st: #7c8a94; --st-soft: #eef1f3; }
.st-objednano { --st: var(--violet); --st-soft: var(--violet-soft); }
.st-doruceno { --st: #a36b00; --st-soft: var(--yellow-soft); }
.st-odeslano { --st: var(--green); --st-soft: var(--green-soft); }
.st-vyrizeno { --st: #55626b; --st-soft: #e3e8eb; }
.st-zruseno, .st-vraceno { --st: var(--red); --st-soft: var(--red-soft); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--st-soft); color: var(--st); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.goods-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.goods-h h3 { margin: 0; font-size: 15px; }
.sum-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.goods-h .all { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.goods-h .all select, .goods-h .all-note { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12.5px; background: #fff; max-width: none; }
.goods-h .all-note { width: 190px; }
.state-cell { position: relative; white-space: nowrap; width: 1%; }
.state-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 4px 10px 4px 12px; background: var(--st-soft); color: var(--st); font-weight: 700; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.state-btn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--st); }
.state-btn::after { content: '▾'; font-size: 10px; opacity: .7; }
.state-btn:hover, .state-btn[aria-expanded=true] { border-color: var(--st); }
.state-pop { position: absolute; z-index: 30; right: 8px; top: calc(100% - 6px); width: 270px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(16,24,32,.18); padding: 10px; display: grid; gap: 2px; white-space: normal; }
.state-pop[hidden] { display: none; }
.state-pop .st-opt { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.state-pop .st-opt:hover { background: #f3f5f7; }
.state-pop .st-opt input { width: 16px; height: 16px; accent-color: var(--st); }
.state-pop .st-opt:has(:checked) { background: var(--st-soft); color: var(--st); font-weight: 700; }
.state-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.state-pop .pop-note { display: grid; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.state-pop .pop-note input { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 12.5px; color: var(--text); }
.aside { padding: 14px 16px; display: grid; gap: 14px; align-content: start; font-size: 13px; }
.detail-in > .aside { background: #f7f9fa; border-top-right-radius: var(--radius); }
.orders .detail-in > .aside { border-top-right-radius: 10px; }
.aside h4 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 5px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.aside a { color: var(--teal-dark); }
.aside select, .aside textarea, .aside input[type=text], .aside input[type=date] { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 13px; background: #fff; }
.aside textarea { min-height: 64px; resize: vertical; }
.aside .pay-line { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cust-note { background: var(--yellow-soft); border-radius: 8px; padding: 8px 10px; }
.parcels { display: grid; gap: 6px; }
.parcel { display: flex; align-items: center; gap: 6px; }
.parcel a { color: var(--muted); }
.order-state { display: flex; flex-wrap: wrap; gap: 6px; }
.order-state label { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.order-state input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.order-state label:has(:checked) { border-color: var(--orange); background: var(--orange-soft); color: #a04d00; }
.order-state label:focus-within { box-shadow: 0 0 0 2px var(--teal-soft); }
.state-date { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.detail-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 var(--radius) var(--radius); }
.detail-foot .right { margin-left: auto; display: flex; gap: 8px; }
.detail-in.dirty .detail-foot .btn.primary { box-shadow: 0 0 0 3px rgba(246,117,0,.25); }
.detail-in.busy { opacity: .6; pointer-events: none; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: #eef1f3; }

/* ---- dialogs ---- */
.dlg { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(16,24,32,.3); color: var(--text); }
.dlg::backdrop { background: rgba(16,24,32,.4); }
.dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { margin: 0; font-size: 16px; }
.dlg-b { padding: 14px 18px; display: grid; gap: 12px; }
.dlg-b p { margin: 0; }
.dlg-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 14px 14px; }
.dlg-f .right { margin-left: auto; display: flex; gap: 8px; }
.field { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
.field select, .field input, .field textarea { font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%; background: #fff; }
.field textarea { resize: vertical; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12.5px; }
.choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.contacts summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; }
.contacts[open] summary { margin-bottom: 8px; }
.contacts { display: grid; gap: 8px; }
.dlg-msg { padding: 8px 10px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 600; }
.dlg-msg.error { background: var(--red-soft); color: var(--red); }

/* ---- goods list ---- */
.flash.error { background: var(--red-soft); color: var(--red); }
.toolbar .filter-search.wide { margin-left: 0; flex: 1 1 260px; }
.cat-pick { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; background: #fff; color: var(--muted); min-width: 240px; }
.cat-pick:focus-within { border-color: var(--teal); }
.cat-pick .icon { width: 16px; height: 16px; }
.cat-pick input[type=text] { border: 0; outline: none; flex: 1; min-width: 0; background: none; color: var(--text); padding: 0; }
.cat-clear { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.cat-clear .icon { width: 14px; height: 14px; }
.pick-list { position: absolute; z-index: 40; left: -1px; right: -1px; top: calc(100% + 4px); max-height: 340px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,32,.15); min-width: 300px; }
.pick-list li { padding: 6px 9px; border-radius: 7px; cursor: pointer; color: var(--text); font-size: 13px; line-height: 1.3; }
.pick-list li small { display: block; color: var(--muted); font-size: 11.5px; }
.pick-list li.on, .pick-list li:hover { background: var(--teal-soft); }
.pick-list li.off { color: var(--muted); }
.pick-list li.none { cursor: default; color: var(--muted); background: none; }
.cat-browse { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -2px 0 12px; font-size: 13px; color: var(--muted); }
.cat-browse > a { color: var(--teal-dark); font-weight: 600; }
.cat-browse > a.on { color: var(--text); }
.cat-sub { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: 12.5px; }
.chip:hover { border-color: var(--teal); }
.chip i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.chip.off { color: var(--muted); border-style: dashed; }
.products { width: 100%; border-collapse: separate; border-spacing: 0; }
.products > thead th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: var(--top-h); z-index: 2; }
.products > thead th.r { text-align: right; }
.products > thead th:first-child { border-top-left-radius: var(--radius); }
.products > thead th:last-child { border-top-right-radius: var(--radius); }
.products > tbody td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.products > tbody tr:last-child td { border-bottom: 0; }
.products > tbody tr:hover td { background: #fafbfc; }
.products .thumb { width: 60px; height: 45px; object-fit: contain; border-radius: 6px; background: #f3f5f7; display: block; }
.products .who b { font-weight: 700; font-size: 14px; }
.products .who a:hover b { color: var(--teal-dark); }
.products .who span { display: block; color: var(--muted); font-size: 12px; }
.products .cat { color: var(--muted); font-size: 12.5px; max-width: 280px; }
.products .money { text-align: right; font-weight: 700; white-space: nowrap; }
.products tr.is-hidden .who b, .products tr.is-hidden .thumb { opacity: .55; }
.products td.empty { text-align: center; padding: 28px; }
.minus { color: var(--red); font-weight: 700; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 16px 0 0; font-size: 13px; }
.pager a, .pager span { min-width: 34px; padding: 6px 10px; border-radius: 8px; text-align: center; }
.pager a { background: #fff; box-shadow: var(--shadow); font-weight: 600; }
.pager a:hover { color: var(--teal-dark); }
.pager a.on { background: var(--orange); color: #fff; }
.pager span { color: var(--muted); }

/* ---- goods form ---- */
.product-form { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; align-items: start; }
.pf-main, .pf-side { display: grid; gap: 14px; min-width: 0; }
.pf-sec { padding: 16px 18px; display: grid; gap: 12px; }
.pf-sec h2 { display: flex; align-items: center; justify-content: space-between; margin: 0; font-size: 15px; }
.pf-sec .field input[type=text], .pf-sec .field input[type=number], .pf-sec .field select { padding: 8px 10px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 120px; gap: 12px; }
.field-row .field { align-content: start; }
.field .new-value { font-size: 12.5px; padding: 5px 9px !important; border-style: dashed; }
.packs-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.packs { width: 100%; border-collapse: collapse; min-width: 700px; }
.packs th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; text-align: left; padding: 6px 4px; font-weight: 700; line-height: 1.25; }
.packs th.r { text-align: right; }
.packs td { padding: 5px 4px; border-top: 1px solid var(--line); vertical-align: middle; }
.packs input[type=text], .packs input[type=number] { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 13px; }
.packs input.num { width: 76px; text-align: right; font-weight: 700; }
.packs td:nth-child(1) { width: 15%; }
.packs td:nth-child(2) { width: 17%; }
.packs td:nth-child(4) { width: 12%; }
.packs td:nth-child(5) { width: 19%; }
.packs td:nth-child(6) { font-size: 12.5px; }
.packs .was { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.seg-mini { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; white-space: nowrap; }
.seg-mini label { position: relative; padding: 5px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg-mini label:last-child { border-right: 0; }
.seg-mini input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.seg-mini label:has(:checked) { background: var(--green-soft); color: var(--green); }
.seg-mini label:nth-child(2):has(:checked) { background: var(--orange-soft); color: #a04d00; }
.seg-mini label:nth-child(3):has(:checked) { background: #e3e8eb; color: var(--text); }
.seg-mini label:focus-within { box-shadow: inset 0 0 0 2px var(--teal); }
.sec-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.sec-foot .hint { flex: 1; margin: 0; min-width: 240px; }
.code-area { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 12.5px/1.5 Consolas, 'Courier New', monospace; resize: vertical; }
.popis-preview { width: 100%; height: 340px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.h-tools { font-size: 12px; font-weight: 400; }
.order-state.vis label { font-size: 13px; padding: 5px 12px; }
.chips-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chips-list li { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; background: #fafbfc; }
.chips-list li span:first-of-type, .chips-list li a { flex: 1; min-width: 0; }
.chips-list li a { color: var(--teal-dark); font-weight: 600; }
.chips-list li .muted { flex: none; font-size: 12px; }
.chips-list .more { width: 26px; height: 26px; }
.chips-list .more .icon { width: 14px; height: 14px; }
.pf-side .cat-pick { min-width: 0; }
.pics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pics figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.pics img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f7f9fa; }
.pics figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; font-size: 12px; border-top: 1px solid var(--line); }
.pics figcaption b { width: 100%; }
.pics .del { display: inline-flex; align-items: center; gap: 4px; color: var(--red); cursor: pointer; }
.pics figure:has(.del :checked) img { opacity: .3; }
.pics .replace { position: relative; color: var(--teal-dark); font-weight: 600; cursor: pointer; overflow: hidden; }
.pics .replace input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pics .replace.chosen { color: var(--orange); }
.form-bar { grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-radius: var(--radius); box-shadow: 0 -2px 14px rgba(16,24,32,.08); }
.form-bar .right { margin-left: auto; display: flex; gap: 8px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.product-form.dirty .form-bar .btn.primary { box-shadow: 0 0 0 3px rgba(246,117,0,.25); }

/* ---- warehouse ---- */
.toolbar .filter-search.narrow { margin-left: 0; min-width: 0; flex: 0 1 150px; }
.toolbar .filter-search:first-child { margin-left: 0; }
.toolbar .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.page-head .actions form { display: contents; }
.small-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.small-kpis .value { font-size: 22px; }
.link { color: var(--teal-dark); font-weight: 600; }
.products.stock td form { margin: 0; }
.wh-list { overflow: hidden; }
.wh-head, .wh-main { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 100px minmax(0, 1fr) 80px; gap: 10px; align-items: center; padding: 8px 14px; }
.wh-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fafbfc; border-bottom: 1px solid var(--line); }
.wh { border-bottom: 1px solid var(--line); }
.wh:last-child { border-bottom: 0; }
.wh:target, .wh:has(details[open]) { background: #fcfdfd; }
.wh-main label { display: flex; align-items: center; gap: 8px; }
.wh-id { flex: none; width: 44px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wh-deliveries:not([open]) { display: none; }
.page-head .filter-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; background: #fff; color: var(--muted); min-width: 240px; }
.page-head .filter-search:focus-within { border-color: var(--teal); }
.page-head .filter-search input { border: 0; outline: none; flex: 1; min-width: 0; background: none; color: var(--text); }
.wh-main input[type=text] { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 13px; }
.wh-main input[type=text]:not(:focus) { border-color: transparent; background: transparent; }
.wh-main input[type=text]:hover { border-color: var(--line); }
.wh-main .btn { padding: 5px 10px; justify-self: end; }
.wh-dates { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wh-dates .chip { padding: 2px 8px; font-size: 12px; }
.wh-deliveries { padding: 0 14px 10px; }
.wh-deliveries summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; font-size: 12.5px; width: max-content; }
.wh-deliveries[open] summary { margin-bottom: 8px; }
.wh-delivery { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.wh-delivery label { display: inline-flex; align-items: center; gap: 6px; }
.wh-delivery input { border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; font-size: 13px; color: var(--text); }
.wh-delivery .btn { padding: 5px 10px; }
.wh.hidden-by-filter { display: none; }

@media print {
  .side, .top, .side-shade, .page-head .actions, .toolbar, .toast, .flash { display: none !important; }
  .app { display: block; }
  body, html { background: #fff; }
  .page { padding: 0; }
  .card { box-shadow: none; }
  .products > thead th { position: static; }
}

/* ---- customers ---- */
.facts { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.address { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.loyalty { display: grid; gap: 6px; font-size: 13px; }
.loyalty .value { font-size: 24px; font-weight: 700; }
.progress { height: 8px; border-radius: 999px; background: #eef1f3; overflow: hidden; }
.progress i { display: block; height: 100%; max-width: 100%; background: var(--teal); border-radius: 999px; }
.bonus-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; margin: 0; }
.bonus-row span { flex: 1; color: var(--muted); }
.bonus-row.off { opacity: .55; }
.bonus-add, .inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.bonus-add .field { flex: 0 1 120px; }
.bonus-add .field.wide, .inline-fields .field.grow { flex: 1 1 200px; }
.inline-fields .field { flex: 0 1 160px; }
.inline-fields .cat-pick { min-width: 0; }
.customer-orders { margin-top: 14px; }
.levels input[type=text], .levels input[type=number] { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 13px; }
.levels input.num { width: 110px; text-align: right; font-weight: 700; }
.levels input.small-num { width: 70px; }
.levels .del { color: var(--red); font-size: 12.5px; cursor: pointer; }
.add-level { margin-top: 14px; }
.template-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.field-row.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.preview-card { position: sticky; top: calc(var(--top-h) + 14px); }
.mail-preview { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #f3f5f7; }
.h-tools.inline { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.h-tools.inline input { width: 100px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; }
.h-tools.inline .btn { padding: 4px 10px; }
.search-customers { margin-top: 14px; }

/* ---- reports ---- */
.page-head .seg a { text-decoration: none; }
.report { margin-top: 14px; }
.report .panel-h { flex-wrap: wrap; }
.chart-wrap { padding: 12px 16px 4px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #e9edf0; stroke-width: 1; }
.chart .ylab { font-size: 11px; fill: var(--muted); text-anchor: end; }
.chart .xlab { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.chart .bar rect:first-child { fill: var(--teal); }
.chart .bar:hover rect:first-child { fill: var(--teal-dark); }
.chart .bar .cmp { stroke: var(--side); stroke-width: 2.5; stroke-linecap: round; opacity: .55; }
.chart .hit { fill: transparent; }
.chart-years .series polyline { fill: none; stroke: var(--c); stroke-width: 2.5; stroke-linejoin: round; }
.chart-years .series circle { fill: #fff; stroke: var(--c); stroke-width: 2; }
.chart-years .series circle:hover { r: 6; fill: var(--c); }
.year-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 18px 0; font-size: 13px; }
.year-legend label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.year-legend input { accent-color: var(--c); }
.year-legend i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.report-table { padding: 0 18px 14px; }
.report-table summary { cursor: pointer; color: var(--teal-dark); font-weight: 600; font-size: 13px; padding: 4px 0 10px; }
.report > table, .report .table-scroll { border-top: 1px solid var(--line); }
.up { color: var(--green); font-weight: 600; }
.down { color: var(--red); font-weight: 600; }
.chips-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip.on { border-color: var(--orange); background: var(--orange-soft); }
.toolbar.plain { box-shadow: none; padding: 12px 18px; margin: 0; }
.toolbar .range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.toolbar .range input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); }
.table-scroll { overflow-x: auto; }
.table-scroll .products > thead th { position: static; }
.pivot td, .pivot th, .vat td, .vat th { font-size: 12.5px; }
.products tfoot th { padding: 10px 12px; border-top: 2px solid var(--line); text-align: left; font-size: 12.5px; }
.products tfoot th.r { text-align: right; }
.vat tr.new-day td { border-top: 2px solid #dfe5e9; }
.shares { display: grid; gap: 6px; padding: 14px 18px; }
.share { display: grid; grid-template-columns: 170px minmax(0, 1fr) 110px 44px; align-items: center; gap: 10px; font-size: 13px; }
.share i { display: block; height: 10px; border-radius: 999px; background: var(--teal); min-width: 2px; }
.share b { text-align: right; }

/* ---- goods tools ---- */
.head-pick { min-width: 280px; }
.check-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.move-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.flash.compact { margin: 8px 18px; padding: 6px 10px; font-size: 13px; }
code { font-family: Consolas, 'Courier New', monospace; font-size: 12px; background: #eef1f3; border-radius: 4px; padding: 1px 4px; }
.pf-sec > .cat-pick { min-width: 0; }

/* ---- settings ---- */
.ship-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ship-card { display: grid; gap: 8px; align-content: start; padding: 16px 18px; transition: box-shadow .15s; }
.ship-card:hover { box-shadow: 0 1px 2px rgba(16,24,32,.06), 0 8px 24px rgba(16,24,32,.09); }
.ship-card.off { opacity: .6; }
.ship-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ship-card-h b { font-size: 15px; }
.pay-mini td { padding: 4px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.pay-mini tr.off td { color: var(--muted); text-decoration: line-through; }
.pay-mini tr:hover td { background: none; }
.packs.pays { min-width: 0; }
.packs.pays td:first-child { width: auto; }

/* ---- payments ---- */
.refund { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.refund input { width: 90px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 6px; text-align: right; }
.refund .btn { padding: 4px 10px; }
.old-gateway td, .old-gateway th { font-size: 12px; white-space: nowrap; }
.page-head .actions form { display: contents; }

/* ---- old admin pages inside the new layout ---- */
.is-legacy .main { height: 100vh; }
.legacy-bar { display: flex; align-items: center; gap: 12px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: #fff; font-size: 13px; }
.legacy-bar b { font-size: 15px; }
.legacy-note { color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.legacy-open { margin-left: auto; color: var(--teal-dark); font-weight: 600; }
.legacy-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; display: block; }

/* ---- smaller screens ---- */
@media (max-width: 1300px) {
  .detail-in { grid-template-columns: minmax(0, 1fr) 270px; }
  .orders .c-items { display: none; }
}
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2.even { grid-template-columns: minmax(0, 1fr); }
  .detail-in { grid-template-columns: minmax(0, 1fr); }
  .items { border-right: 0; border-bottom: 1px solid var(--line); }
  .toolbar .filter-search { margin-left: 0; flex: 1; }
  .product-form { grid-template-columns: minmax(0, 1fr); }
  .template-edit { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; }
  .field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .products .cat { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  .side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .side-open .side-shade { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(16,24,32,.35); }
  .burger { display: grid; }
  .top { padding: 0 14px; gap: 10px; }
  .top-links .today, .search kbd { display: none; }
  .page { padding: 16px 14px 32px; }
  .legacy-bar { padding: 10px 14px; }
  .mini td { padding: 10px 12px; }
  .orders-mini, .orders-mini tbody { display: block; }
  .orders-mini tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .orders-mini tr:last-child { border-bottom: 0; }
  .orders-mini td { padding: 0; border: 0; }
  .orders-mini .state { grid-column: 2 / -1; }
  .orders-mini .money { grid-row: 1; grid-column: 3; }
  .orders > thead { display: none; }
  .orders, .orders > tbody, .orders > tbody > tr, .orders > tbody > tr > td { display: block; width: 100%; }
  .orders tr.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .orders tr.row > td { padding: 0; border: 0; background: none !important; width: auto; }
  .orders tr.row > td.c-check { grid-row: 1 / span 3; }
  .orders tr.row > td.c-ship, .orders tr.row > td.c-items, .orders tr.row > td.c-more { display: none; }
  .orders tr.row > td.c-pay { grid-column: 2; font-size: 12.5px; color: var(--muted); }
  .orders tr.row > td.c-money { grid-column: 3; grid-row: 1; }
  .orders tr.row > td.c-state { grid-column: 3; grid-row: 2; text-align: right; }
  .orders .detail-in { margin: 0 0 10px; }
  .items table, .items tbody { display: block; }
  .items thead { display: none; }
  .items tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .items td { padding: 0; border: 0; }
  .items .thumb { width: 44px; height: 33px; }
  .items .name { min-width: 0; grid-column: 2 / -1; }
  .items tr > td:nth-child(3), .items .sum td:nth-child(4), .items tr > td:nth-child(6):empty { display: none; }
  .items tr > td:nth-child(4) { grid-column: 3; }
  .items tr > td:nth-child(5) { grid-column: 4; }
  .items tr.line > td.state-cell { grid-column: 2; grid-row: 2; width: auto; }
  .state-pop { right: auto; left: 0; }
  .goods-h .all { margin-left: 0; }
  .detail-foot .right { margin-left: 0; width: 100%; }
  .detail-foot .right .btn.primary { flex: 1; justify-content: center; }
  .toolbar .filter-search { min-width: 0; width: 100%; }
  .cat-pick { min-width: 0; width: 100%; }
  .wh-head { display: none; }
  .share { grid-template-columns: minmax(0, 1fr) 90px; }
  .share i, .share .muted { display: none; }
  .wh-main { grid-template-columns: minmax(0, 1fr) auto; }
  .wh-main > input[type=text], .wh-main .wh-dates { grid-column: 1 / -1; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .products > thead { display: none; }
  .products, .products > tbody, .products > tbody > tr { display: block; width: 100%; }
  .products > tbody > tr { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .products > tbody td { padding: 0; border: 0; }
  .products > tbody td:first-child { grid-row: 1 / span 3; }
  .products > tbody td:nth-child(4), .products > tbody td:nth-child(6), .products > tbody td:last-child { display: none; }
  .form-bar { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: minmax(0, 1fr); }
  .avatar { display: none; }
}
