:root {
  --bg: #f5f5f2;
  --surface: #ffffff;
  --surface-2: #f7f8f4;
  --line: #e9eae5;
  --line-strong: #dcdfd6;
  --text: #1a1f1c;
  --text-2: #5d6660;
  --text-3: #8b938d;
  --label: #6e8a75;
  --side: #1d2a23;
  --side-2: #263730;
  --side-text: #e9efe9;
  --side-muted: #8fa597;
  --lime: #dbee6c;
  --lime-strong: #cfe453;
  --green: #2c6b3e;
  --ok-bg: #e2f2e3;
  --ok: #1f7a3b;
  --warn-bg: #fbf0d9;
  --warn: #9a6a0b;
  --bad-bg: #fbe5e0;
  --bad: #b2452f;
  --info-bg: #e5eefa;
  --info: #2e5f9e;
  --muted-bg: #eeefeb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 300px, var(--bg) 300px); }
.sidebar {
  background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; padding: 28px 18px 22px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 14px; padding: 0 18px 34px; }
.brand-mark {
  width: 52px; height: 52px; border-radius: 13px; background: var(--lime);
  display: grid; place-items: center; color: var(--side); flex: none;
}
.brand-name { font-weight: 800; letter-spacing: .02em; font-size: 17px; }
.brand-sub { font-size: 11px; letter-spacing: .14em; color: var(--side-muted); text-transform: uppercase; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 12px;
  color: var(--side-text); font-size: 18px; font-weight: 600; position: relative;
  border: 1px solid transparent; transition: background .15s;
}
.nav a svg { width: 22px; height: 22px; color: #c9d6cd; }
.nav a:hover { background: rgba(255,255,255,.04); }
.nav a.active { background: var(--side-2); border-color: rgba(255,255,255,.75); }
.nav a.active::before {
  content: ""; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--lime);
}
.side-foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 22px 18px 0; }
.side-foot .ws { font-size: 13px; font-weight: 800; letter-spacing: .1em; display: flex; align-items: center; gap: 10px; }
.side-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.side-foot .dot.off { background: #e0a243; }
.side-foot .meta { font-size: 11.5px; color: var(--side-muted); margin-top: 6px; }

.main-wrap { position: relative; min-width: 0; }
.main { padding: 40px 56px 64px; min-width: 0; }
.cur-toggle {
  position: absolute; top: 30px; right: 56px; z-index: 5; display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; box-shadow: var(--shadow);
}
.cur-toggle button {
  border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-weight: 700; font-size: 13px;
  color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.cur-toggle button:hover:not(:disabled):not(.on) { color: var(--text); background: var(--surface-2); }
.cur-toggle button.on { background: var(--side); color: #fff; }
.cur-toggle button:disabled { opacity: .45; cursor: not-allowed; }
.cur-toggle button:focus-visible { outline: 2px solid var(--lime-strong); outline-offset: 1px; }
.crumbs { font-size: 13px; font-weight: 800; letter-spacing: .1em; color: var(--label); text-transform: uppercase; }
.crumbs a:hover { color: var(--green); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 14px 0 34px; flex-wrap: wrap; }
.page-head h1 { font-size: 38px; line-height: 1.1; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { color: var(--text-2); margin-top: 12px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 700; cursor: pointer; white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: #c6cbbf; background: #fbfbf9; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--lime); border-color: var(--lime); color: #1a2a1f; }
.btn-primary:hover { background: var(--lime-strong); border-color: var(--lime-strong); }
.btn-danger { color: var(--bad); }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { color: var(--green); font-weight: 700; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { text-decoration: underline; }

/* ---------- картки і статистика ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin-bottom: 42px; }
.stat { padding: 24px 24px 26px; min-height: 128px; }
.stat .k { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.stat .v { font-size: 32px; font-weight: 800; margin-top: 18px; letter-spacing: -.01em; }
.stat .v.ok { color: var(--ok); }
.stat .v .uah { display: block; font-size: 16px; font-weight: 700; color: var(--text-2); margin-top: 4px; letter-spacing: 0; }
.stat .v.bad { color: #c46c3f; }
.stat .hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.panel { padding: 30px 30px 26px; margin-bottom: 30px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.panel-head h2 { margin: 0; font-size: 24px; font-weight: 700; }
.panel-head .sub { color: var(--text-2); margin-top: 6px; font-size: 14px; }

/* ---------- таблиці ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1100px; }
thead th {
  background: var(--surface-2); text-align: left; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); font-weight: 800; padding: 16px 18px; white-space: nowrap;
}
tbody td { padding: 20px 18px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: #fbfbf9; }
td.name { font-weight: 700; white-space: normal; min-width: 200px; }
td.num { font-variant-numeric: tabular-nums; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-2); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* ---------- статуси ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 800; background: var(--muted-bg); color: var(--text-2); white-space: nowrap;
}
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill .spin { width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { padding: 14px 18px; border-radius: 12px; margin-bottom: 24px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--info-bg); color: var(--info); }

/* ---------- галерея ---------- */
.product-block { padding: 26px 28px 28px; margin-bottom: 26px; }
.product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.product-head h3 { margin: 0; font-size: 20px; font-weight: 700; }
.product-head .sub { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.shot { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.shot.original { background: var(--surface-2); }
.shot .img {
  aspect-ratio: var(--ar, 1/1); background: #f1f2ee center/cover no-repeat; position: relative; display: grid; place-items: center;
}
.shot .img img { width: 100%; height: 100%; object-fit: cover; }
.shot.original .img img { object-fit: contain; }
.shot .img .placeholder { color: var(--text-3); font-size: 13px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.shot .img .placeholder .spin { width: 22px; height: 22px; border: 3px solid #cfd5c9; border-right-color: transparent; border-radius: 50%; animation: spin .9s linear infinite; }
.shot .review-badge { position: absolute; top: 10px; left: 10px; }
.shot .body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.shot .title { font-weight: 800; font-size: 15.5px; }
.shot .title .seq { color: var(--text-3); font-weight: 700; }
.shot .shot-name { color: var(--text-3); font-size: 13.5px; margin-top: -6px; }
.shot details summary { cursor: pointer; font-size: 17px; list-style: none; display: flex; gap: 8px; align-items: center; }
.shot details summary::-webkit-details-marker { display: none; }
.shot details summary::before { content: "▶"; font-size: 12px; transition: transform .15s; }
.shot details[open] summary::before { transform: rotate(90deg); }
.shot details pre {
  white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 8px;
  margin: 10px 0 0; max-height: 260px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.shot .meta { font-size: 13px; color: var(--text-3); }
.shot .err { font-size: 13px; color: var(--bad); }
.shot .actions { border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.act { background: none; border: 0; padding: 4px 0; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--text-2); cursor: pointer; text-align: left; white-space: nowrap; }
.act:hover { color: var(--text); }
.act svg { width: 15px; height: 15px; }
.act.on-ok { color: var(--ok); }
.act.on-bad { color: var(--bad); }
.act:disabled { opacity: .4; cursor: default; }

/* ---------- товари ---------- */
.toolbar { display: flex; gap: 12px; margin-bottom: 24px; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.pcard { overflow: hidden; cursor: pointer; transition: transform .15s; }
.pcard:hover { transform: translateY(-2px); }
.pcard .img { aspect-ratio: 1/1; background: var(--surface-2); }
.pcard .img img { width: 100%; height: 100%; object-fit: contain; }
.pcard .body { padding: 14px 16px 16px; }
.pcard .name { font-weight: 800; }
.pcard .meta { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ---------- форми ---------- */
.field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.input, select.input, textarea.input {
  width: 100%; height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 16px;
  background: var(--surface); font-weight: 600; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 12px 16px; resize: vertical; font-weight: 500; }
select.input {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231a1f1c' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.input:focus { border-color: #9fb88f; box-shadow: 0 0 0 3px rgba(219, 238, 108, .45); }
.input.sm { height: 38px; border-radius: 10px; padding: 0 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 22px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-size: 12.5px; color: var(--text-3); margin-top: 8px; }

.dropzone {
  border: 1.5px dashed #c5d1bc; border-radius: 14px; background: var(--surface-2); padding: 30px 20px 28px; text-align: center;
  transition: background .15s, border-color .15s;
}
.dropzone.drag { background: #eef5dc; border-color: #9fb88f; }
.dropzone svg { width: 34px; height: 34px; color: #4f6d58; }
.dropzone .t { font-weight: 800; margin-top: 10px; }
.dropzone .s { font-size: 13px; color: var(--text-3); margin: 6px 0 16px; }
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-top: 16px; text-align: left; }
.file-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.file-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.file-item .n { font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.estimate { background: var(--surface-2); border-radius: 12px; padding: 14px 18px; font-size: 14px; color: var(--text-2); }
.estimate b { color: var(--text); }

/* ---------- модалка ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(28, 38, 32, .55); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; width: min(1060px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal-head { padding: 22px 36px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head .eyebrow { font-size: 13px; letter-spacing: .1em; font-weight: 800; color: var(--label); text-transform: uppercase; }
.modal-head h2 { margin: 8px 0 0; font-size: 26px; font-weight: 700; }
.modal-x { border: 0; background: none; font-size: 26px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 6px; }
.modal-body { padding: 30px 36px; overflow-y: auto; }
.modal-foot { padding: 22px 36px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- інше ---------- */
.models-table td { white-space: normal; vertical-align: top; }
.models-table tbody tr { cursor: default; }
.models-table code { font-size: 12.5px; background: var(--surface-2); padding: 3px 6px; border-radius: 6px; }
.switch { position: relative; width: 44px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d5d9d0; border-radius: 26px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(18px); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 12px 16px; font-size: 14px; margin: 6px 0 20px; }
.kv dt { color: var(--text-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 700; word-break: break-all; }
.login { min-height: 100vh; display: grid; place-items: center; background: var(--side); padding: 20px; }
.login .card { width: min(420px, 100%); padding: 36px; }
.login .brand { padding: 0 0 26px; color: var(--text); }
.login .brand-sub { color: var(--text-3); }

#toast-root { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { background: var(--side); color: #fff; padding: 14px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 420px; animation: up .2s ease-out; }
.toast.bad { background: #8f3424; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1400px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; background: var(--bg); }
  .sidebar { position: static; height: auto; padding: 14px 16px; flex-direction: row; align-items: center; gap: 10px; overflow-x: auto; }
  .brand { padding: 0 10px 0 0; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-text, .side-foot { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 10px 14px; font-size: 15px; }
  .nav a.active::before { display: none; }
  .main { padding: 26px 16px 48px; }
  .main-wrap { display: flex; flex-direction: column; }
  .cur-toggle { position: static; align-self: flex-end; margin: 14px 16px -12px 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .settings-grid, .form-grid { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 30px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 20px; padding-right: 20px; }
}

/* ---------- діалоги ---------- */
.dialog-back { z-index: 60; }
.modal.dialog { width: min(520px, 100%); }
.modal.dialog .modal-head { padding: 22px 28px 18px; }
.modal.dialog .modal-head h2 { font-size: 22px; margin-top: 4px; }
.modal.dialog .modal-body { padding: 22px 28px; }
.modal.dialog .modal-foot { padding: 16px 28px; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #9a3a26; border-color: #9a3a26; }

/* ---------- згортання пресетів ---------- */
.preset-tools { display: flex; gap: 18px; align-items: center; justify-content: flex-end; margin: -10px 0 14px; font-size: 14px; color: var(--text-3); }
.preset-tools span { margin-right: auto; }
.preset-card { margin-bottom: 14px; overflow: hidden; }
.preset-head { display: flex; align-items: center; gap: 16px; padding: 18px 22px; cursor: pointer; user-select: none; }
.preset-head:hover { background: #fbfbf9; }
.preset-head:focus-visible { outline: 2px solid var(--lime-strong); outline-offset: -2px; }
.preset-head .chev { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: transform .18s; }
.preset-card.open .preset-head .chev { transform: rotate(90deg); }
.preset-title { min-width: 160px; }
.preset-title h3 { margin: 0; font-size: 18px; font-weight: 700; }
.preset-title .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.preset-strip { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 0; overflow: hidden; }
.preset-strip img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.preset-strip .more { font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 12px 10px; flex: none; }
.preset-strip .empty-strip { font-size: 13px; color: var(--text-3); }
.preset-card .head-actions { margin-left: auto; flex: none; }
.preset-body { padding: 0 22px 22px; border-top: 1px solid var(--line); padding-top: 18px; }
@media (max-width: 1100px) {
  .preset-head { flex-wrap: wrap; }
  .preset-strip { order: 3; flex-basis: 100%; }
  .preset-card .head-actions { margin-left: 0; }
}

/* ---------- період статистики ---------- */
.range-wrap { position: relative; }
.range-btn svg { width: 17px; height: 17px; color: var(--green); }
.range-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; display: flex; gap: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 12px;
  box-shadow: 0 20px 50px rgba(20, 30, 25, .18);
}
.range-pop[hidden] { display: none; }
.range-presets { display: flex; flex-direction: column; gap: 2px; padding-right: 10px; border-right: 1px solid var(--line); min-width: 150px; }
.range-presets button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.range-presets button:hover { background: var(--surface-2); color: var(--text); }
.range-presets button.on { background: var(--side); color: #fff; }
.range-cal { padding: 2px 6px; width: 284px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head b { text-transform: capitalize; font-size: 15px; }
.cal-nav { border: 1px solid var(--line); background: var(--surface); width: 32px; height: 32px; border-radius: 9px; font-size: 18px; line-height: 1; cursor: pointer; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: 11.5px; font-weight: 700; color: var(--text-3); text-align: center; padding: 4px 0 6px; }
.cal-day { height: 36px; border: 0; background: none; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.cal-day:hover:not(:disabled) { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--lime-strong); }
.cal-day.in { background: #eef5dc; border-radius: 0; }
.cal-day.edge { background: var(--side); color: #fff; border-radius: 9px; }
.cal-day:disabled { color: #c5c9c2; cursor: default; }
.cal-hint { font-size: 12.5px; color: var(--text-3); margin-top: 8px; text-align: center; }
@media (max-width: 1100px) {
  .range-pop { right: auto; left: 0; flex-direction: column; }
  .range-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 8px; min-width: 0; }
  .range-cal { width: min(284px, calc(100vw - 64px)); }
}

/* ---------- блоки пресетів ---------- */
.preset-section { margin-bottom: 8px; }
.section-head { display: flex; align-items: center; gap: 12px; padding: 10px 4px; margin-bottom: 12px; cursor: pointer; user-select: none; border-radius: 12px; }
.section-head:hover h2 { color: var(--green); }
.section-head:focus-visible { outline: 2px solid var(--lime-strong); }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.section-head .sub { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.section-head .chev { width: 20px; height: 20px; flex: none; color: var(--text-3); transform: rotate(90deg); transition: transform .18s; }
.preset-section.closed .section-head .chev { transform: rotate(0deg); }
.preset-section.closed .section-head { border-bottom: 1px solid var(--line); border-radius: 0; padding-bottom: 16px; }

/* Формат: підказка з прямокутником пропорцій */
.ratio-help { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.ratio-help .ratio-box { flex: none; border: 2px solid var(--green); background: var(--lime); border-radius: 4px; }
.ratio-help b { color: inherit; font-weight: 700; }

/* ---------- розмір карток галереї ---------- */
.size-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; }
.size-toggle > span { font-size: 13px; color: var(--text-3); font-weight: 600; padding: 0 8px 0 10px; }
.size-toggle button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--text-2); cursor: pointer; }
.size-toggle button:hover:not(.on) { background: var(--surface-2); color: var(--text); }
.size-toggle button.on { background: var(--side); color: #fff; }
.shot .status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }

/* Середні */
.product-block.size-m { padding: 20px 22px 22px; margin-bottom: 18px; }
.size-m .product-head { margin-bottom: 14px; }
.size-m .product-head h3 { font-size: 17px; }
.size-m .gallery { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.size-m .shot .body { padding: 12px 12px 10px; gap: 8px; }
.size-m .shot .title { font-size: 14px; }
.size-m .shot details summary { font-size: 14px; }
.size-m .act { font-size: 12.5px; }
.size-m .shot .actions { gap: 4px 12px; padding-top: 8px; }

/* Малі (компактно) */
.product-block.size-s { padding: 14px 16px 16px; margin-bottom: 14px; }
.size-s .product-head { margin-bottom: 10px; align-items: center; }
.size-s .product-head h3 { font-size: 15px; }
.size-s .product-head .sub { font-size: 12.5px; margin-top: 2px; }
.size-s .product-head .btn-sm { padding: 6px 11px; font-size: 12.5px; }
.size-s .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.size-s .shot { border-radius: 10px; }
.size-s .shot .body { padding: 8px 9px 7px; gap: 5px; }
.size-s .shot .title { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size-s .shot .shot-name { font-size: 11.5px; margin-top: -3px; }
.size-s .shot .shot-name img { width: 20px !important; height: 20px !important; }
.size-s .shot details summary { font-size: 12px; }
.size-s .shot details summary::before { font-size: 9px; }
.size-s .shot .pill { padding: 3px 8px; font-size: 11px; }
.size-s .shot .meta { font-size: 11px; }
.size-s .shot .err { font-size: 11.5px; }
.size-s .shot .img .placeholder { font-size: 11.5px; gap: 6px; }
.size-s .shot .img .placeholder .spin { width: 16px; height: 16px; border-width: 2px; }
.size-s .shot .review-badge { top: 6px; left: 6px; }
.size-s .shot .actions { padding-top: 6px; gap: 2px; justify-content: space-between; flex-wrap: nowrap; }
.size-s .act .lbl { display: none; }
.size-s .act { padding: 5px; border-radius: 6px; }
.size-s .act:hover:not(:disabled) { background: var(--surface-2); }
.size-s .act svg { width: 16px; height: 16px; }
.size-s .shot.original .body .shot-name { display: none; }

/* ---------- активна нейромережа ---------- */
.prov-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.prov-opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 16px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, background .15s; }
.prov-opt:hover:not(.on) { border-color: var(--text-3); }
.prov-opt.on { border-color: var(--green); background: #f4f9e6; box-shadow: 0 0 0 3px rgba(219, 238, 108, .45); }
.prov-opt .radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); margin-top: 2px; position: relative; }
.prov-opt.on .radio { border-color: var(--green); }
.prov-opt.on .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--green); }
.prov-opt .txt { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.prov-opt .txt b { font-size: 16px; }
.prov-opt .txt small { color: var(--text-3); font-size: 12.5px; line-height: 1.4; }
.prov-opt .pill { padding: 3px 9px; font-size: 11.5px; }
.side-foot .active-prov b { color: var(--lime); }
@media (max-width: 900px) { .prov-choice { grid-template-columns: 1fr; } }

/* ---------- дії в рядку таблиці партій ---------- */
.row-acts { display: flex; gap: 6px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover:not(.disabled) { color: var(--text); border-color: var(--text-3); background: var(--surface-2); }
.icon-btn.disabled { opacity: .35; cursor: default; }
/* таблиця партій — компактна, щоб уміщалася без прокрутки */
.batches-table { min-width: 0; }
.batches-table thead th { padding: 13px 10px; font-size: 11.5px; letter-spacing: .05em; }
.batches-table tbody td { padding: 14px 10px; }
.batches-table th:first-child, .batches-table td:first-child { padding-left: 16px; }
.batches-table th:last-child, .batches-table td:last-child { padding-right: 14px; }
.batches-table td.name { min-width: 150px; white-space: normal; }
.batches-table .num { text-align: right; }
.batches-table td.name .when { font-weight: 500; font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.batches-table .pill { padding: 5px 10px; font-size: 12px; }
@media (max-width: 1400px) {
  .batches-table thead th { padding: 12px 6px; font-size: 10.5px; letter-spacing: .02em; }
  .batches-table tbody td { padding: 12px 6px; font-size: 14px; }
  .batches-table td.name { min-width: 128px; }
  .batches-table .row-acts { gap: 4px; }
  .batches-table .icon-btn { width: 30px; height: 30px; }
}
@media (max-width: 1100px) { .batches-table { min-width: 820px; } }

/* артикул під фото товару */
.file-item .art { display: block; width: 100%; border: 0; border-top: 1px solid var(--line); padding: 7px 8px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--text); background: #fff; outline: none; }
.file-item .art:focus { background: #f8fbe9; box-shadow: inset 0 -2px 0 var(--lime-strong); }
.file-item .art::placeholder { color: var(--bad); font-weight: 600; }
.names-help { margin-top: 12px; font-size: 13px; color: var(--text-2); text-align: left; line-height: 1.5; }
.names-help #names-preview { margin-top: 4px; color: var(--text-3); font-size: 12.5px; word-break: break-word; }

/* ---------- сторінки ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 18px 4px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.pager-info { color: var(--text-3); font-size: 13.5px; font-weight: 600; min-width: 90px; }
.pager-pages { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-weight: 700; font-size: 14px; color: var(--text-2); cursor: pointer; }
.pg:hover:not(:disabled):not(.on) { border-color: var(--text-3); color: var(--text); }
.pg.on { background: var(--side); border-color: var(--side); color: #fff; }
.pg:disabled { opacity: .35; cursor: default; }
.pg-gap { padding: 0 4px; color: var(--text-3); }
.pager-size { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.pager-size select { width: auto; padding: 7px 30px 7px 12px; min-height: 0; height: 36px; }
@media (max-width: 700px) { .pager { justify-content: center; } }

/* ---------- головна для гостей: вхід / реєстрація ---------- */
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.landing.single { grid-template-columns: 1fr; place-items: center; padding: 20px; background: var(--side); }
.landing-hero { background: var(--side); color: var(--side-text); padding: 56px clamp(28px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 22px; position: relative; overflow: hidden; }
.landing-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(219,238,108,.18), transparent 65%); pointer-events: none; }
.landing-hero .brand { padding: 0; position: absolute; top: 40px; left: clamp(28px, 6vw, 88px); }
.landing-hero h1 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.05; margin: 40px 0 0; letter-spacing: -.02em; font-weight: 800; }
.landing-hero p { font-size: 18px; line-height: 1.55; color: #c3d0c7; max-width: 520px; margin: 0; }
.landing-hero ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 12px; }
.landing-hero li { display: flex; gap: 12px; align-items: center; font-weight: 600; font-size: 16px; }
.landing-hero li svg { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--lime); color: var(--side); flex: none; }
.landing-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.landing.single .auth-card { color: var(--text); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 20px; }
.auth-tabs button { border: 0; background: none; padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--text-2); cursor: pointer; }
.auth-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.btn-google { width: 100%; justify-content: center; gap: 10px; background: #fff; border: 1px solid var(--line-strong); }
.btn-google:hover { background: var(--surface-2); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 18px 0 6px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#auth-form .field { margin-top: 12px; }
.auth-err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 20px; margin: 12px 0 4px; }
.auth-submit { width: 100%; justify-content: center; }
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; }
  .landing-hero { padding: 96px 24px 36px; }
  .landing-hero .brand { top: 28px; left: 24px; }
  .landing-hero h1 { margin-top: 0; }
}

/* ---------- користувач у боковій панелі ---------- */
.me-box { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--side); display: grid; place-items: center; font-weight: 800; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.me-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt span { font-size: 11.5px; color: var(--side-muted); }
.me-out { margin-left: auto; background: none; border: 0; color: var(--side-muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.me-out:hover { color: #fff; background: rgba(255,255,255,.06); }
.me-out svg { width: 18px; height: 18px; display: block; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #e0a243; color: #1d2a23; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.nav-badge[hidden] { display: none; }

/* ---------- сторінка користувачів ---------- */
.users-list { display: grid; gap: 14px; }
.user-card { padding: 20px 22px; }
.user-card.pending { border-color: #ecc77d; box-shadow: 0 0 0 3px rgba(224,162,67,.15); }
.user-card.blocked { opacity: .75; }
.user-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.user-id { flex: 1; min-width: 200px; }
.user-name { font-weight: 800; font-size: 16px; }
.user-mail { color: var(--text-2); font-size: 14px; margin-top: 2px; word-break: break-all; }
.user-meta { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.user-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.user-state select { width: auto; }
.perm-row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.perm-label { font-size: 13px; font-weight: 700; color: var(--text-2); margin-right: 4px; }
.perm { display: inline-flex; gap: 7px; align-items: center; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--surface); }
.perm:has(input:checked) { background: #f1f8dc; border-color: var(--green); }
.perm.sensitive:has(input:checked) { background: var(--warn-bg); border-color: #e0a243; }
.user-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
code.copy { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 12.5px; cursor: pointer; word-break: break-all; }
code.copy:hover { border-color: var(--text-3); }

/* компактна зона завантаження фото */
.dropzone.compact { padding: 14px 18px; text-align: left; }
.dropzone.compact .dz-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dropzone.compact .dz-row > svg { width: 28px; height: 28px; flex: none; }
.dropzone.compact .dz-txt { flex: 1; min-width: 180px; }
.dropzone.compact .t { margin: 0; font-size: 14.5px; }
.dropzone.compact .s { margin: 2px 0 0; font-size: 12.5px; }
.dropzone.compact .file-list { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 12px; }
.dropzone.compact .file-list:empty { display: none; }
select.input.placeholder { color: var(--text-3); }
select.input.placeholder option { color: var(--text); }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(200, 60, 40, .12); }
