/* Дизайн-токени взято з BotLabs CRM (crm-jd.botlabs.agency): палітра slate, Inter, радіус 0.625rem. */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&display=swap');

:root {
  --radius: 0.625rem;
  --background: oklch(100% 0 0);
  --foreground: oklch(12.9% .042 264.695);
  --card: oklch(100% 0 0);
  --card-foreground: oklch(12.9% .042 264.695);
  --popover: oklch(100% 0 0);
  --primary: oklch(20.8% .042 265.755);
  --primary-foreground: oklch(98.4% .003 247.858);
  --secondary: oklch(96.8% .007 247.896);
  --secondary-foreground: oklch(20.8% .042 265.755);
  --muted: oklch(96.8% .007 247.896);
  --muted-foreground: oklch(55.4% .046 257.417);
  --accent: oklch(96.8% .007 247.896);
  --accent-foreground: oklch(20.8% .042 265.755);
  --destructive: oklch(57.7% .245 27.325);
  --border: oklch(92.9% .013 255.508);
  --input: oklch(92.9% .013 255.508);
  --ring: oklch(70.4% .04 256.788);
  --sidebar: var(--background);
  --ok: oklch(52.7% .154 150.069);
  --ok-bg: oklch(96.2% .044 156.743);
  --warn: oklch(55.5% .163 48.998);
  --warn-bg: oklch(96.2% .059 95.617);
  --bad: oklch(57.7% .245 27.325);
  --bad-bg: oklch(95.6% .029 17.38);
  --info: oklch(48.8% .217 264.376);
  --info-bg: oklch(95.1% .026 236.824);
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --sidebar-width: 16rem;
  color-scheme: light;
}
:root.dark {
  --background: oklch(12.9% .042 264.695);
  --foreground: oklch(98.4% .003 247.858);
  --card: oklch(14% .04 259.21);
  --card-foreground: oklch(98.4% .003 247.858);
  --popover: oklch(20.8% .042 265.755);
  --primary: oklch(92.9% .013 255.508);
  --primary-foreground: oklch(20.8% .042 265.755);
  --secondary: oklch(27.9% .041 260.031);
  --secondary-foreground: oklch(98.4% .003 247.858);
  --muted: oklch(27.9% .041 260.031);
  --muted-foreground: oklch(70.4% .04 256.788);
  --accent: oklch(27.9% .041 260.031);
  --accent-foreground: oklch(98.4% .003 247.858);
  --destructive: oklch(70.4% .191 22.216);
  --border: oklch(100% 0 0 / .1);
  --input: oklch(100% 0 0 / .15);
  --ring: oklch(55.1% .027 264.364);
  --ok: oklch(79.2% .209 151.711);
  --ok-bg: oklch(39.3% .095 152.535 / .35);
  --warn: oklch(82.8% .189 84.429);
  --warn-bg: oklch(47.3% .137 46.201 / .35);
  --bad: oklch(70.4% .191 22.216);
  --bad-bg: oklch(39.6% .141 25.723 / .35);
  --info: oklch(70.7% .165 254.624);
  --info-bg: oklch(37.9% .146 265.522 / .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11';
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Каркас ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); flex: none; background: var(--sidebar); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 8px;
}
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 8px; margin-bottom: 4px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; }
.logo svg.i { width: 18px; height: 18px; }
.brand-name { font-weight: 600; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted-foreground); }
.nav-group { padding: 8px 0; }
.nav-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 0 8px; height: 32px; display: flex; align-items: center; }
.nav-item {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 6px; text-decoration: none;
  color: var(--foreground); font-size: 14px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--accent); }
.nav-item.active { background: var(--accent); font-weight: 500; }
.nav-item .count { margin-left: auto; font-size: 12px; font-weight: 500; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 8px; background: var(--muted); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.header {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--background) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.header .spacer { flex: 1; }
.content { padding: 24px 16px 48px; width: 100%; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; margin: 0; line-height: 1.25; }
.page-sub { color: var(--muted-foreground); margin: 4px 0 0; }
.backdrop { display: none; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .layout.nav-open .sidebar { transform: none; }
  .layout.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .4); z-index: 40; }
}
@media (min-width: 901px) { .only-mobile { display: none !important; } }
@media (max-width: 900px) { .only-desktop { display: none !important; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; border: 1px solid transparent; text-decoration: none;
  background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-xs); transition: background .15s, opacity .15s;
}
.btn:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .tab:focus-visible {
  outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); border-color: var(--ring);
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.outline { background: var(--background); color: var(--foreground); border-color: var(--input); }
.btn.outline:hover, .btn.ghost:hover { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--foreground); box-shadow: none; }
.btn.secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: none; }
.btn.destructive { background: var(--destructive); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.dashed { border-style: dashed; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent;
  cursor: pointer; color: var(--foreground);
}
.icon-btn:hover { background: var(--accent); }
.icon-btn.sm { width: 32px; height: 32px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Поля ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 14px; font-weight: 500; line-height: 1; }
.hint { font-size: 12px; color: var(--muted-foreground); }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--input); background: transparent;
  box-shadow: var(--shadow-xs); font-size: 14px; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.textarea { height: auto; min-height: 96px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select option { background: var(--popover); color: var(--foreground); }
.input::placeholder, .textarea::placeholder { color: var(--muted-foreground); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--destructive); }
.field-error { font-size: 12px; color: var(--destructive); }
.input-group { position: relative; }
.input-group > svg.i { position: absolute; left: 10px; top: 10px; color: var(--muted-foreground); pointer-events: none; }
.input-group > svg.i + .input { padding-left: 34px; }
.input-group > .input + .icon-btn { right: 2px; }
.input-group > .icon-btn { position: absolute; right: 2px; top: 2px; width: 32px; height: 32px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--input); transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--background); box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }

/* ---------- Картки ---------- */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.card-head { padding: 20px 24px 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-weight: 600; font-size: 16px; line-height: 1.3; margin: 0; }
.card-desc { color: var(--muted-foreground); font-size: 13px; margin: 4px 0 0; }
.card-body { padding: 20px 24px; display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { border-radius: 12px; border: 1px solid var(--border); background: var(--card); padding: 12px; text-align: left; box-shadow: var(--shadow-xs); cursor: pointer; }
.kpi:hover { background: var(--accent); }
.kpi.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.kpi-label { margin-top: 4px; font-size: 14px; font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--muted-foreground); }
.kpi.warn .kpi-value { color: var(--warn); }

/* ---------- Таблиця ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .input-group { width: 280px; max-width: 100%; }
.toolbar .select { width: auto; min-width: 150px; height: 32px; font-size: 13px; }
.table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { height: 40px; padding: 0 8px; text-align: left; font-weight: 500; color: var(--muted-foreground); white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in oklch, var(--muted) 50%, transparent); }
.table th:first-child, .table td:first-child { padding-left: 12px; }
.table th:last-child, .table td:last-child { padding-right: 12px; }
.table .right { text-align: right; }
.row-link { cursor: pointer; }
.thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--muted); display: grid; place-items: center; color: var(--muted-foreground); }
.cell-title { font-weight: 500; display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.cell-title:hover { text-decoration: underline; }
.cell-sub { font-size: 12px; color: var(--muted-foreground); }
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-old { color: var(--muted-foreground); text-decoration: line-through; font-size: 12px; margin-left: 6px; font-weight: 400; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted-foreground); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; color: var(--muted-foreground); font-size: 13px; flex-wrap: wrap; }
.pager .btns { display: flex; gap: 8px; }

/* ---------- Бейджі ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.outline { border-color: var(--border); color: var(--foreground); }
.badge.s-in_stock, .badge.r-done { color: var(--ok); background: var(--ok-bg); }
.badge.s-reserved, .badge.r-new { color: var(--warn); background: var(--warn-bg); }
.badge.s-sold, .badge.r-cancelled { color: var(--bad); background: var(--bad-bg); }
.badge.s-hidden { color: var(--muted-foreground); background: var(--muted); }
.badge.r-confirmed { color: var(--info); background: var(--info-bg); }
.badge.disc { color: var(--bad); background: var(--bad-bg); }
.badge.disc::before { display: none; }

/* ---------- Меню, діалоги, тости ---------- */
.menu { position: fixed; z-index: 60; min-width: 200px; background: var(--popover); color: var(--foreground); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-size: 14px; text-align: left; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); outline: none; }
.menu-item.danger { color: var(--destructive); }
.menu-sep { height: 1px; background: var(--border); margin: 4px -4px; }
.dialog-overlay { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .5); display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 440px; background: var(--background); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 24px; display: grid; gap: 16px; }
.dialog h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dialog p { margin: 0; color: var(--muted-foreground); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; background: var(--muted); border-radius: 10px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.seg button.on { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-xs); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--popover); color: var(--foreground); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; animation: toastIn .2s ease; }
.toast.error svg.i { color: var(--destructive); }
.toast.ok svg.i { color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Вкладки ---------- */
.tabs { display: inline-flex; flex-wrap: wrap; padding: 3px; background: var(--muted); border-radius: 10px; gap: 2px; margin-bottom: 12px; }
.tab { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted-foreground); display: inline-flex; align-items: center; gap: 6px; }
.tab.on { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-xs); }
.tab .n { font-variant-numeric: tabular-nums; font-size: 12px; opacity: .8; }

/* ---------- Редактор ---------- */
.editor-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.editor-bar .title { flex: 1; min-width: 200px; }
.dirty-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); }
.dirty-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.editor-col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1100px) {
  /* одна колонка: картки в порядку роботи з телефона — фото, основне, ціна, статус, опис, розміри, решта */
  .editor-grid { display: flex; flex-direction: column; align-items: stretch; }
  .editor-col { display: contents; }
  .ord-photos { order: 1; } .ord-main { order: 2; } .ord-price { order: 3; } .ord-status { order: 4; } .ord-desc { order: 5; }
  .ord-dims { order: 6; } .ord-ai { order: 7; } .ord-more { order: 8; } .ord-after { order: 9; } .ord-hist { order: 10; }
}
/* форма товару: вибір із словника каталогу (бренд, колір, матеріал, характеристики) */
.pick { display: grid; gap: 8px; min-width: 0; }
.pick-chips:empty { display: none; }
.chip.add { border-style: dashed; color: var(--primary); }
.pick-chips .chip, .dims-help .chip { max-width: 100%; height: auto; min-height: 32px; padding-top: 5px; padding-bottom: 5px; white-space: normal; text-align: left; line-height: 1.3; overflow-wrap: anywhere; }
.chip.add svg, .chip svg { width: 14px; height: 14px; }
.chip:disabled { opacity: .4; cursor: default; }
.chip .sw { width: 12px; height: 12px; border-radius: 50%; border: 1px solid color-mix(in oklch, var(--foreground) 25%, transparent); flex: none; }
.sw.f-black { background: #1E1F1A; } .sw.f-gray { background: #9C9D97; } .sw.f-white { background: #fff; } .sw.f-cream { background: #E6DCC6; }
.sw.f-brown { background: #A5683A; } .sw.f-green { background: #3F5E5A; } .sw.f-none { background: repeating-linear-gradient(45deg, transparent 0 2px, var(--muted-foreground) 2px 3px); }
.ask { display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--muted); }
.ask-q { font-weight: 500; font-size: 14px; }
.feat-chips .chip.feat { height: auto; min-height: 32px; padding: 0 4px 0 12px; gap: 4px; max-width: 100%; white-space: normal; text-align: left; }
.feat-text { all: unset; cursor: pointer; padding: 6px 0; line-height: 1.3; overflow-wrap: anywhere; }
.feat-x { all: unset; cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; }
.feat-x:hover { background: color-mix(in oklch, var(--primary-foreground) 20%, transparent); }
.feat-add { display: flex; gap: 8px; } .feat-add .input { flex: 1; min-width: 0; }
.dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dim { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 4px 6px; align-items: center; min-width: 0; }
.dim-k { grid-column: 1 / -1; font-size: 13px; color: var(--muted-foreground); }
.dim .input { min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.dim-u { color: var(--muted-foreground); }
.dims-help { display: grid; gap: 8px; }
.dims-help:empty { display: none; }
.site-preview { display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--muted); }
.site-preview .label { font-size: 12px; color: var(--muted-foreground); font-weight: 500; }
.site-url { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.site-url svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.site-preview .tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--background); border: 1px solid var(--border); font-size: 12.5px; }
details.more > summary { list-style: none; cursor: pointer; padding-bottom: 20px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary > svg { flex: none; transition: transform .15s; margin-top: 2px; }
details.more[open] > summary > svg { transform: rotate(180deg); }
details.more[open] > summary { padding-bottom: 0; }
@media (max-width: 640px) {
  details.more > summary { padding-bottom: 16px; }
  details.more[open] > summary { padding-bottom: 0; }
  .chip.sm { height: 36px; }
  .pick-chips .chip.sm, .dims-help .chip.sm { height: auto; min-height: 36px; }
}
.discount-line { font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--muted); color: var(--muted-foreground); }
.discount-line.on { background: var(--bad-bg); color: var(--bad); font-weight: 500; }
.discount-line.err { background: var(--bad-bg); color: var(--destructive); }
.features { display: grid; gap: 8px; }
.feature-row { display: flex; gap: 6px; align-items: center; }
.feature-row .input { flex: 1; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--muted); cursor: grab; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.photo.dragging { opacity: .4; }
.photo.drop-target { box-shadow: 0 0 0 2px var(--primary); }
.photo .cover-tag { position: absolute; left: 6px; top: 6px; background: var(--primary); color: var(--primary-foreground); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.photo .tools { position: absolute; inset: auto 4px 4px 4px; display: flex; justify-content: space-between; gap: 2px; opacity: 0; transition: opacity .15s; }
.photo:hover .tools, .photo:focus-within .tools { opacity: 1; }
@media (hover: none) { .photo .tools { opacity: 1; } }
.photo .tools button { width: 28px; height: 28px; border-radius: 6px; border: 0; background: rgb(255 255 255 / .92); color: #0f172a; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.photo .tools button svg.i { width: 14px; height: 14px; }
.photo .tools button.danger { color: #dc2626; }
.dropzone { border: 1px dashed var(--input); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted-foreground); cursor: pointer; font-size: 13px; display: grid; gap: 6px; justify-items: center; }
.dropzone:hover, .dropzone.over { background: var(--accent); color: var(--foreground); }
.history { display: grid; gap: 10px; font-size: 13px; margin: 0; padding: 0; list-style: none; }
.history li { display: grid; gap: 2px; }
.history .when { font-size: 12px; color: var(--muted-foreground); }
.status-options { display: grid; gap: 8px; }
.status-option { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.status-option:hover { background: var(--accent); }
.status-option.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.status-option input { margin: 3px 0 0; accent-color: var(--primary); }
.status-option .t { font-weight: 500; }
.status-option .d { font-size: 12px; color: var(--muted-foreground); }

/* ---------- Заявки ---------- */
.req-note { min-width: 160px; height: 32px; font-size: 13px; }
.req-status { height: 32px; font-size: 13px; width: 150px; }
.link-muted { color: var(--muted-foreground); text-decoration: none; }
.link-muted:hover { text-decoration: underline; color: var(--foreground); }
.msg { font-size: 12px; color: var(--muted-foreground); max-width: 280px; white-space: pre-wrap; }

/* ---------- Налаштування ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; word-break: break-word; }
.list { display: grid; gap: 0; border: 1px solid var(--border); border-radius: 10px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 140px; }
.state-line { display: flex; align-items: center; gap: 8px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--muted); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* ---------- Вхід ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 20px; font-weight: 500; }
.login-brand svg.i { width: 22px; height: 22px; }
.login-card { padding: 24px; display: grid; gap: 16px; }
.login-card h1 { font-size: 18px; font-weight: 600; margin: 0; }
.login-card p { margin: 0; color: var(--muted-foreground); font-size: 14px; }
.alert { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.alert.error { border-color: color-mix(in oklch, var(--destructive) 40%, transparent); color: var(--destructive); background: var(--bad-bg); }
.alert.warn { border-color: color-mix(in oklch, var(--warn) 40%, transparent); color: var(--warn); background: var(--warn-bg); }
.skeleton { background: var(--muted); border-radius: 8px; animation: pulse 2s cubic-bezier(.4,0,.6,1) infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* =================== Бізнес: замовлення, доставки, огляд =================== */
:root { --series-1: #2a78d6; --series-2: #eb6834; --tabbar-h: 60px; }
:root.dark { --series-1: #3987e5; --series-2: #d95926; }
.grow { flex: 1; min-width: 0; }
.fit { justify-self: start; width: max-content; }
.spacer { flex: 1; }
.form-stack { display: grid; gap: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }
.toolbar .input-group.grow { width: auto; flex: 1; }
.alert.info { border-color: color-mix(in oklch, var(--info) 35%, transparent); color: var(--info); background: var(--info-bg); }
.danger-text { color: var(--destructive) !important; }
.dialog-actions .danger-text { margin-right: auto; }
.neg { color: var(--bad); }
.below-list { margin-top: 16px; display: flex; justify-content: center; }
.below-list a, a.link-muted { display: inline-flex; align-items: center; gap: 6px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.card.empty { padding: 32px 16px; }
details > summary { cursor: pointer; padding: 4px 0; }

/* статуси замовлень */
.badge.o-new { color: var(--warn); background: var(--warn-bg); }
.badge.o-confirmed { color: var(--info); background: var(--info-bg); }
.badge.o-delivered { color: var(--ok); background: var(--ok-bg); }
.badge.o-closed { color: var(--muted-foreground); background: var(--muted); }
.badge.o-cancelled { color: var(--bad); background: var(--bad-bg); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; background: var(--muted); color: var(--muted-foreground); white-space: nowrap; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag svg.i { width: 13px; height: 13px; }
.tag.link:hover { color: var(--foreground); }

/* вкладки-чіпи з горизонтальним прокручуванням (телефон) */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 0; margin-bottom: 0; }
.chip { flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--input); background: var(--background); cursor: pointer; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; color: var(--foreground); }
.chip .n { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.chip.on .n { color: inherit; opacity: .8; }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }

/* картки замовлень і доставок */
.olist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.olist > .alert, .olist > .card.empty, .olist > .day-sep { grid-column: 1 / -1; }
.ocard { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; box-shadow: var(--shadow-xs); cursor: pointer; min-width: 0; }
.ocard:hover { border-color: var(--ring); }
.ocard:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.ocard-top, .ocard-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ocard-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.ocard-name { font-weight: 600; font-size: 15px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.ocard-items { color: var(--muted-foreground); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ocard .price { font-size: 16px; }
.dcard { cursor: default; }
.dcard.done { opacity: .65; }
.dwhen { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.place { display: inline-flex; gap: 6px; align-items: flex-start; text-decoration: none; color: var(--info); font-weight: 500; }
.place svg.i { margin-top: 3px; }
.day-sep { font-size: 13px; font-weight: 600; color: var(--muted-foreground); padding: 8px 2px 0; text-transform: capitalize; }

/* редактор замовлення */
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .order-grid { grid-template-columns: 1fr; } }
.items { display: grid; gap: 10px; }
.item-row { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in oklch, var(--muted) 40%, transparent); }
.item-head { display: flex; align-items: center; gap: 8px; }
.item-nums { display: grid; grid-template-columns: 1fr 1fr 64px; gap: 8px; }
.item-nums .label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.sumline { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted-foreground); }
.sumline b { color: var(--foreground); font-variant-numeric: tabular-nums; }
.totals { display: grid; gap: 6px; }
.tot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.tot b { font-variant-numeric: tabular-nums; }
.tot.big { font-size: 18px; padding: 10px 12px; border-radius: 10px; background: var(--muted); }
.tot.big.warn { background: var(--warn-bg); color: var(--warn); }
.tot.big.ok { background: var(--ok-bg); color: var(--ok); }
.tot.big.bad { background: var(--bad-bg); color: var(--bad); }
.pay-list { display: grid; gap: 8px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr 1.2fr 32px; gap: 6px; align-items: center; }
.pay-row.invalid .input:first-child { border-color: var(--destructive); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; }
.savebar { position: sticky; bottom: 0; z-index: 15; display: flex; justify-content: flex-end; gap: 8px; margin: 16px -16px -48px; padding: 12px 16px; background: color-mix(in oklch, var(--background) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.pick-list { display: grid; gap: 4px; max-height: min(55vh, 420px); overflow-y: auto; margin: 0 -8px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left; width: 100%; min-width: 0; }
.pick-row:hover, .pick-row:focus-visible { background: var(--accent); outline: none; }
.pick-row .cell-title { max-width: 100%; }
.select.narrow { width: auto; }
.state-line.wrap { flex-wrap: wrap; }
.req-order { margin-top: 6px; display: inline-flex; }

/* огляд */
.month-picker { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 10px; padding: 2px; background: var(--card); }
.month-label { min-width: 132px; text-align: center; font-weight: 600; font-size: 14px; }
.dash { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.dash-grid > *, .editor-col > *, .order-grid > * { min-width: 0; }
.trend-table { overflow-x: auto; }
.quick { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.quick-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); text-decoration: none; box-shadow: var(--shadow-xs); flex-wrap: wrap; }
.quick-item:hover { background: var(--accent); }
.quick-item b { font-size: 18px; font-variant-numeric: tabular-nums; }
.quick-add { height: auto; }
.dash-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; }
@media (max-width: 1300px) { .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi.static { cursor: default; }
.kpi.static:hover { background: var(--card); }
.kpi-label.top { margin: 0 0 4px; font-size: 13px; color: var(--muted-foreground); }
.kpi.neg .kpi-value { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.pl { display: grid; gap: 0; }
.pl-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pl-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl-row.minus b { color: var(--muted-foreground); font-weight: 500; }
.pl-row.sub { font-weight: 600; }
.pl-row.indent { padding: 4px 0 4px 16px; font-size: 13px; color: var(--muted-foreground); border-bottom-style: dashed; }
.pl-row.indent b { font-weight: 400; }
.pl-row.total { border-bottom: 0; font-size: 16px; font-weight: 700; padding-top: 12px; }
.pl-row.total.neg b { color: var(--bad); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted-foreground); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }
.sw.s1 { background: var(--series-1); }
.sw.s2 { background: var(--series-2); }
svg.trend { width: 100%; height: auto; display: block; overflow: visible; }
svg.trend .grid { stroke: var(--border); stroke-width: 1; }
svg.trend .axis { stroke: var(--muted-foreground); stroke-width: 1; opacity: .6; }
svg.trend .tick { fill: var(--muted-foreground); font-size: 10px; font-family: inherit; }
svg.trend .tick.cur { fill: var(--foreground); font-weight: 600; }
svg.trend .b1 { fill: var(--series-1); }
svg.trend .b2 { fill: var(--series-2); }
svg.trend .hit { fill: transparent; }
svg.trend .col { cursor: pointer; outline: none; }
svg.trend .col:hover .hit, svg.trend .col:focus .hit { fill: color-mix(in oklch, var(--muted) 70%, transparent); }
.trend-info { font-size: 13px; color: var(--muted-foreground); min-height: 20px; }
.trend-info b { color: var(--foreground); }
.trend-table .table { font-size: 13px; }
.src-list { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.card-body { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.card-body > * { min-width: 0; }
.src-row { display: grid; gap: 4px; }
.src-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.src-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-bar { height: 8px; background: var(--muted); border-radius: 4px; overflow: hidden; }
.src-bar span { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }

/* витрати */
.list-row.clickable { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.list-row.clickable:hover { background: var(--accent); }
.list-row.clickable:last-child { border-bottom: 0; }
.list-row b { white-space: nowrap; }
.import-wrap { display: grid; gap: 16px; max-width: 900px; grid-template-columns: minmax(0, 1fr); }

/* нижнє меню на телефоні */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in oklch, var(--background) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--border);
  }
  .tabbar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; text-decoration: none; color: var(--muted-foreground); background: none; border: 0; cursor: pointer; font-family: inherit; padding: 0; }
  .tabbar-item.active { color: var(--foreground); }
  .tabbar-icon { position: relative; display: grid; place-items: center; width: 44px; height: 28px; border-radius: 14px; }
  .tabbar-item.active .tabbar-icon { background: var(--accent); }
  .tabbar-icon svg.i { width: 20px; height: 20px; }
  .tabbar-icon .count { position: absolute; top: -4px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; background: var(--destructive); color: #fff; display: grid; place-items: center; }
  .content { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
  .savebar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); margin-bottom: calc(-1 * (var(--tabbar-h) + 32px)); }
  .toasts { top: calc(8px + env(safe-area-inset-top)); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
  .header { height: 52px; }
}
@media (max-width: 640px) {
  .content { padding-top: 16px; padding-left: 12px; padding-right: 12px; }
  .page-title { font-size: 21px; }
  .page-head { align-items: center; margin-bottom: 12px; }
  .page-head .toolbar { margin-bottom: 0; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 16px; gap: 14px; }
  .olist { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick-add { grid-column: 1 / -1; height: 44px; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi-value { font-size: 20px; }
  .grid2.keep { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pay-row { grid-template-columns: 1fr 1fr 32px; }
  .pay-row input[type=date] { grid-column: 1 / 3; grid-row: 2; }
  .savebar { margin-left: -12px; margin-right: -12px; }
  .savebar .btn { flex: 1; height: 44px; }
  .input, .select { height: 42px; font-size: 16px; } /* 16px — iOS не збільшує сторінку при фокусі */
  .textarea { font-size: 16px; }
  .btn { height: 42px; }
  .btn.sm { height: 34px; }
  .month-picker { width: 100%; justify-content: space-between; }
  .page-head > .toolbar:has(.month-picker) { width: 100%; }
  .dialog { padding: 18px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .dialog-overlay { align-items: end; padding: 8px; }
  .settings-grid { gap: 12px; }
}

/* Токен бота в Налаштуваннях */
.token-form { display: grid; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.token-form .state-line { flex-wrap: wrap; }

/* Команда Миколи */
.team { display: grid; gap: 10px; }
.member { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.member-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-head .grow { min-width: 0; }
.member-head .small { overflow-wrap: anywhere; }
.member-name { font-weight: 600; }
.member-notify { display: grid; gap: 6px; }
.chip.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.chip.sm svg { width: 14px; height: 14px; }
.team-form { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.team-wrap { display: grid; gap: 10px; }
.team-warn { display: grid; gap: 8px; }
.team-warn:empty { display: none; }
.member-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.member-status svg { width: 16px; height: 16px; }
.member-status.ok { color: var(--ok, #1f7a4d); }
.member-status.wait { color: var(--warn); }
.strangers { display: grid; gap: 8px; padding-top: 6px; }
.stranger { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; }
.stranger .member-head { flex-wrap: wrap; }
.team-done { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--muted, transparent); }

/* аналітика */
.ins-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 700px) { .ins-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ins-tile { padding: 12px; min-width: 0; }
.ins-tile .kpi-value { font-size: 22px; }
.ins-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.delta { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted-foreground); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.ins-pick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; -webkit-overflow-scrolling: touch; }
.ins-pick::-webkit-scrollbar { display: none; }
.ins-pick-item { flex: 1 0 132px; padding: 10px 12px; font: inherit; color: inherit; display: flex; flex-direction: column; justify-content: space-between; }
.ins-pick-item .kpi-value { font-size: 20px; }
.ins-chart { display: grid; gap: 8px; }
svg.ins-line .l-cur { fill: none; stroke: var(--series-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
svg.ins-line .l-prev { fill: none; stroke: var(--muted-foreground); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
svg.ins-line .l-dot { fill: var(--series-1); stroke: var(--card); stroke-width: 2; pointer-events: none; }
.sw.s0 { background: transparent; border: 1.5px dashed var(--muted-foreground); width: 12px; height: 0; border-radius: 0; vertical-align: 3px; }
.ins-list { display: grid; gap: 4px; margin: -4px 0; }
.ins-prod { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px; margin: 0 -6px; border-radius: 10px; text-decoration: none; color: inherit; }
.ins-prod:hover { background: var(--accent); }
.ins-prod img, .ins-noimg { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--muted); display: grid; place-items: center; }
.ins-prod-title { font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ins-prod-n { text-align: right; font-size: 13px; white-space: nowrap; }
.ins-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ins-how { padding: 14px 18px; }
.ins-how summary { cursor: pointer; font-weight: 500; font-size: 14px; }
.ins-how p { margin: 10px 0 0; line-height: 1.5; }

/* ---------- блог: список і редактор (public/blog.js) ---------- */
.bl-search { width: 100% !important; max-width: 420px; }
.bl-list { display: grid; gap: 8px; }
.bl-row { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 10px; cursor: pointer; box-shadow: var(--shadow-xs); min-width: 0; }
.bl-row:hover { border-color: var(--ring); }
.bl-row:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.bl-row.trash { cursor: default; opacity: .75; }
.bl-thumb { width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--muted); display: grid; place-items: center; flex: none; color: var(--muted-foreground); }
.bl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bl-row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.bl-row-title { font-weight: 600; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bl-row-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.badge.bl-st-draft { color: var(--muted-foreground); background: var(--muted); }
.badge.bl-st-scheduled { color: var(--info); background: var(--info-bg); }
.badge.bl-st-published { color: var(--ok); background: var(--ok-bg); }
.badge.bl-st-trash { color: var(--bad); background: var(--bad-bg); }

.bl-bar { position: sticky; top: 64px; z-index: 18; background: color-mix(in oklch, var(--background) 94%, transparent); backdrop-filter: blur(8px); margin: -8px -16px 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
.bl-bar .title { min-width: 0; }
.bl-bar-title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-save-info.warn { color: var(--warn); }
.bl-save-info.err { color: var(--destructive); }
.bl-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.bl-grid { grid-template-columns: minmax(0, 1fr) 360px; }
.only-narrow { display: none; }
@media (max-width: 1100px) {
  .only-narrow { display: inline-flex; }
  .bl-off { display: none !important; }
  .bl-grid { grid-template-columns: 1fr; }
}
.bl-doc .card-body { gap: 10px; }
.bl-title { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; padding: 0; overflow: hidden; }
.bl-title-hint { margin-top: -4px; }
.bl-excerpt { width: 100%; border: 0; outline: none; background: transparent; resize: none; font-size: 16px; line-height: 1.5; color: var(--muted-foreground); padding: 0; overflow: hidden; }
.bl-cover { display: grid; gap: 8px; }
.bl-cover-add { width: 100%; border: 1px dashed var(--input); border-radius: 12px; background: var(--muted); padding: 22px 12px; display: flex; gap: 8px; align-items: center; justify-content: center; font-weight: 500; cursor: pointer; color: var(--foreground); }
.bl-cover-add:hover { background: var(--accent); }
.bl-cover-img, .bl-img { position: relative; border-radius: 12px; overflow: hidden; background: var(--muted); }
.bl-cover-img img, .bl-img img { display: block; width: 100%; max-height: 360px; object-fit: cover; }
.bl-cover-tools { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.bl-img-replace { position: absolute; right: 8px; bottom: 8px; }

.bl-blocks { display: grid; gap: 2px; }
.bl-block { position: relative; border-radius: 10px; padding: 4px 8px; margin: 0 -8px; border: 1px solid transparent; display: grid; gap: 8px; }
.bl-block.sel { border-color: var(--border); background: color-mix(in oklch, var(--muted) 45%, transparent); padding-top: 6px; padding-bottom: 8px; }
.bl-tools { display: none; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 12px; color: var(--muted-foreground); }
.bl-block.sel .bl-tools { display: flex; }
.bl-tools .spacer { flex: 1; }
.bl-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; margin-right: 4px; }
.bl-tag svg.i { width: 14px; height: 14px; }
.bl-tools-fmt { display: inline-flex; gap: 2px; }
.bl-ce { outline: none; min-height: 1.6em; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.bl-ce:empty::before { content: attr(data-ph); color: var(--muted-foreground); pointer-events: none; }
.bl-ce a { color: var(--info); text-decoration: underline; }
.bl-h2 { font-size: 22px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.bl-h3 { font-size: 18px; font-weight: 650; line-height: 1.35; }
.bl-list-ce ul, .bl-list-ce ol { margin: 0; padding-left: 22px; }
.bl-quote-ce { border-left: 3px solid var(--foreground); padding-left: 14px; font-style: italic; font-size: 17px; }
.bl-hr { border: 0; border-top: 2px solid var(--border); margin: 10px 0; }
.bl-add-end { width: 100%; margin-top: 8px; height: 44px; }
.bl-add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 60vh; overflow: auto; }
.bl-add-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--background); cursor: pointer; color: var(--foreground); }
.bl-add-item:hover { background: var(--accent); }
.bl-add-item svg.i { width: 20px; height: 20px; margin-top: 1px; }
.bl-add-item span { display: grid; gap: 2px; }
.bl-add-item small { color: var(--muted-foreground); font-size: 12px; line-height: 1.3; }
.dialog:has(.bl-add-grid), .dialog:has(.bl-media-grid), .dialog:has(.bl-prod-list) { max-width: 560px; }
.bl-media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; }
.bl-media-item { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 4 / 3; background: var(--muted); }
.bl-media-item:hover, .bl-media-item:focus-visible { border-color: var(--primary); outline: none; }
.bl-media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-row-inline { display: flex; gap: 8px; align-items: flex-end; }
.bl-row-inline .field { flex: 1; }
.bl-prod-card { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); text-align: left; color: var(--foreground); }
.bl-prod-card img { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; flex: none; }
.bl-prod-card b { display: block; font-size: 14px; line-height: 1.3; }
.bl-prod-card.pick { cursor: pointer; width: 100%; }
.bl-prod-card.pick:hover { background: var(--accent); }
.bl-prod-list { display: grid; gap: 6px; max-height: 60vh; overflow: auto; }
.bl-cta { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: #f4f1ea; color: #15170f; }
:root.dark .bl-cta { background: var(--muted); color: var(--foreground); }
.bl-cta-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.bl-fake { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 6px; color: #fff; }
.bl-fake.sms { background: #15170f; } .bl-fake.ms { background: #2f7cf6; } .bl-fake.wa { background: #1fa855; }
.bl-when { display: grid; gap: 8px; }
.bl-when .tabs { margin: 0; }
.bl-pub-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bl-trash { justify-self: start; color: var(--destructive); }
.bl-slug { display: flex; align-items: center; gap: 4px; }
.bl-slug .input { flex: 1; }
.bl-label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bl-count { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.bl-count.ok { color: var(--ok); } .bl-count.warn { color: var(--warn); }
.bl-snippet { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: Arial, sans-serif; background: #fff; color: #202124; }
.bl-sn-url { font-size: 12px; color: #4d5156; overflow-wrap: anywhere; }
.bl-sn-t { font-size: 18px; color: #1a0dab; line-height: 1.3; margin: 2px 0; }
.bl-sn-d { font-size: 13px; color: #4d5156; line-height: 1.45; }
.bl-switch-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.bl-switch-row .switch { margin-top: 2px; }
.bl-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.bl-check li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.bl-check li svg.i { margin-top: 1px; }
.bl-check li.ok svg { color: var(--ok); } .bl-check li.warn svg { color: var(--warn); } .bl-check li.bad svg { color: var(--destructive); } .bl-check li.info svg { color: var(--info); }
.bl-link { display: grid; gap: 10px; }
@media (max-width: 900px) { .bl-bar { top: 52px; margin-left: -16px; margin-right: -16px; } }
@media (max-width: 640px) {
  .bl-bar { margin-left: -12px; margin-right: -12px; padding: 6px 12px; gap: 6px; }
  .bl-bar .btn { padding: 0 12px; }
  .bl-hide-xs { display: none; }
  .bl-bar-title { font-size: 16px; }
  .bl-title { font-size: 24px; }
  .bl-add-grid { grid-template-columns: 1fr; }
  .bl-thumb { width: 60px; height: 46px; }
  .bl-tools .icon-btn.sm { width: 34px; height: 34px; }
}
/* блог: блок «Товари в наявності» */
.bl-picks { display: grid; gap: 12px; }
.bl-picks .chips { flex-wrap: wrap; overflow: visible; gap: 6px; }
.bl-picks .chip { height: 34px; padding: 0 12px; font-size: 13.5px; }
.bl-picks-g { display: grid; gap: 6px; }
.bl-picks-prev { display: grid; gap: 8px; min-height: 20px; }
.bl-picks-row { display: flex; gap: 8px; overflow-x: auto; }
.bl-picks-it { flex: none; width: 84px; display: grid; gap: 2px; }
.bl-picks-it img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--muted); }
.warn-text { color: var(--warning, #a15c00); }

/* ---------- Команда / доступи (2026-12-04) ---------- */
.team-users { display: grid; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.team-user { display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; font: inherit; color: inherit; width: 100%; min-height: 64px; }
.team-user:last-child { border-bottom: 0; }
button.team-user { cursor: pointer; }
button.team-user:hover { background: var(--muted); }
.team-user .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.team-user > svg { width: 18px; height: 18px; color: var(--muted-foreground); flex: none; }
.team-user.off .team-user-name, .team-user.off .avatar { opacity: .55; }
.team-user-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.team-user-perms { color: var(--foreground); overflow-wrap: anywhere; }
.team-card .card-body > .btn { justify-self: start; }
.dialog-body { display: grid; gap: 14px; }
.dialog:has(.perms) { max-width: 480px; }
.perms { display: grid; gap: 10px; }
.perm-presets { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.perm-presets .chip { height: 32px; }
.perm-presets .chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.perm-list { display: grid; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.perm-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer; min-height: 48px; }
.perm-list .perm-row:last-child { border-bottom: 0; }
.perm-row input[type=checkbox] { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.perm-row .grow { display: grid; gap: 2px; min-width: 0; }
.perm-name { font-weight: 600; }
.perm-desc { font-size: 13px; color: var(--muted-foreground); }
.off-row { border: 1px solid var(--border); border-radius: 10px; }
.perm-money { color: var(--muted-foreground); }
.perm-money.warn { color: var(--warning, #b45309); }
.team-danger { display: flex; gap: 8px; flex-wrap: wrap; }
.cred { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--muted); }
.cred-row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.cred-row .code { overflow-wrap: anywhere; }
.cred-pass { font-size: 18px; letter-spacing: .04em; }
