:root {
  color-scheme: dark;
  --background: #07090c;
  --surface: #0d1217;
  --surface-raised: #11171d;
  --surface-soft: #0a0e12;
  --foreground: #f2f5f7;
  --secondary: #89939d;
  --border: #1b252d;
  --border-strong: #27343e;
  --accent: #8ee3b3;
  --accent-hover: #a8edc5;
  --accent-soft: rgba(142, 227, 179, .10);
  --blue: #65a9ff;
  --warning: #f4bd6a;
  --danger: #ff7169;
  --shadow: 0 18px 55px rgba(0, 0, 0, .23);
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -15%, rgba(56, 105, 83, .12), transparent 30%),
    var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
a { color: var(--accent); }
[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: rgba(7, 9, 12, .84);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
}
.topbar-inner {
  max-width: 1480px;
  min-height: 62px;
  margin: 0 auto;
  padding: 8px 30px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--foreground); font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid #bb62f3; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #7f22c7, #e2378c); box-shadow: 0 0 24px rgba(199, 43, 199, .22); font-weight: 750; }
.primary-nav { min-width: 0; display: flex; justify-content: center; gap: 4px; }
.primary-nav a { padding: 7px 10px; border-radius: 8px; color: var(--secondary); text-decoration: none; font-size: 13px; transition: color .18s ease, background .18s ease; }
.primary-nav a:hover { color: var(--foreground); background: rgba(255, 255, 255, .035); }
.primary-nav a[aria-current="true"] { color: var(--foreground); background: var(--surface-raised); }
.topbar-actions, .panel-head, .section-heading-row, .search-row, .pagination, .dialog-head, .dialog-actions, .section-heading, .inline-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-switcher select { min-width: 150px; max-width: 220px; min-height: 36px; }
.current-user { max-width: 130px; overflow: hidden; color: var(--secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sync-state { position: relative; display: inline-flex; align-items: center; gap: 7px; color: var(--secondary); font-size: 12px; white-space: nowrap; }
.sync-state[data-period]::after {
  content: attr(data-period);
  position: absolute;
  top: calc(100% + 13px);
  right: 0;
  z-index: 50;
  width: 230px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--foreground);
  background: rgba(13, 18, 23, .97);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
.sync-state[data-period]:hover::after { opacity: 1; transform: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); }
.sync-state.is-running .status-dot { background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
.sync-state.is-ready .status-dot { background: var(--accent); box-shadow: 0 0 10px rgba(142, 227, 179, .45); }
.sync-state.is-warning .status-dot { background: var(--warning); }
.sync-state.is-error .status-dot { background: var(--danger); }

main { max-width: 1480px; margin: 0 auto; padding: 26px 30px 90px; }
.context-bar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 54px; }
.period-controls, .custom-period, .custom-period label { display: flex; align-items: center; gap: 9px; }
.period-controls { flex-wrap: wrap; }
.custom-period label { color: var(--secondary); font-size: 12px; }
.custom-period input { width: 138px; min-height: 38px; }
.page:not([hidden]) { animation: page-in .34s ease both; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 34px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 10px; font-size: clamp(40px, 5.4vw, 68px); line-height: .99; letter-spacing: -.048em; font-weight: 680; }
h2 { margin-bottom: 5px; font-size: 21px; line-height: 1.2; letter-spacing: -.018em; }
h3 { margin-bottom: 8px; font-size: 17px; letter-spacing: -.012em; }
.eyebrow { margin-bottom: 9px; color: #707a84; font-size: 11px; font-weight: 650; letter-spacing: .13em; text-transform: uppercase; }
.hero-copy { max-width: 720px; margin-bottom: 0; color: var(--secondary); font-size: 16px; }
.secondary { margin-bottom: 0; color: var(--secondary); }
.coverage { display: flex; flex-direction: column; align-items: end; gap: 7px; color: var(--secondary); text-align: right; }
.coverage small { font-size: 12px; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; width: fit-content; padding: 6px 10px; border: 1px solid rgba(142, 227, 179, .2); border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 550; }
.live-badge span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.live-badge.small { padding: 5px 8px; font-size: 11px; }
.live-badge.neutral { border-color: var(--border-strong); color: var(--secondary); background: rgba(255, 255, 255, .025); }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 11px; margin-bottom: 30px; }
.kpi-grid.compact-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.analytics-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-card, .panel, .module-card, .product-card, .campaign-card { border: 1px solid var(--border); background: linear-gradient(145deg, rgba(17, 23, 29, .96), rgba(11, 16, 21, .96)); box-shadow: var(--shadow); }
.kpi-card { min-height: 145px; padding: 22px; border-radius: var(--radius-md); }
.kpi-label { display: block; margin-bottom: 20px; color: var(--secondary); font-size: 12px; }
.kpi-value { display: block; font-size: clamp(28px, 2.45vw, 38px); font-weight: 630; letter-spacing: -.042em; white-space: nowrap; }
.kpi-note { margin: 7px 0 0; color: #67717b; font-size: 11px; }
.kpi-button { width: 100%; position: relative; color: var(--foreground); font: inherit; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.kpi-button:hover { border-color: var(--border-strong); background: var(--surface-raised); transform: translateY(-2px); }
.kpi-button[aria-pressed="true"] { border-color: var(--accent); background: linear-gradient(145deg, rgba(25, 45, 36, .96), rgba(11, 20, 17, .96)); }
.kpi-action { display: block; margin-top: 12px; color: var(--accent); font-size: 11px; }
.advertising-settings-row { position: relative; z-index: 8; display: flex; justify-content: flex-end; margin: -10px 0 12px; }
.metric-settings { position: relative; }
.metric-settings > summary { list-style: none; }
.metric-settings > summary::-webkit-details-marker { display: none; }
.metric-settings-panel { position: absolute; top: calc(100% + 8px); right: 0; width: min(720px, calc(100vw - 32px)); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 17px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-raised); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.metric-settings-panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.metric-settings-panel legend { margin-bottom: 10px; font-size: 12px; font-weight: 650; }
.metric-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.metric-settings-grid label { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 7px; color: var(--secondary); background: rgba(255,255,255,.025); cursor: pointer; font-size: 11px; }
.metric-settings-grid input { width: 14px; min-height: 14px; margin: 0; padding: 0; accent-color: var(--accent); }
.metric-settings-grid span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-settings-panel > p { grid-column: 1 / -1; margin: 0; font-size: 10px; }
.advertising-metric-detail { margin-bottom: 30px; animation: page-in .25s ease both; }
.panel { border-radius: var(--radius-lg); }
.chart-panel { padding: 25px; margin-bottom: 44px; }
.content-panel { min-width: 0; padding: 24px; margin-bottom: 24px; }
.panel-head { align-items: flex-start; }
.chart { min-height: 300px; margin-top: 20px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-grid { stroke: rgba(255, 255, 255, .065); stroke-width: 1; }
.chart-axis { fill: #6f7982; font-size: 11px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; animation: draw-line .8s cubic-bezier(.22,.7,.25,1) both; }
.chart-area { opacity: 0; animation: fade-area .55s .25s ease forwards; }
.chart-point { fill: var(--surface); stroke: var(--accent); stroke-width: 2; transition: r .15s ease, fill .15s ease; }
.chart-target { fill: transparent; cursor: crosshair; }
.chart-hit.is-active .chart-point { r: 7; fill: var(--accent); }
.chart-tooltip { position: fixed; inset: 0 auto auto 0; z-index: 100; width: 265px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--foreground); background: rgba(13, 18, 23, .96); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); backdrop-filter: blur(18px); pointer-events: none; }
.chart-tooltip strong { display: block; margin-bottom: 10px; font-size: 14px; }
.chart-tooltip dl { margin: 0; }
.chart-tooltip dl div { display: flex; justify-content: space-between; gap: 14px; padding: 4px 0; color: var(--secondary); font-size: 12px; }
.chart-tooltip dt, .chart-tooltip dd { margin: 0; }
.chart-tooltip dd { color: var(--foreground); text-align: right; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.segmented button { border: 0; border-radius: 6px; padding: 7px 11px; color: var(--secondary); background: transparent; cursor: pointer; transition: color .16s ease, background .16s ease; }
.segmented button:hover { color: var(--foreground); }
.segmented button[aria-pressed="true"] { color: var(--foreground); background: var(--surface-raised); box-shadow: 0 1px 5px rgba(0, 0, 0, .3); }
.section-heading { margin: 0 0 17px; }
.section-heading > p { text-align: right; }
.module-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.module-card { position: relative; min-height: 225px; padding: 22px; border-radius: var(--radius-md); color: var(--foreground); text-decoration: none; overflow: hidden; transition: border-color .2s ease, transform .2s ease, background .2s ease; }
.module-card:hover { border-color: var(--border-strong); transform: translateY(-2px); background: var(--surface-raised); }
.module-card .live-badge { margin: 0 0 18px 48px; }
.module-icon { position: absolute; top: 20px; left: 20px; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--secondary); background: rgba(255,255,255,.015); }
.module-card h3, .module-card p, .module-card strong, .module-card > small { margin-left: 56px; }
.module-card p { max-width: 560px; min-height: 42px; margin-bottom: 24px; color: var(--secondary); }
.module-card strong { display: block; font-size: 23px; letter-spacing: -.025em; }
.module-card > small { display: block; margin-top: 4px; color: #65707a; }
.module-arrow { position: absolute; right: 22px; bottom: 20px; color: #6f7982; font-size: 20px; transition: transform .18s ease; }
.module-card:hover .module-arrow { transform: translateX(4px); color: var(--accent); }
.campaign-grid { align-items: start; margin-top: 16px; }
.campaign-card { min-width: 0; border-radius: var(--radius-md); overflow: hidden; transition: border-color .2s ease, background .2s ease; }
.campaign-card:hover { border-color: var(--border-strong); }
.campaign-card[open] { grid-column: 1 / -1; }
.campaign-summary { position: relative; min-height: 285px; padding: 22px 22px 54px; list-style: none; cursor: pointer; }
.campaign-summary::-webkit-details-marker { display: none; }
.campaign-summary .live-badge { margin-bottom: 18px; }
.campaign-summary h3 { margin-bottom: 4px; }
.campaign-summary p { margin-bottom: 22px; color: var(--secondary); }
.campaign-spend { display: block; font-size: 23px; letter-spacing: -.025em; }
.campaign-summary > small { display: block; margin-top: 4px; color: #65707a; }
.campaign-action { position: absolute; right: 22px; bottom: 19px; color: var(--accent); font-size: 12px; }
.campaign-action span:last-child, .campaign-card[open] .campaign-action span:first-child { display: none; }
.campaign-card[open] .campaign-action span:last-child { display: inline; }
.metric-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 0; }
.metric-list div { padding-top: 9px; border-top: 1px solid var(--border); }
.metric-list dt { color: var(--secondary); font-size: 10px; }
.metric-list dd { margin: 3px 0 0; font-weight: 600; }
.campaign-card[open] .metric-list { grid-template-columns: repeat(6, 1fr); }
.campaign-detail { padding: 22px; border-top: 1px solid var(--border); background: rgba(7, 9, 12, .28); }
.campaign-detail h3 { margin-bottom: 4px; }
.campaign-lifecycle { margin-bottom: 20px; padding: 14px; border: 1px solid rgba(142,227,179,.26); border-radius: 11px; background: rgba(16,31,25,.58); }
.campaign-lifecycle-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.campaign-lifecycle-head .eyebrow { margin: 0 0 3px; }
.campaign-lifecycle-summary { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 6px; margin: 12px 0 0; }
.campaign-lifecycle-summary > div { min-width: 0; padding: 8px 9px; border: 1px solid rgba(255,255,255,.045); border-radius: 7px; background: rgba(5,9,8,.28); }
.campaign-lifecycle-summary dt { color: var(--secondary); font-size: 9px; }
.campaign-lifecycle-summary dd { margin: 3px 0 0; font-size: 12px; font-weight: 600; }
.campaign-lifecycle-summary small { display: block; margin-top: 3px; color: #65766d; font-size: 8px; }
.campaign-lifecycle-products-block { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.campaign-lifecycle-products-block > p { flex: none; margin: 0; color: var(--secondary); font-size: 10px; }
.campaign-lifecycle-products-block > p strong { margin-left: 3px; color: var(--foreground); }
.campaign-lifecycle-products { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.campaign-lifecycle-product { flex: none; min-width: 98px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 8px; background: rgba(7,11,10,.45); }
.campaign-lifecycle-product .product-photo-link { width: 27px; height: 35px; border-radius: 5px; }
.campaign-lifecycle-product small, .campaign-lifecycle-product strong { display: block; }
.campaign-lifecycle-product small { color: var(--secondary); font-size: 8px; }
.campaign-lifecycle-product strong { margin-top: 1px; font-size: 10px; }
.campaign-history { margin-top: 10px; border-top: 1px solid rgba(142,227,179,.13); }
.campaign-history > summary { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px 0; color: var(--foreground); font-size: 11px; font-weight: 600; list-style: none; cursor: pointer; }
.campaign-history > summary::-webkit-details-marker { display: none; }
.campaign-history > summary::after { content: "⌄"; margin-left: 8px; color: var(--accent); }
.campaign-history[open] > summary::after { transform: rotate(180deg); }
.campaign-history > summary span { margin-left: auto; color: var(--secondary); font-size: 9px; font-weight: 400; }
.campaign-history ol { margin: 9px 0 0; padding: 0; list-style: none; }
.campaign-history-event { position: relative; display: grid; grid-template-columns: minmax(170px, .45fr) minmax(0, 1fr); gap: 10px; padding: 8px 8px 8px 17px; border-left: 1px solid rgba(142,227,179,.22); }
.campaign-history-dot { position: absolute; top: 14px; left: -3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(142,227,179,.08); }
.campaign-history-copy strong, .campaign-history-copy time, .campaign-history-copy small { display: block; }
.campaign-history-copy strong { font-size: 11px; }
.campaign-history-copy time { margin-top: 2px; color: var(--secondary); font-size: 9px; }
.campaign-history-copy small { margin-top: 2px; color: #78857e; font-size: 9px; }
.campaign-history-products { display: flex; gap: 5px; overflow-x: auto; }
.campaign-controls { width: min(600px, 100%); }
.campaign-controls input { max-width: 340px; }
.campaign-table-wrap { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.campaign-table { min-width: 1470px; font-variant-numeric: tabular-nums; }
.campaign-table th:first-child, .campaign-table td:first-child { width: 185px; min-width: 185px; max-width: 185px; }
.campaign-table th:nth-child(2), .campaign-table td:nth-child(2) { width: 105px; min-width: 105px; max-width: 105px; }
.campaign-table th:nth-child(3), .campaign-table td:nth-child(3) { width: 150px; min-width: 150px; max-width: 150px; }
.campaign-table td strong, .campaign-table td small { display: block; }
.campaign-table td small { margin-top: 3px; color: var(--secondary); font-size: 10px; }
.campaign-table th.is-selected, .campaign-table td.is-selected { color: var(--accent); background: var(--accent-soft); }
.advertising-detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.advertising-view-switcher { flex: 0 0 auto; }
.advertising-view-switcher button { min-width: 108px; }
.ad-campaign-group-list { display: grid; gap: 8px; margin-top: 18px; }
.ad-campaign-group { border: 1px solid var(--border); border-radius: 11px; background: rgba(10,14,18,.54); overflow: hidden; }
.ad-campaign-group > summary { min-height: 70px; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 2fr) auto 10px; align-items: center; gap: 14px; padding: 12px 15px; list-style: none; cursor: pointer; }
.ad-campaign-group > summary::-webkit-details-marker { display: none; }
.ad-campaign-group > summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--secondary); border-bottom: 1.5px solid var(--secondary); transform: rotate(45deg); transition: transform .18s ease; }
.ad-campaign-group[open] > summary::after { transform: rotate(225deg); }
.ad-campaign-name { min-width: 0; }
.ad-campaign-name strong, .ad-campaign-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-campaign-name small { margin-top: 4px; color: var(--secondary); font-size: 10px; }
.ad-product-name { min-width: 0; }
.ad-product-summary-metrics { min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(72px, 1fr); gap: 5px; overflow-x: auto; scrollbar-width: none; }
.ad-product-summary-metrics::-webkit-scrollbar { display: none; }
.ad-product-summary-metrics > * { min-width: 0; padding: 5px 7px; border-left: 1px solid var(--border); border-radius: 6px; }
.ad-product-summary-metrics > .is-selected { border-left-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ad-campaign-filter-metrics > button { border-top: 0; border-right: 0; border-bottom: 0; color: inherit; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.ad-campaign-filter-metrics > button:hover { background: rgba(255,255,255,.045); }
.ad-campaign-filter-metrics > button:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.ad-product-summary-metrics small, .ad-product-summary-metrics strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-product-summary-metrics small { color: var(--secondary); font-size: 8px; }
.ad-product-summary-metrics strong { margin-top: 3px; font-size: 13px; }
.ad-product-count { color: var(--secondary); font-size: 10px; text-align: right; white-space: nowrap; }
.ad-campaign-products { display: grid; gap: 7px; padding: 10px 12px 12px; border-top: 1px solid var(--border); background: rgba(7,9,12,.3); }
.ad-campaign-product { min-width: 0; display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 2fr); align-items: center; gap: 14px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.ad-attribution-note { display: block; margin-top: 5px; color: #d9b46d; font-size: 9px; }

input, select { width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; color: var(--foreground); background: var(--surface-soft); }
input::placeholder { color: #5d6770; }
select { cursor: pointer; }
.inline-controls { width: min(520px, 100%); justify-content: flex-end; }
.inline-controls input { max-width: 300px; }
.inline-controls select { max-width: 175px; }
.ranking-list { margin-top: 18px; }
.ranking-row { min-height: 78px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.ranking-row:last-child { border-bottom: 0; }
.rank { color: #5d6770; font-variant-numeric: tabular-nums; text-align: center; }
.ranking-main { min-width: 0; }
.ranking-main strong, .ranking-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-main small, .ranking-metrics small { margin-top: 4px; color: var(--secondary); font-size: 11px; }
.product-name-content { min-width: 0; display: flex; align-items: center; gap: 9px; }
.product-name-copy { min-width: 0; flex: 1; }
.product-photo-link { position: relative; width: 42px; height: 54px; flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 7px; color: var(--secondary); background: var(--surface-soft); text-decoration: none; transition: border-color .16s ease, transform .16s ease; }
.product-photo-link:hover { border-color: var(--accent); transform: translateY(-1px); }
.product-photo-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-soft); }
.product-photo-placeholder { font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.product-photo-column, .product-photo-cell { width: 66px; min-width: 66px; text-align: center; }
.product-photo-cell .product-photo-link { margin-inline: auto; }
.product-name .product-name-primary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-name .product-name-secondary { display: flex; gap: 8px; margin-top: 3px; color: var(--secondary); font-size: 10px; font-weight: 400; white-space: nowrap; }
.product-name-id { flex: none; }
.product-name-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ranking-bar { max-width: 460px; height: 3px; display: block; margin-top: 10px; border-radius: 4px; background: rgba(255,255,255,.045); overflow: hidden; }
.ranking-bar i, .bar-track i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #5caf83, var(--accent)); transform-origin: left; animation: grow-bar .6s ease both; }
.ranking-metrics { min-width: 205px; text-align: right; }
.ranking-metrics strong, .ranking-metrics small { display: block; }
.compact-row { grid-template-columns: minmax(0,1fr) auto; }
.dense-list .ranking-row { min-height: 62px; }

.top-summary-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 13px; margin-bottom: 24px; }
.top-summary-panel { margin-bottom: 0; }
.abc-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.abc-card { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--foreground); background: var(--surface-soft); text-align: left; cursor: pointer; transition: border-color .16s ease, transform .16s ease; }
.abc-card:hover, .abc-card[aria-pressed="true"] { border-color: var(--border-strong); transform: translateY(-1px); }
.abc-card strong, .abc-card small { display: block; }
.abc-card strong { margin-top: 10px; font-size: 18px; }
.abc-card small { margin-top: 3px; color: var(--secondary); font-size: 10px; }
.abc-letter, .abc-badge { display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 7px; font-weight: 700; }
.abc-letter { width: 27px; height: 27px; }
.abc-badge { width: 30px; height: 30px; }
.abc-a { color: var(--accent); }
.abc-b { color: var(--warning); }
.abc-c { color: var(--blue); }
.abc-bar { height: 7px; display: flex; margin-top: 14px; border-radius: 9px; background: var(--surface-soft); overflow: hidden; }
.abc-bar span { height: 100%; }
.abc-bar .abc-a { background: var(--accent); }
.abc-bar .abc-b { background: var(--warning); }
.abc-bar .abc-c { background: var(--blue); }
.problem-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.problem-card { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border: 1px solid var(--border); border-left: 3px solid var(--secondary); border-radius: 9px; color: var(--foreground); background: var(--surface-soft); text-align: left; cursor: pointer; }
.problem-card:hover, .problem-card[aria-pressed="true"] { border-color: var(--border-strong); background: var(--surface-raised); }
.problem-card strong, .problem-card small { display: block; }
.problem-card strong { font-size: 18px; }
.problem-card small { color: var(--secondary); font-size: 10px; }
.problem-card em { color: var(--secondary); font-size: 10px; font-style: normal; white-space: nowrap; }
.problem-card.critical, .stock-badge.critical { border-color: rgba(255,113,105,.35); color: var(--danger); }
.problem-card.warning, .problem-card.overstock, .stock-badge.warning { border-color: rgba(244,189,106,.35); color: var(--warning); }
.problem-card.returns { border-color: rgba(255,113,105,.25); color: #ff9b95; }
.stock-badge.healthy { border-color: rgba(142,227,179,.25); color: var(--accent); }
.stock-badge.neutral { color: var(--secondary); }
.top-tasks-panel { margin-bottom: 24px; }
.top-task-filters { width: min(540px, 100%); display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr)); }
.top-task-filters select { max-width: none; }
#top-task-summary strong { color: var(--foreground); }
.top-task-list { display: grid; gap: 7px; }
.top-task-row { min-height: 72px; display: grid; grid-template-columns: 22px minmax(280px, 1.35fr) minmax(250px, 1fr) 105px; align-items: center; gap: 13px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); transition: border-color .16s ease, opacity .16s ease; }
.top-task-row:hover { border-color: var(--border-strong); }
.top-task-row.is-completed { opacity: .55; }
.top-task-row.is-completed .top-task-copy > strong { text-decoration: line-through; text-decoration-thickness: 1px; }
.top-task-check { display: grid; place-items: center; }
.top-task-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.top-task-copy, .top-task-product { min-width: 0; }
.top-task-copy > strong, .top-task-copy > small { display: block; }
.top-task-copy > strong { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.top-task-copy > small { margin-top: 3px; overflow: hidden; color: var(--secondary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.top-task-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.top-task-urgency, .top-task-type { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--secondary); font-size: 8px; line-height: 1; }
.top-task-urgency.critical { border-color: rgba(255,113,105,.32); color: var(--danger); }
.top-task-urgency.high { border-color: rgba(244,189,106,.32); color: var(--warning); }
.top-task-urgency.medium { border-color: rgba(116,174,255,.28); color: var(--blue); }
.top-task-product .product-photo-link { width: 34px; height: 44px; }
.top-task-product .product-name-primary { font-size: 11px; }
.top-task-product .product-name-secondary { font-size: 8px; }
.top-task-revenue { text-align: right; white-space: nowrap; }
.top-task-revenue small, .top-task-revenue strong { display: block; }
.top-task-revenue small { color: var(--secondary); font-size: 8px; }
.top-task-revenue strong { margin-top: 3px; font-size: 11px; }
.top-task-more { justify-self: center; margin-top: 5px; }
.top-segments { margin: 0 0 24px; }
.segment-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.segment-chip { min-width: 168px; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--foreground); background: var(--surface-soft); text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.segment-chip:hover, .segment-chip[aria-pressed="true"] { border-color: var(--border-strong); background: var(--surface-raised); transform: translateY(-1px); }
.segment-chip strong { min-width: 25px; font-size: 16px; font-variant-numeric: tabular-nums; }
.segment-chip span, .segment-chip small { display: block; }
.segment-chip span { font-size: 10px; font-weight: 600; }
.segment-chip small { margin-top: 2px; color: var(--secondary); font-size: 8px; font-weight: 400; }
.top-filter-controls { width: min(1080px, 100%); display: grid; grid-template-columns: minmax(190px, 1.5fr) repeat(4, minmax(120px, 1fr)); }
.top-filter-controls input, .top-filter-controls select { max-width: none; }
.top-advanced-filters { margin: 6px 0 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.top-advanced-filters > summary { width: fit-content; padding: 10px 0; color: var(--secondary); cursor: pointer; font-size: 11px; }
.advanced-filter-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 9px; padding: 2px 0 13px; }
.advanced-filter-grid label { color: var(--secondary); font-size: 9px; }
.advanced-filter-grid select { width: 100%; max-width: none; display: block; margin-top: 5px; }
.top-results-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; }
.top-filter-summary { margin: 0; color: var(--secondary); font-size: 11px; }
.top-filter-summary strong { color: var(--foreground); }
.active-filter-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.active-filter-chips:empty { margin: 0; }
.active-filter-chips button { padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; color: var(--secondary); background: var(--surface-soft); font-size: 9px; cursor: pointer; }
.top-product-card { margin-top: 8px; border: 1px solid var(--border); border-radius: 11px; background: rgba(10,14,18,.54); overflow: hidden; }
.top-product-card summary { min-height: 76px; display: grid; grid-template-columns: 32px minmax(220px, 1fr) 484px 12px; align-items: center; gap: 13px; padding: 13px 15px; cursor: pointer; list-style: none; }
.top-product-card summary::-webkit-details-marker { display: none; }
.top-product-card summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--secondary); border-bottom: 1.5px solid var(--secondary); transform: rotate(45deg); transition: transform .18s ease; }
.top-product-card[open] summary::after { transform: rotate(225deg); }
.top-product-name { min-width: 0; }
.top-product-name strong, .top-product-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-product-name small { margin-top: 4px; color: var(--secondary); font-size: 10px; }
.top-product-quick { display: grid; grid-template-columns: repeat(3, 78px) 99px 103px; align-items: center; gap: 12px; text-align: right; }
.top-product-quick > span:not(.stock-badge) small, .top-product-quick > span:not(.stock-badge) strong { display: block; }
.top-product-quick small { color: var(--secondary); font-size: 9px; }
.top-product-quick .trend-badge, .top-product-quick .stock-badge { justify-self: start; }
.stock-badge { padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px; font-size: 9px; white-space: nowrap; }
.trend-badge { display: inline-flex; align-items: center; width: fit-content; padding: 4px 7px; border: 1px solid var(--border); border-radius: 7px; color: var(--secondary); font-size: 9px; white-space: nowrap; }
.trend-badge.growth, .trend-badge.new { border-color: rgba(142,227,179,.25); color: var(--accent); }
.trend-badge.decline { border-color: rgba(255,113,105,.3); color: var(--danger); }
.trend-badge.stable { color: var(--blue); }
.kpi-note .trend-badge { margin-left: 7px; }
.pinned-mark { display: inline-block; margin-top: 5px; padding: 2px 5px; border-radius: 5px; color: var(--accent); background: var(--accent-soft); font-size: 8px; }
.top-product-detail { padding: 18px; border-top: 1px solid var(--border); background: rgba(7,9,12,.3); }
.product-detail-actions { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.detail-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 18px; }
.detail-metrics > span { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.detail-metrics > span > small, .detail-metrics > span > strong { display: block; }
.detail-metrics > span > small { color: var(--secondary); font-size: 9px; }
.detail-metrics strong { margin-top: 4px; font-size: 13px; }
.product-sparkline { margin-bottom: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.product-sparkline > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-sparkline h3 { font-size: 12px; }
.product-sparkline svg { width: 100%; height: 72px; margin-top: 8px; overflow: visible; }
.product-sparkline polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.product-sparkline circle { fill: var(--surface-raised); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.product-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-detail-grid > section { min-width: 0; padding: 15px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); }
.product-detail-grid h3 { font-size: 14px; }
.recommendation-list { margin: 0; padding-left: 18px; color: var(--secondary); font-size: 12px; }
.recommendation-list li + li { margin-top: 7px; }
.detail-list { margin: 0; }
.detail-list div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 11px; }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-list dd { margin: 0; white-space: nowrap; }
.warehouse-detail-list dd { white-space: normal; text-align: right; }
.campaign-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.campaign-chips span { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--secondary); font-size: 9px; }
.product-top-link { min-width: 0; display: block; border-radius: 4px; color: inherit; text-decoration: none; }
.product-top-link:hover { color: var(--accent); }
.top-product-card { scroll-margin-top: 82px; }
details.top-product-card.is-route-target { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px rgba(142,227,179,.18), 0 12px 36px rgba(0,0,0,.22); }
details.top-product-card.is-route-target > summary { background: linear-gradient(90deg, rgba(142,227,179,.2), rgba(142,227,179,.05)); }
.product-detail-grid > .top-ad-detail { grid-column: 1 / -1; padding: 14px; border-color: rgba(142,227,179,.28); background: linear-gradient(145deg, rgba(18,34,27,.7), rgba(9,16,14,.82)); box-shadow: inset 3px 0 0 rgba(142,227,179,.7); }
.top-ad-head, .top-ad-chart-head, .top-ad-table-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.top-ad-head { margin-bottom: 10px; }
.top-ad-head .eyebrow { margin-bottom: 2px; }
.top-ad-head h3, .top-ad-chart-head h4, .top-ad-table-head h4, .top-ad-block > h4 { margin-bottom: 0; }
.top-ad-head > p { margin: 2px 0 0; color: var(--secondary); font-size: 10px; white-space: nowrap; }
.top-ad-kpis { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)); gap: 6px; }
.top-ad-kpis > span { min-width: 0; padding: 8px 9px; border: 1px solid rgba(255,255,255,.055); border-radius: 7px; background: rgba(5,10,8,.42); }
.top-ad-kpis small, .top-ad-kpis strong { display: block; }
.top-ad-kpis small { color: var(--secondary); font-size: 8px; }
.top-ad-kpis strong { margin-top: 2px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-ad-insights { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 8px; margin-top: 8px; }
.top-ad-block { min-width: 0; padding: 11px; border: 1px solid rgba(255,255,255,.055); border-radius: 8px; background: rgba(5,10,8,.34); }
.top-ad-chart-head { align-items: center; }
.top-ad-chart-head h4, .top-ad-block > h4, .top-ad-table-head h4, .top-ad-source-body h4 { font-size: 11px; }
.top-ad-chart-head > span { display: inline-flex; align-items: center; gap: 5px; color: var(--secondary); font-size: 8px; white-space: nowrap; }
.top-ad-chart-head i { width: 12px; height: 2px; margin-left: 4px; border-radius: 2px; background: var(--accent); }
.top-ad-chart-head i.spend { background: var(--blue); }
.top-ad-trend svg { display: block; width: 100%; height: 112px; margin-top: 4px; overflow: visible; }
.top-ad-trend svg line { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.top-ad-trend polyline { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.top-ad-trend polyline.sales { stroke: var(--accent); }
.top-ad-trend polyline.spend { stroke: var(--blue); }
.top-ad-trend circle { fill: var(--surface-raised); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.top-ad-chart-dates { display: flex; justify-content: space-between; margin-top: -8px; color: var(--secondary); font-size: 8px; }
.top-ad-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 9px; }
.top-ad-funnel > div { position: relative; min-width: 0; padding: 8px 8px 10px; overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: rgba(7,12,10,.54); }
.top-ad-funnel > div > span { position: absolute; left: 0; bottom: 0; width: var(--funnel-width); height: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.top-ad-funnel small, .top-ad-funnel strong, .top-ad-funnel em { display: block; }
.top-ad-funnel small { color: var(--secondary); font-size: 8px; }
.top-ad-funnel strong { margin-top: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.top-ad-funnel em { margin-top: 2px; color: #6f7e76; font-size: 7px; font-style: normal; line-height: 1.25; }
.top-ad-table-block { min-width: 0; margin-top: 10px; }
.top-ad-table-head { align-items: flex-end; }
.top-ad-table-head p { margin: 2px 0 0; color: var(--secondary); font-size: 9px; }
.top-ad-table-wrap { margin-top: 7px; border: 1px solid var(--border); border-radius: 8px; }
.top-ad-table { min-width: 1120px; font-size: 10px; }
.top-ad-table th, .top-ad-table td { max-width: 250px; padding: 7px 8px; }
.top-ad-table th { cursor: default; }
.top-ad-table td:nth-child(n+3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.top-ad-table td strong, .top-ad-table td small { display: block; }
.top-ad-table td strong { font-size: 10px; }
.top-ad-table td small { margin-top: 2px; color: var(--secondary); font-size: 8px; }
.performance-badge { display: inline-flex; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--secondary); background: rgba(255,255,255,.025); font-size: 8px; font-weight: 600; white-space: nowrap; }
.performance-badge.efficient { border-color: rgba(142,227,179,.34); color: var(--accent); background: rgba(142,227,179,.08); }
.performance-badge.average { border-color: rgba(101,169,255,.27); color: var(--blue); }
.performance-badge.weak { border-color: rgba(255,113,105,.3); color: var(--danger); background: rgba(255,113,105,.055); }
.performance-badge.insufficient, .performance-badge.not_comparable { color: var(--secondary); }
.top-ad-source { margin-top: 10px; border: 1px solid rgba(142,227,179,.14); border-radius: 8px; background: rgba(5,10,8,.28); overflow: hidden; }
.top-ad-source > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; color: var(--foreground); font-size: 10px; font-weight: 600; list-style: none; cursor: pointer; }
.top-ad-source > summary::-webkit-details-marker { display: none; }
.top-ad-source > summary::after { content: "⌄"; color: var(--accent); transition: transform .16s ease; }
.top-ad-source[open] > summary::after { transform: rotate(180deg); }
.top-ad-source > summary span { margin-left: auto; color: var(--secondary); font-size: 8px; font-weight: 400; }
.top-ad-source-body { padding: 0 10px 10px; border-top: 1px solid rgba(142,227,179,.1); }
.top-ad-source-body h4 { margin: 10px 0 0; }

.split-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(520px, 1.28fr); gap: 16px; align-items: start; }
.finance-page-head { align-items: center; margin-bottom: 28px; }
.finance-settings-button { min-width: 250px; justify-content: flex-start; gap: 10px; text-align: left; }
.finance-settings-button strong, .finance-settings-button small { display: block; }
.finance-settings-button strong { font-size: 12px; }
.finance-settings-button small { margin-top: 2px; color: var(--secondary); font-size: 9px; }
.finance-overview { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(320px, .92fr) minmax(480px, 1.45fr); gap: 11px; align-items: stretch; margin-bottom: 11px; }
.finance-overview > .panel { min-height: 390px; margin: 0; }
.finance-profit-card { display: flex; flex-direction: column; justify-content: space-between; padding: 25px; border-color: rgba(142,227,179,.22); background: linear-gradient(155deg, rgba(20,38,31,.97), rgba(10,15,18,.98) 74%); }
.finance-profit-card .eyebrow { margin-bottom: auto; }
.finance-profit-value { display: block; margin: 40px 0 3px; font-size: clamp(36px, 4.2vw, 60px); line-height: .95; letter-spacing: -.052em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-profit-period { margin: 0; color: var(--secondary); font-size: 11px; }
.finance-profit-ratios { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 27px; }
.finance-profit-ratios span { padding: 10px; border: 1px solid rgba(142,227,179,.13); border-radius: 8px; color: var(--secondary); background: rgba(6,12,9,.38); font-size: 10px; }
.finance-profit-ratios b { display: block; margin-top: 2px; color: var(--foreground); font-size: 16px; }
.finance-cost-progress { margin-top: 15px; color: var(--secondary); font-size: 9px; }
.finance-cost-progress span { display: flex; justify-content: space-between; gap: 12px; }
.finance-cost-progress::after { content: ""; display: block; height: 3px; margin-top: 7px; border-radius: 4px; background: rgba(255,255,255,.055); }
.finance-expense-panel, .finance-trend-panel { padding: 20px; }
.finance-expense-panel h2, .finance-trend-panel h2 { font-size: 18px; }
.finance-trend-panel { min-width: 0; }
.finance-trend-switcher { flex: none; }
.finance-trend-switcher button { padding: 5px 8px; font-size: 9px; }
.finance-summary-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 0 0 24px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.finance-summary-strip > div { min-width: 0; min-height: 92px; padding: 14px 16px; background: var(--surface); }
.finance-summary-strip small, .finance-summary-strip strong, .finance-summary-strip span { display: block; }
.finance-summary-strip small { color: var(--secondary); font-size: 9px; }
.finance-summary-strip strong { margin-top: 7px; font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-summary-strip span { margin-top: 3px; color: #65707a; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finance-reconciliation-panel { margin-bottom: 24px; }
.finance-settings-drawer { width: min(1120px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow: auto; }
.finance-settings-drawer::backdrop { background: rgba(0,0,0,.72); }
.finance-settings-dialog-head { position: sticky; top: -22px; z-index: 4; grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin: -22px -22px 0; padding: 20px 22px 15px; border-bottom: 1px solid var(--border); background: rgba(13,18,23,.97); backdrop-filter: blur(18px); }
.finance-settings-dialog-head h2 { font-size: 24px; }
.edit-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--accent); font-size: 15px; }
.finance-settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 22px; }
.finance-settings-form > section { min-width: 0; }
.finance-settings-heading { min-height: 48px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.finance-settings-heading h2 { font-size: 16px; }
.finance-settings-heading p { font-size: 10px; }
.finance-input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.finance-input-grid label { min-width: 0; }
.finance-input-grid label > span:first-child { display: block; margin-bottom: 5px; color: var(--secondary); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money-input { position: relative; display: block; }
.money-input input { padding-right: 58px; }
.money-input > small { position: absolute; top: 50%; right: 10px; color: var(--secondary); font-size: 9px; transform: translateY(-50%); pointer-events: none; }
.finance-checkbox { grid-column: 1 / -1; min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); cursor: pointer; }
.finance-checkbox input { width: 15px; min-height: 15px; margin: 0; padding: 0; accent-color: var(--accent); }
.finance-checkbox > span { margin: 0 !important; color: var(--foreground) !important; font-size: 11px !important; }
.finance-product-settings, .finance-form-actions { grid-column: 1 / -1; }
.finance-settings-search { width: min(300px, 100%); }
.finance-product-costs { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.finance-product-cost-row { min-height: 72px; display: grid; grid-template-columns: minmax(250px, 1.5fr) minmax(140px, .7fr) 160px; align-items: center; gap: 14px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: default; }
.finance-product-cost-row:last-child { border-bottom: 0; }
.finance-product-cost-row .product-photo-link { width: 34px; height: 44px; }
.product-cost-category { min-width: 0; color: var(--secondary); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-cost-category small { display: block; margin-top: 3px; color: #65707a; }
.finance-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.finance-form-actions .form-error { flex: 1; margin: 0; }
.finance-warnings { margin: -12px 0 24px; }
.finance-expenses { margin-top: 10px; }
.finance-expense-row, .finance-expense-row > summary { min-height: 49px; align-items: center; justify-content: space-between; gap: 14px; }
.finance-expense-row { display: flex; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 11px; }
details.finance-expense-row { display: block; padding: 0; }
.finance-expense-row > summary { display: flex; padding: 8px 2px; list-style: none; cursor: pointer; }
.finance-expense-row > summary::-webkit-details-marker { display: none; }
.finance-expense-row > summary > span:first-child::after { content: "›"; display: inline-block; margin-left: 7px; color: var(--secondary); transition: transform .16s ease; }
.finance-expense-row[open] > summary > span:first-child::after { transform: rotate(90deg); }
.finance-expense-row span, .finance-expense-row strong, .finance-expense-row small { display: block; }
.finance-expense-row small { margin-top: 2px; color: var(--secondary); font-size: 8px; }
.finance-expense-row strong { white-space: nowrap; }
.finance-expense-amount { min-width: 104px; text-align: right; }
.finance-expense-amount i { position: relative; display: block; width: 100%; height: 3px; margin-top: 6px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.finance-expense-amount i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--expense-share); border-radius: inherit; background: var(--warning); }
.finance-expense-row dl { margin: 0 0 8px 12px; padding: 6px 10px; border-left: 1px solid var(--border-strong); }
.finance-expense-row dl div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--secondary); font-size: 10px; }
.finance-expense-row dt, .finance-expense-row dd { margin: 0; }
.finance-trend { min-width: 0; margin-top: 10px; }
.finance-trend-meta { display: grid; grid-template-columns: minmax(130px, 1fr) auto; align-items: end; gap: 1px 14px; min-height: 49px; }
.finance-trend-meta > div { grid-row: 1 / 3; }
.finance-trend-meta small, .finance-trend-meta strong { display: block; }
.finance-trend-meta small { color: var(--secondary); font-size: 8px; }
.finance-trend-meta strong { margin-top: 2px; font-size: 23px; font-variant-numeric: tabular-nums; }
.finance-trend-meta > span { color: var(--secondary); font-size: 8px; text-align: right; }
.finance-trend-meta b { color: var(--foreground); font-weight: 550; }
.finance-trend canvas { display: block; max-width: 100%; margin-top: 7px; }
.finance-trend-dates { display: flex; justify-content: space-between; margin-top: -17px; color: var(--secondary); font-size: 8px; }
.finance-trend-data { margin-top: 17px; border-top: 1px solid var(--border); }
.finance-trend-data > summary { padding: 9px 0 0; color: var(--secondary); font-size: 9px; cursor: pointer; }
.finance-trend-table-wrap { max-height: 230px; margin-top: 9px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.finance-trend-table-wrap table { font-size: 9px; }
.finance-trend-table-wrap th, .finance-trend-table-wrap td { padding: 6px 7px; white-space: nowrap; }
.profit-bridge { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 9px; margin-top: 22px; }
.profit-step { min-width: 0; padding: 15px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.profit-step.is-result { border-color: rgba(142,227,179,.35); background: var(--accent-soft); }
.profit-step small, .profit-step strong { display: block; }
.profit-step small { color: var(--secondary); font-size: 9px; }
.profit-step strong { margin-top: 5px; font-size: 17px; white-space: nowrap; }
.profit-arrow { color: var(--secondary); }
.finance-products-panel { padding-inline: 0; overflow: hidden; }
.finance-products-panel > .panel-head { padding-inline: 24px; }
.finance-product-controls { width: min(820px, 100%); display: grid; grid-template-columns: minmax(190px, 1.35fr) repeat(3, minmax(135px, .9fr)); gap: 7px; }
.finance-product-controls input, .finance-product-controls select { min-width: 0; width: 100%; }
.finance-table-wrap { width: 100%; overflow-x: auto; }
.finance-table { min-width: 1120px; margin-top: 18px; border-top: 1px solid var(--border); }
.finance-table th:first-child, .finance-table td:first-child { padding-left: 24px; }
.finance-table th:last-child, .finance-table td:last-child { padding-right: 24px; }
.finance-table th:not(:first-child), .finance-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-table td > small { display: block; margin-top: 3px; color: var(--secondary); font-size: 9px; }
.finance-table .product-name { min-width: 250px; max-width: 330px; text-align: left; white-space: normal; }
.finance-product-row { cursor: pointer; }
.finance-product-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.finance-product-row[aria-expanded="true"] > td { border-bottom-color: transparent; background: rgba(142,227,179,.055); }
.finance-product-row[aria-expanded="true"] > td:first-child { box-shadow: inset 3px 0 var(--accent); }
.finance-row-chevron { display: inline-block; color: var(--secondary); font-size: 17px; transition: transform .16s ease; }
.finance-product-group.is-expanded .finance-row-chevron { color: var(--accent); transform: rotate(180deg); }
.finance-statuses { display: flex !important; justify-content: flex-end; gap: 4px; }
.finance-status-badge { display: inline-flex !important; width: fit-content; margin-top: 3px; padding: 2px 5px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--secondary); background: rgba(255,255,255,.025); font-size: 7px; }
.finance-status-badge.loss, .finance-status-badge.low_margin { border-color: rgba(255,113,105,.27); color: var(--danger); background: rgba(255,113,105,.055); }
.finance-status-badge.missing_cost { border-color: rgba(244,189,106,.27); color: var(--warning); background: rgba(244,189,106,.055); }
.finance-product-detail-row > td { padding: 0 !important; text-align: left !important; white-space: normal !important; background: rgba(8,14,12,.64); }
.finance-product-detail { padding: 18px 24px 22px; border-bottom: 1px solid rgba(142,227,179,.25); box-shadow: inset 3px 0 var(--accent); }
.finance-product-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.finance-detail-metrics { display: flex; flex-wrap: wrap; gap: 7px; }
.finance-detail-metrics span { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--secondary); background: rgba(255,255,255,.02); font-size: 9px; }
.finance-detail-metrics strong { margin-left: 4px; color: var(--foreground); }
.finance-unit-switcher button { padding: 5px 8px; font-size: 9px; }
.finance-detail-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.finance-detail-grid > section { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(5,10,8,.34); }
.finance-detail-grid h3 { margin: 0 0 9px; color: var(--secondary); font-size: 10px; font-weight: 600; }
.finance-formula > div, .finance-detail-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.045); font-size: 10px; }
.finance-formula > div:last-child, .finance-detail-list > div:last-child { border-bottom: 0; }
.finance-formula .is-result { margin-top: 5px; padding-top: 8px; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.finance-detail-list { margin: 0; }
.finance-detail-list dt, .finance-detail-list dd { margin: 0; }
.finance-detail-list dt { color: var(--secondary); }
.finance-detail-list dd { font-variant-numeric: tabular-nums; }
.finance-detail-note { margin: 11px 0 0; font-size: 9px; }
.positive-value { color: var(--accent); }
.negative-value { color: var(--danger); }
.missing-value { color: var(--warning); }
.bar-list { margin-top: 18px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(100px, 1.5fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.bar-row:last-child { border-bottom: 0; }
.bar-row > div { min-width: 0; }
.bar-row strong, .bar-row small { display: block; }
.bar-row > div strong, .bar-row > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row small { margin-top: 3px; color: var(--secondary); font-size: 10px; }
.bar-track { height: 5px; border-radius: 8px; background: rgba(255,255,255,.045); overflow: hidden; }
.product-details { margin-top: 16px; }
.product-card { margin-bottom: 7px; border-radius: 11px; box-shadow: none; overflow: hidden; }
.product-card summary { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; list-style: none; cursor: pointer; }
.product-card summary::-webkit-details-marker { display: none; }
.product-card summary::after { content: ""; width: 8px; height: 8px; flex: none; border-right: 1.5px solid var(--secondary); border-bottom: 1.5px solid var(--secondary); transform: rotate(45deg); transition: transform .18s ease; }
.product-card[open] summary::after { transform: rotate(225deg); }
:is(.top-advanced-filters, .top-product-card, .ad-campaign-group, .campaign-card, .product-card) { overflow-anchor: none; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
:is(.top-advanced-filters, .top-product-card, .ad-campaign-group, .campaign-card, .product-card)[open] { border-color: rgba(142,227,179,.48); background: rgba(18,34,27,.72); box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px rgba(142,227,179,.08); }
:is(.top-advanced-filters, .top-product-card, .ad-campaign-group, .campaign-card, .product-card)[open] > summary { background: linear-gradient(90deg, rgba(142,227,179,.16), rgba(142,227,179,.04)); }
.product-card summary > span:first-child { min-width: 0; }
.product-card summary strong, .product-card summary small { display: block; }
.product-card summary > span:first-child strong, .product-card summary > span:first-child small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-card summary small { margin-top: 3px; color: var(--secondary); font-size: 10px; }
.product-totals { flex: none; display: grid; grid-template-columns: repeat(3, auto); column-gap: 12px; text-align: right; }
.product-totals b { font-size: 16px; }
.product-totals small { grid-row: 2; }
.product-body { padding: 0 15px 15px; border-top: 1px solid var(--border); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 0; }
.mini-stats span { padding: 6px 9px; border-radius: 7px; color: var(--secondary); background: rgba(255,255,255,.025); font-size: 11px; }
.mini-stats b { color: var(--foreground); }
.warehouse-rows > div { display: grid; grid-template-columns: minmax(180px, 1fr) repeat(3, 70px); gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.warehouse-rows span { text-align: right; }
.warehouse-rows span:first-child { text-align: left; }
.warehouse-rows strong, .warehouse-rows small { display: block; }
.warehouse-rows small { color: var(--secondary); font-size: 9px; }

.warehouse-panel { margin-bottom: 16px; padding: 0; overflow: hidden; }
.warehouse-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 24px; border: 0; color: var(--foreground); background: transparent; text-align: left; cursor: pointer; }
.warehouse-toggle:hover { background: rgba(255,255,255,.015); }
.warehouse-toggle:focus-visible { outline-offset: -2px; }
.warehouse-toggle > span { min-width: 0; }
.warehouse-toggle-title { display: block; margin-bottom: 5px; font-size: 21px; line-height: 1.2; letter-spacing: -.018em; font-weight: 700; }
.warehouse-toggle::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 1.5px solid var(--secondary); border-bottom: 1.5px solid var(--secondary); transform: rotate(45deg); transition: transform .18s ease; }
.warehouse-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.warehouse-content { padding: 0 24px 24px; }
.warehouse-filter-row { display: flex; justify-content: flex-end; }
.warehouse-filter-row select { width: 165px; }
.warehouse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px; margin-top: 18px; }
.warehouse-card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 11px; color: var(--foreground); background: var(--surface-soft); text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.warehouse-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.warehouse-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.warehouse-card-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.warehouse-card-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warehouse-card-head small { flex: none; color: var(--secondary); font-size: 9px; }
.warehouse-card-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 15px; }
.warehouse-card-metrics span { min-width: 0; }
.warehouse-card-metrics b, .warehouse-card-metrics small { display: block; }
.warehouse-card-metrics b { font-size: 16px; }
.warehouse-card-metrics small { margin-top: 2px; color: var(--secondary); font-size: 8px; }
.notice { margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--secondary); background: rgba(255,255,255,.025); font-size: 11px; }
.notice.warning { border-color: rgba(244,189,106,.28); color: var(--warning); background: rgba(244,189,106,.06); }
.logistics-products-panel { overflow: hidden; padding-inline: 0; }
.logistics-products-panel > .panel-head { padding-inline: 24px; }
.logistics-controls { width: min(760px, 100%); }
.logistics-table-wrap, .supply-table-wrap, .logistics-detail-table { width: 100%; overflow-x: auto; }
.logistics-table { min-width: 1100px; margin-top: 18px; border-top: 1px solid var(--border); }
.logistics-table th:first-child, .logistics-table td:first-child { padding-left: 24px; }
.logistics-table th:last-child, .logistics-table td:last-child { padding-right: 24px; }
.logistics-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.logistics-table td > small { display: block; margin-top: 3px; color: var(--secondary); font-size: 9px; }
.logistics-sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: inherit; background: transparent; cursor: pointer; }
.logistics-sort-button span { color: #5d6770; font-size: 10px; }
.logistics-sort-button.is-active { color: var(--foreground); }
.logistics-sort-button.is-active span { color: var(--accent); }
.logistics-product-row { cursor: pointer; }
.logistics-product-row[aria-expanded="true"] > td { background: rgba(18,34,27,.72); box-shadow: inset 0 1px rgba(142,227,179,.48); }
.logistics-product-row[aria-expanded="true"] > td:first-child { box-shadow: inset 3px 0 var(--accent), inset 0 1px rgba(142,227,179,.48); }
.logistics-product-row[aria-expanded="true"] > td:last-child { box-shadow: inset -1px 0 rgba(142,227,179,.48), inset 0 1px rgba(142,227,179,.48); }
.logistics-detail-row > td { padding: 0 24px 18px !important; background: rgba(7,9,12,.38); }
.logistics-product-row[aria-expanded="true"] + .logistics-detail-row > td { background: rgba(18,34,27,.52); box-shadow: inset 3px 0 var(--accent), inset -1px 0 rgba(142,227,179,.48), inset 0 -1px rgba(142,227,179,.48); }
.logistics-product-row[aria-expanded="true"] + .logistics-detail-row .logistics-detail-table { border-color: rgba(142,227,179,.48); background: rgba(7,14,11,.72); }
.logistics-detail-table { border: 1px solid var(--border); border-radius: 9px; }
.logistics-detail-table table { min-width: 760px; }
.logistics-detail-table th { position: static; }
.logistics-detail-table td:first-child small { display: block; color: var(--secondary); font-size: 9px; }
.logistics-detail-table tr.is-selected { background: var(--accent-soft); }
.logistics-detail-table tr.is-without-movement { color: var(--secondary); }
.logistics-warehouse-link { max-width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.logistics-warehouse-link:hover strong { color: var(--accent); }
.logistics-other-warehouses { width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--border); color: var(--secondary); background: transparent; cursor: pointer; }
.logistics-other-warehouses:hover { color: var(--foreground); background: rgba(255,255,255,.02); }
.warehouse-history { margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(7,14,11,.72); }
.warehouse-history-head, .warehouse-history-totals { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.warehouse-history-head > div > strong, .warehouse-history-head > div > small { display: block; }
.warehouse-history-head > div > small { margin-top: 2px; color: var(--secondary); font-size: 9px; }
.warehouse-history-head label { display: flex; align-items: center; gap: 8px; color: var(--secondary); font-size: 10px; }
.warehouse-history-head select { width: 190px; }
.warehouse-history-chart { margin-top: 10px; }
.warehouse-history-chart svg { display: block; width: 100%; height: 170px; overflow: visible; }
.warehouse-history-totals { justify-content: flex-start; }
.warehouse-history-totals > span:not(.warehouse-history-legend) { min-width: 145px; }
.warehouse-history-totals b, .warehouse-history-totals small { display: block; }
.warehouse-history-totals b { font-size: 16px; }
.warehouse-history-totals small { color: var(--secondary); font-size: 9px; }
.warehouse-history-legend { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--secondary); font-size: 9px; }
.warehouse-history-legend i { width: 14px; height: 3px; margin-left: 7px; border-radius: 2px; background: var(--blue); }
.warehouse-history-legend i.is-orders { height: 8px; background: var(--accent); }
.warehouse-history-baseline { stroke: var(--border-strong); }
.warehouse-history-bar { fill: var(--accent); opacity: .78; }
.warehouse-history-line { fill: none; stroke: var(--blue); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.warehouse-history-point { fill: var(--surface); stroke: var(--blue); stroke-width: 2; vector-effect: non-scaling-stroke; }
.warehouse-history-axis { fill: var(--secondary); font-size: 9px; }
.warehouse-history-hit { fill: transparent; cursor: crosshair; }
.supply-status { display: inline-flex; padding: 4px 7px; border: 1px solid var(--border); border-radius: 99px; color: var(--secondary); font-size: 9px; white-space: nowrap; }
.supply-status.risk { border-color: rgba(255,113,105,.35); color: var(--danger); background: rgba(255,113,105,.07); }
.supply-status.need { border-color: rgba(244,189,106,.32); color: var(--warning); background: rgba(244,189,106,.06); }
.supply-status.enough { border-color: rgba(142,227,179,.28); color: var(--accent); background: var(--accent-soft); }
.supply-form fieldset { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(145px, .7fr)) auto; align-items: end; gap: 10px; margin: 18px 0 0; padding: 0; border: 0; }
.supply-form label span, .supply-form output { display: block; }
.supply-form label > span { margin-bottom: 6px; color: var(--secondary); font-size: 10px; }
.supply-form output { min-height: 38px; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supply-form fieldset:disabled { opacity: .52; }
.supply-summary { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-top: 16px; }
.supply-summary span { padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.02); }
.supply-summary b, .supply-summary small { display: block; }
.supply-summary b { font-size: 20px; }
.supply-summary small { margin-top: 2px; color: var(--secondary); font-size: 9px; }
.supply-results { margin-top: 16px; }
.supply-table { min-width: 980px; }
.supply-table th { position: static; }
.supply-table .supply-check { width: 16px; min-height: 16px; accent-color: var(--accent); }
.supply-table .supply-quantity { width: 92px; min-height: 32px; padding-block: 5px; }

.data-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 16px; align-items: start; }
.dataset-sidebar { min-width: 0; }
.count-badge { min-width: 27px; padding: 3px 8px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); text-align: center; font-size: 11px; }
.dataset-group { margin-top: 20px; }
.dataset-group-title { margin: 0 9px 6px; color: var(--secondary); font-size: 11px; font-weight: 600; }
.dataset-button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 2px; padding: 8px 9px; border: 0; border-radius: 8px; color: var(--foreground); background: transparent; text-align: left; cursor: pointer; }
.dataset-button:hover { background: rgba(255,255,255,.03); }
.dataset-button[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }
.dataset-meta { display: flex; align-items: center; gap: 5px; color: var(--secondary); font-size: 10px; }
.dataset-status { width: 6px; height: 6px; border-radius: 50%; background: var(--secondary); }
.dataset-status.loaded { background: var(--accent); }
.dataset-status.forbidden, .dataset-status.unavailable { background: var(--warning); }
.dataset-status.error { background: var(--danger); }
.table-panel { min-width: 0; overflow: hidden; padding: 0; }
.table-toolbar { padding: 21px 21px 15px; }
.search-row { padding: 0 21px 14px; }
.search-row input { max-width: 360px; }
.table-responsive { width: 100%; overflow-x: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { max-width: 340px; padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { position: sticky; top: 0; z-index: 2; color: var(--secondary); background: var(--surface-raised); font-weight: 600; white-space: nowrap; cursor: pointer; }
tbody tr:hover { background: rgba(142, 227, 179, .025); }
.field-label { position: relative; }
.pagination { padding: 14px 21px 18px; }

.button, .icon-button { border: 0; cursor: pointer; text-decoration: none; transition: background .16s ease, color .16s ease, opacity .16s ease, transform .16s ease; }
.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 9px; font-weight: 550; white-space: nowrap; }
.button-primary { color: #07100b; background: var(--accent); }
.button-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button-secondary { color: var(--foreground); background: var(--surface-raised); }
.button-secondary:hover { background: #172028; }
.button:disabled, .is-disabled { opacity: .38; cursor: default; pointer-events: none; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; color: var(--secondary); background: var(--surface-raised); font-size: 23px; }
.empty-state { min-height: 180px; display: grid; place-items: center; padding: 26px; color: var(--secondary); text-align: center; }
.empty-state.compact { min-height: 78px; }
.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; }

dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); color: var(--foreground); background: var(--surface); box-shadow: 0 28px 90px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(0,0,0,.62); backdrop-filter: blur(8px); }
dialog form { padding: 24px; }
dialog label { display: block; margin: 18px 0 7px; font-size: 12px; font-weight: 600; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(390px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(17,23,29,.98), rgba(11,16,21,.98)); box-shadow: var(--shadow); }
.login-card .brand-mark { margin-bottom: 24px; }
.login-card h1 { margin-bottom: 28px; font-size: 36px; }
.login-card label, .stack-form label { display: block; margin: 14px 0 6px; color: var(--secondary); font-size: 12px; }
.login-card input, .login-card button, .stack-form input, .stack-form select, .stack-form button { width: 100%; }
.login-card button { margin-top: 12px; }
.auth-dialog { width: min(460px, calc(100% - 32px)); }
.admin-dialog { width: min(1120px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 24px; overflow: auto; }
.admin-dialog > .dialog-head { position: sticky; top: -24px; z-index: 3; margin: -24px -24px 20px; padding: 22px 24px 14px; border-bottom: 1px solid var(--border); background: rgba(13,18,23,.96); backdrop-filter: blur(14px); }
.admin-dialog h2, .admin-dialog h3 { margin-bottom: 8px; }
.admin-dialog form { padding: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-section { min-width: 0; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-soft); }
.admin-wide { grid-column: 1 / -1; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.check-label { display: flex !important; align-items: center; gap: 7px; min-height: 36px; }
.stack-form { padding: 0 !important; }
.stack-form > * { margin-top: 8px; }
.account-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.account-checks label { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; }
.admin-list { display: grid; gap: 7px; margin-top: 14px; }
.admin-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-raised); }
.admin-item strong, .admin-item small { display: block; }
.admin-item small { color: var(--secondary); }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-actions input { width: min(230px, 100%); }
.freshness-table { max-height: 390px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.freshness-row { display: grid; grid-template-columns: minmax(170px, 1fr) repeat(4, minmax(135px, .8fr)); gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--border); font-size: 11px; }
.freshness-row:last-child { border-bottom: 0; }
.freshness-row strong, .freshness-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.freshness-row span { color: var(--secondary); }
.freshness-row.is-error strong { color: var(--warning); }
.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { justify-content: flex-end; margin-top: 23px; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 110; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 15px; border: 1px solid var(--border-strong); border-radius: 9px; color: var(--foreground); background: var(--surface-raised); box-shadow: var(--shadow); }

.reveal { opacity: 0; animation: reveal .42s var(--delay, 0ms) ease forwards; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.82); } }
@keyframes draw-line { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade-area { to { opacity: 1; } }
@keyframes grow-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1180px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; gap: 14px; }
  .primary-nav { justify-content: flex-start; overflow-x: auto; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid.analytics-grid { grid-template-columns: repeat(4, 1fr); }
  .split-layout { grid-template-columns: 1fr; }
  .top-summary-grid { grid-template-columns: 1fr; }
  .top-product-card summary { grid-template-columns: 32px minmax(180px, 1fr) 12px; }
  .top-product-quick { grid-column: 2; grid-row: 2; grid-template-columns: repeat(3, minmax(78px, 1fr)) 99px 103px; text-align: left; }
  .top-product-quick .trend-badge, .top-product-quick .stock-badge { justify-self: start; }
  .top-product-card summary::after { grid-column: 3; grid-row: 1 / 3; }
  .supply-form fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-overview { grid-template-columns: minmax(260px, .75fr) minmax(360px, 1.25fr); }
  .finance-overview > .panel { min-height: 350px; }
  .finance-trend-panel { grid-column: 1 / -1; }
  .finance-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .topbar-inner { grid-template-columns: auto 1fr; padding-inline: 16px; }
  .primary-nav { grid-column: 1 / -1; order: 3; padding-bottom: 4px; }
  .topbar-actions { justify-self: end; }
  .account-switcher select { min-width: 110px; max-width: 150px; }
  .current-user { display: none; }
  .sync-state { display: none; }
  main { padding: 22px 16px 70px; }
  .context-bar { align-items: flex-start; flex-direction: column; margin-bottom: 38px; }
  .hero { align-items: start; flex-direction: column; gap: 18px; }
  .coverage { align-items: start; text-align: left; }
  .kpi-grid, .kpi-grid.analytics-grid { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: 1fr; }
  .panel-head, .section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > p { text-align: left; }
  .inline-controls { width: 100%; justify-content: stretch; }
  .inline-controls input, .inline-controls select { max-width: none; }
  .metric-switcher { width: 100%; overflow-x: auto; }
  .metric-switcher button { flex: 1; }
  .advertising-detail-toolbar { align-items: stretch; flex-direction: column; }
  .advertising-view-switcher { width: fit-content; }
  .campaign-card[open] .metric-list { grid-template-columns: repeat(3, 1fr); }
  .campaign-lifecycle-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-settings-panel { grid-template-columns: 1fr; }
  .metric-settings-panel > p { grid-column: 1; }
  .ad-campaign-group > summary { grid-template-columns: minmax(0, 1fr) auto 10px; gap: 10px; }
  .ad-product-summary-metrics { grid-column: 1 / 3; grid-row: 2; }
  .ad-product-count { grid-column: 2; grid-row: 1; }
  .ad-campaign-group > summary::after { grid-column: 3; grid-row: 1 / 3; }
  .ad-campaign-product { grid-template-columns: minmax(0, 1fr); }
  .ad-campaign-product .ad-product-summary-metrics { grid-column: 1; grid-row: 2; }
  .finance-overview { grid-template-columns: 1fr; }
  .finance-overview > .panel { min-height: 0; }
  .finance-trend-panel { grid-column: 1; }
  .finance-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-product-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-settings-form { grid-template-columns: 1fr; }
  .finance-product-settings, .finance-form-actions { grid-column: 1; }
  .finance-product-cost-row { grid-template-columns: minmax(220px, 1fr) 140px; }
  .finance-product-cost-row .product-cost-category { grid-column: 1; grid-row: 2; }
  .finance-product-cost-row .money-input { grid-column: 2; grid-row: 1 / 3; }
  .finance-detail-grid { grid-template-columns: 1fr; }
  .finance-product-detail-head { align-items: flex-start; flex-direction: column; }
  .data-layout { grid-template-columns: 1fr; }
  .dataset-sidebar nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
  .dataset-group { display: contents; }
  .dataset-group-title { display: none; }
  .dataset-button { flex: 0 0 auto; width: auto; white-space: nowrap; background: var(--surface); }
  .top-filter-controls, .advanced-filter-grid { grid-template-columns: repeat(2, 1fr); }
  .top-task-filters { width: 100%; }
  .top-task-row { grid-template-columns: 22px minmax(0, 1fr) 100px; }
  .top-task-check { grid-column: 1; grid-row: 1 / 3; }
  .top-task-copy { grid-column: 2 / 4; grid-row: 1; }
  .top-task-product { grid-column: 2; grid-row: 2; }
  .top-task-revenue { grid-column: 3; grid-row: 2; }
  .detail-metrics { grid-template-columns: repeat(3, 1fr); }
  .top-ad-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .top-ad-insights { grid-template-columns: 1fr; }
  .warehouse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supply-summary { grid-template-columns: repeat(2, 1fr); }
  .warehouse-history-head { align-items: stretch; flex-direction: column; }
  .warehouse-history-head label { justify-content: space-between; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-wide { grid-column: 1; }
  .freshness-row { grid-template-columns: minmax(150px, 1fr) minmax(130px, .8fr); }
  .freshness-row span:nth-of-type(n+2) { display: none; }
}
@media (max-width: 540px) {
  .brand span:last-child { display: none; }
  .topbar-actions .button { padding-inline: 10px; }
  #open-admin, #open-import { font-size: 0; }
  #open-admin::after { content: "⚙"; font-size: 15px; }
  #open-import::after { content: "↻"; font-size: 15px; }
  .context-bar { align-items: stretch; flex-direction: column; }
  .context-bar .segmented { width: 100%; }
  .context-bar .segmented button { flex: 1; }
  .period-controls, .custom-period { width: 100%; }
  .custom-period { flex-wrap: wrap; }
  .custom-period label { flex: 1; }
  .custom-period input { min-width: 0; width: 100%; }
  h1 { font-size: 42px; }
  .kpi-grid, .kpi-grid.analytics-grid, .kpi-grid.compact-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 120px; }
  .module-card { min-height: 235px; }
  .metric-list, .campaign-card[open] .metric-list { grid-template-columns: repeat(2, 1fr); }
  .campaign-lifecycle-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campaign-lifecycle-products-block { align-items: stretch; flex-direction: column; gap: 7px; }
  .campaign-history-event { grid-template-columns: 1fr; }
  .campaign-controls .button { width: 100%; }
  .advertising-view-switcher { width: 100%; }
  .advertising-view-switcher button { flex: 1; min-width: 0; }
  .advertising-settings-row { margin-top: 0; }
  .top-product-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-settings { width: 100%; }
  .metric-settings > summary { width: 100%; }
  .metric-settings-panel { position: static; width: 100%; margin-top: 8px; }
  .metric-settings-grid { grid-template-columns: 1fr; }
  .ad-campaign-group > summary { grid-template-columns: minmax(0, 1fr) 10px; }
  .ad-product-summary-metrics { grid-column: 1; grid-row: 2; }
  .ad-product-count { grid-column: 1; grid-row: 3; }
  .ad-campaign-group > summary::after { grid-column: 2; grid-row: 1 / 4; }
  .inline-controls { flex-direction: column; }
  .abc-summary { grid-template-columns: 1fr; }
  .finance-page-head .finance-settings-button { width: 100%; }
  .finance-profit-value { font-size: 42px; }
  .finance-summary-strip, .finance-product-controls { grid-template-columns: 1fr; }
  .finance-trend-panel .panel-head { gap: 10px; }
  .finance-trend-switcher { width: 100%; }
  .finance-trend-switcher button { flex: 1; }
  .finance-trend-meta { grid-template-columns: 1fr; }
  .finance-trend-meta > div { grid-row: auto; }
  .finance-trend-meta > span { text-align: left; }
  .finance-input-grid { grid-template-columns: 1fr; }
  .finance-checkbox { grid-column: 1; }
  .finance-settings-heading, .finance-form-actions { align-items: stretch; flex-direction: column; }
  .finance-settings-search { width: 100%; }
  .finance-product-cost-row { grid-template-columns: minmax(0, 1fr); }
  .finance-product-cost-row .product-cost-category, .finance-product-cost-row .money-input { grid-column: 1; grid-row: auto; }
  .profit-bridge { grid-template-columns: 1fr; }
  .profit-arrow { transform: rotate(90deg); text-align: center; }
  .problem-summary, .top-filter-controls, .product-detail-grid { grid-template-columns: 1fr; }
  .top-task-filters { grid-template-columns: 1fr; }
  .top-task-row { grid-template-columns: 22px minmax(0, 1fr); }
  .top-task-check { grid-column: 1; grid-row: 1 / 4; }
  .top-task-copy, .top-task-product, .top-task-revenue { grid-column: 2; }
  .top-task-copy { grid-row: 1; }
  .top-task-product { grid-row: 2; }
  .top-task-revenue { grid-row: 3; text-align: left; }
  .advanced-filter-grid { grid-template-columns: 1fr; }
  .top-results-toolbar { align-items: stretch; flex-direction: column; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .top-product-card summary { grid-template-columns: 30px minmax(0, 1fr) 10px; }
  .top-product-quick { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .trend-badge, .stock-badge { width: fit-content; }
  .product-detail-grid > .top-ad-detail { padding: 11px; }
  .top-ad-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .top-ad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-ad-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-ad-table-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .top-ad-source > summary { flex-wrap: wrap; }
  .ranking-row { grid-template-columns: 28px minmax(0,1fr); }
  .ranking-metrics { grid-column: 2; min-width: 0; text-align: left; }
  .bar-row { grid-template-columns: minmax(110px, 1fr) auto; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .product-card summary { align-items: flex-start; flex-direction: column; }
  .product-totals { width: 100%; justify-content: start; text-align: left; }
  .warehouse-rows > div { grid-template-columns: 1fr repeat(3, 48px); }
  .date-grid { grid-template-columns: 1fr; gap: 0; }
  .search-row { align-items: stretch; flex-direction: column; }
  .warehouse-grid, .supply-form fieldset, .supply-summary { grid-template-columns: 1fr; }
  .warehouse-history-totals { align-items: flex-start; flex-wrap: wrap; }
  .warehouse-history-legend { width: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .reveal { opacity: 1; }
}
