:root {
  --bg: #f4f5f9;
  --card: #ffffff;
  --text: #1a1d2e;
  --muted: #8b93a7;
  --purple: #7b61ff;
  --purple-dark: #6347f5;
  --purple-light: #f3efff;
  --purple-soft: #ebe4ff;
  --accent: var(--purple);
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --info: #3b82f6;
  --border: #eceef4;
  --sidebar: #ffffff;
  --sidebar-text: #5c6378;
  --sidebar-active: linear-gradient(135deg, #7b61ff, #9d7bff);
  --shadow: 0 8px 30px rgba(88, 63, 200, 0.06);
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin:0; font-family: 'Inter', system-ui, sans-serif; background:var(--bg); color:var(--text); }
.wrap { max-width: 460px; margin: 0 auto; padding: 24px; }
.app-shell { display:flex; min-height:100vh; }
.sidebar {
  width: 260px; flex-shrink:0; background:var(--sidebar);
  border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:24px 16px;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
  z-index: 50;
}
.sidebar-brand {
  display:flex; align-items:center;
  margin-bottom:28px; padding:0 8px;
  flex-shrink: 0;
}
.brand-logo-img {
  height: 34px; width: auto; max-width: 100%;
  display: block; object-fit: contain;
}
.sidebar-logo {
  width:42px; height:42px; border-radius:12px;
  background: linear-gradient(135deg, var(--purple), #9d7bff);
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800;
}
.sidebar-nav { display:flex; flex-direction:column; gap:4px; flex:1 1 auto; min-height:0; overflow-y:auto; }
.sidebar-nav button, .sidebar-nav a.nav-link, .sidebar-nav a.sidebar-nav-link {
  width:100%; text-align:left; background:transparent; color:var(--sidebar-text);
  border:none; padding:12px 14px; border-radius:12px; font-weight:600;
  cursor:pointer; font-size:14px; display:flex; align-items:center; gap:10px;
  text-decoration:none;
}
.sidebar-nav a.sidebar-nav-link:hover:not(.locked-out), .sidebar-nav a.nav-link:hover {
  background: var(--sidebar-active);
  color: #fff;
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.28);
}
.sidebar-nav a.sidebar-nav-link.active {
  background: var(--sidebar-active); color:#fff;
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.28);
}
.nav-icon { width:20px; text-align:center; font-size:15px; opacity:.9; }
.nav-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  transition: filter 0.15s ease;
}
.sidebar-nav button:hover:not(.locked-out) .nav-icon-img,
.sidebar-nav button.active .nav-icon-img,
.sidebar-nav a.sidebar-nav-link:hover:not(.locked-out) .nav-icon-img,
.sidebar-nav a.sidebar-nav-link.active .nav-icon-img {
  filter: brightness(0) invert(1);
}
.nav-badge {
  margin-left:auto; background:var(--purple-light); color:var(--purple-dark);
  font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px;
}
.sidebar-nav button:hover:not(.locked-out) .nav-badge,
.sidebar-nav button.active .nav-badge,
.sidebar-nav a.sidebar-nav-link:hover:not(.locked-out) .nav-badge,
.sidebar-nav a.sidebar-nav-link.active .nav-badge { background:rgba(255,255,255,.22); color:#fff; }
.sidebar-user {
  margin-top:12px; padding:14px; border-radius:14px; background:#f8f9fc;
  border:1px solid var(--border); display:flex; gap:12px; align-items:center;
  width:100%; text-align:left; cursor:pointer; font:inherit; color:inherit;
  flex-shrink: 0;
}
.sidebar-user:hover { border-color:#d8ccff; background:#f3efff; }
.sidebar-user:focus-visible { outline:2px solid rgba(123, 97, 255, .35); outline-offset:2px; }
.sidebar-avatar {
  width:40px; height:40px; border-radius:50%;
  background: linear-gradient(135deg, #c4b5fd, #7b61ff);
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700;
}
.sidebar-user-meta { min-width:0; flex:1; }
.sidebar-user-name { font-weight:700; font-size:14px; }
.sidebar-user-email { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-footer { margin-top:12px; flex-shrink: 0; }
.sidebar-footer button { width:100%; }
.mobile-session-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
}
.mobile-session-bar .mobile-session-user {
  min-width: 0;
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-session-bar button {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
}

.app-shell.is-booting .topbar,
.app-shell.is-booting .content-area,
.app-shell.is-booting .app-footer-banner {
  visibility: hidden;
}
.topbar {
  display:flex; align-items:flex-start; justify-content:space-between; gap:20px;
  padding:28px 32px 0; flex-wrap:wrap;
}
.topbar-greeting h1 { margin:0 0 6px; font-size:28px; font-weight:800; }
.topbar-greeting p { margin:0; color:var(--muted); font-size:14px; }
.topbar-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.store-select-wrap { position:relative; }
.store-select-btn {
  display:flex; align-items:center; gap:10px; padding:10px 14px;
  border:1px solid var(--border); border-radius:12px; background:#fff;
  font-weight:600; cursor:pointer; min-width:220px; color:var(--text);
}
.store-select-label {
  flex:1; min-width:0; text-align:left;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.store-dot { width:10px; height:10px; border-radius:50%; background:var(--ok); flex-shrink:0; }
.store-dot.inactive { background:#d1d5db; }
.store-dropdown {
  position:absolute; right:0; top:calc(100% + 8px); width:min(320px, 90vw);
  background:#fff; border:1px solid var(--border); border-radius:14px;
  box-shadow:var(--shadow); padding:12px; z-index:40; display:none;
}
.store-dropdown.open { display:block; }
.store-dropdown input {
  width:100%; padding:10px 12px; border:1px solid var(--border);
  border-radius:10px; margin-bottom:8px;
}
.store-option {
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  border-radius:10px; cursor:pointer; border:none; background:transparent;
  width:100%; text-align:left; font:inherit;
}
.store-option:hover, .store-option.active { background:var(--purple-light); }
.store-option { color:var(--text); }
.date-select-wrap { position:relative; }
.date-select-btn {
  display:flex; align-items:center; gap:8px; padding:10px 14px;
  border:1px solid var(--border); border-radius:12px; background:#fff;
  font-weight:600; font-size:13px; cursor:pointer; color:var(--text);
  min-width:190px; white-space:nowrap;
}
.date-dropdown {
  position:absolute; right:0; top:calc(100% + 8px); width:min(280px, 90vw);
  background:#fff; border:1px solid var(--border); border-radius:14px;
  box-shadow:var(--shadow); padding:12px; z-index:40; display:none;
}
.date-dropdown.open { display:block; }
.date-preset {
  width:100%; text-align:left; padding:10px 12px; border-radius:10px;
  border:none; background:transparent; font:inherit; font-weight:600;
  cursor:pointer; color:var(--text);
}
.date-preset:hover, .date-preset.active { background:var(--purple-light); color:var(--purple-dark); }
.pill-btn {
  padding:10px 14px; border:1px solid var(--border); border-radius:12px;
  background:#fff; font-weight:600; font-size:13px; cursor:pointer; color:var(--text);
}
.icon-btn {
  width:42px; height:42px; border:1px solid var(--border); border-radius:12px;
  background:#fff; cursor:pointer; font-size:18px; color:var(--text);
}

.content-area { padding:24px 32px 32px; flex:1; width:100%; min-width:0; }
.main-panel {
  flex:1; min-width:0; width:100%;
  display:flex; flex-direction:column;
}
.page-shell { width:100%; min-width:0; }
#integrationsPage .onboarding-banner { width:100%; max-width:none; margin-bottom:16px; }

/* ——— Integrations page ——— */
.integrations-page-shell { width:100%; min-width:0; }
.integrations-page-head {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:20px; flex-wrap:wrap; margin-bottom:18px;
}
.integrations-page-title { display:flex; align-items:center; gap:12px; }
.integrations-page-title h1 {
  margin:0; font-size:28px; font-weight:800; letter-spacing:-0.02em;
}
.integrations-page-title-icon {
  width:44px; height:44px; border-radius:14px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:20px;
  background:linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow:0 8px 20px rgba(123, 97, 255, 0.25);
}
.integrations-page-subtitle {
  margin:8px 0 0; color:var(--muted); font-size:14px; max-width:560px;
}
.integrations-add-btn {
  padding:11px 18px; border-radius:12px; border:none; white-space:nowrap;
  background:linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow:0 8px 20px rgba(123, 97, 255, 0.28);
  font-weight:700; font-size:14px; color:#fff;
}
.integrations-add-btn:hover { filter:brightness(1.03); }
.integrations-page-actions {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  justify-content:flex-end; flex:1; min-width:280px;
}
.integrations-search-wrap {
  position:relative; display:flex; align-items:center;
  flex:1; min-width:220px; max-width:300px;
}
.integrations-search-icon {
  position:absolute; left:14px; color:var(--muted); font-size:16px; pointer-events:none;
}
.integrations-search-input {
  width:100%; padding:11px 14px 11px 38px; border-radius:12px;
  border:1px solid var(--border); background:#fff; font-size:14px;
}
.integrations-category-tabs {
  margin:0 0 18px;
  gap:8px;
}
.integrations-category-tabs button {
  display:inline-flex; align-items:center; gap:8px;
  padding:9px 16px; border-radius:999px; border:1px solid var(--border);
  background:#fff; font-size:13px; font-weight:700; color:var(--text);
  box-shadow:0 1px 2px rgba(15, 23, 42, 0.03);
}
.integrations-category-tabs button:hover {
  border-color:#c4b5fd; background:#faf8ff;
}
.integrations-category-tabs button.active {
  background:linear-gradient(135deg, #7b61ff, #9d7bff);
  border-color:transparent; color:#fff;
  box-shadow:0 6px 16px rgba(123, 97, 255, 0.24);
}
.integrations-category-tab-count {
  min-width:22px; height:22px; padding:0 7px; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; background:#f3f4f8; color:var(--muted);
}
.integrations-category-tabs button.active .integrations-category-tab-count {
  background:rgba(255,255,255,.22); color:#fff;
}
.integrations-grid-empty {
  grid-column:1 / -1; padding:28px 12px; text-align:center; font-size:14px;
}
.integrations-grid {
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px;
}
@media (max-width: 960px) {
  .integrations-grid { grid-template-columns:1fr; }
}
.integration-platform-card {
  position:relative; overflow:hidden;
  border:1px solid var(--border); border-radius:18px; padding:20px;
  background:#fff; min-height:220px;
  display:flex; flex-direction:column; gap:12px;
  box-shadow:0 1px 2px rgba(15, 23, 42, 0.04);
}
.integration-platform-card > :not(.integration-platform-wave) {
  position:relative; z-index:1;
}
.integration-platform-top {
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.integration-platform-menu {
  width:32px; height:32px; flex-shrink:0; padding:0; margin-top:2px;
  border:none; border-radius:10px; background:transparent; color:var(--muted);
  font-size:18px; line-height:1; cursor:pointer;
}
.integration-platform-menu:hover:not(:disabled) { background:#f3f4f8; }
.integration-platform-menu:disabled { opacity:.35; cursor:default; }
.integration-platform-head {
  display:flex; align-items:flex-start; gap:14px; min-width:0; flex:1;
}
.integration-platform-icon {
  width:52px; height:52px; flex-shrink:0; border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid #eef0f5; overflow:hidden; padding:0;
  background:#f6f7fb;
}
.integration-platform-icon img {
  width:100%; height:100%; object-fit:cover; display:block;
}
.integration-platform-icon--muted {
  background:#f3f4f8; color:var(--muted); font-weight:800; font-size:18px;
}
.integration-platform-title-wrap {
  min-width:0; flex:1; display:flex; flex-direction:column; gap:6px;
}
.integration-platform-title {
  margin:0; font-size:18px; font-weight:800; letter-spacing:-0.01em;
}
.integration-platform-status {
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:700;
}
.integration-platform-status.is-active { color:#16a34a; }
.integration-platform-status.is-pending { color:#b45309; }
.integration-platform-status.is-inactive { color:#6b7280; }
.integration-platform-link {
  display:block; margin-top:2px;
  font-size:13px; color:var(--purple); text-decoration:none; word-break:break-all;
}
.integration-platform-link:hover { text-decoration:underline; }
.integration-platform-desc {
  margin:0; color:var(--muted); font-size:14px; line-height:1.45;
}
.integration-platform-footer {
  display:flex; flex-wrap:wrap; gap:8px; margin-top:auto; padding-top:4px;
}
.integration-platform-footer--toggle {
  align-items:center;
}
.integration-action-btn {
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 12px; border-radius:10px; border:1px solid var(--border);
  background:#fff; color:var(--text); font-weight:600; font-size:13px; cursor:pointer;
}
.integration-action-btn:hover { background:#fafbff; border-color:#dfe3ef; }
.integration-action-btn-primary {
  background:linear-gradient(135deg, #7b61ff, #9d7bff); border-color:transparent; color:#fff;
}
.integration-action-btn-danger {
  background:#fff5f5; border-color:#fecaca; color:#b91c1c;
}
.integration-connect-btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:12px; border:1px solid var(--border);
  background:#fff; color:var(--text); font-weight:600; font-size:14px; cursor:pointer;
}
.integration-connect-btn:disabled { opacity:.55; cursor:not-allowed; }
.integration-connect-btn:not(:disabled):hover { background:#fafbff; border-color:#dfe3ef; }
.integration-platform-wave {
  position:absolute; right:0; bottom:0; width:72%; height:52%;
  pointer-events:none; z-index:0;
}
.integration-platform-wave svg {
  display:block; width:100%; height:100%;
}
.integration-row-icon { width:28px; height:28px; object-fit:contain; flex-shrink:0; }
.platform-card-icon {
  width:40px; height:40px; object-fit:contain; display:block; margin-bottom:10px;
}
.page-header { margin-bottom:20px; }
.page-header-row { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.page-header h1 { margin:0; font-size:24px; font-weight:800; }
h1,h2 { margin: 0 0 16px; }
.card {
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:20px; margin-bottom:16px; box-shadow:var(--shadow);
}
.card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.card-head h2, .card-head h3 { margin:0; font-size:16px; font-weight:700; }
.card-link { color:var(--purple); font-size:13px; font-weight:600; text-decoration:none; }
.card-link:hover { text-decoration:underline; }

input, button, select, textarea {
  font: inherit; padding:10px 12px; border-radius:10px;
  border:1px solid var(--border); background:#fff; color:var(--text);
}
button {
  background:var(--accent); border:none; cursor:pointer; font-weight:600; color:#fff;
}
button.secondary { background:#fff; color:var(--text); border:1px solid var(--border); }
button.danger { background:#fee2e2; color:#b91c1c; border:none; }
button.linkish { background:transparent; border:none; color:var(--purple); padding:0; font-weight:600; cursor:pointer; text-align:left; }

/* Нейтральні кнопки в шапці та списках — після загального button */
.topbar-actions button.store-select-btn,
.topbar-actions button.date-select-btn,
.topbar-actions button.icon-btn,
button.store-option,
button.date-preset,
button.modal-close,
button.platform-card,
button.np-dropdown-item,
button.order-drawer-add-product-row,
.sidebar-nav button,
.sidebar-nav a.sidebar-nav-link,
.sidebar-footer button.secondary {
  background:#fff;
  border:1px solid var(--border);
  color:var(--text);
}
.sidebar-nav button.active,
.sidebar-nav a.sidebar-nav-link.active { background:var(--sidebar-active); border:none; color:#fff; }
#selectedStoreLabel,
#dateRangeLabel,
.store-select-label {
  color:var(--text) !important;
}
.kpi-label { color:#5c6378; }
.kpi-value { color:var(--text); }
.card-head h2, .card-head h3, .card h2, .card h3 { color:var(--text); }
.donut span { color:var(--text); position:relative; z-index:1; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }
.row > * { flex:1; min-width:140px; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:12px 10px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:top; }
th { color:var(--muted); font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.muted { color:var(--muted); font-size:13px; }
.hidden { display: none !important; }
.badge { display:inline-block; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; background:#eef2ff; color:#4338ca; }
.badge.ok, .status-picked { background:#dcfce7; color:#166534; }
.badge.picking, .status-picking { background:var(--purple-light); color:var(--purple-dark); }
.badge.new, .status-new { background:#dbeafe; color:#1d4ed8; }
.badge.error { background:#fee2e2; color:#b91c1c; }
.badge.status-inactive { background:#f3f4f6; color:#6b7280; }
.badge.status-awaiting { background:#fef3c7; color:#b45309; }
.error { color:#dc2626; margin-top:8px; }
.success { color:#16a34a; margin-top:8px; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.tabs button { background:#f3f4f6; color:var(--text); }
.tabs button.active { background:var(--purple); color:#fff; }
.log-toolbar { display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap; margin-bottom:16px; }
.lightbox { position:fixed; inset:0; background:rgba(0,0,0,.85); display:flex; align-items:center; justify-content:center; z-index:1000; padding:24px; }
.lightbox img { max-width:100%; max-height:90vh; border-radius:12px; }
.lightbox button { position:absolute; top:24px; right:24px; }
.achievement-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
.achievement-card { background:#fff; border:1px solid var(--border); border-radius:var(--radius); padding:16px; }
.achievement-card img, .achievement-placeholder { width:100%; height:160px; object-fit:cover; border-radius:12px; background:#f3f4f6; display:flex; align-items:center; justify-content:center; color:var(--muted); margin-bottom:12px; }
.achievement-category { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--purple); margin-bottom:8px; }
.achievement-value { font-size:28px; font-weight:700; margin:8px 0; }
.achievement-desc { margin:4px 0 8px; font-size:13px; }
.achievements-page .products-table-card { padding:20px; }
.store-checks { display:flex; flex-wrap:wrap; gap:12px 20px; margin-top:8px; }
.store-checks label { display:flex; align-items:center; gap:6px; margin:0; color:var(--text); cursor:pointer; }
input[readonly] { opacity: 0.65; cursor: not-allowed; }
.form-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:16px; align-items:center; }
.modal-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; z-index:1400; padding:24px; }
.modal { background:var(--card); border:1px solid var(--border); border-radius:18px; width:100%; max-width:520px; max-height:90vh; overflow:auto; padding:24px; box-shadow:0 24px 48px rgba(0,0,0,.15); }
.modal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.modal-head h2 { margin:0; font-size:20px; }
.modal-close { background:#fff; border:1px solid var(--border); color:var(--muted); padding:6px 10px; line-height:1; }
.modal .row > * { min-width:100%; }
.modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal select,
.modal textarea {
  width:100%;
  display:block;
  box-sizing:border-box;
}
.modal label + input:not([type="checkbox"]):not([type="radio"]),
.modal label + select,
.modal label + textarea,
.modal p + input:not([type="checkbox"]):not([type="radio"]),
.modal p + select {
  margin-bottom:12px;
}
.modal .field-copy-row { width:100%; }
.modal-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:20px; }
.packing-thumb { width:72px; height:72px; object-fit:cover; border-radius:8px; cursor:pointer; background:#f3f4f6; }
.packing-thumb.placeholder { display:flex; align-items:center; justify-content:center; color:var(--muted); font-size:11px; }
.detail-head { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.detail-head h1 { margin:0; flex:1; font-size:22px; }
label { display:block; font-size:13px; color:var(--muted); margin-bottom:4px; font-weight:600; }
.log-view { background:#0f172a; color:#e2e8f0; padding:16px; border-radius:12px; overflow:auto; max-height:480px; font-size:12px; line-height:1.5; }

/* Login */
.login-screen {
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  padding:24px; background: linear-gradient(180deg, #f7f7fb 0%, #ece9ff 100%);
}
.login-card {
  width:min(440px, 100%); background:#fff; border:1px solid var(--border);
  border-radius:20px; padding:36px; box-shadow:var(--shadow);
}
.login-card .brand-row { display:flex; align-items:center; margin-bottom:24px; }
.login-card .brand-row .brand-logo-img { height: 38px; }
.login-card h1 { margin:0 0 8px; font-size:26px; }

/* Dashboard */
.kpi-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:16px; margin-bottom:20px; }
.kpi-card {
  background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 20px; box-shadow:var(--shadow);
}
.kpi-label { font-size:13px; color:var(--muted); margin-bottom:8px; }
.kpi-value { font-size:28px; font-weight:800; margin-bottom:8px; }
.kpi-trend { font-size:12px; font-weight:600; color:var(--ok); }
.kpi-trend.neutral { color:var(--muted); }
.kpi-spark { height:36px; margin-top:12px; border-radius:8px; opacity:.85; }

.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px; }
.dash-grid-2 { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:16px; }
.store-row {
  display:flex; align-items:center; gap:12px; padding:12px 0;
  border-bottom:1px solid var(--border);
}
.store-row:last-child { border-bottom:none; }
.store-icon {
  width:40px; height:40px; border-radius:10px; background:var(--purple-light);
  display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--purple);
}
.store-row-main { flex:1; min-width:0; }
.store-row-name { font-weight:600; }
.store-row-url { font-size:12px; color:var(--muted); }
.store-row-stats { text-align:right; font-size:13px; }
.store-row-stats strong { display:block; font-size:15px; }

.order-mini { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); }
.order-mini:last-child { border-bottom:none; }
.order-mini-id { font-weight:700; }
.order-mini-time { font-size:12px; color:var(--muted); }

.donut-wrap { display:flex; align-items:center; gap:20px; }
.donut {
  width:120px; height:120px; border-radius:50%;
  background: conic-gradient(var(--purple) 0 var(--donut-pct, 98%), #e8e8ef var(--donut-pct, 98%) 100%);
  display:flex; align-items:center; justify-content:center; position:relative; flex-shrink:0;
}
.donut::after {
  content:''; width:78px; height:78px; border-radius:50%; background:#fff; position:absolute;
}
.donut span { position:relative; z-index:1; font-weight:800; font-size:18px; }
.donut-legend { font-size:13px; }
.donut-legend div { display:flex; justify-content:space-between; gap:16px; padding:4px 0; }
.info-banner {
  margin-top:14px; padding:12px 14px; border-radius:12px;
  background:#eff6ff; color:#1e40af; font-size:13px;
}

.integration-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--border); }
.integration-row:last-child { border-bottom:none; }
.dot-ok { width:8px; height:8px; border-radius:50%; background:var(--ok); }

.scanner-widget { text-align:center; }
.scanner-illustration {
  width:100%; max-width:180px; margin:0 auto 12px;
  padding:20px; border-radius:14px; background:linear-gradient(180deg,#f8f9fc,#eef2ff);
}
.scanner-illustration svg { width:100%; height:auto; }

.timeline { display:flex; flex-direction:column; gap:14px; }
.timeline-item { display:flex; gap:12px; align-items:flex-start; }
.timeline-dot {
  width:32px; height:32px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:14px;
}
.timeline-dot.ok { background:#dcfce7; }
.timeline-dot.warn { background:#fef3c7; }
.timeline-dot.info { background:var(--purple-light); }
.timeline-text { font-size:13px; }
.timeline-text strong { display:block; margin-bottom:2px; }

.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quick-btn {
  display:flex; flex-direction:column; align-items:flex-start; gap:8px;
  padding:16px; border-radius:14px; border:none; cursor:pointer; font-weight:700;
  color:#fff; text-align:left; min-height:88px;
}
.quick-btn.purple { background:linear-gradient(135deg,#7b61ff,#9d7bff); }
.quick-btn.green { background:linear-gradient(135deg,#22c55e,#4ade80); }
.quick-btn.orange { background:linear-gradient(135deg,#f59e0b,#fbbf24); color:#422006; }
.quick-btn.blue { background:linear-gradient(135deg,#3b82f6,#60a5fa); }
.quick-btn span { font-size:22px; }

.app-footer-banner {
  margin:0 32px 24px; padding:14px 20px; border-radius:14px;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  color:#fff; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
  font-size:14px;
}
.app-footer-banner a { color:#fff; font-weight:700; text-decoration:none; }
.app-footer-banner a:hover { text-decoration:underline; }

.app-footer-banner a:hover { text-decoration:underline; }

/* ——— Products page ——— */
.products-page .content-area,
.products-page-shell { width: 100%; min-width: 0; }
.products-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 16px;
}
.products-page-title { display: flex; align-items: center; gap: 12px; }
.products-page-title h1 {
  margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
}
.products-page-title-icon {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.25);
}
.products-page-subtitle {
  margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 560px;
}
.products-page-actions-wrap {
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  flex: 1; min-width: 280px;
}
.products-page-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: flex-end; width: 100%;
}
.products-filter-select,
.products-per-page select {
  min-width: 148px; padding: 11px 36px 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238b93a7' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.products-search-wrap {
  position: relative; display: flex; align-items: center; min-width: 220px; flex: 1; max-width: 280px;
}
.products-search-icon {
  position: absolute; left: 14px; color: var(--muted); font-size: 16px; pointer-events: none;
}
.products-search-input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff; font-size: 14px;
}
.products-search-input:focus {
  outline: none; border-color: #c4b5fd; box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12);
}
.products-add-btn {
  padding: 11px 18px; border-radius: 12px; border: none; white-space: nowrap;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.28);
  font-weight: 700; font-size: 14px; color: #fff;
}
.products-add-btn:hover { filter: brightness(1.03); }
.products-toolbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  flex-wrap: wrap;
}
.products-tool-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-weight: 600; font-size: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.products-tool-btn:hover { background: #fafbff; border-color: #dfe3ef; }
.products-tool-icon { font-size: 16px; line-height: 1; color: var(--muted); }
.products-table-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.products-meta {
  margin: 0; padding: 14px 18px 0; color: var(--muted); font-size: 13px;
}
.products-meta:empty { display: none; padding: 0; }
.products-table-wrap { overflow-x: auto; }
.products-table { width: 100%; border-collapse: collapse; }
.products-table th, .products-table td {
  padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.products-table thead th {
  font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; background: #fafbff;
}
.products-col-check { width: 44px; text-align: center; }
.products-col-channels { width: 120px; }
.products-col-menu { width: 44px; text-align: center; }
.products-col-check input,
.products-row-check {
  width: 16px; height: 16px; accent-color: var(--purple); cursor: pointer;
}
.products-name-cell {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.products-name-body {
  min-width: 0; flex: 1;
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 4px;
}
.products-row-menu {
  width: 34px; height: 34px; padding: 0; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-size: 18px; line-height: 1; cursor: pointer;
}
.products-row-menu:hover {
  background: #f3f4f8; border-color: var(--border); color: var(--text);
}
.products-table-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); background: #fff;
}
.products-per-page {
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 600;
}
.products-pagination {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.products-page-btn {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer;
}
.products-page-btn:hover:not(:disabled) { background: #fafbff; border-color: #dfe3ef; }
.products-page-btn.active {
  background: linear-gradient(135deg, #7b61ff, #9d7bff); border-color: transparent; color: #fff;
  box-shadow: 0 6px 16px rgba(123, 97, 255, 0.24);
}
.products-page-btn:disabled { opacity: .45; cursor: default; }
.products-page-ellipsis { color: var(--muted); padding: 0 4px; font-weight: 600; }

.products-table { width: 100%; border-collapse: collapse; }
.products-table th, .products-table td {
  padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle;
}
.products-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.product-thumb {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: #f3f4f8;
  display: block; flex-shrink: 0;
}
.product-thumb-empty {
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.products-table tbody tr.product-row {
  cursor: pointer;
  transition: background .12s ease;
}
.products-table tbody tr.product-row:hover,
.products-table tbody tr.product-row.is-active {
  background: var(--purple-light);
}
.product-name-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 0; font: inherit; color: inherit;
  text-align: left; cursor: default;
}
.product-name-open {
  display: block; width: 100%; margin: 0; padding: 0;
  background: none; border: none; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
}
.product-name-open strong {
  display: block; font-size: 14px; font-weight: 600; line-height: 1.35;
  transition: color .12s ease;
}
.product-name-open:hover strong { color: var(--purple); }
.product-expand-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 4px; padding: 0;
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  vertical-align: top;
}
.product-expand-chevron {
  color: var(--purple); font-size: 12px; width: 14px; flex-shrink: 0;
}
.products-name-hint {
  flex: 1 0 100%; font-size: 12px; margin-top: 2px;
}
.products-table tbody tr.product-row.is-expanded td {
  border-bottom: none;
  padding-bottom: 6px;
}
.products-table tbody tr.product-channel-row {
  cursor: default;
}
.products-table tbody tr.product-channel-row td {
  background: #fafbff;
  border-bottom: 1px solid var(--border);
  padding: 8px;
  vertical-align: middle;
}
.product-channel-logo-cell {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border);
}
.product-channels-panel-drawer {
  display: flex; flex-direction: column; gap: 8px;
}
.product-channel-drawer-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: #fff;
}
.product-channel-drawer-body { min-width: 0; flex: 1; }
.product-channel-drawer-meta { font-size: 12px; margin-top: 4px; }
.product-channel-icon { font-size: 18px; flex-shrink: 0; line-height: 1.2; display: inline-flex; align-items: center; }
.channel-logo { width: 24px; height: 24px; object-fit: contain; display: block; }
.product-channel-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.product-channel-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 4px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.product-channel-badge .channel-logo { width: 22px; height: 22px; }
.product-channel-logo-cell .channel-logo,
.product-channel-icon .channel-logo { width: 26px; height: 26px; }

.products-channel-tabs {
  margin: 0 0 16px;
  gap: 8px;
}
.products-channel-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.products-channel-tabs button:hover {
  border-color: #c4b5fd;
  background: #faf8ff;
}
.products-channel-tabs button.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.products-channel-tab-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.products-channel-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .08);
  line-height: 1.2;
}
.products-channel-tabs button.active .products-channel-tab-count {
  background: rgba(255, 255, 255, .22);
}

.product-image-upload {
  border: 1px dashed var(--border); border-radius: 14px; padding: 12px;
  background: #fafbff; margin-bottom: 4px;
}
.product-image-preview {
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #fff; border: 1px solid var(--border);
  overflow: hidden; margin-bottom: 10px;
}
.product-image-preview img {
  width: 100%; max-height: 180px; object-fit: contain; display: block;
}
.product-image-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.product-image-upload.is-dragover {
  border-color: var(--purple); background: var(--purple-light);
}

.product-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 1200;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.product-drawer-backdrop.open {
  opacity: 1; pointer-events: auto;
}
.product-drawer,
.product-drawer.order-drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(700px, 100vw);
  background: #fff; border-left: 1px solid var(--border);
  box-shadow: -20px 0 60px rgba(26, 29, 46, .14);
  z-index: 1201; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s ease;
}
.product-drawer.open { transform: translateX(0); }
.product-drawer.hidden { display: none; }
.product-drawer-backdrop.hidden { display: none; }
.product-drawer-head {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 16px;
  padding: 24px 24px 20px;
}
.product-drawer-head-text { min-width: 0; width: 100%; padding-right: 44px; }
.product-drawer-kicker {
  margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--purple);
}
.product-drawer-head h2 {
  margin: 0; font-size: 22px; line-height: 1.35; font-weight: 800; letter-spacing: -0.02em;
}
.product-drawer-close {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 36px; height: 36px; flex-shrink: 0; padding: 0;
  border-radius: 999px; border: none; background: #f3f4f8; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer;
}
.product-drawer-close:hover { background: #ebedf3; color: var(--text); }
.product-drawer-body {
  flex: 1; overflow: auto; padding: 0 24px 24px;
  display: flex; flex-direction: column; gap: 20px;
}
.product-drawer-image-wrap {
  width: 100%; padding: 0; margin: 0;
  background: transparent; border: none;
}
.product-drawer-image {
  width: 100%; max-height: 280px; border-radius: 0; object-fit: contain;
  background: transparent; display: block; margin: 0 auto;
}
.product-drawer-image-empty {
  min-height: 180px; display: flex; align-items: center; justify-content: center;
  font-size: 48px; background: transparent; border-radius: 0;
}
.product-drawer-meta {
  margin: 0; display: flex; flex-direction: column;
}
.product-drawer-meta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.product-drawer-meta-row:last-child { border-bottom: none; }
.product-drawer-meta dt {
  margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; flex-shrink: 0;
}
.product-drawer-meta dd {
  margin: 0; font-weight: 700; font-size: 14px; text-align: right; word-break: break-word;
}
.product-drawer-section-title {
  margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--text);
}
.product-drawer-channel-list {
  display: flex; flex-direction: column; gap: 10px;
}
.product-drawer-channel-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: #fff;
}
.product-drawer-channel-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #fafbff; border: 1px solid #eef0f5;
}
.product-drawer-channel-icon .channel-logo { width: 24px; height: 24px; }
.product-drawer-channel-main { min-width: 0; flex: 1; }
.product-drawer-channel-main strong {
  display: block; font-size: 13px; font-weight: 600; line-height: 1.35;
  margin-bottom: 6px;
}
.product-drawer-channel-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.product-drawer-channel-chevron {
  flex-shrink: 0; color: var(--muted); font-size: 22px; line-height: 1; font-weight: 300;
}
.product-drawer-barcode-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.product-drawer-barcode-actions.hidden { display: none; }
.product-drawer-cancel-btn {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: #fff;
  color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer;
}
.product-drawer-cancel-btn:hover { background: #fafbff; border-color: #dfe3ef; }
.product-drawer-channels { margin-top: 4px; }
.product-drawer-barcode-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.28);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.product-drawer-barcode-btn:hover { filter: brightness(1.03); }
.product-drawer-barcode-icon { font-size: 18px; line-height: 1; opacity: .95; }
.product-drawer-scan-box {
  border: 1px dashed #cfc6f5; background: var(--purple-light);
  border-radius: 14px; padding: 14px;
}
.product-drawer-scan-box label {
  display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px;
}
.product-drawer-scan-box input {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff;
}
.product-drawer-scan-hint {
  margin: 8px 0 0; font-size: 12px; color: var(--muted);
}
.product-drawer-scan-status {
  min-height: 20px; margin: 0; font-size: 13px;
}
.product-drawer-scan-status.ok {
  color: var(--ok);
  font-weight: 700;
  background: #f0fdf4;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
}
.product-drawer-scan-status.error {
  color: var(--danger);
  font-weight: 700;
  background: #fef2f2;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
}
.product-drawer-scan-status.muted {
  padding: 4px 0;
}
.product-drawer-delete-actions {
  margin: 0; padding-top: 4px;
}
.product-drawer-delete-actions .danger {
  width: 100%; padding: 12px; border-radius: 12px;
}
.product-drawer-footer {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 16px 24px 24px; border-top: 1px solid var(--border); background: #fff;
}
.product-drawer-nav-btn {
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--text); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.product-drawer-nav-btn:hover:not(:disabled) { background: #fafbff; border-color: #dfe3ef; }
.product-drawer-nav-btn:disabled { opacity: .45; cursor: default; }

.product-drawer.order-drawer,
.order-drawer { width: min(700px, 100vw) !important; }
.order-drawer-note {
  margin-bottom: 12px; padding: 12px 14px; border-radius: 12px;
  background: #fffbeb; border: 1px solid #fde68a; font-size: 13px; line-height: 1.45;
}
.order-drawer-note strong { display: block; margin-bottom: 4px; font-size: 12px; color: #92400e; }
.order-drawer-note p { margin: 0; color: var(--text); white-space: pre-wrap; }
.order-drawer-progress {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.order-drawer-items { display: flex; flex-direction: column; gap: 8px; }
.order-item-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  height: 32px;
}
.order-item-qty-input {
  box-sizing: border-box;
  width: 52px;
  height: 32px;
  margin: 0;
  text-align: center;
  padding: 0 4px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 30px;
  -moz-appearance: textfield;
}
.order-item-qty-input::-webkit-outer-spin-button,
.order-item-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.order-item-qty-btn,
.order-item-remove-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: #374151;
  flex-shrink: 0;
}
.order-item-remove-btn { color: #b91c1c; }
.order-drawer-items-edit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.order-drawer-add-product {
  display: flex;
  gap: 8px;
  align-items: center;
}
.order-drawer-add-product-list {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-drawer-add-product-row {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 500;
}
.order-drawer-add-product-row strong {
  color: var(--text);
  font-weight: 700;
}
.order-drawer-add-product-row:hover { border-color: #c4b5fd; background: #faf8ff; color: var(--text); }
body.cabinet-role-picker #orderDrawerItemsEdit { display: none !important; }
.order-item-row {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.order-item-row.is-complete { border-color: #bbf7d0; background: #f0fdf4; }
.order-item-row img, .order-item-thumb-empty {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #f3f4f8;
}
.order-item-thumb-empty { display: flex; align-items: center; justify-content: center; }
.order-item-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.order-item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.order-item-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 110px;
}
.order-item-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}
.order-item-unit-price {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.order-item-line-total {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.order-item-price-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.order-item-qty { font-weight: 700; white-space: nowrap; }
.order-drawer-ambiguous {
  border: 1px solid #fde68a; background: #fffbeb; border-radius: 12px; padding: 12px;
}
.order-drawer-ambiguous button { width: 100%; margin-top: 8px; text-align: left; }
.order-drawer-footer { flex-wrap: wrap; }
.products-table tbody tr.order-row,
table tbody tr.order-row {
  cursor: pointer;
  transition: background .12s ease;
}
table tbody tr.order-row:hover,
table tbody tr.order-row.is-active {
  background: var(--purple-light);
}

.placeholder-page .ph-icon {
  width:72px; height:72px; border-radius:18px; margin:0 auto 16px;
  background:var(--purple-light); display:flex; align-items:center; justify-content:center;
  font-size:32px;
}
.settings-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; }
.settings-tile {
  padding:18px; border:1px solid var(--border); border-radius:14px; background:#fff;
  cursor:pointer; text-align:left; transition:border-color .15s;
}
.settings-tile:hover { border-color:#d8ccff; }
.settings-tile strong { display:block; margin-bottom:4px; }

.dashboard-empty {
  text-align:center; padding:72px 24px; max-width:520px; margin:40px auto;
}
.dashboard-empty .empty-icon {
  width:88px; height:88px; border-radius:22px; margin:0 auto 20px;
  background:var(--purple-light); display:flex; align-items:center; justify-content:center; font-size:36px;
}
.dashboard-empty h2 { margin:0 0 10px; font-size:26px; }
.dashboard-empty p { color:var(--muted); margin:0 0 24px; }

.sidebar-nav button.locked-out {
  opacity:.45; pointer-events:none;
}
.onboarding-banner {
  background:#fff7ed; border:1px solid #fed7aa; color:#9a3412;
  border-radius:14px; padding:14px 18px; margin-bottom:16px; font-size:14px;
}

.settings-delivery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  align-items: stretch;
}
.settings-delivery-grid .integration-platform-card {
  min-width: 0;
}
.settings-delivery-grid .integration-platform-card label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}
@media (max-width: 1100px) {
  .settings-delivery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .settings-delivery-grid { grid-template-columns: 1fr; }
}
.store-hours-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.store-hours-day-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.store-hours-day-row.is-closed {
  opacity: 0.78;
}
.store-hours-day-row__label {
  font-size: 14px;
  font-weight: 700;
}
.store-hours-day-row label.store-hours-closed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.store-hours-day-row label.store-hours-end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}
.store-hours-day-row input[type="time"] {
  min-width: 120px;
}
@media (max-width: 640px) {
  .store-hours-day-row {
    grid-template-columns: 1fr;
  }
}
.status-styles-section {
  margin-top: 14px;
}
.status-styles-heading {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.status-styles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-style-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) auto auto minmax(120px, 1fr);
  gap: 10px 14px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.status-style-row__label {
  font-size: 14px;
  font-weight: 600;
}
.status-style-row__code {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}
.status-style-colors {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
}
.status-style-colors input[type="color"] {
  width: 36px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.status-style-preview .badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .status-style-row {
    grid-template-columns: 1fr 1fr;
  }
  .status-style-preview {
    grid-column: 1 / -1;
  }
}
.integration-platform-icon--openai {
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  font-size: 14px;
}
@media (max-width: 720px) {
  .settings-delivery-grid { grid-template-columns: 1fr; }
}
.integration-card {
  border:1px solid var(--border); border-radius:16px; padding:18px 20px; margin-bottom:12px;
  background:#fff;
}
.integration-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:14px; }
.integration-card-title { display:flex; align-items:center; gap:12px; }
.integration-logo {
  width:44px; height:44px; border-radius:12px; background:#f3efff;
  display:flex; align-items:center; justify-content:center; font-weight:800; color:var(--purple);
}
.integration-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.status-inactive { background:#fee2e2; color:#b91c1c; }
.status-awaiting { background:#fef3c7; color:#b45309; }

.platform-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:16px 0; }
.platform-card {
  border:1px solid var(--border); border-radius:14px; padding:16px; text-align:left;
  background:#fff; cursor:pointer; position:relative;
}
.platform-card:hover:not(:disabled) { border-color:#d8ccff; background:var(--purple-light); }
.platform-card:disabled { opacity:.55; cursor:not-allowed; }
.platform-card .dev-badge {
  position:absolute; top:10px; right:10px; font-size:10px; font-weight:700;
  background:#f3f4f6; color:var(--muted); padding:3px 8px; border-radius:999px;
}
.keys-reveal { margin-top:16px; padding:16px; border-radius:12px; background:#f8f9fc; border:1px solid var(--border); }
.keys-reveal input { width:100%; margin-top:6px; margin-bottom:12px; }
.field-copy-row { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.field-copy-row input { flex:1; margin:6px 0 0; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:13px; }
.field-copy-row button { margin-top:6px; white-space:nowrap; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns:repeat(2, 1fr); }
  .dash-grid { grid-template-columns:1fr; }
  .dash-grid-2 { grid-template-columns:1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display:none; }
  .mobile-session-bar { display: flex; }
  .topbar, .content-area, .app-footer-banner { padding-left:16px; padding-right:16px; }
  .kpi-grid, .dash-grid-2 { grid-template-columns:1fr; }
}

/* —— Orders (merged picking) —— */
.orders-page-shell { width: 100%; min-width: 0; }
.orders-page-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.orders-page-title { display: flex; align-items: center; gap: 12px; }
.orders-page-title h1 {
  margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
}
.orders-page-title-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: #eef2ff; font-size: 20px;
}
.orders-page-subtitle {
  margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 520px;
}
.orders-page-actions-wrap { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.orders-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.orders-table tr.order-row {
  cursor: pointer;
  user-select: none;
}
.orders-table tr.order-row td { cursor: pointer; }
.orders-table tr.order-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--purple) 45%, white);
  outline-offset: -2px;
}
button.order-row-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
button.order-row-open strong {
  font-size: 14px;
  font-weight: 600;
  display: block;
}
.order-row-date {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}
button.order-row-open:hover strong,
.orders-table tr.order-row:hover button.order-row-open strong {
  color: var(--purple);
}
.orders-customer-cell { display: block; text-align: left; }
.orders-customer-cell strong { display: block; }
.orders-customer-phone {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.35;
  font-weight: 500;
}
button.orders-customer-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
button.orders-customer-open:hover strong {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.orders-customer-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--purple) 45%, white);
  outline-offset: 2px;
}
.orders-filter-select {
  min-width: 160px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; padding: 0 12px; font-weight: 600; font-size: 13px;
}
label.orders-search-wrap,
.orders-search-wrap {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  min-width: 240px; max-width: 320px; flex: 1 1 240px; margin: 0;
  color: inherit; font-size: inherit; font-weight: inherit;
}
.orders-search-icon { color: var(--muted); font-size: 14px; flex-shrink: 0; line-height: 1; }
.orders-search-input {
  border: 0; outline: none; background: transparent; width: 100%; min-width: 0;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.orders-tool-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; text-decoration: none;
}
.orders-tool-btn:hover { border-color: #c4b5fd; background: #faf8ff; }
.orders-tool-icon { font-size: 14px; }
.orders-status-tabs,
.orders-channel-tabs {
  margin: 0; gap: 8px; display: flex; flex-wrap: wrap;
}
.orders-channel-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; flex-wrap: wrap;
}
.orders-channel-row .orders-channel-tabs { flex: 1; min-width: 0; }
.orders-sort-btn,
.orders-filter-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--text); cursor: pointer; flex-shrink: 0;
}
.orders-sort-btn:hover,
.orders-filter-btn:hover { border-color: #c4b5fd; background: #faf8ff; }
.orders-sort-btn-icon { font-size: 14px; line-height: 1; opacity: .85; }
.orders-filter-btn.has-filters {
  border-color: var(--purple); background: #f5f3ff; color: var(--purple-dark, #5b21b6);
}
.orders-filter-btn-icon { font-size: 12px; opacity: .7; }
.orders-filter-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--purple); color: #fff; font-size: 11px; font-weight: 800;
  display: inline-grid; place-items: center;
}
.orders-active-filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px;
}
.orders-active-filters.hidden { display: none; }
.orders-active-chip {
  border: 1px solid #ddd6fe; background: #f5f3ff; color: #5b21b6;
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.orders-active-chip:hover { background: #ede9fe; }
.orders-status-tabs button,
.orders-channel-tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
  border-radius: 999px; border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-weight: 700; color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); cursor: pointer;
}
.orders-status-tabs button:hover,
.orders-channel-tabs button:hover { border-color: #c4b5fd; background: #faf8ff; }
.orders-status-tabs button.active,
.orders-channel-tabs button.active {
  background: var(--purple); border-color: var(--purple); color: #fff;
}
.orders-channel-tab-icon { width: 20px; height: 20px; object-fit: contain; display: block; flex-shrink: 0; }
.orders-channel-tab-count {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: rgba(0, 0, 0, .08); line-height: 1.2;
}
.orders-channel-tabs button.active .orders-channel-tab-count,
.orders-status-tabs button.active .orders-channel-tab-count { background: rgba(255,255,255,.22); }
.orders-table-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.orders-bulk-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border); background: #f8fafc;
}
.orders-bulk-bar.hidden { display: none; }
.orders-bulk-count { font-size: 13px; font-weight: 600; color: var(--text); margin-right: 4px; }
.orders-bulk-delete-btn { color: #b91c1c; border-color: #fecaca; }
.orders-packed-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.orders-packed-actions.hidden { display: none; }
.orders-print-ttn-btn { font-weight: 700; }
.orders-print-picker-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 320px; overflow: auto; padding: 4px 0;
}
.orders-print-picker-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer;
}
.orders-print-picker-all {
  margin-bottom: 8px;
  background: #f8fafc;
  font-weight: 600;
}
.orders-print-picker-row input { margin: 0; }
.orders-print-picker-meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.orders-ttn-cell a { font-weight: 600; color: #1d4ed8; text-decoration: none; }
.orders-ttn-cell a:hover { text-decoration: underline; }
.orders-ttn-missing { color: #b45309; font-size: 12px; font-weight: 600; }
.orders-col-check { width: 44px; text-align: center; }
.orders-col-check input { width: 16px; height: 16px; cursor: pointer; }
.orders-table tr.order-row td.orders-col-check { cursor: default; }
.orders-col-approve { width: 72px; text-align: center; white-space: nowrap; }
.orders-table tr.order-row td.orders-col-approve { cursor: default; }
.orders-approve-actions { justify-content: center; }
.wc-import-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0;
}
.wc-import-dates label {
  display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600;
}
.wc-import-dates input[type="date"] {
  font-weight: 400; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
}
.orders-meta { margin: 0; padding: 14px 18px 0; font-size: 13px; color: var(--muted); }
.orders-table-wrap { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.orders-table td {
  padding: 14px 16px; border-bottom: 1px solid #f1f3f8; font-size: 14px; vertical-align: middle;
}
.orders-table tr.order-row { cursor: pointer; }
.orders-table tr.order-row:hover td { background: #fafbff; }
.orders-table tr.order-row.is-active td { background: #f3f0ff; }
.orders-channel-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.orders-channel-cell img { width: 22px; height: 22px; object-fit: contain; }
.orders-payment-badge,
.orders-ship-badge,
.orders-photo-badge { white-space: nowrap; }
.orders-ship-badge { background: #e0f2fe; color: #0369a1; }
.orders-photo-badge.has-photo { background: #dcfce7; color: #166534; }
.orders-photo-badge.no-photo { background: #fef3c7; color: #b45309; }
.badge.status-shipped { background: #e0f2fe; color: #0369a1; }
.badge.status-received { background: #dcfce7; color: #166534; }
.badge.status-cancelled { background: #f3f4f6; color: #6b7280; }

.orders-filter-modal { max-width: 560px; width: min(560px, calc(100vw - 32px)); }
.orders-filter-section { margin-top: 18px; }
.orders-filter-section-title { margin: 0 0 10px; font-size: 13px; font-weight: 800; }
.orders-filter-chips,
.orders-filter-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.orders-filter-chip {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.orders-filter-chip:hover { border-color: #c4b5fd; background: #faf8ff; }
.orders-filter-chip.active {
  border-color: var(--chip-color, var(--purple));
  background: color-mix(in srgb, var(--chip-color, var(--purple)) 14%, white);
  color: var(--chip-color, var(--purple));
}

.order-drawer-hub-meta,
.order-drawer-photos-block,
.order-drawer-history-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafbff;
}
.order-drawer-history-head {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px;
}
.order-drawer-history-summary { margin: 0; font-size: 12px; }
.order-drawer-history-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px;
}
.order-drawer-history-filters select {
  height: 36px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; font: inherit; background: #fff;
}
.order-drawer-history-errors {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
}
.order-drawer-history-list {
  display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto;
}
.order-history-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid #eef0f6;
}
.order-history-item.is-error {
  background: #fef2f2; border-color: #fecaca;
}
.order-history-icon {
  width: 22px; text-align: center; flex-shrink: 0; font-weight: 700; line-height: 1.4;
}
.order-history-body { min-width: 0; flex: 1; }
.order-history-message { font-size: 13px; font-weight: 600; color: var(--text); }
.order-history-meta { font-size: 12px; margin-top: 2px; }
.order-history-details { margin-top: 6px; font-size: 12px; }
.order-history-details pre {
  margin: 6px 0 0; padding: 8px; border-radius: 8px; background: #fff;
  overflow: auto; font-size: 11px; max-height: 120px;
}
.order-drawer-hub-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.order-drawer-hub-meta-grid label {
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600;
}
.order-drawer-hub-meta-grid select,
.order-drawer-hub-meta-grid input {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0 12px; font: inherit; background: #fff;
}
.order-drawer-hub-meta-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
#orderDrawerHubMetaMsg.ok,
#orderDrawerPhotosMsg.ok { color: var(--ok); font-weight: 600; }
#orderDrawerHubMetaMsg.error,
#orderDrawerPhotosMsg.error { color: var(--danger); font-weight: 600; }
.order-drawer-photos-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 24px;
}
.order-drawer-photo-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); display: block; background: #fff;
}
.order-drawer-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.integration-platform-icon--monobank {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 14px;
}
.orders-packing-link { margin: 16px 0 0; }
.orders-packing-link .linkish {
  border: 0; background: none; color: var(--purple); font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.orders-packing-link .linkish:hover { text-decoration: underline; }
.orders-add-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 12px; border: 0; background: var(--purple); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.orders-add-btn:hover { filter: brightness(1.05); }

.add-order-modal { max-width: 760px; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.add-order-section { margin-top: 18px; }
.add-order-section-title { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
.add-order-channel-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.add-order-modal textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  resize: vertical;
}
.add-order-np-block { margin-top: 4px; }

.np-config-modal .np-settings-section {
  margin-top: 16px;
}
.np-config-modal .np-settings-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.np-sender-summary:not(:empty) {
  padding: 8px 10px;
  background: #fff7ed;
  border-radius: 8px;
  border: 1px solid #fed7aa;
}
.np-settings-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.np-settings-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
}
.np-settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.np-settings-row label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.np-settings-section input,
.np-settings-section select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}
.np-parcel-templates-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}
.np-parcel-tpl-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(120px, 1.4fr) minmax(64px, 0.7fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
}
.np-parcel-tpl-row strong { font-weight: 700; }
.np-parcel-tpl-row .muted { font-size: 12px; }
.np-parcel-tpl-actions { display: flex; gap: 6px; }
.np-parcel-tpl-actions button {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.np-parcel-tpl-actions button.danger { color: #b91c1c; border-color: #fecaca; }
.np-tpl-hint {
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}
.np-tpl-dims {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.np-tpl-dims label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.np-tpl-dim-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.np-tpl-dim-row input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
}
.np-tpl-dim-row span { color: var(--muted); font-size: 12px; font-weight: 600; }
@media (max-width: 640px) {
  .np-tpl-dims { grid-template-columns: 1fr 1fr; }
  .np-parcel-tpl-row { grid-template-columns: 1fr; }
}

.order-drawer-np-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafbff;
}
.order-drawer-np-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
}
.order-drawer-np-summary { font-size: 13px; line-height: 1.45; }
.order-drawer-np-form { margin-top: 10px; }
.order-drawer-np-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.order-drawer-np-form input,
.order-drawer-np-form select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}
.order-drawer-np-actions { margin-top: 10px; }
.order-drawer-np-waybill {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.order-drawer-np-manual-ttn {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.order-drawer-np-manual-ttn label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.order-drawer-np-manual-ttn > input#orderNpManualTtnInput {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.order-drawer-np-waybill label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.order-drawer-np-waybill > input#orderSeatsCount,
.order-drawer-np-waybill #orderCodAmountInput {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
#orderDrawerNpMsg.ok { color: var(--ok); font-weight: 600; }
#orderDrawerNpMsg.error { color: var(--danger); font-weight: 600; }
.order-seats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  max-height: 42vh;
  overflow: auto;
}
.order-seat-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.order-seat-head { margin-bottom: 8px; font-size: 13px; }
.order-seat-row label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 6px; }
.order-seat-row select,
.order-seat-row input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.order-seat-hint { margin: 6px 0 0; font-size: 12px; }
.order-seat-dims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.order-seat-dims label { margin: 0; }
#orderSeatsCount {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.order-drawer-np-summary .linkish {
  border: 0; background: none; color: var(--purple); font: inherit; font-weight: 700; cursor: pointer; padding: 0;
}
.add-order-np-type-label {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
}
.add-order-np-type-tabs { margin: 8px 0 12px; }
.np-search-wrap { position: relative; }
.np-dropdown-wrap { position: relative; }
.np-config-modal .np-dropdown { z-index: 20; }
.np-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.np-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.np-dropdown-item:hover { background: #f7f7fb; color: var(--text); }
.np-dropdown-item.muted,
.np-dropdown-item.error {
  cursor: default;
  color: var(--muted);
  font-weight: 400;
}
.np-dropdown-item.is-active { background: #f0f3ff; color: var(--text); }
.add-order-customer-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px;
}
.add-order-customer-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #8a5a00; background: #fff6e5;
  border: 1px solid #f0d9a8; border-radius: 999px; padding: 4px 10px;
}
.add-order-address-suggest {
  margin: 8px 0 12px; border: 1px solid var(--border); border-radius: 14px;
  background: #fafbff; padding: 8px; max-height: 180px; overflow: auto;
}
.add-order-address-suggest-title {
  font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .03em; padding: 4px 8px 8px;
}
.client-comment-dot { color: #c9851a; margin-left: 6px; font-size: 10px; vertical-align: middle; }
.customer-row-avatar,
.customer-drawer-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ede9fe, #dbeafe); color: #4338ca;
  font-weight: 700; font-size: 16px;
}
.customer-drawer-avatar {
  width: 56px; height: 56px; border-radius: 16px; font-size: 22px; margin-bottom: 8px;
}
.customer-drawer-body label { display: block; margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.customer-drawer-body input,
.customer-drawer-body textarea {
  width: 100%; box-sizing: border-box;
}
.customer-drawer-section { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #eef0f6; }
.customer-drawer-section:last-child { border-bottom: 0; margin-bottom: 0; }
.customer-drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.customer-address-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.customer-address-list li {
  display: flex; justify-content: space-between; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fafbff;
}
.customer-address-actions { display: flex; gap: 6px; flex-shrink: 0; }
.customer-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.customer-orders-table th, .customer-orders-table td {
  text-align: left; padding: 8px 6px; border-bottom: 1px solid #eef0f6;
}
.customer-orders-table tbody tr.customer-order-row { cursor: pointer; }
.customer-orders-table tbody tr.customer-order-row:hover { background: #f7f8fc; }
.customer-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
button.customer-order-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e8eaf2;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
button.customer-order-card:hover {
  border-color: #d5daf0;
  background: #f7f8fc;
}
.customer-order-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.customer-order-card-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.customer-order-card-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.customer-order-payment { font-size: 12px; }
.customer-order-card-total {
  margin-top: 6px;
  font-size: 13px;
}
.products-table tbody tr.client-row { cursor: pointer; }
.products-table tbody tr.client-row:hover,
.products-table tbody tr.client-row.is-active { background: #f7f8fc; }
@media (max-width: 980px) {
  .customer-drawer-avatar { width: 48px; height: 48px; font-size: 18px; }
}
.add-order-products-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.add-order-product-search { min-width: 220px; height: 38px; }
.add-order-product-list {
  max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 14px;
  background: #fafbff; padding: 8px;
}
.add-order-product-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  cursor: pointer; background: #fff; border: 1px solid transparent; margin-bottom: 6px;
}
.add-order-product-row:hover { border-color: #e7e9f3; }
.add-order-product-row.is-out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
  background: #fafafa;
}
.add-order-product-row.is-out-of-stock:hover { border-color: var(--border); }
.add-order-product-row input { width: 16px; height: 16px; flex-shrink: 0; }
.add-order-product-thumb {
  width: 42px; height: 42px; border-radius: 10px; overflow: hidden; background: #f3f4f8;
  display: grid; place-items: center; flex-shrink: 0;
}
.add-order-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.add-order-product-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.add-order-product-main strong { font-size: 14px; color: var(--text); }
.add-order-product-main span { font-size: 12px; }
.add-order-product-stock {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.add-order-product-stock-out { color: #b91c1c; }
.add-order-product-stock-low { color: #b91c1c; font-weight: 700; }
.order-drawer-add-product-row .add-order-product-stock-out,
.order-drawer-add-product-row .add-order-product-stock-low {
  color: #b91c1c;
  font-weight: 700;
}
.add-order-selected-list {
  display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; background: #fff;
}
.add-order-selected-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #fafbff;
}
.add-order-selected-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.add-order-qty-wrap { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.add-order-qty-wrap input { width: 72px; height: 36px; }
.add-order-remove-btn { min-width: 36px; height: 36px; padding: 0; }

.ai-consultant-fab {
  position: fixed;
  right: 24px;
  bottom: 114px;
  z-index: 1300;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: none;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 12px 28px rgba(91, 33, 182, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ai-consultant-fab:hover { filter: brightness(1.06); }
.ai-consultant-fab.is-open { background: #312e81; }
.ai-consultant-fab.is-unconfigured { background: #6b7280; }
.ai-consultant-fab-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}
.ai-consultant-panel {
  position: fixed;
  right: 24px;
  bottom: 190px;
  z-index: 1300;
  width: min(380px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 190px));
  max-height: min(680px, calc(100vh - 190px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-consultant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}
.ai-consultant-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.ai-consultant-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.ai-consultant-msg p { margin: 0; }
.ai-consultant-msg--assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.ai-consultant-msg--user {
  align-self: flex-end;
  background: var(--purple);
  color: #fff;
}
.ai-consultant-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.ai-consultant-form textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
}
.ai-consultant-form button {
  align-self: flex-end;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--purple);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.ai-consultant-form button:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 768px) {
  .orders-page-actions-wrap { align-items: stretch; width: 100%; }
  .orders-page-actions { justify-content: stretch; }
  .orders-search-wrap { min-width: 0; flex: 1; }
}

.products-import-progress {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f7f8ff;
  font-size: 13px;
}
.warehouses-sync-panel {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}
.warehouses-sync-toggle {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 14px; color: var(--text);
}
.pp-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  max-width: 720px;
}
.pp-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pp-toggle-track {
  position: relative;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}
.pp-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}
.pp-toggle-input:checked + .pp-toggle-track {
  background: var(--purple);
}
.pp-toggle-input:checked + .pp-toggle-track::after {
  transform: translateX(18px);
}
.pp-toggle-input:focus-visible + .pp-toggle-track {
  outline: 2px solid rgba(124, 58, 237, 0.45);
  outline-offset: 2px;
}
.pp-toggle-label {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}
.warehouses-sync-hint {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a; font-size: 13px; line-height: 1.45;
}
.import-options-fieldset {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px;
}
.import-option-row {
  display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer;
}
.import-option-row input { width: auto; margin: 0; }
.product-drawer-stocks-block {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fafbff;
}
.product-drawer-stock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-drawer-stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.product-drawer-stock-row input {
  width: 96px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  font: inherit;
}


/* Picker cabinet role */
body.cabinet-role-picker #ordersBulkDeleteBtn,
body.cabinet-role-picker .orders-pick-link,
body.cabinet-role-picker #addStoreFromDropdown,
body.cabinet-role-picker #aiConsultantFab,
body.cabinet-role-picker #aiConsultantPanel,
body.cabinet-role-picker #clearActivityLogBtn,
body.cabinet-role-picker #saveJournalSettingsBtn,
body.cabinet-role-picker label[for="journalRetentionDays"],
body.cabinet-role-picker #journalRetentionDays,
body.cabinet-role-picker #addProductBtn,
body.cabinet-role-picker #syncProductsBtn,
body.cabinet-role-picker #deletePikPakProductBtn,
body.cabinet-role-picker #deleteCustomerBtn,
body.cabinet-role-picker .products-col-check,
body.cabinet-role-picker #productsSelectAll,
body.cabinet-role-picker #addOrderBtn,
body.cabinet-role-picker #orderDrawerMonoInvoiceBtn,
body.cabinet-role-picker #orderDrawerMonoRemoveBtn,
body.cabinet-role-picker #orderDrawerMonoLink,
body.cabinet-role-picker #orderDrawerApproveBar,
body.cabinet-role-picker .orders-col-approve,
body.cabinet-role-picker [data-order-customer-index] {
  display: none !important;
}
body.cabinet-role-picker .sidebar-user {
  pointer-events: none;
}
