:root {
  --green: #16784b;
  --green-dark: #0f5c39;
  --green-soft: #eaf5ef;
  --ink: #18211d;
  --muted: #65716b;
  --line: #dce3df;
  --surface: #ffffff;
  --canvas: #f4f6f5;
  --amber: #a55a00;
  --amber-soft: #fff4df;
  --red: #b42318;
  --red-soft: #fff0ee;
  --blue: #155eef;
  --shadow: 0 10px 35px rgba(24, 33, 29, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.btn { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .nav-item:focus-visible { outline: 3px solid rgba(21, 94, 239, .22); outline-offset: 1px; }
.btn-primary { background: var(--green); color: white; }
.btn-secondary { border-color: var(--line); }
.btn-danger { color: var(--red); border-color: #f0c7c2; }
.btn-icon { width: 40px; padding: 0; border-color: var(--line); }
.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.input, .select, .textarea { width: 100%; min-height: 42px; border: 1px solid #cfd8d3; border-radius: 6px; background: white; padding: 9px 11px; color: var(--ink); }
.textarea { min-height: 90px; resize: vertical; }
.textarea.tall { min-height: 132px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 650; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.error-text { color: var(--red); font-size: 13px; min-height: 18px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.badge { display: inline-flex; min-height: 25px; align-items: center; padding: 2px 8px; border-radius: 999px; background: #edf1ef; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.green { color: var(--green-dark); background: var(--green-soft); }
.badge.amber { color: var(--amber); background: var(--amber-soft); }
.badge.red { color: var(--red); background: var(--red-soft); }
.empty { padding: 46px 24px; text-align: center; color: var(--muted); border: 1px dashed #cbd5d0; border-radius: 6px; background: white; }
.empty .icon { width: 32px; height: 32px; margin: 0 auto 10px; }

/* Auth */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 520px) 1fr; background: white; }
.auth-panel { padding: clamp(26px, 5vw, 72px); display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 820; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 6px; }
.auth-form { width: min(100%, 380px); margin: auto; }
.auth-form h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: 0; }
.auth-switch { margin-top: 20px; font-size: 14px; }
.link-btn { border: 0; padding: 0; color: var(--green); background: transparent; font-weight: 700; }
.auth-scene { min-height: 100vh; position: relative; overflow: hidden; background: #26312c url('/auth-universal-catalog.png') center/cover no-repeat; color: white; display: flex; align-items: flex-end; padding: clamp(32px, 6vw, 90px); }
.auth-scene::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,30,21,.15), rgba(10,30,21,.92)); }
.auth-copy { position: relative; z-index: 1; max-width: 580px; }
.auth-copy h2 { margin: 0 0 14px; font-size: clamp(34px, 4vw, 58px); line-height: 1.04; letter-spacing: 0; }
.auth-copy p { margin: 0; font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.82); }
.turnstile-widget { min-height: 65px; width: 100%; display: flex; align-items: center; }
.turnstile-widget > div, .turnstile-widget iframe { max-width: 100%; }
.turnstile-loading { min-height: 65px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; color: var(--muted); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.turnstile-loading .spinner { width: 20px; height: 20px; border-width: 2px; margin: 0; }
.turnstile-status { margin-top: -7px; color: var(--muted); font-size: 11px; }
.turnstile-status.success-text { color: var(--green); }
.oauth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.oauth-divider::before, .oauth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.oauth-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.oauth-provider { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.share-catalog { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; }
.share-catalog > img { width: 220px; height: 220px; border: 1px solid var(--line); background: #fff; padding: 8px; }
@media (max-width: 560px) { .share-catalog { grid-template-columns: 1fr; } .share-catalog > img { margin: 0 auto; } }

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; background: #14251d; color: white; display: flex; flex-direction: column; overflow: hidden; }
.sidebar .brand { padding: 0 8px 22px; }
.sidebar .brand-mark { background: white; color: var(--green-dark); }
.nav { min-height: 0; display: grid; align-content: start; gap: 4px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }
.nav-item { width: 100%; min-height: 42px; border: 0; border-radius: 6px; padding: 0 11px; background: transparent; color: #c9d7d0; display: flex; align-items: center; gap: 11px; text-align: left; font-weight: 600; }
.nav-item:hover { color: white; background: rgba(255,255,255,.07); }
.nav-item.active { color: white; background: rgba(255,255,255,.13); }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.12); }
.tenant-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { min-width: 0; }
.topbar { min-height: 68px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 20; }
.topbar-context { min-width: 0; display: grid; gap: 3px; }
.topbar-title { font-size: 18px; font-weight: 780; }
.topbar-meta { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar-meta > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar-meta > * + *::before { content: '·'; margin-right: 8px; color: #9aa8a1; }
.topbar-meta strong { max-width: 260px; color: var(--ink); }
.topbar-actions { flex: none; }
.main-content { padding: 28px; max-width: 1500px; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 5px; font-size: 26px; letter-spacing: 0; }
.page-head p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { margin-top: 8px; font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; }
.panel { border: 1px solid var(--line); border-radius: 6px; background: white; overflow: hidden; }
.panel-head { min-height: 58px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.toolbar { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.selection-line { min-height: 42px; margin-bottom: 10px; padding: 8px 12px; border: 1px solid var(--line); background: white; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pagination { min-height: 58px; padding: 10px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; }
.search { position: relative; flex: 1; max-width: 460px; }
.search .icon { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search .input { padding-left: 40px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { height: 43px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #f8faf9; color: var(--muted); text-align: left; font-size: 12px; font-weight: 750; white-space: nowrap; }
td { min-height: 54px; padding: 11px 14px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 240px; }
.product-thumb { width: 44px; height: 44px; padding: 3px; border-radius: 5px; object-fit: contain; background: #f7f9f8; flex: none; }
.product-title { font-weight: 700; }
.sku { color: var(--muted); font-size: 12px; margin-top: 3px; }
.status-select { min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 4px 7px; background: white; }
.import-zone { width: 100%; min-height: 168px; margin-bottom: 18px; padding: 30px 22px; border: 2px dashed #bfcac4; border-radius: 6px; background: white; text-align: center; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 5px; }
.import-zone.drag { border-color: var(--green); background: var(--green-soft); }
.import-zone .icon { width: 34px; height: 34px; color: var(--green); margin: 0 0 6px; }
.import-zone input { display: none; }
.import-result { padding: 14px 16px; background: var(--green-soft); color: var(--green-dark); border-radius: 6px; }
.two-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.settings-form { padding: 18px; }
.audit-list { display: grid; }
.audit-item { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.category-item { min-height: 150px; padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: white; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; position: relative; }
.category-check { position: absolute; top: 13px; right: 13px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: white; }
.category-check input { width: 17px; height: 17px; accent-color: var(--green); }
.category-item h3 { margin: 14px 0 3px; font-size: 16px; }
.category-item p { margin: 0; color: var(--muted); font-size: 13px; }
.category-icon { width: 38px; height: 38px; border-radius: 6px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.image-upload-row { display: flex; align-items: flex-start; gap: 14px; }
.upload-preview { width: 118px; height: 96px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; flex: none; }
.logo-preview { width: 96px; height: 64px; padding: 5px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: white; flex: none; }
.import-options { margin-bottom: 14px; padding: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.import-mapping { margin-bottom: 14px; }
.mapping-grid { padding: 16px; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; }
.switch-row { min-height: 56px; display: flex; align-items: center; gap: 11px; }
.switch-row input { width: 19px; height: 19px; accent-color: var(--green); }
.switch-row span { display: grid; gap: 3px; }
.catalog-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.catalog-fields .switch-row { min-height: 42px; }
.catalog-fields .required-setting { grid-column: 1 / -1; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.switch-row small { color: var(--muted); }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 18px; align-items: start; }
.palette-list { display: flex; flex-wrap: wrap; gap: 9px; }
.palette { width: 64px; height: 38px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: white; display: flex; overflow: hidden; }
.palette:hover { border-color: var(--ink); }
.palette i { flex: 1; height: 100%; background: var(--c); }
.color-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.color-grid label { color: var(--muted); font-size: 11px; text-align: center; }
.color-grid input { display: block; width: 100%; height: 38px; margin-top: 5px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.catalog-preview { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; color: var(--p-text); background: var(--p-bg); }
.preview-head { height: 46px; padding: 0 12px; background: var(--p-surface); display: flex; align-items: center; justify-content: space-between; font-weight: 750; }
.preview-head b { padding: 6px 9px; border-radius: 4px; background: var(--p-accent); color: white; font-size: 11px; }
.preview-body { margin: 12px; padding: 13px; background: var(--p-surface); border-radius: 5px; display: grid; gap: 7px; }
.preview-body small { color: var(--p-accent); font-weight: 800; }
.preview-body span { color: var(--muted); font-size: 11px; }
.preview-body div { display: flex; align-items: center; justify-content: space-between; }
.preview-body button { border: 0; border-radius: 4px; padding: 6px 9px; background: var(--p-accent); color: white; font-size: 11px; }

/* Catalog */
.catalog-page { min-height: 100vh; background: var(--canvas); padding-bottom: 90px; overflow-x: clip; }
.catalog-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.catalog-header-inner { max-width: 1320px; min-height: 64px; margin: 0 auto; padding: 8px 22px; display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.4fr) auto; align-items: center; gap: 18px; }
.catalog-page .input, .catalog-page .select, .catalog-page .btn-secondary { background: var(--surface); color: var(--ink); }
.catalog-page .panel { background: var(--surface); }
.catalog-brand-name { min-width: 0; font-size: 18px; font-weight: 820; overflow: hidden; display: flex; align-items: center; gap: 10px; }
.catalog-brand-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-logo { width: 42px; height: 42px; object-fit: contain; flex: none; }
.cart-btn { position: relative; }
.cart-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; background: white; color: var(--green); font-size: 11px; font-weight: 800; }
.catalog-inner { width: 100%; max-width: 1320px; min-width: 0; margin: 0 auto; padding: 25px 22px; }
#catalog-products, .catalog-table { min-width: 0; max-width: 100%; }
.catalog-table .table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.catalog-info { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.catalog-info h1 { margin: 0 0 5px; font-size: 26px; letter-spacing: 0; }
.catalog-info p { margin: 0; color: var(--muted); }
.catalog-notice { max-width: 760px; margin-top: 12px; padding-left: 12px; border-left: 3px solid var(--green); color: var(--ink); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.catalog-actions { display: flex; align-items: flex-end; gap: 12px; flex-direction: column; }
.category-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 3px 0 9px; margin-bottom: 12px; scrollbar-width: thin; }
.mobile-category-picker { display: none; margin-bottom: 14px; }
.mobile-category-picker label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.category-btn { min-height: 34px; border: 1px solid transparent; border-radius: 5px; padding: 0 11px; background: transparent; white-space: nowrap; color: var(--muted); font-weight: 650; }
.category-btn:hover { background: color-mix(in srgb, var(--surface) 75%, transparent); border-color: var(--line); }
.category-btn.active { background: var(--surface); color: var(--green); border-color: var(--line); box-shadow: inset 0 -2px var(--green); }
.category-btn.category-more { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, white); }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.segmented button { width: 35px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.segmented button.active { background: #edf1ef; color: var(--ink); }
.products-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.products-grid.no-images .product-card h3 { min-height: 42px; margin-top: 10px; }
.product-card { min-width: 0; border: 1px solid color-mix(in srgb, var(--line) 82%, transparent); border-radius: 6px; background: var(--surface); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease, transform .15s ease; }
.product-card:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); transform: translateY(-1px); }
.product-card-image { aspect-ratio: 4 / 3; width: 100%; object-fit: contain; padding: 10px; background: color-mix(in srgb, var(--canvas) 60%, var(--surface)); }
.product-card > .image-placeholder { aspect-ratio: 4 / 3; width: 100%; }
.image-service-upload { position: relative; width: max-content; }
.image-placeholder { aspect-ratio: 4/3; display: grid; place-items: center; background: #edf1ef; color: #8b9891; }
.image-placeholder .icon { width: 35px; height: 35px; }
.product-card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { margin: 8px 0 5px; font-size: 15px; line-height: 1.35; min-height: 41px; }
.product-description { color: var(--muted); font-size: 12px; line-height: 1.45; }
.product-card .product-description { margin: 0 0 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.price-basis { margin-top: 2px; color: var(--muted); font-size: 11px; }
.wholesale-tiers { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.wholesale-tiers span { padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--green-dark); background: color-mix(in srgb, var(--canvas) 70%, var(--surface)); font-size: 10px; font-weight: 700; }
.price-tier-list { display: grid; gap: 8px; margin-top: 8px; }
.price-tier-row { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 8px; }
.rate-list { display: flex; gap: 8px; flex-wrap: wrap; }
.rate-list span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: #f8faf9; font-size: 12px; }
.report-period { width: 150px; }
.compact-head { padding-inline: 0; margin-top: 12px; }
.dashboard-grid.platform-overview { grid-template-columns: minmax(0,1fr); }
.platform-integrations { width: min(100%, 1040px); margin: 0 auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; }
.platform-integrations > .hint, .platform-integrations > .row, .platform-integrations > .switch-row, .platform-integrations > .error-text, .platform-integrations > button, .platform-integrations > .compact-head, .platform-integrations > .form-grid { grid-column: 1 / -1; }
.product-card-foot { margin-top: auto; padding-top: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.product-price { font-size: 18px; font-weight: 820; }
.stock { margin-top: 3px; color: var(--green-dark); font-size: 12px; }
.stock.out { color: var(--red); }
.pick-list-document { border: 1px solid var(--border); background: #fff; padding: 18px; }
.pick-list-title { display: grid; gap: 3px; padding-bottom: 14px; border-bottom: 2px solid var(--green); margin-bottom: 14px; }
.pick-list-title span { color: var(--green); font-size: 11px; font-weight: 800; }
.pick-list-title strong { font-size: 22px; }
.pick-list-title small { color: var(--muted); }
.pick-list-document .pick-row { border-bottom: 1px solid var(--border); padding-block: 10px; }
.pick-list-document .cart-total { margin-top: 16px; }
.qty-control { height: 36px; display: grid; grid-template-columns: 34px 42px 34px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.qty-control button { border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; }
.qty-control button:disabled { color: #a9b3ae; background: #f3f5f4; }
.qty-control span { display: grid; place-items: center; border-inline: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.catalog-table .qty-control { display: inline-grid; }
.mobile-cart-bar { display: none; position: fixed; z-index: 25; left: 12px; right: 12px; bottom: 12px; min-height: 56px; padding: 8px 14px; border: 0; border-radius: 7px; background: var(--green); color: white; box-shadow: var(--shadow); align-items: center; justify-content: space-between; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 16px; margin-bottom: 18px; align-items: stretch; }
.chart-bars { min-height: 190px; padding: 20px 16px 12px; display: flex; align-items: flex-end; gap: 7px; }
.chart-column { flex: 1; min-width: 14px; height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.chart-bar { width: min(100%, 28px); min-height: 3px; background: var(--green); border-radius: 3px 3px 0 0; }
.chart-column small, .chart-value { color: var(--muted); font-size: 10px; }
.rank-list { display: grid; }
.rank-row { min-height: 61px; padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 10px; align-items: center; }
.rank-row:last-child { border-bottom: 0; }
.contact-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.catalog-footer { margin-top: 28px; padding: 20px 0 70px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
.cookie-notice { position: fixed; z-index: 40; left: 18px; right: 18px; bottom: 18px; max-width: 920px; margin: 0 auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; }
.cookie-notice p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.legal-text { display: grid; gap: 8px; line-height: 1.55; }
.legal-text h3 { margin: 8px 0 0; font-size: 15px; }
.legal-text p { margin: 0; color: var(--muted); }
.legal-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; }
.consent-row input { margin-top: 3px; }
.legal-inline { padding: 10px 12px; border-left: 3px solid var(--green); background: var(--green-soft); color: var(--muted); font-size: 12px; line-height: 1.5; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.address-picker { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.pickup-map-panel { margin-top: 10px; }
.pickup-map { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #eef2f0; }
.status-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; }
.status-summary > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-downloads { margin-bottom: 18px; }
.funnel-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.funnel-row > div { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9f8; display: grid; gap: 3px; }
.funnel-row strong { font-size: 22px; }
.funnel-row span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 14px; }
.permission-grid .switch-row { min-height: 42px; }
.access-summary { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; max-width: 300px; }
.compact-stats .stat-value { font-size: 24px; }
.order-logistics { padding: 13px; border: 1px solid var(--line); background: #f8faf9; display: grid; gap: 5px; }
.payment-result { margin-top: 18px; padding: 14px; border: 1px solid var(--line); background: #f8faf9; text-align: left; display: grid; gap: 7px; white-space: pre-line; }
.payment-result small { color: var(--muted); }

/* Modal & cart */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 20px; background: rgba(17, 28, 23, .56); display: grid; place-items: center; }
.modal { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 7px; background: white; box-shadow: var(--shadow); }
.modal.wide { width: min(880px, 100%); }
.modal-head { min-height: 62px; padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; background: white; z-index: 2; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 18px; }
.modal-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.cart-tools { margin-bottom: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cart-line-total { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cart-line:last-child { border-bottom: 0; }
.picker-summary { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); background: #f7f9f8; display: flex; justify-content: space-between; gap: 12px; }
.pick-row { grid-template-columns: auto minmax(0,1fr) auto; }
.pick-check { width: 34px; height: 34px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; font-weight: 800; }
.pick-check input { position: absolute; opacity: 0; }
.pick-row.picked { opacity: .5; text-decoration: line-through; background: #f4f6f5; }
.pick-row.picked .pick-check { background: var(--green); color: white; }
.cart-total { margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--ink); display: grid; gap: 8px; }
.total-main { font-size: 20px; font-weight: 820; }
.success { padding: 20px 0; text-align: center; }
.success-mark { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); border-radius: 50%; }
.success-mark .icon { width: 30px; height: 30px; }
.toasts { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 9px; }
.toast { width: min(360px, calc(100vw - 36px)); padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; background: white; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 1050px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-cols { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-scene { display: none; }
  .admin-shell { grid-template-columns: 1fr; padding-bottom: 66px; }
  .sidebar { position: fixed; z-index: 50; inset: auto 0 0; width: 100%; height: 64px; padding: 7px; display: block; border-top: 1px solid rgba(255,255,255,.14); }
  .sidebar .brand, .sidebar-foot { display: none; }
  .nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .nav-item { width: 64px; min-width: 64px; height: 50px; min-height: 50px; justify-content: center; padding: 0; }
  .nav-item span { display: none; }
  .nav-item .icon { width: 21px; height: 21px; }
  .topbar { padding: 0 16px; }
  .topbar-meta span:first-of-type { display: none; }
  .main-content { padding: 20px 14px; }
  .catalog-header-inner { grid-template-columns: 1fr auto; padding: 9px 14px; }
  .catalog-header .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .catalog-inner { padding: 18px 14px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .import-options { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .catalog-table { display: block; }
  .category-tabs { display: none; }
  .mobile-category-picker { display: block; }
  .mobile-cart-bar.show { display: flex; }
  .platform-integrations { grid-template-columns: 1fr; }
  .platform-integrations > * { grid-column: 1 !important; }
}
@media (max-width: 520px) {
  .auth-panel { padding: 22px; }
  .auth-form h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 13px; }
  .stat-value { font-size: 20px; }
  .page-head.row-between { align-items: flex-start; }
  .page-head .btn span { display: none; }
  .topbar-actions .btn span { display: none; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .product-card-body { padding: 11px; }
  .product-card h3 { font-size: 14px; }
  .product-card-foot { align-items: stretch; flex-direction: column; }
  .qty-control { width: 100%; grid-template-columns: 1fr 42px 1fr; }
  .catalog-info { align-items: flex-start; flex-direction: column; }
  .catalog-actions { width: 100%; align-items: flex-start; }
  .catalog-actions > .row { width: 100%; flex-wrap: wrap; }
  .catalog-actions > .row .btn { flex: 1 1 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .price-tier-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 38px; }
  .category-grid { grid-template-columns: 1fr; }
  .image-upload-row { flex-direction: column; }
  .upload-preview { width: 100%; height: 150px; }
  .color-grid { grid-template-columns: repeat(3, 1fr); }
  .mapping-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 7px 7px 0 0; }
  .cart-line { grid-template-columns: 1fr auto; }
  .cart-line .money { grid-column: 2; }
  .cookie-notice { left: 8px; right: 8px; bottom: 8px; grid-template-columns: 1fr auto; }
  .cookie-notice > div { grid-column: 1 / -1; }
  .catalog-footer { flex-direction: column; }
  .address-picker { grid-template-columns: 1fr; }
  .status-summary { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 1fr 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .legal-links { grid-template-columns: 1fr; }
}

@media print {
  body * { visibility: hidden !important; }
  .modal, .modal * { visibility: visible !important; }
  .modal { position: absolute; inset: 0; width: 100%; max-height: none; box-shadow: none; }
  .modal-head button, .modal-foot, .contact-actions, .field { display: none !important; }
  .pick-list-document { border: 0; padding: 0; }
  .two-cols { display: block !important; }
  .two-cols > .stack { display: none !important; }
}
