:root {
  --navy: #17384f;
  --navy-dark: #102b3e;
  --accent: #167c68;
  --accent-light: #e6f4f0;
  --blue: #2f6fed;
  --surface: #ffffff;
  --background: #f3f5f7;
  --text: #1c2933;
  --muted: #6c7a86;
  --border: #e1e7eb;
  --danger: #b5443c;
  --danger-light: #fbeceb;
  --warning: #9a6717;
  --warning-light: #fff5df;
  --shadow: 0 8px 30px rgba(21, 44, 59, 0.06);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; color: var(--text); font-family: "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(25px, 3vw, 32px); line-height: 1.2; letter-spacing: -.03em; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.3; }
h3 { margin-bottom: 6px; font-size: 16px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.eyebrow { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-note { margin: 16px 2px 10px; color: var(--muted); font-size: 13px; }
.notice { padding: 12px 14px; border: 1px solid #e8d8ac; border-radius: 12px; background: var(--warning-light); color: #72511a; font-size: 13px; }

.button { min-height: 42px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 650; transition: background .15s, transform .15s; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { background: #116a58; }
.button.secondary { border-color: var(--border); background: white; color: var(--navy); }
.button.secondary:hover { background: #f7f9fa; }
.button.danger { border-color: #efc9c5; background: white; color: var(--danger); }
.button.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.button.full { width: 100%; }
.text-button { padding: 4px; border: 0; background: transparent; color: var(--accent); font-weight: 600; }
.icon-button { min-height: 40px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px; background: white; color: var(--navy); }

label { display: grid; gap: 6px; color: #40515d; font-size: 13px; font-weight: 600; }
label small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cfd9df; border-radius: 9px; outline: none; background: white; color: var(--text); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 124, 104, .12); }
input[type="file"] { padding: 12px; border-style: dashed; background: #f8fafb; }
.stack-form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-error { margin: 16px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--danger-light); color: var(--danger); font-size: 13px; }

.auth-shell { min-height: 100vh; padding: 40px 20px; background: linear-gradient(145deg, var(--navy-dark) 0, var(--navy) 43%, #edf3f2 43%, #edf3f2 100%); }
.auth-brand { display: flex; align-items: center; gap: 12px; max-width: 420px; margin: 0 auto 28px; color: white; }
.auth-brand div, .sidebar-brand div { display: grid; }
.auth-brand span:not(.brand-mark), .sidebar-brand span:not(.brand-mark) { color: #b8cbd5; font-size: 12px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; background: var(--accent); color: white; font-size: 13px; font-weight: 800; letter-spacing: .03em; }
.auth-card { max-width: 420px; margin: 0 auto; padding: 32px; border-radius: 20px; background: white; box-shadow: 0 24px 70px rgba(5, 25, 37, .22); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card .stack-form { margin-top: 24px; }
.auth-footnote { max-width: 420px; margin: 22px auto 0; color: #627985; font-size: 12px; text-align: center; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 246px; padding: 24px 16px 18px; flex-direction: column; background: var(--navy-dark); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 27px; }
.sidebar-brand strong { font-size: 15px; }
.side-nav { display: grid; gap: 5px; }
.nav-item { display: flex; min-height: 44px; padding: 10px 12px; align-items: center; gap: 12px; border: 0; border-radius: 10px; background: transparent; color: #b8cbd5; text-align: left; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: white; }
.nav-item.active { background: rgba(65, 183, 157, .16); color: #8ee0cb; }
.nav-symbol { width: 23px; color: #6e8b9a; font-size: 10px; font-weight: 700; }
.sidebar-future { display: grid; gap: 7px; margin: 28px 10px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .09); color: #718d9c; font-size: 12px; }
.sidebar-future .eyebrow { color: #718d9c; }
.sidebar-user { display: flex; margin-top: auto; padding: 15px 10px 0; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .09); color: #c3d3dc; font-size: 12px; }
.sidebar-user .text-button { color: #8ee0cb; }
.main-content { min-height: 100vh; margin-left: 246px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 104px; padding: 22px 32px; align-items: center; gap: 18px; border-bottom: 1px solid rgba(220, 228, 232, .85); background: rgba(243, 245, 247, .94); backdrop-filter: blur(12px); }
.page-heading { flex: 1; }
.page-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.dataset-badge { display: inline-flex; min-height: 29px; padding: 5px 10px; align-items: center; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.dataset-badge.demo { background: var(--warning-light); color: var(--warning); }
.dataset-badge.real { background: var(--accent-light); color: var(--accent); }
.content { max-width: 1540px; margin: 0 auto; padding: 26px 32px 42px; }
.view { display: none; }
.view.active { display: block; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.panel { margin-bottom: 20px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; margin-bottom: 18px; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 0; }
.filters-panel, .toolbar { display: flex; align-items: end; gap: 12px; }
.filters-panel label { min-width: 150px; }
.filters-panel label:first-child { min-width: 190px; }
.toolbar { flex-wrap: wrap; }
.toolbar .search-field { flex: 1; min-width: 180px; }
.toolbar label:not(.search-field) { min-width: 190px; }

.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { display: grid; min-height: 133px; padding: 19px; align-content: space-between; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.kpi-card.accent { border-color: #b9dcd2; background: linear-gradient(145deg, #fff, #f0f9f6); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-card strong { margin: 10px 0 6px; font-size: clamp(21px, 2vw, 28px); line-height: 1.1; letter-spacing: -.035em; }
.kpi-card small { color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr); gap: 20px; }
.chart-panel { min-width: 0; }
.legend { color: var(--accent); font-size: 12px; }
.legend::before { content: ""; display: inline-block; width: 16px; height: 3px; margin: 0 6px 3px 0; border-radius: 2px; background: var(--accent); }
.sales-chart { min-height: 250px; }
.sales-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #e7edef; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.chart-area { fill: url(#chart-fill); }
.chart-label { fill: #758590; font-size: 11px; }
.chart-empty { display: grid; min-height: 220px; place-items: center; color: var(--muted); }
.marketplace-summary { display: grid; gap: 12px; }
.marketplace-row { padding: 13px 0; border-bottom: 1px solid var(--border); }
.marketplace-row:last-child { border-bottom: 0; }
.marketplace-row header { display: flex; margin-bottom: 8px; align-items: center; justify-content: space-between; }
.marketplace-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.marketplace-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.marketplace-dot.ozon { background: #2f6fed; }
.marketplace-dot.wildberries { background: #a443c4; }
.marketplace-dot.yandex { background: #e6b32c; }
.marketplace-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; color: var(--muted); font-size: 12px; }
.marketplace-stats strong { color: var(--text); font-weight: 650; }
.attention-list { display: grid; gap: 10px; }
.attention-item { display: flex; padding: 13px 14px; align-items: flex-start; gap: 12px; border-radius: 11px; background: #f7f9fa; }
.attention-item.high { background: var(--danger-light); }
.attention-item.medium { background: var(--warning-light); }
.attention-marker { width: 8px; height: 8px; margin-top: 7px; flex: 0 0 8px; border-radius: 50%; background: var(--warning); }
.attention-item.high .attention-marker { background: var(--danger); }
.attention-item p { margin: 0; color: var(--muted); font-size: 13px; }
.attention-item strong { display: block; margin-bottom: 2px; font-size: 14px; }
.empty-state { padding: 26px 16px; color: var(--muted); text-align: center; }

.table-panel { padding: 0; overflow: hidden; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f8fafb; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid #edf1f3; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfc; }
#products-table tr.product-return-highlight > td,
#products-cards .product-return-highlight { background: #eef0ff; }
#products-table tr.product-return-highlight > td:first-child,
#products-cards .product-return-highlight { box-shadow: inset 4px 0 0 var(--accent); }
.product-name { display: grid; min-width: 210px; }
.product-name strong { font-size: 14px; }
.product-name small, .cell-note { color: var(--muted); font-size: 11px; }
.number-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #eef2f4; color: #526571; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status.committed, .status.approved { background: var(--accent-light); color: var(--accent); }
.status.failed, .status.rejected { background: var(--danger-light); color: var(--danger); }
.status.preview, .status.pending { background: var(--warning-light); color: var(--warning); }
.product-cards { display: none; }

.import-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; }
.import-help ol { margin: 18px 0; padding-left: 22px; color: var(--muted); }
.import-help li { margin-bottom: 10px; }
.mapping-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.mapping-grid label { font-size: 12px; }
.preview-table { margin: 18px 0; border: 1px solid var(--border); border-radius: 10px; }
.import-result { display: flex; margin-bottom: 14px; align-items: center; justify-content: space-between; gap: 12px; }
.import-errors { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--danger-light); color: var(--danger); font-size: 13px; }
.import-errors ul { max-height: 180px; margin: 8px 0 0; padding-left: 20px; overflow-y: auto; }

.changes-list { display: grid; gap: 12px; }
.change-card { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(160px, 1fr) minmax(140px, .8fr) auto; gap: 16px; padding: 17px 19px; align-items: center; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: var(--shadow); }
.change-card h3 { margin: 0 0 3px; }
.change-card p { margin: 0; color: var(--muted); font-size: 12px; }
.change-values { font-size: 16px; font-weight: 700; white-space: nowrap; }
.change-values span { padding: 0 8px; color: var(--muted); font-weight: 400; }
.change-actions { display: flex; gap: 8px; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.integration-card { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.integration-card .marketplace-name { margin-bottom: 16px; font-size: 18px; }
.integration-card p { color: var(--muted); font-size: 13px; }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: grid; padding: 20px; place-items: center; background: rgba(8, 28, 40, .55); backdrop-filter: blur(3px); }
.modal { position: relative; display: grid; width: min(100%, 480px); max-height: calc(100vh - 40px); padding: 26px; gap: 15px; overflow-y: auto; border-radius: 18px; background: white; box-shadow: 0 24px 80px rgba(0, 0, 0, .25); }
.modal-close { position: absolute; top: 14px; right: 16px; }
.current-value { margin: 0; padding: 11px 13px; border-radius: 9px; background: #f3f6f7; color: var(--muted); }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 17px; border-radius: 11px; background: var(--navy-dark); color: white; box-shadow: 0 12px 40px rgba(0, 0, 0, .22); }
.toast.error { background: var(--danger); }
.mobile-only, .mobile-nav { display: none; }
#warehouse-mobile-product { display: none; }
.sidebar-overlay { position: fixed; z-index: 25; inset: 0; background: rgba(8, 28, 40, .45); }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .change-card { grid-template-columns: 1.3fr 1fr auto; }
  .change-card > div:nth-child(3) { display: none; }
}

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
  .content, .topbar { padding-right: 20px; padding-left: 20px; }
  .import-layout, .integration-grid { grid-template-columns: 1fr; }
  .mapping-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .change-card { grid-template-columns: 1fr 1fr; }
  .change-actions { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .sidebar { width: 246px; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-only { display: inline-flex; }
  .mobile-nav { position: fixed; z-index: 22; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); }
  .mobile-nav button { min-height: 44px; padding: 6px 3px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; }
  .mobile-nav button.active { background: var(--accent-light); color: var(--accent); }
  body:has(#warehouse-mobile-product:not([hidden])) { overflow-x: clip; }
  .topbar:has(#warehouse-mobile-product:not([hidden])) { flex-wrap: wrap; }
  #warehouse-mobile-product {
    display: grid;
    flex: 0 0 100%;
    gap: 5px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 12px;
    overflow-wrap: anywhere;
  }
  #warehouse-mobile-product strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    line-height: 1.3;
    font-size: 13px;
  }
  .warehouse-mobile-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 8px;
    color: var(--muted);
    font-size: 11px;
  }
  .warehouse-mobile-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
  }
  .warehouse-mobile-metrics > div {
    padding: 5px 6px;
    border-radius: 6px;
    background: #f3f5f8;
  }
  .warehouse-mobile-metrics dt { color: var(--muted); font-size: 11px; }
  .warehouse-mobile-metrics dd {
    margin: 2px 0 0;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }
  .warehouse-mobile-metrics > .warehouse-mobile-metric-total {
    background: var(--accent-light);
    color: var(--accent);
  }
  #view-warehouses:has(#warehouse-back-to-product:not([hidden])) {
    padding-bottom: 54px;
  }
  #warehouse-back-to-product {
    position: fixed;
    z-index: 21;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(65px + env(safe-area-inset-bottom));
    min-height: 44px;
    box-shadow: var(--shadow);
  }
  .topbar { min-height: 90px; padding-top: 16px; padding-bottom: 16px; align-items: flex-start; }
  .topbar .page-heading .eyebrow { display: none; }
  .topbar h1 { font-size: 24px; }
  .topbar #menu-button { margin-top: 1px; }
  .content { padding: 18px 14px 92px; }
  .panel { margin-bottom: 14px; padding: 16px; border-radius: 14px; }
  .filters-panel, .toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .filters-panel label, .filters-panel label:first-child, .toolbar label:not(.search-field) { min-width: 0; }
  .filters-panel label:first-child, .toolbar .search-field { grid-column: 1 / -1; }
  .filters-panel .button, .toolbar .button { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .kpi-card { min-height: 118px; padding: 15px; }
  .kpi-card:last-child { grid-column: 1 / -1; min-height: 100px; }
  .kpi-card strong { font-size: 22px; }
  .dashboard-grid { gap: 14px; }
  .sales-chart { min-height: 210px; }
  .desktop-products { display: none; }
  .product-cards { display: grid; gap: 12px; }
  .product-card { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: white; box-shadow: var(--shadow); }
  .product-card header { display: flex; margin-bottom: 12px; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .product-card h3 { margin: 0; }
  .product-card .sku { color: var(--muted); font-size: 11px; }
  .product-card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
  .product-card-stats div { display: grid; }
  .product-card-stats span { color: var(--muted); font-size: 11px; }
  .product-card-stats strong { font-size: 15px; }
  .product-card .button { width: 100%; }
  .mapping-grid { grid-template-columns: 1fr; }
  .change-card { grid-template-columns: 1fr; gap: 10px; }
  .change-card > div:nth-child(3) { display: block; }
  .change-actions { grid-column: auto; }
  .change-actions .button { flex: 1; }
  .toast { right: 16px; bottom: 76px; left: 16px; }
}

@media (max-width: 480px) {
  .auth-shell { padding: 22px 14px; background: linear-gradient(160deg, var(--navy-dark) 0, var(--navy) 32%, #edf3f2 32%, #edf3f2 100%); }
  .auth-brand { margin-bottom: 20px; }
  .auth-card { padding: 23px 19px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .dataset-badge { padding: 4px 8px; font-size: 10px; }
  .topbar { gap: 10px; }
  .topbar #page-subtitle { font-size: 11px; }
  .kpi-card small { font-size: 10px; }
  .panel-heading { margin-bottom: 14px; }
  .import-result { align-items: flex-start; flex-direction: column; }
}

:root {
  --accent: #4f5eea;
  --accent-light: #edf0ff;
  --background: #f7f8fa;
  --border: #e2e6eb;
  --shadow: none;
  --radius: 10px;
}

body { font-size: 14px; }
.button { min-height: 36px; padding: 8px 14px; border-radius: 8px; }
.button.primary { background: var(--accent); }
.button.primary:hover { background: #414fd4; }
input, select, textarea { min-height: 36px; padding: 7px 10px; border-radius: 7px; font-size: 12px; }
.panel { margin-bottom: 16px; padding: 16px; border-radius: 10px; }
.topbar { min-height: 64px; height: 64px; padding: 0 24px; gap: 22px; border-bottom: 1px solid var(--border); background: #fff; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 9px; font-size: 11px; }
.topbar-brand div { display: grid; }
.topbar-brand strong { font-size: 15px; line-height: 1.2; }
.topbar-brand span:not(.brand-mark) { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
#logout-top { color: var(--muted); font-size: 12px; }
.page-heading { display: flex; align-items: center; gap: 12px; }
.page-heading h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.page-heading .eyebrow { display: none; }
.page-heading p:last-child { font-size: 12px; }
.sidebar { top: 64px; width: 64px; padding: 12px 8px; border-right: 1px solid var(--border); background: #fff; }
.sidebar-brand, .sidebar-future, .sidebar-user { display: none; }
.side-nav { gap: 10px; }
.nav-item { min-height: 42px; height: 42px; padding: 0; justify-content: center; border-radius: 9px; color: #687986; }
.nav-item:hover { background: #f2f5f7; color: var(--accent); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-label { display: none; }
.nav-symbol { width: auto; color: inherit; font-size: 11px; }
.main-content { margin-left: 64px; }
.content { padding: 18px 24px 36px; }
.filters-panel { position: sticky; z-index: 15; top: 64px; padding: 12px 16px; }
.kpi-grid { gap: 12px; margin-bottom: 16px; }
.kpi-card { min-height: 104px; padding: 14px; border: 0; border-radius: 10px; background: #edf0f3; }
.kpi-card.accent { border: 0; background: #e9edf7; }
.kpi-card strong { margin: 8px 0 4px; font-size: 24px; }
.kpi-card small { font-size: 10px; }
th { padding: 10px 12px; background: #f4f6f8; font-size: 10px; }
td { padding: 11px 12px; font-size: 12px; }
.marketplace-row { padding: 10px 0; }
.product-card { box-shadow: none; }
.change-card, .integration-card { box-shadow: none; }

@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .main-content { margin-left: 56px; }
  .topbar { gap: 14px; padding: 0 16px; }
  .topbar-brand strong { font-size: 13px; }
  .page-heading p:last-child { display: none; }
  .content { padding: 16px; }
}

@media (max-width: 760px) {
  .sidebar { top: 0; width: 246px; padding: 24px 16px 18px; border-right: 0; background: var(--navy-dark); }
  .sidebar-brand { display: flex; }
  .sidebar-future { display: grid; }
  .sidebar-user { display: flex; }
  .side-nav { gap: 5px; }
  .nav-item { height: auto; min-height: 44px; padding: 10px 12px; justify-content: flex-start; gap: 12px; color: #b8cbd5; }
  .nav-item:hover { background: rgba(255, 255, 255, .06); color: white; }
  .nav-item.active { background: rgba(65, 183, 157, .16); color: #8ee0cb; }
  .nav-label { display: inline; }
  .nav-symbol { width: 23px; }
  .main-content { margin-left: 0; }
  .topbar { min-height: 76px; height: auto; padding: 14px; gap: 12px; background: rgba(247, 248, 250, .96); }
  .topbar-brand { display: none; }
  .topbar-actions { gap: 8px; }
  #logout-top { display: none; }
  .page-heading { display: block; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p:last-child { display: block; margin-top: 3px; }
  .content { padding: 16px 14px 92px; }
  .filters-panel { position: static; padding: 16px; }
  .panel { margin-bottom: 14px; padding: 16px; }
  .kpi-grid { gap: 10px; }
  .kpi-card, .kpi-card:last-child { min-height: 100px; padding: 14px; }
  .kpi-card strong { font-size: 21px; }
}

.sidebar { width: 230px; padding: 18px 12px; }
.main-content { margin-left: 230px; }
.side-nav { gap: 20px; }
.nav-group { display: grid; gap: 5px; }
.nav-group-toggle { display: grid; grid-template-columns: 20px minmax(0, 1fr) 12px; min-height: 34px; padding: 5px 7px; align-items: center; gap: 9px; border: 0; border-radius: 7px; background: transparent; color: #536672; text-align: left; }
.nav-group-toggle:hover { background: #f3f5f7; color: var(--accent); }
.nav-group-toggle > span:nth-child(2) { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-icon { display: inline-flex; width: 18px; height: 18px; }
.nav-group-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.nav-group-icon.blue { color: #5577e8; }
.nav-group-icon.purple { color: #8c62d8; }
.nav-group-icon.green { color: #3d9b83; }
.nav-chevron { width: 7px; height: 7px; border-right: 1.5px solid #83929b; border-bottom: 1.5px solid #83929b; transform: rotate(225deg); transition: transform .15s; }
.nav-group.collapsed .nav-chevron { transform: rotate(45deg); }
.nav-group-children { position: relative; display: grid; gap: 2px; padding-left: 10px; }
.nav-group-children::before { content: ""; position: absolute; top: 3px; bottom: 3px; left: 6px; width: 1px; background: #e0e5e9; }
.nav-group.collapsed .nav-group-children { display: none; }
.nav-item { position: relative; min-height: 36px; height: auto; padding: 8px 10px 8px 16px; justify-content: flex-start; border-radius: 7px; color: #5f6f7b; font-size: 12px; text-align: left; }
.nav-item:hover { background: #f3f5f8; color: var(--accent); }
.nav-item.active { background: var(--accent-light); color: var(--accent); }
.nav-item.active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 2px; width: 3px; border-radius: 2px; background: var(--accent); }
.nav-label { display: inline; }
.nav-item.future-item { justify-content: space-between; cursor: default; opacity: .55; }
.future-item small { font-size: 9px; text-transform: uppercase; }

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .main-content { margin-left: 220px; }
}

@media (max-width: 760px) {
  .sidebar { width: 246px; padding: 24px 16px 18px; }
  .main-content { margin-left: 0; }
  .nav-group-toggle { min-height: 40px; color: #d0dfe7; }
  .nav-group-toggle:hover { background: rgba(255, 255, 255, .06); color: white; }
  .nav-chevron { border-color: #91a8b5; }
  .nav-group-children::before { background: rgba(255, 255, 255, .12); }
  .nav-item { min-height: 40px; padding: 9px 12px 9px 16px; font-size: 13px; }
  .nav-item.active::before { background: #8ee0cb; }
}

.nav-group-icon.orange { color: #d88432; }
.nav-group-icon.pink { color: #d4518a; }
.nav-group-icon.gray { color: #687c8b; }
.sidebar { overflow-y: auto; }

.integrations-heading { display: flex; align-items: center; justify-content: space-between; }
.integration-card .button { width: 100%; margin-top: 12px; }
.shop-modal { width: min(100%, 400px); gap: 16px; padding: 26px; }
.shop-modal h2 { margin-bottom: 3px; font-size: 20px; }
.shop-ads-fields { display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--border); }
.shop-ads-fields h3 { margin: 0; font-size: 15px; }
.shop-ads-fields h3 span { font-size: 12px; font-weight: 400; }
.shop-ads-fields .form-note { margin: -6px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.modal-close-icon { top: 12px; right: 13px; color: #84919a; font-size: 24px; font-weight: 400; line-height: 1; }
.modal-actions { display: flex; gap: 12px; margin-top: 4px; }
.modal-actions .button { flex: 1; }
.instruction-link { display: inline-flex; width: fit-content; padding: 0; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--accent); font-size: 12px; }
.instruction-link span { display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 700; }
.instruction-steps { margin: 0; padding-left: 20px; color: var(--muted); }
.instruction-steps li { margin-bottom: 9px; }
.instruction-marketplace { padding: 10px 0; border-bottom: 1px solid var(--border); }
.instruction-marketplace summary { cursor: pointer; font-weight: 650; }
.instruction-marketplace p { margin: 8px 0; color: var(--muted); font-size: 13px; }
.instruction-marketplace a { color: var(--accent); font-size: 13px; }
.shops-list { display: grid; gap: 10px; }
.shop-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) minmax(150px, 1fr) minmax(190px, 1fr) auto; gap: 14px; padding: 14px; align-items: center; border: 1px solid var(--border); border-radius: 9px; background: #f8f9fb; }
.shop-row-actions { display: grid; gap: 7px; justify-items: end; }
.shop-row-actions small { max-width: 220px; color: var(--muted); font-size: 10px; text-align: right; }
.shop-buttons { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.shop-sync { display: grid; min-width: 0; gap: 4px; }
.sync-result { display: grid; gap: 5px; margin-top: 7px; padding: 10px; border-radius: 7px; background: var(--warning-light); font-size: 11px; }
.sync-result details { color: var(--muted); }
.sync-result summary { cursor: pointer; color: var(--navy); }
.sync-result p { margin-top: 6px; line-height: 1.45; }
.sync-message { margin-top: 6px !important; }
.sync-error { color: var(--danger) !important; }
@media (max-width: 1200px) {
  .shop-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-row-actions { justify-items: start; }
  .shop-buttons { justify-content: flex-start; }
}
.status.connected { background: var(--accent-light); color: #168064; }
.status.error { background: var(--danger-light); color: var(--danger); }
.shop-row h3 { margin: 0 0 3px; }
.shop-row p { margin: 0; color: var(--muted); font-size: 11px; }
.shop-credentials { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .integrations-heading { align-items: flex-start; gap: 12px; }
  .integrations-heading .button { flex: 0 0 auto; }
  .shop-row { grid-template-columns: 1fr; gap: 9px; }
  .shop-modal { padding: 22px 19px; }
}

.tax-top-actions { display: flex; align-items: end; gap: 12px; }
.tax-top-actions label { min-width: 100px; }
.tax-base-select { max-width: 460px; margin-bottom: 16px; }
.tax-quarters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tax-quarter { padding: 12px; border-radius: 9px; background: #f3f5f7; }
.tax-quarter h3 { margin-bottom: 10px; font-size: 13px; }
.tax-month { display: grid; gap: 6px; margin-bottom: 11px; }
.tax-month:last-child { margin-bottom: 0; }
.tax-month > span { color: var(--muted); font-size: 11px; }
.tax-month-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tax-month-fields label { font-size: 10px; }
.shop-row-actions { justify-items: start; }
.shop-row-actions small { text-align: left; }

@media (max-width: 1200px) {
  .tax-quarters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .tax-top-actions { align-items: stretch; flex-direction: column; }
  .tax-quarters { grid-template-columns: 1fr; }
  .tax-month-fields label { font-size: 11px; }
}

.dashboard-section-heading { display: flex; margin: 4px 0 16px; align-items: center; justify-content: space-between; gap: 14px; }
.dashboard-section-heading h2 { font-size: 19px; }
.widget-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-card { position: relative; min-height: 128px; padding: 16px; }
.kpi-card .kpi-label { display: block; padding-right: 24px; }
.kpi-card strong { display: block; margin: 9px 0 5px; font-size: 23px; }
.kpi-info { position: absolute; top: 10px; right: 10px; display: grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 1px solid #9aa8b3; border-radius: 50%; background: transparent; color: #647681; font-size: 11px; font-weight: 700; }
.kpi-info:hover { border-color: var(--accent); color: var(--accent); }
.kpi-previous { display: block; color: var(--muted); font-size: 11px; }
.kpi-delta { display: inline-flex; margin-top: 5px; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; }
.kpi-delta.positive { color: #168064; }
.kpi-delta.negative { color: var(--danger); }
.kpi-delta.neutral { color: var(--muted); }
.additional-metrics { margin-bottom: 18px; }
.additional-metrics summary { display: flex; width: fit-content; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 650; list-style: none; }
.additional-metrics summary::-webkit-details-marker { display: none; }
.additional-metrics summary .nav-chevron { transform: rotate(45deg); }
.additional-metrics[open] summary .nav-chevron { transform: rotate(225deg); }
.additional-metrics .kpi-grid { margin-top: 14px; }
.top-products { display: grid; gap: 9px; }
.top-product-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; align-items: center; border-bottom: 1px solid var(--border); }
.top-product-row:last-child { border-bottom: 0; }
.top-product-rank { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; background: var(--accent-light); color: var(--accent); font-size: 11px; font-weight: 700; }
.top-product-row strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.top-product-row small { color: var(--muted); font-size: 10px; }
.top-product-profit { font-size: 13px; font-weight: 700; white-space: nowrap; }
.revenue-structure { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 18px; align-items: center; }
.revenue-donut { position: relative; display: grid; width: 126px; height: 126px; place-items: center; border-radius: 50%; }
.revenue-donut svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.revenue-donut::after { content: ""; position: absolute; width: 78px; height: 78px; border-radius: 50%; background: white; }
.revenue-donut span { position: relative; z-index: 1; color: var(--navy); font-size: 11px; font-weight: 700; text-align: center; }
.revenue-legend { display: grid; gap: 10px; }
.revenue-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 11px; }
.revenue-legend-row strong { font-size: 12px; }
.widget-options { display: grid; max-height: 50vh; gap: 8px; overflow-y: auto; }
.widget-options label { display: flex; min-height: 34px; padding: 7px 8px; align-items: center; gap: 8px; border-radius: 7px; background: #f5f7f9; }
.widget-options input { width: 17px; height: 17px; min-height: 17px; margin: 0; }
#dashboard-products-table { min-width: 940px; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .dashboard-section-heading { align-items: flex-start; flex-direction: column; }
  .widget-actions { width: 100%; }
  .widget-actions .button { flex: 1; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 118px; padding: 13px; }
  .kpi-card strong { font-size: 19px; }
  .revenue-structure { grid-template-columns: 105px minmax(0, 1fr); gap: 12px; }
  .revenue-donut { width: 100px; height: 100px; }
  .revenue-donut::after { width: 62px; height: 62px; }
}

.top-product-metrics { display: grid; gap: 3px; text-align: right; }
.top-product-metrics strong { font-size: 13px; }
.top-product-metrics small { color: var(--muted); font-size: 10px; }
.recommendations-list { display: grid; gap: 10px; }
.recommendation-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 12px; align-items: start; border-radius: 10px; background: #f6f8fa; }
.recommendation-item.high { background: var(--danger-light); }
.recommendation-item.medium { background: var(--warning-light); }
.recommendation-item.low { background: var(--accent-light); }
.recommendation-priority { padding: 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; white-space: nowrap; }
.recommendation-item strong { display: block; margin-bottom: 3px; font-size: 13px; }
.recommendation-item p { margin: 0; color: var(--muted); font-size: 11px; }
.recommendation-basis { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.tax-shop-breakdown { display: grid; gap: 8px; }
.tax-shop-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; gap: 12px; padding: 10px 0; align-items: center; border-bottom: 1px solid var(--border); font-size: 12px; }
.tax-shop-row:last-child { border-bottom: 0; }
.tax-shop-row small { color: var(--muted); }
.tax-shop-missing { color: var(--warning); font-size: 11px; }

@media (max-width: 760px) {
  .tax-shop-row { grid-template-columns: 1fr auto; }
  .tax-shop-row small { grid-column: 1 / -1; }
}

.period-filter { flex: 1; min-width: 250px; }
.filter-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.period-picker-button { display: flex; width: 100%; min-width: 0; min-height: 43px; padding: 7px 12px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 8px; background: white; text-align: left; }
.period-picker-button > span:first-child { min-width: 0; overflow: hidden; }
.period-picker-button > span:last-child { flex: 0 0 auto; }
.period-picker-button strong, .period-picker-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.period-picker-button strong { color: var(--navy); font-size: 12px; }
.period-picker-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.period-modal { width: min(1040px, 100%); gap: 16px; padding: 22px; border-radius: 14px; }
.period-modal h2 { margin: 0; font-size: 20px; }
.period-selectors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.period-mode { padding: 11px 12px; border: 1px solid transparent; border-radius: 9px; background: #f7f9fb; text-align: left; }
.period-mode.active { border-color: #d9e3ff; background: #eef4ff; }
.period-mode-title { display: flex; width: 100%; padding: 0; align-items: center; gap: 7px; border: 0; background: transparent; color: inherit; font-size: 12px; font-weight: 650; text-align: left; }
.period-mode-dot { width: 9px; height: 9px; border: 2px solid #9aadd0; border-radius: 50%; background: white; }
.period-mode.active .period-mode-dot { border-color: var(--accent); background: var(--accent); }
.period-date-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr) auto; gap: 8px; margin-top: 10px; align-items: center; }
.period-date-row input { min-width: 0; padding: 8px; font-size: 12px; }
.period-interval { color: var(--muted); font-size: 10px; white-space: nowrap; }
.period-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 20px; padding-top: 4px; }
.period-calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.calendar-month { min-width: 0; }
.calendar-month header { display: grid; grid-template-columns: 30px 1fr 30px; min-height: 34px; align-items: center; }
.calendar-month h3 { margin: 0; font-size: 13px; font-weight: 650; text-align: center; }
.calendar-nav { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.calendar-nav:hover { background: var(--accent-light); color: var(--accent); }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin: 7px 0 4px; color: var(--muted); font-size: 9px; text-align: center; }
.calendar-empty, .calendar-day { min-width: 0; height: 34px; }
.calendar-day { padding: 0; border: 0; border-radius: 7px; background: transparent; color: #273c4b; font-size: 12px; }
.calendar-day:hover { background: var(--accent-light); }
.calendar-day.in-range { border-radius: 0; background: #e9edff; color: #3548bc; }
.calendar-day.range-start, .calendar-day.range-end { background: var(--accent); color: white; }
.calendar-day.range-start { border-radius: 7px 0 0 7px; }
.calendar-day.range-end { border-radius: 0 7px 7px 0; }
.calendar-day.range-start.range-end { border-radius: 7px; }
.period-presets { display: flex; padding-left: 20px; flex-wrap: wrap; align-content: flex-start; gap: 8px; border-left: 1px solid var(--border); }
.period-presets .button { padding: 8px 11px; font-size: 11px; }
.period-week-label { width: 100%; margin-top: 10px; color: var(--navy); font-size: 12px; font-weight: 650; }
.period-week-label select { margin-top: 8px; font-size: 12px; }
.period-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.period-footer .text-button { margin-right: auto; }
.period-error { margin: 0; color: var(--danger); font-size: 12px; }

@media (max-width: 900px) {
  .period-modal { padding: 18px; }
  .period-workspace { grid-template-columns: 1fr; }
  .period-presets { padding: 12px 0 0; border-top: 1px solid var(--border); border-left: 0; }
  .period-week-label { max-width: 280px; }
}

@media (max-width: 760px) {
  .period-filter { grid-column: 1 / -1; min-width: 0; }
  .period-modal { padding: 18px 14px; }
  .period-selectors, .period-calendars { grid-template-columns: 1fr; }
  .period-calendars { gap: 14px; }
  .period-date-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .period-interval { grid-column: 1 / -1; }
  .period-footer { flex-wrap: wrap; }
  .period-footer .button { flex: 1; }
}

@media (max-width: 380px) {
  .period-date-row { grid-template-columns: 1fr; }
  .period-date-row > span:not(.period-interval) { display: none; }
  .calendar-empty, .calendar-day { height: 32px; }
}

html, body { overflow-x: hidden; }
body { min-height: 100vh; min-height: 100svh; }
.app-shell, .main-content { min-height: var(--viewport-height, 100svh); }
.main-content, .content, .view, .panel, .panel-heading, .topbar, .page-heading, .dashboard-grid, .shop-row, .integration-card { min-width: 0; }
.panel-heading > *, .topbar > *, .shop-row > *, .integration-card > * { min-width: 0; }
.topbar { padding-right: clamp(16px, 2vw, 40px); padding-left: clamp(16px, 2vw, 40px); }
.kpi-card strong, .product-name, .cell-note, .shop-row p, .recommendation-item p { overflow-wrap: anywhere; }
.table-scroll { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.modal-backdrop { padding: clamp(8px, 2vw, 20px); overflow-y: auto; }
.modal { min-width: 0; max-height: calc(var(--viewport-height, 100vh) - 40px); }

@media (min-width: 1600px) {
  .content { max-width: 1760px; padding-right: 40px; padding-left: 40px; }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 2000px) {
  .content { max-width: 1900px; }
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .filters-panel, .toolbar { flex-wrap: wrap; }
  .filters-panel label:first-child { flex: 1 1 160px; min-width: 160px; }
  .period-filter { flex: 1 1 290px; }
  .filters-panel .button, .filters-panel .text-button { flex: 0 0 auto; }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .topbar { gap: 12px; }
  .topbar-brand div { display: none; }
  .content { padding-right: 14px; padding-left: 14px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar-actions { flex-shrink: 0; }
  .panel-heading { flex-wrap: wrap; }
  .modal { max-height: calc(var(--viewport-height, 100vh) - 24px); }
  .shop-row-actions, .shop-buttons { max-width: 100%; }
}

@media (max-width: 480px) {
  .integrations-heading { align-items: stretch; flex-direction: column; }
  .integrations-heading .button { width: 100%; }
  .period-footer .text-button { min-height: 40px; }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card, .kpi-card:last-child { grid-column: auto; }
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 21px; }
  .dataset-badge { white-space: normal; text-align: center; }
  .change-actions, .shop-buttons { flex-wrap: wrap; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .modal-backdrop { padding: 8px; place-items: start center; }
  .modal { max-height: calc(var(--viewport-height, 100vh) - 16px); }
  .topbar { min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
  .period-modal { gap: 10px; }
  .content { padding-bottom: 72px; }
}

@media (pointer: coarse) {
  .button { min-height: 42px; }
  .button.small { min-height: 40px; }
  .calendar-day { min-height: 40px; }
  .calendar-nav { width: 40px; height: 40px; }
  .calendar-month header { grid-template-columns: 40px 1fr 40px; }
  .period-mode-title { min-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.marketplace-filter { position: relative; flex: 0 0 190px; min-width: 190px; }
.marketplace-picker-button strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marketplace-popover { position: absolute; z-index: 50; top: calc(100% + 8px); left: 0; width: 290px; max-width: calc(100vw - 28px); padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: white; box-shadow: 0 12px 36px rgba(20, 38, 52, .14); }
.filters-panel .marketplace-search { min-width: 0; }
.marketplace-search input { min-height: 38px; border-color: transparent; background: #f3f5f8; font-size: 12px; }
.marketplace-options { display: grid; max-height: 220px; margin: 8px 0; gap: 3px; overflow-y: auto; }
.filters-panel .marketplace-option { display: flex; min-width: 0; min-height: 38px; padding: 7px 6px; align-items: center; gap: 9px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; }
.marketplace-option:hover { background: #f5f7fa; }
.marketplace-option input { width: 16px; height: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.marketplace-option .marketplace-dot { flex: 0 0 9px; }
.marketplace-count { padding: 5px 3px 9px; color: var(--muted); font-size: 10px; text-align: right; }
.marketplace-empty { padding: 16px 6px; color: var(--muted); font-size: 12px; text-align: center; }
.marketplace-footer { display: flex; align-items: center; gap: 12px; }
.marketplace-footer .text-button { font-size: 12px; }

@media (min-width: 761px) and (max-width: 1100px) {
  .marketplace-filter { flex: 1 1 160px; min-width: 160px; }
}

@media (max-width: 760px) {
  .marketplace-filter { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .marketplace-popover { width: min(320px, 100%); }
}

.filters-panel { flex-wrap: wrap; }
.marketplace-filter { flex: 1 1 170px; }
.dynamic-filter { position: relative; flex: 1 1 160px; min-width: 150px; }
.dynamic-filter-popover { width: min(310px, calc(100vw - 28px)); }
.marketplace-option > span { min-width: 0; overflow-wrap: anywhere; }
.marketplace-option small { color: var(--muted); font-size: 10px; }
#filter-salesMethods .marketplace-popover { right: 0; left: auto; }

@media (max-width: 760px) {
  .dynamic-filter { grid-column: 1 / -1; width: 100%; min-width: 0; }
  #filter-salesMethods .marketplace-popover { right: auto; left: 0; }
}

.cost-cell { min-width: 330px; }
.product-cost-editor { display: grid; grid-template-columns: minmax(85px, 100px) minmax(130px, 145px) auto; gap: 6px; align-items: center; }
.product-cost-editor input { min-height: 32px; padding: 5px 7px; font-size: 11px; }
.product-cost-editor .button { white-space: nowrap; }
.product-card .product-cost-editor { margin: 12px 0; }
.product-card .product-cost-editor .save-cost-button { grid-column: 1 / -1; width: 100%; }

@media (max-width: 760px) {
  .product-card .product-cost-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.repricer-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.repricer-form label { display: flex; flex-direction: column; gap: 7px; }
.repricer-form fieldset { min-width: 0; border: 1px solid #dce2ea; border-radius: 10px; padding: 14px; }
.repricer-wide { grid-column: 1 / -1; }
.repricer-days { display: flex; flex-wrap: wrap; gap: 14px; }
.repricer-days label, .repricer-listings label { flex-direction: row; align-items: center; }
.repricer-days input, .repricer-listings input { width: auto; flex-shrink: 0; }
.repricer-listings { max-height: 300px; overflow: auto; margin-top: 12px; }
.repricer-listings label { padding: 9px; border-bottom: 1px solid #edf0f4; }
.repricer-listings small { display: block; color: #64748b; }
.repricer-task { padding: 16px 0; border-bottom: 1px solid #e2e8f0; overflow-wrap: anywhere; }
#repricer-error { color: #b42318; }
@media (max-width: 640px) { .repricer-form { grid-template-columns: 1fr; } .repricer-task button { margin-bottom: 8px; } }
.repricer-dialog { border: 0; border-radius: 16px; padding: 24px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.repricer-dialog::backdrop { background: #15263b99; }
.repricer-consent-check { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; }
.repricer-consent-check input { width: auto; flex: 0 0 auto; }
#repricer-consent-error { color: #b42318; }
.repricer-step-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.repricer-step-fields[hidden] { display: none; }
@media (max-width: 640px) { .repricer-step-fields { grid-template-columns: 1fr; } }
/* Marketplace warehouse filters and cluster tables. */
.toolbar.warehouse-filters { gap: 10px; padding: 14px; }
.toolbar.warehouse-filters > label { min-width: 112px; flex: 1 1 112px; }
.warehouse-filters .dynamic-filter { min-width: 0; }
.warehouse-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.warehouse-overview[hidden] { display: none; }
.warehouse-overview > div { min-width: 0; padding: 13px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.warehouse-overview > div:last-child { background: #eef2ff; border-color: #dce4ff; }
.warehouse-overview dt, .warehouse-overview small { color: var(--muted); font-size: 12px; }
.warehouse-overview dd { margin: 5px 0 0; font-size: clamp(18px, 2.3vw, 28px); line-height: 1.1; font-weight: 750; font-variant-numeric: tabular-nums; }
.warehouse-overview small:not([hidden]) { display: block; margin-top: 5px; font-weight: 400; }
.warehouse-info { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 0 0 12px; }
.warehouse-info details { margin: 0; min-width: 0; }
.warehouse-info details[open] { flex-basis: 100%; }
.warehouse-info summary { cursor: pointer; }
.warehouse-info .warehouse-status-warning { color: #97541d; }
#filter-warehouse-clusters .marketplace-footer { flex-wrap: wrap; gap: 12px; }
#filter-warehouse-clusters .marketplace-option { display: flex; flex-direction: row; min-width: 0; min-height: 38px; padding: 7px 6px; align-items: center; gap: 9px; border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; flex: none; }
#filter-warehouse-clusters .marketplace-option input { flex: 0 0 16px; }
#filter-warehouse-clusters .marketplace-footer button { width: auto; min-width: 0; flex: 0 1 auto; }
.warehouse-panel { margin-top: 12px; }
.warehouse-panel table { min-width: 780px; }
.warehouse-panel td:first-child { min-width: 240px; max-width: 460px; white-space: normal; }
.warehouse-panel details { margin-top: 8px; font-size: 12px; }
.warehouse-panel summary { cursor: pointer; }
.warehouse-tree { padding: 0; overflow: hidden; }
.warehouse-tree table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.warehouse-tree th { vertical-align: top; text-transform: none; font-size: 12px; background: #f6f8fc; }
.warehouse-tree th:first-child { width: 34%; min-width: 320px; }
.warehouse-tree th small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.warehouse-tree th:not(:first-child), .warehouse-tree td:not(:first-child) { text-align: right; }
.warehouse-tree td { border-bottom: 1px solid #e1e8f1; padding: 10px 12px; vertical-align: top; font-variant-numeric: tabular-nums; }
.warehouse-tree td:first-child { border-right: 1px solid #dbe4ef; }
.warehouse-product-row { background: #fff; }
.warehouse-product-row:hover { background: #f8faff; }
.warehouse-cluster-rows { background: #f5f8fc; }
.warehouse-expand { display: flex; gap: 10px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; color: inherit; cursor: pointer; }
.warehouse-expand strong { display: block; color: #235992; font-weight: 600; }
.warehouse-expand small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.warehouse-chevron { flex: 0 0 14px; color: #2f6fed; font-size: 22px; line-height: 20px; }
.warehouse-photo { flex: 0 0 38px; width: 38px; height: 48px; overflow: hidden; border: 1px solid #e6ebf1; border-radius: 5px; background: #fff; }
.warehouse-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.warehouse-photo-empty { display: grid; place-items: center; width: 100%; height: 100%; color: #a4afbb; background: #f6f8fb; font-size: 24px; }
.warehouse-photo img[hidden], .warehouse-photo-empty[hidden] { display: none; }
.warehouse-cluster-rows[hidden] { display: none; }
.warehouse-cluster-rows td:first-child { padding-left: 43px; }
.warehouse-cluster-rows tr:hover { background: #f8fafc; }
.warehouse-cluster-rows details { margin: 0; font-size: 12px; }
.warehouse-detail { color: var(--muted); font-size: 11px; }
.warehouse-detail p { margin: 4px 0; }
.warehouse-supply { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.warehouse-supply-label { padding: 3px 5px; border-radius: 4px; background: #f1f5f9; color: #607185; font-size: 10px; white-space: nowrap; }
.warehouse-supply-label.needed { color: #9b3d18; background: #fff0e9; }
.warehouse-zero { color: #df542f; font-weight: 600; }
.warehouse-tree td > small { display: block; margin-top: 5px; text-align: left; }
.warehouse-tree td > .warehouse-warning { color: #9a6717; max-width: 235px; white-space: normal; }
.warehouse-tree .warehouse-logistics { min-width: 155px; white-space: normal; }
.warehouse-tree table { table-layout: fixed; min-width: 1100px; }
.warehouse-tree th { white-space: normal; }
.warehouse-tree th:first-child { width: 29%; min-width: 0; }
.warehouse-tree th:nth-child(2) { width: 22%; }
.warehouse-tree th:nth-child(3) { width: 11%; }
.warehouse-tree th:nth-child(4) { width: 8%; }
.warehouse-tree th:nth-child(5) { width: 9%; }
.warehouse-tree th:nth-child(6) { width: 8%; }
.warehouse-tree th:nth-child(7) { width: 13%; }
.warehouse-tree .warehouse-logistics { min-width: 0; }
.warehouse-mobile-list { display: none; }
.warehouse-result-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 8px; }
.warehouse-unplanned { margin-bottom: 12px; padding: 12px 16px; }
.warehouse-unplanned summary { cursor: pointer; font-weight: 600; }
#warehouse-unplanned-count { margin-left: 6px; color: var(--accent); font-variant-numeric: tabular-nums; }
#warehouse-unplanned-list { max-height: 320px; overflow: auto; overflow-wrap: anywhere; }
#warehouse-unplanned-list ul { list-style: none; padding: 0; margin: 8px 0 0; }
#warehouse-unplanned-list li { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--border); }
#warehouse-unplanned-list small { color: var(--muted); }
#warehouse-search { flex: 1 1 240px; min-width: 0; max-width: 360px; }
.warehouse-supply-filter { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.warehouse-supply-filter input { width: auto; min-height: 0; flex: none; }
#warehouse-needed-count {
  flex: none;
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) {
  .toolbar.warehouse-filters { gap: 8px; padding: 10px; }
  .toolbar.warehouse-filters > label { min-width: 0; }
  .warehouse-filters .dynamic-filter { grid-column: auto; }
  #filter-warehouse-clusters .dynamic-filter-popover { right: 0; left: auto; }
  .warehouse-overview { gap: 6px; }
  .warehouse-overview > div { padding: 8px; }
  .warehouse-overview dt, .warehouse-overview small { font-size: 11px; }
  .warehouse-tree { display: none; }
  #warehouse-needed-count { margin-left: auto; }
  #warehouse-search, .warehouse-supply-filter { flex: 1 1 100%; max-width: none; }
  .warehouse-mobile-list, .warehouse-mobile-clusters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .warehouse-mobile-group { padding: 12px; }
  .warehouse-mobile-group .warehouse-expand { width: 100%; }
  .warehouse-product-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 8px;
    margin: 10px 0 0;
    padding: 8px;
    border-radius: 8px;
    background: #f2f5fa;
  }
  .warehouse-product-metrics dt { color: var(--muted); font-size: 11px; }
  .warehouse-product-metrics dd { margin: 3px 0 0; font-weight: 700; overflow-wrap: anywhere; }
  .warehouse-mobile-clusters { margin-top: 12px; }
  .warehouse-cluster-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8f9fc;
    overflow-wrap: anywhere;
  }
  .warehouse-cluster-card h3 { margin: 0; font-size: 14px; }
  .warehouse-cluster-card-needed {
    border-color: #e9b780;
    background: #fff5e8;
    box-shadow: inset 4px 0 0 #c76923;
  }
  .warehouse-cluster-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0;
  }
  .warehouse-cluster-card dt,
  .warehouse-cluster-recommendation > span { color: var(--muted); font-size: 12px; }
  .warehouse-cluster-card dd { margin: 2px 0 0; font-weight: 700; }
  .warehouse-cluster-recommendation {
    padding: 8px;
    border-radius: 8px;
    background: #fff;
  }
  .warehouse-cluster-recommendation > small { display: block; margin-top: 3px; }
  .warehouse-cluster-recommendation .warehouse-warning { color: #79500f; }
  .warehouse-cluster-card details { margin-top: 8px; font-size: 12px; }
}

.repricer-listings input[data-listing-price] { width: 130px; min-width: 95px; margin-left: auto; }
.repricer-listings label span { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .repricer-listings label { flex-wrap: wrap; } .repricer-listings input[data-listing-price] { margin-left: 25px; width: calc(100% - 25px); } }

.product-box-editor { display:flex; gap:6px; align-items:center; flex-wrap:wrap; } .product-box-input { width:115px; min-width:0; }

.repricer-item-warnings { overflow-wrap: anywhere; margin: 12px 0; }
.repricer-item-warnings ul { max-height: 220px; overflow: auto; padding-left: 20px; }
.repricer-item-warnings .button { max-width: 100%; white-space: normal; }

/* Repricer marketplace/shop selectors. */
.repricer-switch-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.repricer-switch-heading h2 { margin:0; font-size:17px; }
.repricer-segments { display:flex; flex-wrap:wrap; gap:6px; padding:6px; border-radius:14px; background:#eef2f7; margin-bottom:18px; }
.repricer-segment { padding:10px 16px; border:1px solid transparent; border-radius:10px; background:transparent; color:#44536b; cursor:pointer; font:inherit; font-weight:600; overflow-wrap:anywhere; min-width:0; }
.repricer-segment[aria-pressed=true] { background:#fff; color:#215cbd; border-color:#cddcf4; box-shadow:0 2px 5px #173c7020; }
.repricer-segment:focus-visible { outline:3px solid #689bec; outline-offset:2px; }
.repricer-switch-editor-row { display:flex; gap:10px; align-items:end; padding:10px 0; border-bottom:1px solid #e4eaf2; }
.repricer-switch-editor-row label { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.repricer-switch-row-actions { display:flex; gap:4px; }
.repricer-switch-row-actions .button { padding:9px 11px; }
.repricer-switch-add { display:flex; gap:10px; align-items:end; margin:16px 0; }
.repricer-switch-add label { flex:1; min-width:0; display:flex; flex-direction:column; gap:5px; }
.repricer-switch-footer { display:flex; flex-wrap:wrap; gap:8px; }
#repricer-switch-error { color:#b42318; }
@media(max-width:600px) { .repricer-segment { padding:9px 11px; } .repricer-switch-heading .button { font-size:12px; } .repricer-switch-editor-row { flex-wrap:wrap; } .repricer-switch-editor-row label { flex-basis:100%; } .repricer-switch-row-actions { margin-left:auto; } .repricer-switch-add { flex-wrap:wrap; } }

#repricer-chain-form > label {display:flex;flex-direction:column;gap:6px;margin:12px 0;}
#repricer-chain-form > .repricer-consent-check {flex-direction:row;}
#repricer-chain-tasks {max-height:280px;overflow:auto;border:1px solid #e1e7ef;border-radius:10px;padding:10px;}
.repricer-chain-choice {display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid #edf1f6;overflow-wrap:anywhere;}
.repricer-chain-choice input {width:auto;flex:0 0 auto;margin-top:4px;}
#repricer-chain-list li {margin-bottom:10px;overflow-wrap:anywhere;}
#repricer-chain-error {color:#b42318;}
#repricer-price-preview {
  margin: 1rem 0;
  overflow-wrap: anywhere;
}
#repricer-price-preview ul {
  padding-inline-start: 1.25rem;
}
#repricer-price-preview li + li {
  margin-top: 0.5rem;
}

.product-box-pick { display: flex; align-items: center; gap: 8px; }
.product-box-pick input { width: auto; min-height: 0; flex: none; }
#product-box-bulk-preview { max-height: 30vh; overflow: auto; overflow-wrap: anywhere; }

.product-filter-panel { padding: 16px; }
.product-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  margin-bottom: 12px;
}
.product-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.product-filter-panel label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.product-filter-panel input, .product-filter-panel select { width: 100%; min-width: 0; }
#product-filters-toggle, #product-filters-reset, #product-active-filters { display: none; }
.product-mobile-filter-summary { display: none; }
.product-list-counts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
.product-freshness-shortcuts { display: flex; flex-wrap: wrap; gap: 4px; }
.product-unskip-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%; min-width: 0; }
.product-unskip-label { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.product-freshness-shortcuts button[aria-pressed="true"] { background: var(--accent-light); color: var(--accent); }
.product-search-progress { color: var(--accent); font-size: 12px; font-weight: 650; }
#product-hidden-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.product-hidden-header { flex: none; }
.product-hidden-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-hidden-heading h2 { margin: 0; font-size: 18px; }
.product-search-control { display: grid; gap: 4px; min-width: 0; }
.product-hidden-search-field, .product-search-field { position: relative; }
.product-hidden-search-field { margin-top: 8px; }
#product-hidden-search, #product-search { width: 100%; padding-right: 40px; }
#product-hidden-search::-webkit-search-cancel-button, #product-search::-webkit-search-cancel-button { display: none; }
#product-hidden-search-clear, #product-search-clear {
  position: absolute;
  inset: 0 0 0 auto;
  width: 40px;
  font-size: 20px;
  line-height: 1;
}
#product-hidden-list { min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; overflow-wrap: anywhere; }
#product-hidden-list li { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid var(--border); }
#product-hidden-list small { color: var(--muted); }
#product-hidden-list mark, #products-table mark, #products-cards mark { border-radius: 2px; background: #ffec9e; color: #382900; }
#product-hidden-undo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
#product-hidden-undo-message { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.product-hidden-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.product-hidden-reasons > span, .product-hidden-reasons button {
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
}
.product-hidden-reasons button { min-height: 32px; border: 1px solid var(--border); cursor: pointer; }
.product-list-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 10px;
}
.product-list-heading h2 { margin: 0 0 3px; font-size: 18px; }
.product-list-heading .section-note { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 0; }
.product-result-count { color: var(--navy); font-weight: 650; }
.product-row-actions, .product-card-actions { display: grid; gap: 6px; }
.product-row-actions .button { white-space: normal; }
.desktop-products table { min-width: 900px; }
.desktop-products .product-name { min-width: 164px; }
.desktop-products .product-shop-name { max-width: 105px; overflow-wrap: anywhere; }
.product-category-label { display: block; color: var(--muted); font-size: 11px; }
.product-completeness-label { display: block; margin-top: 4px; color: #9a4217; font-size: 11px; font-weight: 700; }
.product-completeness-edit {
  min-height: 28px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.product-stock-snapshot { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.product-stock-snapshot time { white-space: nowrap; }
.product-stock-snapshot-stale { color: #9a4217; font-weight: 700; }
.product-card .product-shop-name { color: var(--muted); font-size: 12px; }
.desktop-products td { padding: 10px 8px; }
.desktop-products .cost-cell { min-width: 135px; }
.desktop-products .product-box-input { width: 98px; }
.product-row-actions { min-width: 138px; }
.product-table-cost summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.product-table-cost .product-cost-editor { grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
.product-marketplace-badge { color: var(--accent); background: var(--accent-light); }
.product-cost-note { margin-top: 12px; }
.product-empty-search-clear { margin-top: 8px; }

@media (max-width: 1100px) {
  .product-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body:has(#view-products.active) { overflow-x: clip; }
  .product-search-progress-desktop { display: none; }
  .product-freshness-desktop { display: none; }
  body:has(#view-products.active) .topbar { position: relative; }
  .product-filter-panel {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 19;
    padding: 12px;
    background: #fff;
  }
  .product-search-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-bottom: 0; }
  .product-search-row .button { padding-inline: 9px; }
  #product-filters-toggle { display: inline-block; }
  #product-active-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
  .product-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 34px;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
  }
  .product-filter-chip > span:first-child { min-width: 0; overflow-wrap: anywhere; text-align: left; }
  .product-filter-chip > span:last-child { flex: none; font-size: 16px; }
  .product-mobile-filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 8px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
  }
  #product-mobile-result-count { font-weight: 650; font-variant-numeric: tabular-nums; }
  #product-hidden-open { min-height: 36px; }
  #product-hidden-open:disabled { opacity: 1; color: var(--muted); }
  #product-filters-reset { display: inline-block; min-height: 36px; color: var(--accent); }
  #product-filters-toggle[aria-expanded="true"] { color: var(--accent); background: var(--accent-light); }
  .product-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-filter-panel:has(#product-filters-toggle[aria-expanded="false"]) .product-filter-grid { display: none; }
  .product-filter-panel:has(#product-filters-toggle[aria-expanded="true"]) .product-filter-grid { margin-top: 10px; }
  .product-filter-panel:has(#product-filters-toggle[aria-expanded="true"]) {
    max-height: 60dvh;
    overflow-y: auto;
  }
  .product-card header { margin-bottom: 8px; }
  .product-card header > div { min-width: 0; overflow-wrap: anywhere; }
  .product-card h3 { margin: 5px 0 3px; font-size: 16px; line-height: 1.3; }
  .product-card .product-card-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 10px 0;
  }
  .product-card-stats > div { min-width: 0; padding: 6px; border-radius: 7px; background: #f3f5f8; }
  .product-card-stats > .product-card-stock { background: var(--accent-light); color: var(--accent); }
  .product-card-stats strong { font-size: 13px; overflow-wrap: anywhere; }
  .product-card-box { display: grid; gap: 5px; padding: 9px; border: 1px solid var(--border); border-radius: 8px; }
  .product-card-box > span, .product-card-box .product-box-pick { font-size: 12px; color: var(--muted); }
  .product-card-box .product-box-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .product-card-box .product-box-input { width: 100%; }
  .product-card-cost { margin: 9px 0; color: var(--muted); font-size: 12px; }
  .product-card-actions .open-product-warehouse { color: var(--accent); background: var(--accent-light); }
}
