: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-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-platform-setting {
  margin-top:4px; padding:12px 14px; border-radius:12px;
  border:1px solid var(--border); background:#fafbff;
  display:flex; flex-direction:column; gap:8px;
}
.integration-platform-setting .integration-action-btn {
  align-self:flex-start; margin-top:4px;
}
.integration-platform-setting-hint {
  margin:0; font-size:12.5px; line-height:1.4; color:var(--muted);
}
.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-title {
  display:flex; align-items:center; gap:12px; min-width:0;
}
.page-header-title .page-title,
.page-header-title h1,
.page-header-title h2 { margin:0; }
.page-header-title .page-subtitle { margin:6px 0 0; }
.page-header-title-icon,
.products-page-title-icon,
.orders-page-title-icon,
.integrations-page-title-icon {
  width:44px; height:44px; border-radius:14px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, #7b61ff, #9d7bff);
  box-shadow:0 8px 20px rgba(123, 97, 255, 0.25);
}
.page-header-title-icon img,
.products-page-title-icon img,
.orders-page-title-icon img,
.integrations-page-title-icon img {
  width:22px; height:22px; object-fit:contain; display:block;
  filter:brightness(0) invert(1);
}
.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,.88); display:flex; align-items:center; justify-content:center; z-index:1600; padding:24px; }
.lightbox.hidden { display: none; }
.lightbox img { max-width:min(1100px, calc(100vw - 96px)); max-height:82vh; border-radius:12px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.lightbox-close { position:absolute; top:24px; right:24px; z-index:2; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #111; font-size: 32px; line-height: 1;
  cursor: pointer; z-index: 2;
}
.lightbox-nav:hover { background: #fff; }
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-caption {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  margin: 0; color: #fff; font-size: 13px; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.6); max-width: 80%; text-align: center;
}
.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: 18px;
}
.products-page-title-block { min-width: 0; }
.products-page-h1,
.products-page-title h1 {
  margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: var(--text);
}
.products-page-title { display: flex; align-items: center; gap: 12px; }
.products-page-subtitle {
  margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 640px; line-height: 1.45;
}
.products-page-head-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.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-filters-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.products-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.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-stock-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  white-space: nowrap;
}
.products-stock-range-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.products-stock-range-sep {
  color: var(--muted);
  font-weight: 600;
}
.products-stock-range-input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafbff;
  font-size: 13px;
  font-weight: 600;
}
.products-stock-range-input:focus {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12);
}
.products-search-wrap {
  position: relative; display: flex; align-items: center; min-width: 220px; flex: 1; max-width: 280px;
}
.products-search-wrap--wide {
  max-width: none;
  min-width: 260px;
  flex: 1 1 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-active-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.products-active-filters:empty { display: none; margin: 0; }
.products-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #e8eaf2;
  background: #f7f8fc;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.products-active-chip:hover { background: #eef0f7; }
.products-active-clear {
  border: none;
  background: transparent;
  color: var(--purple, #7b61ff);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
}
.products-active-clear:hover { text-decoration: underline; }
.products-stock-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: 14px;
  background: #f3f4f8;
  width: fit-content;
  max-width: 100%;
}
.products-stock-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.products-stock-tab:hover { color: var(--text); background: rgba(255,255,255,0.7); }
.products-stock-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.products-stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.products-stock-dot.is-in { background: #22c55e; }
.products-stock-dot.is-out { background: #ef4444; }
.products-stock-dot.is-low { background: #f59e0b; }
.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: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); overflow: hidden;
}
.products-meta {
  margin: 0; color: var(--muted); font-size: 13px; font-weight: 600;
}
.products-meta:empty { display: none; }
.products-table-wrap { overflow-x: auto; }
.products-table { width: 100%; border-collapse: collapse; }
.products-table th, .products-table td {
  padding: 14px 16px; border-bottom: 1px solid #eef0f5; 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-direction: column; align-items: flex-start; gap: 2px;
}
.products-name-hint {
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.products-stock-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.products-stock-qty {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.products-stock-qty.is-in { color: #15803d; }
.products-stock-qty.is-out { color: #b91c1c; }
.products-stock-qty.is-low { color: #b45309; }
.products-stock-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.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: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-top: 1px solid #eef0f5;
  background: #fff;
}
.products-table-footer .products-meta { justify-self: start; }
.products-table-footer .products-pagination { justify-self: center; }
.products-table-footer .products-per-page { justify-self: end; }
.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; }

.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: #faf8ff;
}
@media (max-width: 900px) {
  .products-table-footer {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .products-table-footer .products-meta,
  .products-table-footer .products-pagination,
  .products-table-footer .products-per-page {
    justify-self: stretch;
  }
  .products-pagination { justify-content: center; }
  .products-per-page { justify-content: space-between; }
}

.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.customer-drawer {
  width: min(850px, 100vw);
}
.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-expiry-fields {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}
.product-expiry-fields select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.product-expiry-repeater {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.product-expiry-row {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.product-expiry-row .product-expiry-qty {
  width: 72px;
  flex: 0 0 72px;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.product-expiry-row select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
}
.product-expiry-remove,
.product-expiry-add {
  height: 38px;
  min-width: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0 10px;
}
.product-expiry-remove {
  font-size: 18px;
  color: #b91c1c;
}
.product-expiry-add {
  align-self: flex-start;
  min-width: auto;
  padding: 0 14px;
  color: var(--text);
}
.product-expiry-remove:disabled {
  opacity: 0.35;
  cursor: default;
  color: #9ca3af;
}
.product-drawer-expiry-row dd {
  min-width: 0;
  text-align: left;
  font-weight: 500;
}
.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 solid #e4dcff;
  background: var(--purple-light);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.order-drawer-scan-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.order-drawer-scan-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--purple);
  box-shadow: 0 6px 14px rgba(123, 97, 255, 0.28);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7V5a1 1 0 0 1 1-1h2M20 7V5a1 1 0 0 0-1-1h-2M4 17v2a1 1 0 0 0 1 1h2M20 17v2a1 1 0 0 1-1 1h-2M7 8v8M10 8v8M13 8v5M16 8v8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.product-drawer-scan-box label,
.order-drawer-scan-head label {
  display: block;
  font-weight: 700;
  margin: 0;
  font-size: 14px;
  color: var(--text);
}
.product-drawer-scan-box input {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
}
.product-drawer-scan-box input:focus {
  outline: none;
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12);
}
.product-drawer-scan-hint {
  margin: 8px 0 0; font-size: 12px; color: var(--muted);
}
.order-drawer-scan-box .product-drawer-scan-status {
  min-height: 0;
  margin: 10px 0 0;
  font-size: 13px;
}
.order-drawer-scan-box .product-drawer-scan-status.ok {
  display: flex;
  align-items: center;
  color: var(--ok);
  font-weight: 700;
  line-height: 1.25;
  background: #f0fdf4;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
  margin: 10px 0 0;
  box-sizing: border-box;
}
.order-drawer-scan-box .product-drawer-scan-status.error {
  display: flex;
  align-items: center;
  color: var(--danger);
  font-weight: 700;
  line-height: 1.25;
  background: #fef2f2;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  margin: 10px 0 0;
  box-sizing: border-box;
}
.order-drawer-scan-box .product-drawer-scan-status.muted {
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
}
.order-drawer-scan-box .product-drawer-scan-status.muted:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  min-height: 20px;
  color: var(--muted);
  font-weight: 600;
}
.order-drawer-scan-box .product-drawer-scan-status.muted:not(:empty)::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  flex-shrink: 0;
}
.order-drawer-scan-box .product-drawer-scan-status:empty {
  display: none;
  margin: 0;
}
.order-drawer-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.order-drawer-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: #6b7280;
  font-weight: 500;
}
.order-drawer-meta-ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.85;
  background: no-repeat center / 16px 16px;
}
.order-drawer-meta-chip.is-date .order-drawer-meta-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E");
}
.order-drawer-meta-chip.is-person .order-drawer-meta-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c1.5-3.5 4.5-5 8-5s6.5 1.5 8 5'/%3E%3C/svg%3E");
}
.order-drawer-meta-chip.is-phone .order-drawer-meta-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v2a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h2a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.5 2.1L7.1 9.9a16 16 0 0 0 6 6l1.5-1.1a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
}
.order-drawer-meta-chip.is-address .order-drawer-meta-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-5.5 7-12a7 7 0 1 0-14 0c0 6.5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}
.order-drawer-meta-chip.is-channel .order-drawer-meta-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E");
}
.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;
}
.order-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.order-drawer-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.order-drawer-complete-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(123, 97, 255, 0.28);
  cursor: pointer;
}
.order-drawer-complete-btn:hover { filter: brightness(1.03); }
.order-drawer-complete-btn.hidden { display: none !important; }
.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-approve-bar {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.order-drawer-approve-bar.hidden { display: none !important; }
.order-drawer-approve-bar .orders-tool-btn {
  gap: 10px;
  box-shadow: none;
}
.order-drawer-approve-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
#orderDrawerApproveBtn.order-drawer-approve-btn {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: none;
}
#orderDrawerApproveBtn.order-drawer-approve-btn:hover {
  background: var(--purple-dark);
  border-color: var(--purple-dark);
  color: #fff;
  box-shadow: none;
}
.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-head {
  margin: 10px 0 0;
  width: 100%;
}
.order-drawer-note-head + .order-drawer-approve-bar {
  margin-top: 10px;
}
.order-drawer-note strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #92400e;
}
.order-drawer-note-icon { font-size: 14px; line-height: 1; }
.order-drawer-note p { margin: 0; color: var(--text); white-space: pre-wrap; }
.order-drawer-progress {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 10px;
}
.order-drawer-items { display: flex; flex-direction: column; gap: 10px; }
.order-item-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.order-item-qty-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  height: 34px;
}
.order-item-qty-input {
  box-sizing: border-box;
  width: 44px;
  height: 34px;
  margin: 0;
  text-align: center;
  padding: 0 2px;
  border: 0;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  border-radius: 0;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 32px;
  -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: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  color: #374151;
  flex-shrink: 0;
}
.order-item-qty-group .order-item-qty-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: #fff;
}
.order-item-qty-group .order-item-qty-btn:hover {
  background: #f8fafc;
}
.order-item-remove-btn {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff5f5;
}
.order-item-remove-btn:hover {
  background: #fee2e2;
}
.order-drawer-items-edit {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
}
.order-drawer-edit-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.order-drawer-edit-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.order-drawer-add-product {
  display: block;
  width: 100%;
}
.order-drawer-add-product .products-search-wrap,
.order-drawer-add-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-width: 0;
}
.order-drawer-add-product .products-search-icon {
  font-size: 32px;
  left: 12px;
  line-height: 1;
  color: var(--purple);
  z-index: 1;
}
.order-drawer-add-product .products-search-input {
  width: 100%;
  padding: 12px 52px 12px 50px;
  border-radius: 12px;
  border: 1.5px solid #c4b5fd;
  background: #fff;
  font-size: 14px;
}
.order-drawer-add-product .products-search-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.14);
}
.order-drawer-add-plus {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(123, 97, 255, 0.28);
}
.order-drawer-add-product-list {
  margin-top: 8px;
  max-height: 180px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-drawer-add-product-list:empty {
  display: none;
  margin: 0;
}
#orderDrawerItemsEditMsg {
  margin: 6px 0 0;
  font-size: 13px;
}
#orderDrawerItemsEditMsg:empty {
  display: none;
  margin: 0;
}
.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: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(26, 29, 46, 0.03);
}
.order-item-row.is-complete { border-color: #bbf7d0; background: #f0fdf4; }
.order-item-thumb,
.order-item-row img,
.order-item-thumb-empty {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f8;
}
.order-item-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 22px; }
.order-item-main { min-width: 0; }
.order-item-name { font-weight: 700; font-size: 14px; line-height: 1.35; }
.order-item-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.order-item-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 120px;
}
.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: 15px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.order-item-price-hint {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.order-drawer-totals {
  position: relative;
  margin: 12px 0 8px;
  padding: 14px 16px 14px 52px;
  border: 1px solid #e4dcff;
  border-radius: 14px;
  background: var(--purple-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.order-drawer-totals::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--purple) center / 16px 16px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 11h8M8 15h4'/%3E%3C/svg%3E");
  box-shadow: 0 4px 10px rgba(123, 97, 255, 0.25);
}
.order-drawer-totals-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}
.order-drawer-totals-row strong {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.order-drawer-totals-row.is-total {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed #d4c8f5;
  color: var(--text);
  font-size: 14px;
}
.order-drawer-totals-row.is-total strong {
  font-weight: 800;
}
.order-drawer-totals-due {
  color: var(--purple);
  font-weight: 800;
  font-size: 15px;
}
.order-drawer-totals-due strong {
  color: var(--purple);
  font-size: 16px;
}
.order-drawer-payment-due {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  color: #92400e;
}
.order-drawer-payment-due-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fbbf24 center / 18px 18px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23783650' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/%3E%3Cpath d='M16 14h.01M2 10h20'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
}
.order-drawer-payment-due-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.order-drawer-payment-due strong {
  font-size: 16px;
  font-weight: 800;
  color: #a16207;
}
.order-drawer-payment-due-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fde68a;
  overflow: hidden;
}
.order-drawer-payment-due-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}
.order-merge-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(50vh, 360px);
  overflow: auto;
}
.order-merge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
}
.order-merge-item:hover {
  border-color: #93c5fd;
  background: #f8fafc;
}
.order-merge-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.order-merge-item-title {
  font-weight: 700;
  font-size: 14px;
}
.order-merge-item-meta {
  font-size: 12px;
  color: var(--muted);
}
.order-merge-item-side {
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}
.order-item-qty { font-weight: 700; white-space: nowrap; }
@media (max-width: 560px) {
  .order-item-row {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "thumb main"
      "aside aside";
  }
  .order-item-thumb,
  .order-item-row img,
  .order-item-thumb-empty { grid-area: thumb; width: 48px; height: 48px; }
  .order-item-main { grid-area: main; }
  .order-item-aside {
    grid-area: aside;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    width: 100%;
  }
}
.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; }
.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:not(.pp-toggle) {
  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; }
}

/* Settings shell (subnav + cards) */
.settings-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.settings-subnav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 10px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(31, 27, 72, 0.04);
}
.settings-subnav-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 12px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid #eef0f6;
}
.settings-subnav-head-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-light);
}
.settings-subnav-head-icon img {
  display: block;
}
.settings-subnav-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.settings-subnav-desc {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.settings-subnav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0 8px;
}
.settings-subnav-group + .settings-subnav-group {
  border-top: 1px solid #eef0f6;
  margin-top: 4px;
  padding-top: 10px;
}
.settings-subnav-label {
  padding: 4px 12px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3b5;
}
.settings-subnav-divider {
  height: 1px;
  margin: 8px 6px;
  background: #eef0f6;
}
.settings-subnav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.settings-subnav-item:hover {
  background: var(--purple-light);
}
.settings-subnav-item.is-active {
  background: var(--purple-light);
  color: var(--purple-dark);
}
.settings-subnav-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f5fb;
  font-size: 14px;
  line-height: 1;
}
.settings-subnav-item.is-active .settings-subnav-icon {
  background: #fff;
}
.settings-subnav-text {
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}
.settings-subnav-text small {
  font-size: 11px;
  opacity: 0.72;
  line-height: 1.3;
}
.settings-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-panel.hidden {
  display: none;
}
.settings-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 10px 28px rgba(31, 27, 72, 0.04);
}
.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.settings-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #17152a;
}
.settings-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 4px;
}
.settings-card-title-row .settings-card-title {
  margin: 0;
}
.settings-card-desc {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: #6b7280;
}
.settings-card-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.settings-card-brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f4f5fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
}
.settings-card-brand-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.settings-card-brand-icon--mono {
  background: #111827;
  color: #fff;
  font-weight: 800;
}
.settings-card-brand-icon--openai {
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  font-size: 13px;
}
.settings-card-brand-icon--telegram {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 800;
  font-size: 12px;
}
.settings-card-brand-icon--checkbox {
  background: #111827;
  color: #fbbf24;
  font-weight: 800;
  font-size: 15px;
}
.settings-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}
.settings-field input,
.settings-field select,
.settings-card input[type="password"],
.settings-card input[type="text"],
.settings-card input[type="number"],
.settings-card input[type="search"],
.settings-card input[type="tel"],
.settings-card textarea,
.settings-card select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
}
.settings-card-row {
  margin: 4px 0 8px;
}
.settings-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.settings-card-actions--inline {
  margin-top: 0;
  justify-content: flex-end;
}
.settings-btn-primary,
.settings-btn-secondary {
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}
.settings-btn-primary {
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  color: #fff;
  border-color: transparent;
}
.settings-btn-primary:hover {
  filter: brightness(1.03);
}
.settings-btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: #374151;
}
.settings-btn-secondary:hover {
  background: #fafbff;
}
.settings-card-msg {
  margin-top: 10px;
}
.settings-card-msg:empty {
  display: none;
}
.settings-steps {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.settings-telegram-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-card .integration-platform-link {
  display: inline-block;
  margin-top: 6px;
}
@media (max-width: 980px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }
  .settings-subnav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .settings-subnav-head {
    display: none;
  }
  .settings-subnav-divider {
    display: none;
  }
  .settings-subnav-group {
    flex-direction: row;
    align-items: center;
    border-top: 0;
    margin: 0;
    padding: 0;
  }
  .settings-subnav-label {
    padding: 0 8px 0 4px;
    white-space: nowrap;
  }
  .settings-subnav-item {
    flex: 0 0 auto;
    min-width: 160px;
  }
  .settings-subnav-text small {
    white-space: nowrap;
  }
  .settings-fields {
    grid-template-columns: 1fr;
  }
  .settings-card-head {
    flex-direction: column;
  }
  .settings-card-actions--inline {
    justify-content: flex-start;
  }
}

.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;
}
.integration-platform-icon--telegram {
  background: #e0f2fe;
  color: #0369a1;
  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;
}
.channel-pick-grid { margin: 16px 0 8px; }
.channel-pick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  color: var(--text);
  font-weight: inherit;
}
.channel-pick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 10px;
}
.channel-pick-icon--facebook { background: #1877f2; color: #fff; }
.channel-pick-icon--instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
  font-size: 18px;
}
.channel-pick-icon--custom { background: #f3f4f6; font-size: 22px; }
.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: center; gap: 16px;
  margin-bottom: 16px; flex-wrap: wrap; min-height: 44px;
}
.orders-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.orders-board {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: visible;
}
.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;
  white-space: nowrap;
}
.order-row-date {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
}
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;
}
.orders-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px 20px 12px;
}
.orders-search-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: flex-start;
}
.orders-search-cluster .orders-search-wrap {
  flex: 1 1 auto;
  width: auto;
  min-width: 140px;
  max-width: none;
}
.orders-search-cluster .orders-adv-search-btn,
.orders-search-cluster .orders-filters-btn,
.orders-search-cluster .orders-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.orders-search-cluster .orders-cols-wrap { flex-shrink: 0; }
.orders-cols-btn img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}
label.orders-search-wrap,
.orders-search-wrap {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  border: 1px solid #eceef3; border-radius: 12px; background: #f6f7fb;
  min-width: 0; max-width: none; flex: 1 1 auto; margin: 0;
  color: inherit; font-size: inherit; font-weight: inherit;
}
.orders-adv-search-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.orders-adv-search-btn:hover { border-color: #c4b5fd; background: #faf8ff; color: var(--purple, #6d28d9); }
.orders-adv-search-btn.has-filters {
  border-color: var(--purple); background: #f5f3ff; color: var(--purple-dark, #5b21b6);
}
.orders-adv-search-icon { display: block; }
.orders-adv-search-btn .orders-filter-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.orders-adv-search-btn .orders-filter-count.hidden { display: none; }
.orders-filters-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}
.orders-filters-btn:hover { border-color: #c4b5fd; background: #faf8ff; color: var(--purple, #6d28d9); }
.orders-filters-btn.has-filters {
  border-color: var(--purple); background: #f5f3ff; color: var(--purple-dark, #5b21b6);
}
.orders-filters-btn .orders-filter-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
.orders-filters-btn .orders-filter-count.hidden { display: none; }
.orders-channel-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.orders-filter-channel-chips .orders-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.orders-filter-channel-chips .orders-channel-tab-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.orders-search-icon { color: var(--muted); font-size: 14px; flex-shrink: 0; line-height: 1; display: block; }
.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;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  row-gap: 8px;
  column-gap: 8px;
}
.orders-status-tabs {
  gap: 4px !important;
}
.orders-status-tabs > button {
  margin: 0 !important;
}
.orders-channel-row .orders-status-tabs {
  flex: 1 1 auto;
  min-width: 0;
}
.orders-channel-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 0; padding: 4px 12px 0 12px; flex-wrap: wrap;
  border-bottom: 1px solid #eceef2;
}
.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-board .orders-sort-btn {
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 0 10px 10px;
}
.orders-board .orders-sort-btn:hover {
  background: transparent;
  color: var(--text);
  border-color: transparent;
}
.orders-cols-wrap { position: relative; flex-shrink: 0; }
.orders-cols-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 300px;
  max-width: min(300px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 18px 40px rgba(28, 25, 50, .14);
  box-sizing: border-box;
  overflow: hidden;
  white-space: normal;
}
.orders-cols-popover.hidden { display: none; }
.orders-cols-popover-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.orders-cols-popover-head strong { font-size: 14px; }
.orders-cols-hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.orders-cols-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(360px, 50vh);
  overflow-x: hidden;
  overflow-y: auto;
}
.orders-cols-row {
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: grab;
  min-width: 0;
  white-space: normal;
}
.orders-cols-row.is-dragging { opacity: .55; }
.orders-cols-row.is-unavailable { opacity: .58; }
.orders-cols-handle { color: #9aa3b5; font-size: 14px; letter-spacing: -1px; user-select: none; }
.orders-cols-row input { margin: 0; width: 16px; height: 16px; }
.orders-cols-name { font-size: 13px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.orders-cols-move { display: inline-flex; gap: 4px; }
.orders-cols-move button {
  width: 26px; height: 26px; padding: 0; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; font-size: 12px; line-height: 1;
}
.orders-cols-move button:disabled { opacity: .35; cursor: default; }
.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: 0; padding: 0 20px 12px;
}
.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-channel-tabs button:hover { border-color: #c4b5fd; background: #faf8ff; }
.orders-channel-tabs button.active {
  background: var(--purple); border-color: var(--purple); color: #fff;
}
.orders-status-tabs button {
  height: auto;
  padding: 16px 12px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #6b7280;
  font-size: 14px;
  font-weight: 600;
  box-sizing: border-box;
}
.orders-status-tabs button:hover {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.orders-status-tabs button.active {
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--purple);
  color: var(--purple);
  box-shadow: none;
}
.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 { background: rgba(255,255,255,.22); }
.orders-status-tab-n {
  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;
  font-variant-numeric: tabular-nums;
  background: #eceef3;
  color: #6b7280;
  opacity: 1;
  margin-left: 2px;
}
.orders-status-tabs button.active .orders-status-tab-n {
  background: #efeaff;
  color: var(--purple);
  opacity: 1;
}
.orders-table-card {
  background: transparent; border: 0; border-radius: 0; overflow: visible;
}
.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-ettn-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.orders-ettn-progress-modal { max-width: 440px; }
.orders-ettn-progress-wait {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.orders-ettn-progress-count {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.orders-ettn-progress-track {
  height: 12px;
  border-radius: 999px;
  background: var(--purple-soft);
  overflow: hidden;
}
.orders-ettn-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(135deg, #7b61ff, #9d7bff);
  transition: width 0.25s ease;
}
.orders-ettn-progress-fill.is-busy {
  background-size: 28px 28px;
  background-image: linear-gradient(
    135deg,
    rgba(255,255,255,.28) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255,255,255,.28) 50%,
    rgba(255,255,255,.28) 75%,
    transparent 75%,
    transparent
  );
  animation: orders-ettn-progress-stripes 0.8s linear infinite;
}
@keyframes orders-ettn-progress-stripes {
  from { background-position: 0 0; }
  to { background-position: 28px 0; }
}
.orders-ettn-progress-current {
  margin: 12px 0 0;
  font-size: 13px;
  min-height: 18px;
}
.orders-ettn-progress-skips {
  margin: 14px 0 0;
  padding: 10px 12px;
  max-height: 140px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}
.orders-ettn-progress-skips.hidden { display: none; }
.orders-ettn-progress-errors {
  margin: 14px 0 0;
  padding: 10px 12px;
  max-height: 140px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #fecaca;
  background: #fff7f7;
  color: #991b1b;
  font-size: 13px;
  line-height: 1.45;
}
.orders-ettn-progress-errors.hidden { display: none; }
.orders-ettn-badge.is-needed { background: #ffedd5; color: #c2410c; }
.orders-ettn-badge.is-created { background: #dcfce7; color: #15803d; }
.orders-ettn-badge.is-skip { background: #f3f4f6; color: #6b7280; }
.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%;
  min-width: max-content;
  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-col-number,
.orders-col-total,
.orders-total-value {
  white-space: nowrap;
}
.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-channel-logo-only { gap: 0; justify-content: center; }
.orders-channel-logo-only img { width: 26px; height: 26px; }
.orders-channel-fallback {
  width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center;
  background: #f3f4f6; color: #6b7280; font-size: 12px; font-weight: 800;
}
.orders-table--hide-ttn-photo .orders-col-ttn,
.orders-table--hide-ttn-photo .orders-col-photo,
.orders-table--hide-ettn .orders-col-ettn,
th.orders-col-ttn.hidden,
th.orders-col-photo.hidden,
th.orders-col-ettn.hidden {
  display: none !important;
}
.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: 720px; width: min(720px, calc(100vw - 32px)); }
.orders-adv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}
@media (min-width: 700px) {
  .orders-adv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.orders-adv-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.orders-adv-field input {
  font-weight: 500;
  color: var(--text);
  background: #f8fafc;
}
.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;
}
details.order-drawer-accordion {
  display: block;
  margin-top: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  overflow: visible;
}
details.order-drawer-accordion.order-drawer-np-block,
details.order-drawer-accordion.order-drawer-history-block,
details.order-drawer-accordion.order-drawer-hub-meta {
  margin-top: 0;
  padding: 0;
  background: #fff;
}
.order-drawer-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
  padding: 16px 18px;
  user-select: none;
  color: var(--text);
}
.order-drawer-accordion-summary::-webkit-details-marker,
.order-drawer-accordion-summary::marker {
  display: none;
  content: '';
}
.order-drawer-accordion-lead {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.order-drawer-accordion-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--purple-light) center / 20px 20px no-repeat;
  box-shadow: inset 0 0 0 1px #e4dcff;
}
.order-drawer-accordion-badge.is-payment {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2z'/%3E%3Cpath d='M16 14h.01M2 10h20'/%3E%3C/svg%3E");
}
.order-drawer-accordion-badge.is-np {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-5.5 7-12a7 7 0 1 0-14 0c0 6.5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}
.order-drawer-accordion-badge.is-history {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}
.order-drawer-accordion-summary-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.order-drawer-accordion-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}
.order-drawer-accordion-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-drawer-accordion-hint:empty {
  display: none;
}
.order-drawer-accordion-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.18s ease;
}
details.order-drawer-accordion[open] > .order-drawer-accordion-summary .order-drawer-accordion-arrow {
  transform: rotate(180deg);
}
details.order-drawer-accordion[open] > .order-drawer-accordion-summary {
  border-bottom: 1px solid var(--border);
}
.order-drawer-accordion-body {
  padding: 16px 20px 20px;
}
.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: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 520px) {
  .order-drawer-hub-meta-grid { grid-template-columns: 1fr; }
}
.order-drawer-hub-meta-grid label,
.order-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.order-drawer-hub-meta-grid select,
.order-drawer-hub-meta-grid input,
.order-drawer-field-control input,
.order-drawer-field-control select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #fff;
}
.order-drawer-field-control {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.order-drawer-field-control input {
  border: 0;
  border-radius: 0;
  height: 42px;
}
.order-drawer-field-affix {
  flex-shrink: 0;
  width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-light);
  color: var(--purple);
  font-weight: 800;
  border-right: 1px solid #e4dcff;
}
.order-drawer-field-affix.is-calendar {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  font-size: 0;
  color: transparent;
}
.order-drawer-hub-meta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.order-drawer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 700;
}
.order-drawer-action-btn::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: no-repeat center / 16px 16px;
  opacity: 0.9;
}
.order-drawer-action-btn.is-save::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z'/%3E%3Cpath d='M17 21v-8H7v8M7 3v5h8'/%3E%3C/svg%3E");
}
.order-drawer-action-btn.is-merge::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l2-2a5 5 0 0 0-7.1-7.1l-1.2 1.2'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-2 2a5 5 0 0 0 7.1 7.1l1.2-1.2'/%3E%3C/svg%3E");
}
.order-drawer-action-btn.is-mono {
  flex: 1 1 220px;
  background: var(--purple);
  border: none;
  color: #fff;
  box-shadow: 0 8px 18px rgba(123, 97, 255, 0.28);
}
.order-drawer-action-btn.is-mono::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E");
}
.order-drawer-action-btn.is-mono:hover {
  filter: brightness(1.03);
  color: #fff;
}
.order-drawer-mono-info {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.order-drawer-mono-info.hidden { display: none !important; }
.order-drawer-mono-info a { color: #4338ca; font-weight: 700; }
.order-drawer-mono-info-ico {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  background: #6366f1 center / 10px 10px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 10v6M12 7h.01'/%3E%3C/svg%3E");
}
#orderDrawerHubMetaMsg.ok,
#orderDrawerPhotosMsg.ok { color: var(--ok); font-weight: 600; }
#orderDrawerHubMetaMsg.error,
#orderDrawerPhotosMsg.error { color: var(--danger); font-weight: 600; }
.order-drawer-photos-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.order-drawer-photos-head .order-drawer-np-title { margin: 0; }
.order-drawer-photos-list {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; min-height: 24px;
}
.orders-photo-view-btn {
  border: 0; background: #dcfce7; color: #166534; font: inherit; font-weight: 700;
  font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.orders-photo-view-btn:hover { filter: brightness(0.97); }
.order-drawer-photo-thumb {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); display: block; background: #fff; cursor: zoom-in; padding: 0;
}
.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: stretch; height: 44px; padding: 0;
  border-radius: 12px; border: 0; background: var(--purple); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer; overflow: hidden;
}
.orders-add-btn:hover { filter: brightness(1.05); }
.orders-add-btn-label {
  display: inline-flex; align-items: center; padding: 0 18px; white-space: nowrap;
}
.orders-add-btn-split {
  width: 1px; margin: 9px 0; background: rgba(255,255,255,.32); flex-shrink: 0;
}
.orders-add-btn-caret {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; font-size: 11px; line-height: 1; opacity: .95;
}

.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,
.np-settings-section textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.np-settings-section input,
.np-settings-section select {
  height: 40px;
  padding: 0 12px;
}
.np-settings-section textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}
.np-desc-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.np-desc-var {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.np-desc-var code {
  font-size: 12px;
  font-weight: 800;
  color: #5b4cdb;
}
.np-desc-var span {
  font-weight: 600;
  color: #64748b;
}
.np-desc-var:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.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-accounts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.np-account-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 140px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.np-account-chip.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb inset;
  background: #eff6ff;
}
.np-account-chip strong { font-size: 13px; }
.np-account-chip .muted { font-size: 12px; }
#novaPoshtaAccountPickers {
  min-height: 96px;
}
.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-block.order-drawer-accordion {
  margin-top: 0;
  padding: 0;
  background: #fff;
}
.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-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--purple-light);
  border: 1px solid #e4dcff;
}
.order-drawer-np-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff center / 18px 18px no-repeat;
  box-shadow: 0 0 0 1px #e4dcff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V8l7-5 7 5v13M9 21v-6h6v6'/%3E%3C/svg%3E");
}
.order-drawer-np-card-body { min-width: 0; flex: 1; }
.order-drawer-np-card-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.order-drawer-np-card-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.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-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.order-drawer-np-quick-actions > button,
.order-drawer-np-action {
  width: 100%;
  margin: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.order-drawer-np-action::before {
  content: '';
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: no-repeat center / 16px 16px;
}
.order-drawer-np-action.is-address::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s7-5.5 7-12a7 7 0 1 0-14 0c0 6.5 7 12 7 12z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
}
.order-drawer-np-action.is-ttn::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
}
@media (max-width: 420px) {
  .order-drawer-np-quick-actions { grid-template-columns: 1fr; }
}
.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; }
.clients-page-actions-wrap {
  flex: 1;
  min-width: 280px;
  align-items: stretch;
}
.clients-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}
.clients-search-wrap {
  flex: 1 1 260px;
  max-width: 360px;
  min-width: 200px;
}
.clients-search-wrap .products-search-icon {
  font-size: 32px;
  left: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.clients-search-wrap .products-search-input {
  padding-left: 48px;
}
.clients-add-btn {
  box-shadow: none;
  background: var(--purple);
}
.clients-reload-btn {
  box-shadow: none;
}
.clients-table-card {
  border: 1px solid #eef0f6;
  box-shadow: 0 8px 30px rgba(88, 63, 200, 0.05);
}
.clients-meta {
  padding: 16px 20px 4px;
  font-weight: 600;
}
.clients-table th,
.clients-table td {
  border-bottom: 1px solid #f3f4f8;
  padding: 16px 14px;
}
.clients-table thead th {
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #9aa3b5;
  padding-top: 12px;
  padding-bottom: 10px;
}
.clients-table tbody tr.client-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.clients-table tbody tr.client-row:hover,
.clients-table tbody tr.client-row.is-active {
  background: #faf8ff;
}
.clients-table tbody tr.client-row:last-child td {
  border-bottom: 0;
}
.clients-name-cell {
  gap: 12px;
}
.clients-name-open {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.clients-name-open strong {
  font-weight: 700;
  color: var(--text);
}
.clients-name-open:hover strong {
  color: var(--purple);
}
.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: var(--purple-light); color: var(--purple);
  font-weight: 800; font-size: 15px;
  border: 1px solid #e4dcff;
}
.customer-drawer-avatar {
  width: 56px; height: 56px; border-radius: 16px; font-size: 22px; margin-bottom: 8px;
}
.clients-cell-with-ico {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-weight: 500;
}
.clients-cell-ico {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: no-repeat center / 16px 16px;
  opacity: 0.95;
}
.clients-cell-with-ico.is-phone .clients-cell-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v2a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h2a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.5 2.1L7.1 9.9a16 16 0 0 0 6 6l1.5-1.1a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
}
.clients-cell-with-ico.is-email .clients-cell-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z'/%3E%3Cpath d='m3.5 7.5 8.5 6 8.5-6'/%3E%3C/svg%3E");
}
.clients-col-orders {
  text-align: center;
  width: 110px;
}
.clients-orders-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #e4dcff;
  background: #f5f2ff;
  color: #7b61ff;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  box-sizing: border-box;
}
.clients-col-last,
.clients-col-source {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.clients-table .products-row-menu {
  font-size: 20px;
  color: #9aa3b5;
}
@media (max-width: 900px) {
  .clients-search-wrap { max-width: none; flex: 1 1 100%; }
  .clients-page-actions { justify-content: stretch; }
}

/* —— Pickers (Працівники) —— */
.pickers-page-actions-wrap {
  flex: 1;
  min-width: 240px;
  align-items: stretch;
}
.pickers-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}
.pickers-add-btn { box-shadow: none; background: var(--purple); }
.pickers-reload-btn { box-shadow: none; }
.pickers-table-card {
  border: 1px solid #eef0f6;
  box-shadow: 0 8px 30px rgba(88, 63, 200, 0.05);
}
.pickers-meta-row {
  padding: 16px 20px 4px;
}
.pickers-meta { margin: 0; padding: 0; }
.pickers-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f5f2ff;
  border: 1px solid #e4dcff;
  color: #5b4bb7;
  font-size: 13px;
  font-weight: 700;
}
.pickers-meta-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: no-repeat center / 16px 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}
.pickers-table th,
.pickers-table td {
  border-bottom: 1px solid #f3f4f8;
  padding: 16px 14px;
  vertical-align: middle;
}
.pickers-table thead th {
  background: transparent;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b5;
  padding-top: 12px;
  padding-bottom: 10px;
}
.pickers-table tbody tr.picker-row:hover { background: #faf8ff; }
.pickers-table tbody tr.picker-row:last-child td { border-bottom: 0; }
.pickers-table tbody tr.picker-row.is-inactive { opacity: 0.72; }
.pickers-code-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f3f4f8;
  border: 1px solid #e8e9ef;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}
.pickers-login,
.pickers-name,
.pickers-store {
  font-weight: 600;
  color: var(--text);
}
.pickers-person {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pickers-person-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pickers-person-text strong {
  font-weight: 700;
  color: var(--text);
}
.pickers-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #efeaff;
  color: #7b61ff;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  border: 1px solid #e4dcff;
}
.pickers-avatar.is-lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}
.pickers-avatar.has-photo {
  cursor: zoom-in;
  background: #f3f4f8;
  border-color: #e5e7eb;
}
.pickers-avatar.has-photo:hover {
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.18);
}
.pickers-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pickers-edit-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.pickers-edit-avatar {
  flex-shrink: 0;
}
.pickers-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.pickers-role-wrap {
  display: inline-flex;
  color: #7b61ff;
}
.pickers-qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #7b61ff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.pickers-qr-btn:hover { color: #6347e8; }
.pickers-qr-ico { flex-shrink: 0; }
.pickers-activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pickers-activity.is-active {
  background: #e8faf0;
  color: #15803d;
}
.pickers-activity.is-off {
  background: #f3f4f6;
  color: #6b7280;
}
.pickers-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pickers-activity.is-active .pickers-activity-dot { background: #22c55e; }
.pickers-col-actions { width: 96px; text-align: right; }
.pickers-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.pickers-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}
.pickers-icon-btn.is-edit { color: #7b61ff; }
.pickers-icon-btn.is-edit:hover { background: #f5f2ff; }
.pickers-icon-btn.is-delete { color: #ef4444; }
.pickers-icon-btn.is-delete:hover { background: #fef2f2; }

/* —— Analytics —— */
.analytics-page-shell { width: 100%; min-width: 0; }
.analytics-page-actions-wrap {
  flex: 1;
  min-width: 160px;
  align-items: stretch;
}
.analytics-page-actions {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.analytics-filters {
  margin-bottom: 16px;
  padding: 16px 18px;
}
.analytics-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin-bottom: 12px;
}
.analytics-filter-row:last-child { margin-bottom: 0; }
.analytics-filter-label {
  min-width: 140px;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9aa3b5;
}
.analytics-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.analytics-date-inputs {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.analytics-date-inputs.is-open { display: flex; }
.analytics-date-inputs label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.analytics-date-inputs input[type="date"] {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}
.analytics-loading { margin: 0 0 12px; }
.analytics-kpi-grid {
  margin-bottom: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.analytics-kpi-card .kpi-value { font-size: 22px; }
.analytics-kpi-card .analytics-kpi-sub {
  font-weight: 600;
  color: #6b7280;
}
.analytics-all-blocks {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.analytics-all-blocks > .kpi-grid {
  margin-bottom: 0;
}
.analytics-all-blocks > .card,
.analytics-all-blocks > .analytics-grid-2 {
  margin-bottom: 0;
}
.analytics-funnel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.analytics-funnel-total {
  margin: 0;
  font-size: 14px;
  color: #4b5563;
}
.analytics-funnel-total strong {
  color: #111827;
  font-weight: 800;
}
.analytics-funnel-total-sum {
  margin-left: 8px;
  color: #5b4bb7;
  font-weight: 700;
}
.analytics-funnel-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.analytics-money-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.analytics-stock-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}
.analytics-kpi-card.is-clickable {
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  appearance: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.analytics-kpi-card.is-clickable:hover {
  box-shadow: 0 0 0 2px rgba(91, 75, 183, 0.18);
}
.analytics-kpi-card.is-clickable.is-selected {
  box-shadow: 0 0 0 2px rgba(91, 75, 183, 0.45);
}
.analytics-scroll-table {
  max-height: 420px;
  overflow: auto;
}
.analytics-scroll-table.is-tall {
  max-height: min(70vh, 640px);
}
.analytics-scroll-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 0 1px 0 #eef0f6;
}
.analytics-funnel-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  min-width: 0;
}
.analytics-funnel-label {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 6px;
  line-height: 1.25;
}
.analytics-funnel-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
  color: #111827;
}
.analytics-funnel-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
}
.analytics-funnel-card.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.analytics-funnel-card.is-ok .analytics-funnel-meta { color: #15803d; }
.analytics-funnel-card.is-warn { border-color: #fde68a; background: #fffbeb; }
.analytics-funnel-card.is-warn .analytics-funnel-meta { color: #b45309; }
.analytics-funnel-card.is-danger { border-color: #fecaca; background: #fef2f2; }
.analytics-funnel-card.is-danger .analytics-funnel-meta { color: #b91c1c; }
.analytics-funnel-card.is-info { border-color: #bae6fd; background: #f0f9ff; }
.analytics-funnel-card.is-info .analytics-funnel-meta { color: #0369a1; }
.analytics-funnel-card.is-muted { border-color: #e5e7eb; background: #f9fafb; }
.analytics-funnel-hint {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
}
.analytics-kpi-card.is-ok { border-color: #bbf7d0; background: #f0fdf4; }
.analytics-kpi-card.is-ok .analytics-kpi-sub { color: #15803d; }
.analytics-kpi-card.is-danger { border-color: #fecaca; background: #fef2f2; }
.analytics-kpi-card.is-danger .analytics-kpi-sub { color: #b91c1c; }
.analytics-kpi-card.is-muted { border-color: #e5e7eb; background: #f9fafb; }
.analytics-packed-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.analytics-packed-table th.analytics-packed-day {
  white-space: nowrap;
  font-size: 12px;
  text-align: center;
}
.analytics-packed-table td {
  text-align: center;
  white-space: nowrap;
}
.analytics-packed-table td:first-child,
.analytics-packed-table th:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}
.analytics-packed-hit { font-weight: 700; color: #5b4bb7; }
.analytics-packed-total-row td { background: #f8f7ff; }
.analytics-stock-badge {
  display: inline-flex;
  min-width: 36px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}
.analytics-stock-badge.is-danger { background: #fee2e2; color: #b91c1c; }
.analytics-stock-badge.is-warn { background: #ffedd5; color: #c2410c; }
.analytics-stock-badge.is-muted { background: #f3f4f6; color: #4b5563; }
.analytics-outcome-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.analytics-kpi-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #5b4bb7;
}
.analytics-outcome-card.is-ok { border-color: #bbf7d0; }
.analytics-outcome-card.is-ok .analytics-kpi-sub { color: #15803d; }
.analytics-outcome-card.is-warn { border-color: #fde68a; }
.analytics-outcome-card.is-warn .analytics-kpi-sub { color: #b45309; }
.analytics-outcome-card.is-muted .analytics-kpi-sub { color: #6b7280; }
.analytics-ts-col { cursor: pointer; }
.analytics-ts-col:hover .analytics-ts-bar,
.analytics-ts-col:focus-visible .analytics-ts-bar {
  filter: brightness(1.08);
}
.analytics-ts-tooltip {
  position: fixed;
  z-index: 10050;
  pointer-events: none;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.analytics-ts-tooltip.hidden { display: none !important; }
.analytics-ts-tooltip strong { font-size: 12px; font-weight: 800; }
.analytics-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.analytics-panel { margin-bottom: 16px; }
.analytics-panel-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
}
.analytics-bars { display: flex; flex-direction: column; gap: 10px; }
.analytics-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr minmax(90px, auto);
  gap: 10px;
  align-items: center;
}
.analytics-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.analytics-bar-track {
  height: 10px;
  border-radius: 999px;
  background: #f1eefe;
  overflow: hidden;
}
.analytics-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7b61ff, #9d7bff);
}
.analytics-bar-value {
  font-size: 12px;
  font-weight: 700;
  color: #5b4bb7;
  text-align: right;
  white-space: nowrap;
}
.analytics-timeseries { overflow-x: auto; }
.analytics-ts-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 160px;
  padding: 8px 0 0;
}
.analytics-ts-chart.is-dense { gap: 2px; }
.analytics-ts-col {
  flex: 1 1 0;
  min-width: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 150px;
}
.analytics-ts-chart.is-dense .analytics-ts-col { min-width: 4px; }
.analytics-ts-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #9d7bff, #7b61ff);
}
.analytics-ts-label {
  margin-top: 6px;
  font-size: 10px;
  color: #9aa3b5;
  white-space: nowrap;
}
.analytics-table th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9aa3b5;
}
.analytics-product-name { font-weight: 700; }
.analytics-hint { margin: 12px 0 0; font-size: 12px; }
@media (max-width: 900px) {
  .analytics-grid-2 { grid-template-columns: 1fr; }
  .analytics-outcome-grid { grid-template-columns: 1fr; }
  .analytics-funnel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-money-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .analytics-bar-value { text-align: left; }
  .analytics-filter-label { min-width: 100%; padding-top: 0; }
}

.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-head {
  gap: 14px;
}
.customer-drawer-head-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-right: 44px;
}
.customer-drawer.customer-drawer-order-mode .customer-drawer-head-row {
  padding-left: 40px;
}
.customer-drawer-back {
  position: absolute;
  top: 20px;
  left: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #f3f4f8;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.customer-drawer-back:hover { background: #ebedf3; }
.customer-drawer-back.hidden { display: none; }
.customer-drawer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 22px;
  margin: 0;
  flex-shrink: 0;
}
.customer-drawer-head-contacts {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  font-weight: 500;
}
.customer-drawer-head-contact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.customer-drawer-head-contact.is-phone .clients-cell-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v2a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h2a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.5 2.1L7.1 9.9a16 16 0 0 0 6 6l1.5-1.1a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
}
.customer-drawer-head-contact.is-email .clients-cell-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z'/%3E%3Cpath d='m3.5 7.5 8.5 6 8.5-6'/%3E%3C/svg%3E");
}
.customer-drawer-head-contact .clients-cell-ico {
  width: 14px;
  height: 14px;
  background-size: 14px 14px;
}
.customer-drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 4px;
}
.customer-drawer-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 12px;
  border: 1px solid #eef0f6;
  border-radius: 14px;
  background: #fafbff;
  min-width: 0;
}
.customer-drawer-stat-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.customer-drawer-stat-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background: no-repeat center / 16px 16px;
  opacity: 0.9;
}
.customer-drawer-stat-ico.is-orders {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
}
.customer-drawer-stat-ico.is-date {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
.customer-drawer-stat-ico.is-source {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M2 12h20'/%3E%3Cpath d='M12 2a15 15 0 0 1 0 20'/%3E%3Cpath d='M12 2a15 15 0 0 0 0 20'/%3E%3C/svg%3E");
}
.customer-drawer-stat-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}
.customer-drawer-section {
  margin-bottom: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eef0f6;
}
.customer-drawer-section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.customer-drawer-section .product-drawer-section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
}
.customer-field {
  margin-bottom: 10px;
}
.customer-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.customer-field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.customer-field-control {
  position: relative;
}
.customer-field-control .customer-field-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: no-repeat center / 16px 16px;
  opacity: 0.85;
  pointer-events: none;
}
.customer-field-control.is-textarea .customer-field-ico {
  top: 14px;
  transform: none;
}
.customer-field-control.is-user .customer-field-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}
.customer-field-control.is-phone .customer-field-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v2a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h2a2 2 0 0 1 2 1.7c.1.9.3 1.8.6 2.6a2 2 0 0 1-.5 2.1L7.1 9.9a16 16 0 0 0 6 6l1.5-1.1a2 2 0 0 1 2.1-.4c.8.3 1.7.5 2.6.6a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
}
.customer-field-control.is-email .customer-field-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z'/%3E%3Cpath d='m3.5 7.5 8.5 6 8.5-6'/%3E%3C/svg%3E");
}
.customer-field-control.is-comment .customer-field-ico {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z'/%3E%3C/svg%3E");
}
.customer-field-control input,
.customer-field-control textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px 11px 38px;
  border: 1px solid #e4e7f0;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: var(--text);
}
.customer-field-control textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.4;
}
.customer-field-control input:focus,
.customer-field-control textarea:focus {
  outline: none;
  border-color: #cfc4ff;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.12);
}
.customer-drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.customer-drawer-actions #saveCustomerBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.customer-drawer-actions .danger-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b91c1c;
  border-color: #fecaca;
}
.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: 12px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid #eef0f6; border-radius: 14px; background: #fafbff;
}
.customer-address-main {
  display: flex;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.customer-address-pin {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0ebff;
  color: var(--purple);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
.customer-address-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}
.customer-address-text .muted {
  margin-top: 4px;
  font-size: 12px;
}
.customer-address-actions { display: flex; gap: 6px; flex-shrink: 0; }
.customer-orders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
button.customer-order-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 14px 14px;
  border: 1px solid #e8eaf2;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
button.customer-order-card:hover {
  border-color: #d5daf0;
  background: #f7f8fc;
}
.customer-order-card-main {
  min-width: 0;
  flex: 1;
}
.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;
  white-space: nowrap;
}
.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;
  font-weight: 600;
  color: var(--text);
}
.customer-order-card-chevron {
  flex-shrink: 0;
  color: #9aa3b5;
  font-size: 20px;
  line-height: 1;
}
.customer-embedded-order {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.customer-embedded-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.customer-embedded-meta-card {
  padding: 12px 14px;
  border: 1px solid #eef0f6;
  border-radius: 12px;
  background: #fafbff;
}
.customer-embedded-meta-card .muted {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
}
.customer-embedded-meta-card strong {
  font-size: 14px;
  font-weight: 700;
}
.customer-embedded-vat {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}
.customer-embedded-vat strong {
  font-size: inherit;
  font-weight: 700;
  color: var(--text);
}
.customer-order-photos-wrap {
  margin: 0 0 12px;
}
.customer-order-photos-wrap.hidden {
  display: none !important;
}
.customer-order-photos-wrap .orders-photo-view-btn {
  width: auto;
}
.customer-embedded-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.customer-embedded-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #eef0f6;
  border-radius: 12px;
  background: #fff;
}
.customer-embedded-item strong {
  display: block;
  font-size: 14px;
}
.customer-embedded-item .muted {
  margin-top: 4px;
  font-size: 12px;
}
.products-table tbody tr.client-row { cursor: pointer; }
.products-table tbody tr.client-row:hover,
.products-table tbody tr.client-row.is-active { background: #faf8ff; }
@media (max-width: 980px) {
  .customer-drawer-avatar { width: 48px; height: 48px; font-size: 18px; }
  .customer-drawer-stats { grid-template-columns: 1fr; }
  .customer-field-row { grid-template-columns: 1fr; }
  .customer-embedded-meta { grid-template-columns: 1fr; }
}
.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-head { align-items: stretch; }
  .orders-page-actions { justify-content: stretch; width: 100%; margin-left: 0; }
  .orders-add-btn { width: 100%; }
  .orders-add-btn-label { flex: 1; justify-content: center; }
  .orders-search-cluster { width: 100%; }
  .orders-search-cluster .orders-search-wrap { width: auto; flex: 1 1 auto; max-width: none; }
}

.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 {
  position: relative;
  display: flex !important;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  max-width: 720px;
  margin: 0;
  font-weight: 500;
}
.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;
  appearance: none;
  background: transparent;
}
.pp-toggle-track {
  position: relative;
  display: block;
  flex: 0 0 44px;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  box-sizing: border-box;
}
.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;
}
.vat-rate-row {
  margin-top: 14px;
}
.vat-rate-row[hidden] { display: none !important; }
.vat-rate-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  max-width: 160px;
}
.vat-rate-input-wrap input {
  width: 100%;
  margin: 0;
}
.checkbox-sms-balance {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}
.checkbox-sms-balance.is-empty {
  background: #fff7ed;
  border-color: #fed7aa;
}
.checkbox-sms-balance.is-error {
  background: #fef2f2;
  border-color: #fecaca;
}
.checkbox-sms-balance.is-ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.checkbox-sms-balance-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.checkbox-sms-amount {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.checkbox-sms-balance-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  max-width: 420px;
}
.vat-rate-suffix {
  font-weight: 700;
  color: var(--muted);
}
.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 #syncWpProductsBtn,
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;
}

/* Messengers inbox */
.messengers-page-header {
  margin-bottom: 16px;
}
.messengers-connect-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.integration-platform-icon--instagram {
  background: linear-gradient(135deg, #f9a8d4, #db2777);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.integration-platform-icon--tiktok {
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.messengers-webhook-hint {
  margin: 8px 0 0;
  font-size: 12px;
  word-break: break-all;
}
.messengers-inbox {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.messengers-inbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
}
.messengers-inbox-title {
  margin: 0;
  font-size: 16px;
}
.messengers-provider-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.messengers-filter-btn {
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.messengers-filter-btn.is-active {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.messengers-inbox-split {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  min-height: 420px;
}
.messengers-conv-list {
  border-right: 1px solid #eef2f7;
  overflow: auto;
  max-height: 560px;
}
.messengers-empty {
  padding: 20px 16px;
  margin: 0;
}
.messengers-conv-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
}
.messengers-conv-item:hover,
.messengers-conv-item.is-active {
  background: #f8fafc;
}
.messengers-conv-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.messengers-provider-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 6px;
}
.messengers-unread {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #db2777;
  color: #fff;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.messengers-conv-preview {
  margin-top: 4px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.messengers-conv-time {
  margin-top: 2px;
  font-size: 12px;
}
.messengers-thread {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 12px 14px 14px;
}
.messengers-thread-empty {
  margin: auto;
}
.messengers-thread-header {
  padding-bottom: 10px;
  border-bottom: 1px solid #eef2f7;
  margin-bottom: 10px;
}
.messengers-thread-messages {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  padding-right: 4px;
}
.messengers-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
}
.messengers-bubble.is-in {
  align-self: flex-start;
  background: #f1f5f9;
}
.messengers-bubble.is-out {
  align-self: flex-end;
  background: #dbeafe;
}
.messengers-bubble-time {
  margin-top: 4px;
  font-size: 11px;
  color: #64748b;
}
.messengers-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
  align-items: end;
}
.messengers-compose textarea {
  width: 100%;
  resize: vertical;
  min-height: 64px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
}

/* Worker roles settings */
.worker-roles-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin-top: 16px;
  min-height: 420px;
}
.worker-roles-list-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.worker-roles-list {
  display: flex;
  flex-direction: column;
}
.worker-roles-card .settings-card-head .settings-btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 128px;
}
.worker-roles-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
}
.worker-roles-list-item:hover { background: rgba(0,0,0,.03); }
.worker-roles-list-item.is-active {
  background: rgba(59, 130, 246, .08);
  box-shadow: inset 3px 0 0 var(--accent, #3b82f6);
  color: var(--text);
}
.worker-roles-list-name {
  font-weight: 600;
  grid-column: 1;
  color: #17152a;
}
.worker-roles-list-badge {
  font-size: 11px;
  color: #64748b;
  grid-column: 2;
  grid-row: 1;
}
.worker-roles-list-count {
  font-size: 12px;
  grid-column: 1 / -1;
  color: var(--muted);
}
.worker-roles-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface);
  min-width: 0;
}
.worker-roles-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  text-align: center;
  padding: 24px;
}
.worker-roles-editor-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}
.worker-roles-editor-head label { display: block; margin-bottom: 6px; font-size: 13px; }
.worker-roles-editor-head input {
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.worker-roles-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.worker-role-permissions-tree {
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}
.worker-perm-category {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.worker-perm-category:last-child { border-bottom: 0; margin-bottom: 0; }
.worker-perm-category-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.worker-perm-sub { margin-bottom: 12px; }
.worker-perm-sub-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #64748b;
  margin-bottom: 8px;
}
.worker-perm-sub-rows { display: flex; flex-direction: column; gap: 6px; }
.worker-perm-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.worker-perm-row:hover { background: rgba(0,0,0,.03); }
.worker-perm-label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.worker-perm-desc { font-size: 12px; }
@media (max-width: 900px) {
  .worker-roles-layout { grid-template-columns: 1fr; }
}

