:root {
  --bg: #090b10;
  --surface: #10131a;
  --surface-2: #151922;
  --line: #252b36;
  --text: #f4f6fa;
  --muted: #89909e;
  --accent: #c7ff3d;
  --accent-soft: rgba(199, 255, 61, .12);
  --good: #55d68a;
  --warn: #f3bd50;
  --bad: #ff6868;
  --neutral: #747d8c;
  --purple: #9e72ff;
  --sidebar-width: 230px;
  --sidebar-collapsed-width: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -20%, rgba(158, 114, 255, .08), transparent 32rem),
    var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-width);
  padding: 28px 18px;
  background: rgba(12, 14, 20, .96);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: width .2s ease, padding .2s ease;
}
.brand { position: relative; display: flex; align-items: center; gap: 12px; padding: 0 4px 30px; min-width: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  flex: 0 0 38px;
  display: grid; place-items: center; font-weight: 900; color: #0b0e0a;
  background: var(--accent); box-shadow: 0 0 24px rgba(199, 255, 61, .2);
}
.brand-text { min-width: 0; }
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand span, .sidebar-foot span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.sidebar-toggle {
  margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #0c0f15; color: var(--muted); cursor: pointer; transition: .2s;
}
.sidebar-toggle:hover { color: var(--text); border-color: #495160; }
.sidebar-toggle span { display: block; font-size: 22px; line-height: 1; transition: transform .2s ease; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
  padding: 11px 13px; border-radius: 9px; color: var(--muted); text-decoration: none;
  display: flex; gap: 11px; align-items: center; min-width: 0; white-space: nowrap; transition: .2s;
}
.sidebar nav a:hover, .sidebar nav a.active { color: var(--text); background: var(--surface-2); }
.sidebar nav a.active { box-shadow: inset 2px 0 var(--accent); }
.sidebar nav a span { flex: 0 0 22px; text-align: center; color: var(--accent); font-size: 18px; }
.sidebar-foot {
  margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 9px;
}
.sidebar-status-text { min-width: 0; }
.sidebar-foot strong { font-size: 12px; }
.api-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.api-dot.good { background: var(--good); box-shadow: 0 0 10px var(--good); }
.api-dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); }

body.sidebar-collapsed { --sidebar-width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .sidebar { padding: 22px 10px; }
body.sidebar-collapsed .brand { flex-direction: column; justify-content: center; gap: 10px; padding: 0 0 26px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-status-text { display: none; }
body.sidebar-collapsed .sidebar-toggle { margin: 0; width: 34px; height: 30px; }
body.sidebar-collapsed .sidebar-toggle span { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar nav a {
  justify-content: center; gap: 0; padding: 12px 0; font-size: 0;
}
body.sidebar-collapsed .sidebar nav a span { font-size: 20px; }
body.sidebar-collapsed .sidebar nav a.active { box-shadow: inset 3px 0 var(--accent); }
body.sidebar-collapsed .sidebar-foot {
  justify-content: center; padding: 14px 0 0; gap: 0;
}
body.sidebar-collapsed .api-dot { width: 10px; height: 10px; }

main {
  margin-left: var(--sidebar-width);
  padding: 34px clamp(18px, 3vw, 46px) 60px;
  max-width: none;
  transition: margin-left .2s ease;
}
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
h1, h2 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 3vw, 42px); }
h2 { font-size: 22px; }
.subtitle { color: var(--muted); margin: 8px 0 0; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.generated { color: var(--muted); font-size: 12px; }
.icon-button {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 17px;
}
.icon-button:hover { border-color: #495160; }

.filter-panel {
  position: relative; z-index: 10;
  padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  display: grid; grid-template-columns: 145px 145px minmax(170px, .7fr) minmax(240px, 1.2fr) auto; gap: 10px; align-items: end;
}
.period-presets {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; color: var(--muted); font-size: 10px;
}
.period-presets button {
  min-height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); background: #0c0f15; cursor: pointer; font-size: 10px;
}
.period-presets button:hover { color: var(--text); border-color: #495160; }
.period-presets button.active { color: var(--accent); border-color: rgba(199,255,61,.4); background: var(--accent-soft); }
.field { position: relative; }
.field label { display: block; margin: 0 0 7px 2px; color: var(--muted); font-size: 11px; }
input, select, .select-button {
  width: 100%; height: 42px; padding: 0 12px; color: var(--text); background: #0c0f15;
  border: 1px solid var(--line); border-radius: 9px; outline: none;
}
input:focus, select:focus, .select-button:focus { border-color: #566170; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8d94a0 50%), linear-gradient(135deg, #8d94a0 50%, transparent 50%); background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px; background-size: 5px 5px; background-repeat: no-repeat; }
.select-button { display: flex; justify-content: space-between; align-items: center; cursor: pointer; text-align: left; }
.select-button span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.primary-button {
  height: 42px; padding: 0 19px; border: 0; border-radius: 9px; background: var(--accent);
  color: #10130b; font-weight: 800; cursor: pointer; transition: .2s; white-space: nowrap;
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.secondary-button { height: 40px; padding: 0 14px; border: 1px solid rgba(199,255,61,.35); border-radius: 9px; color: var(--accent); background: var(--accent-soft); cursor: pointer; font-weight: 700; font-size: 12px; }
.secondary-button:disabled { opacity: .55; cursor: wait; }
.primary-button.full { width: 100%; margin-top: 22px; }
.article-popover {
  position: absolute; top: 69px; right: 0; width: min(520px, 90vw); padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: #11151d; box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.article-popover input { margin-bottom: 8px; }
#articleOptions { max-height: 300px; overflow: auto; contain: content; }
.article-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.article-actions button, .popover-cancel { min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: #b7bec9; background: #0c0f15; cursor: pointer; font-size: 10px; }
.article-actions button:hover, .popover-cancel:hover { color: var(--text); border-color: #495160; }
.article-selection-info { padding: 0 4px 7px; color: var(--muted); font-size: 10px; }
.article-option { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.article-option:hover { background: var(--surface-2); }
.article-option input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.article-option strong { display: block; font-size: 12px; }
.article-option span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.article-popover-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.article-popover-footer .primary-button { height: 34px; }
.article-popover-footer .primary-button { grid-column: auto; }
.popover-cancel { min-width: 82px; }
.hidden { display: none !important; }
.notice { margin-top: 12px; padding: 11px 14px; color: #d8c58e; background: rgba(243, 189, 80, .08); border: 1px solid rgba(243, 189, 80, .22); border-radius: 9px; font-size: 12px; }
.sync-progress { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sync-progress > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.sync-progress span, #syncErrors { color: var(--muted); }
.progress-track { height: 5px; margin: 10px 0; overflow: hidden; border-radius: 9px; background: #272d37; }
.progress-track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
#syncErrors { font-size: 11px; }
#syncSections { margin-bottom: 7px; color: #b8bec8; font-size: 11px; }
.tech-errors-button { margin-top: 9px; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; text-decoration: underline; }
.technical-errors { max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 10px; color: #c2c8d1; background: #090c11; border-radius: 7px; font-size: 10px; white-space: pre-wrap; }

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-shell {
  width: min(100%, 460px);
  margin: 0;
  padding: 0;
}
.auth-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(21, 25, 34, .96), rgba(13, 16, 22, .98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36);
}
.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}
.auth-brand h1 {
  font-size: 30px;
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-field span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.auth-message {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}
.auth-message[data-type="error"] {
  color: var(--bad);
}
.auth-message[data-type="success"] {
  color: var(--good);
}
.auth-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}
.auth-links a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}
.auth-links a:hover {
  text-decoration: underline;
}
.account-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.account-body {
  min-height: 100vh;
  padding: 34px clamp(18px, 4vw, 54px);
}
.account-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0;
}
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}
.account-head-actions,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.account-grid {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(360px, 1.2fr);
  gap: 14px;
}
.account-panel {
  padding: 20px;
}
.account-panel-wide {
  grid-column: 1 / -1;
}
.account-panel:nth-child(3) {
  grid-column: 1 / -1;
}
.account-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.account-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.account-list div {
  display: grid;
  grid-template-columns: minmax(130px, .45fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.account-list dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.account-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.account-status-badge {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #0b0e13;
  font-size: 11px;
  font-weight: 800;
}
.account-status-badge[data-status="ok"] {
  color: var(--good);
  border-color: rgba(85, 214, 138, .35);
  background: rgba(85, 214, 138, .08);
}
.account-status-badge[data-status="empty"] {
  color: var(--warn);
  border-color: rgba(243, 189, 80, .35);
  background: rgba(243, 189, 80, .08);
}
.account-token-form,
.account-password-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.account-actions.compact {
  justify-content: flex-start;
}
.account-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.secondary-button.danger {
  color: var(--bad);
  border-color: rgba(255, 104, 104, .28);
  background: rgba(255, 104, 104, .08);
}
.notice[data-type="success"] {
  color: var(--good);
  border-color: rgba(85, 214, 138, .28);
  background: rgba(85, 214, 138, .08);
}
.notice[data-type="error"] {
  color: var(--bad);
  border-color: rgba(255, 104, 104, .28);
  background: rgba(255, 104, 104, .08);
}
@media (max-width: 860px) {
  .account-head,
  .account-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .account-panel:nth-child(3) {
    grid-column: auto;
  }
  .account-panel-wide {
    grid-column: auto;
  }
}

.summary-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; margin: 16px 0; }
.summary-card { min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, #13171f, #0f1218); }
.summary-card.highlight { border-color: rgba(199,255,61,.28); background: linear-gradient(145deg, rgba(199,255,61,.1), #10131a 70%); }
.summary-card span { color: var(--muted); font-size: 11px; }
.summary-card strong { display: block; margin-top: 12px; font-size: clamp(18px, 2vw, 25px); letter-spacing: -.03em; }
.summary-card small { display: block; margin-top: 7px; color: var(--good); font-size: 10px; }

.dashboard-shell {
  margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(145deg, #12161d, #0d1016);
}
.dashboard-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 10px;
}
.dashboard-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.dashboard-filters button {
  min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); background: #0b0e13; cursor: pointer; font-size: 11px;
}
.dashboard-filters button:hover { color: var(--text); border-color: #495160; }
.dashboard-filters button.active {
  color: #10130b; border-color: var(--accent); background: var(--accent); font-weight: 800;
}
.dashboard-sort { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.dashboard-sort select { width: 190px; height: 36px; font-size: 11px; }
.dashboard-period { margin: 12px 0 16px; color: var(--muted); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.dashboard-card {
  position: relative; min-height: 168px; padding: 20px; overflow: visible;
  border: 1px solid #303744; border-radius: 15px;
  background: linear-gradient(145deg, #1a1f28, #141820);
  box-shadow: 0 10px 28px rgba(0,0,0,.14);
}
.dashboard-card.good {
  border-color: rgba(72, 190, 120, .32);
  background: linear-gradient(145deg, rgba(38, 111, 70, .45), rgba(20, 52, 36, .56));
}
.dashboard-card.bad {
  border-color: rgba(231, 89, 89, .34);
  background: linear-gradient(145deg, rgba(116, 42, 48, .48), rgba(61, 25, 30, .58));
}
.dashboard-card-title {
  min-height: 36px; display: flex; align-items: flex-start; gap: 7px;
  color: #c7cdd6; font-size: 12px; font-weight: 650; line-height: 1.35;
}
.metric-info {
  position: relative; flex: 0 0 auto; width: 17px; height: 17px; padding: 0;
  border: 1px solid #727b89; border-radius: 50%; color: #9ba4b2;
  background: transparent; cursor: help; font: 700 10px/15px Arial;
}
.metric-info::after {
  content: attr(data-tooltip); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 9px);
  width: 270px; padding: 10px 11px; border: 1px solid #394252; border-radius: 9px;
  color: #e3e7ed; background: #080b10; box-shadow: 0 12px 30px rgba(0,0,0,.4);
  font: 400 11px/1.45 "Segoe UI", Arial, sans-serif; text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 5px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.metric-info:hover::after, .metric-info:focus::after {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.dashboard-card > strong {
  display: block; margin-top: 18px; font-size: clamp(25px, 2.3vw, 35px);
  line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.dashboard-change {
  margin-top: 17px; color: var(--neutral); font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-change.good { color: #78e3a3; }
.dashboard-change.bad { color: #ff8b8b; }
.dashboard-change b { margin-left: 3px; font-size: 16px; }

.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.report-tabs {
  min-height: 74px; margin: 16px 0 10px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.report-tabs h2 { font-size: 18px; }
.pivot-panel { overflow: hidden; margin-bottom: 16px; }
.pivot-help {
  padding: 9px 14px; color: var(--muted); background: #0d1016;
  border-bottom: 1px solid var(--line); font-size: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.pivot-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.pivot-actions button {
  min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px;
  color: #9ca5b2; background: #090c11; cursor: pointer; font-size: 9px;
}
.pivot-actions button:hover { color: var(--text); border-color: #495160; }
.pivot-actions button.active { color: var(--accent); border-color: rgba(199,255,61,.38); background: var(--accent-soft); }
.data-quality {
  margin: 12px 14px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  color: #cbd3dd; background: #0c1017; font-size: 11px;
}
.data-quality div { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.data-quality strong { color: #edf2f7; }
.data-quality span { color: #9aa4b2; }
.data-quality b { color: #edf2f7; }
.data-quality b.good { color: var(--good); }
.data-quality b.warn { color: var(--warn); }
.data-quality b.bad { color: var(--bad); }
.data-quality p { margin: 7px 0 0; color: var(--warn); }
.pivot-wrap { max-height: 720px; overflow: auto; }
.pivot-table {
  width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0;
  table-layout: fixed; font-variant-numeric: tabular-nums;
}
.pivot-table th {
  position: sticky; top: 0; z-index: 8; height: 48px; padding: 8px 10px;
  white-space: nowrap; text-align: center; background: #0d1016;
}
.pivot-table td {
  height: 42px; padding: 7px 10px; white-space: nowrap; background: var(--surface);
  border-right: 1px solid rgba(37,43,54,.55); font-size: 11px;
}
.pivot-table .pivot-sticky { position: sticky; z-index: 5; }
.pivot-table th.pivot-sticky { z-index: 10; }
.pivot-metric-column { left: 0; width: 250px; min-width: 250px; max-width: 250px; text-align: left !important; }
.pivot-total-column { left: 250px; width: 125px; min-width: 125px; max-width: 125px; text-align: right !important; font-weight: 750; }
.pivot-missing { color: #929aa7; font-size: 10px; font-weight: 650; text-transform: lowercase; }
.pivot-dynamic-column {
  left: 375px; width: 132px; min-width: 132px; max-width: 132px;
  box-shadow: 9px 0 14px -13px #000;
}
.pivot-date { width: 112px; min-width: 112px; max-width: 112px; }
.pivot-day { min-width: 112px; width: 112px; text-align: right; }
.pivot-day span { font-weight: 650; }
.pivot-day b { display: inline-block; width: 14px; margin-left: 5px; font-size: 11px; text-align: center; }
.pivot-day b.good { color: var(--good); }
.pivot-day b.bad { color: var(--bad); }
.pivot-day b.neutral, .pivot-day.no-data { color: var(--neutral); }
.pivot-group-row td {
  height: 42px; color: #eef1f6; background: linear-gradient(90deg, #202633, #171c25);
  border-top: 8px solid #0b0e13; border-bottom: 1px solid #3b4554; font-weight: 850;
}
.pivot-group-row:first-child td { border-top-width: 0; }
.pivot-group-row:hover td { background: linear-gradient(90deg, #252c3a, #1b212b); }
.pivot-group-row button {
  width: 100%; padding: 0; border: 0; color: inherit; background: transparent;
  cursor: pointer; text-align: left; font-size: 11px; font-weight: 800;
}
.pivot-label-text, .pivot-child-label, .pivot-expand-button span {
  display: inline-block; max-width: 215px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: middle;
}
.pivot-label-text { padding-left: 14px; }
.pivot-expand-button {
  width: 100%; padding: 0 0 0 14px; overflow: hidden; border: 0; color: inherit;
  background: transparent; cursor: pointer; text-align: left; font: inherit;
}
.pivot-child-row td { background: #0d1118; color: #aab2bf; }
.pivot-child-row:hover td { background: #121721; }
.pivot-child-label { position: relative; padding-left: 42px; }
.pivot-child-label::before {
  content: ""; position: absolute; left: 26px; top: 50%; width: 8px;
  border-top: 1px solid #4a5361;
}
.pivot-metric-row:hover td { background: #141922; }
.pivot-sparkline { height: 30px; display: flex; align-items: end; justify-content: center; gap: 3px; }
.pivot-sparkline i { width: 5px; min-height: 3px; border-radius: 2px 2px 0 0; background: var(--neutral); cursor: help; outline: none; transition: filter .12s, transform .12s; }
.pivot-sparkline i:hover, .pivot-sparkline i:focus { filter: brightness(1.35); transform: translateY(-1px); }
.pivot-sparkline i.good { background: var(--good); }
.pivot-sparkline i.bad { background: var(--bad); }
.pivot-sparkline i.neutral { background: #596270; }
.pivot-sparkline i.missing { height: 3px; min-height: 3px; background: #343a45; opacity: .6; }
.chart-tooltip {
  position: fixed; z-index: 1000; left: 0; top: 0; max-width: 260px; padding: 7px 9px;
  border: 1px solid #303744; border-radius: 7px; color: #fff; background: #05070a;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 11px; font-weight: 650;
  line-height: 1.3; white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(3px);
  transition: opacity .1s ease, transform .1s ease, visibility .1s ease;
}
.chart-tooltip.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.article-report-panel { margin: 16px 0; overflow: hidden; }
.article-report-head {
  padding: 17px 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; border-bottom: 1px solid var(--line); background: #12161d; color: var(--text);
}
.article-report-head .eyebrow { color: var(--accent); }
.article-report-head h2 { font-size: 19px; }
.article-report-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.article-report-actions input { width: 260px; height: 34px; color: var(--text); background: #0b0e13; border-color: var(--line); font-size: 11px; }
.article-report-actions button {
  min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px;
  color: #aab1bc; background: #0b0e13; cursor: pointer; font-size: 10px; font-weight: 650;
}
.article-report-actions button:hover, .article-report-actions button.active { color: var(--text); border-color: #4b5564; background: #1a202a; }
.article-report-actions .accent-outline { color: var(--accent); border-color: rgba(199,255,61,.38); background: var(--accent-soft); }
.article-report-meta { padding: 8px 14px; color: var(--muted); background: #0d1016; border-bottom: 1px solid var(--line); font-size: 10px; }
.article-report-wrap { max-height: 650px; overflow: auto; background: #0b0e13; scrollbar-color: #3c4552 #0a0d12; scrollbar-width: thin; }
.article-report-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.article-report-wrap::-webkit-scrollbar-track { background: #0a0d12; }
.article-report-wrap::-webkit-scrollbar-thumb { background: #3c4552; border: 2px solid #0a0d12; border-radius: 8px; }
.article-report-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; color: var(--text); font-size: 10px; }
.article-report-table th {
  position: sticky; top: 0; z-index: 7; min-width: 115px; max-width: 180px; height: 46px;
  padding: 7px 9px; overflow: hidden; color: #aab2bf; background: #1a1f28;
  border-right: 1px solid #303744; border-bottom: 1px solid #3a424f;
  text-overflow: ellipsis; white-space: normal; line-height: 1.2; cursor: pointer;
}
.article-report-table td {
  height: 60px; min-width: 115px; max-width: 220px; padding: 6px 9px; overflow: hidden;
  color: #d7dce4; background: #10141b; border-right: 1px solid #262c36;
  border-bottom: 1px solid #252b35; text-overflow: ellipsis; white-space: nowrap;
}
.article-report-table tr:nth-child(even):not(.article-total-row) td { background: #0d1117; }
.article-report-table tr:hover td { background: #171d26 !important; }
.article-report-table a { color: var(--accent); font-weight: 700; text-decoration: none; }
.article-report-table a:hover { text-decoration: underline; }
.article-report-table .article-sticky-photo { position: sticky; left: 0; z-index: 5; min-width: 70px; max-width: 70px; text-align: center; }
.article-report-table .article-sticky-1 { position: sticky; left: 70px; z-index: 5; min-width: 145px; max-width: 145px; }
.article-report-table .article-sticky-2 { position: sticky; left: 215px; z-index: 5; min-width: 130px; max-width: 130px; }
.article-report-table .article-sticky-3 { position: sticky; left: 345px; z-index: 5; min-width: 145px; max-width: 145px; box-shadow: 8px 0 14px -12px #000; }
.article-report-table th.article-sticky-photo, .article-report-table th.article-sticky-1, .article-report-table th.article-sticky-2, .article-report-table th.article-sticky-3 { z-index: 9; background: #202631; }
.article-total-row td { position: sticky; top: 46px; z-index: 4; height: 42px; color: #edf2e2; background: #20291d; font-weight: 800; border-top: 1px solid #536334; border-bottom: 1px solid #536334; }
.article-total-row .article-sticky-photo, .article-total-row .article-sticky-1, .article-total-row .article-sticky-2, .article-total-row .article-sticky-3 { z-index: 8; background: #273122; }
.article-report-table .article-number, .article-report-table .article-currency, .article-report-table .article-percent { text-align: right; font-variant-numeric: tabular-nums; }
.article-report-table .article-text, .article-report-table .article-link { text-align: left; }
.article-report-table .article-image { text-align: center; }
.article-no-data { color: #747d8c; }
.article-product-photo {
  display: block; width: 48px; height: 48px; margin: 0 auto; object-fit: cover;
  border: 1px solid #343c48; border-radius: 8px; background: #1a1f28; cursor: zoom-in;
}
.article-photo-placeholder {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto;
  border: 1px dashed #3a424e; border-radius: 8px; color: #6e7785; background: #151920;
  font-size: 8px; line-height: 1.1; white-space: normal;
}
.product-photo-preview {
  position: fixed; z-index: 1100; left: 0; top: 0; width: 190px; height: 190px; padding: 5px;
  border: 1px solid #3a4350; border-radius: 12px; background: #080b10;
  box-shadow: 0 18px 48px rgba(0,0,0,.62); opacity: 0; visibility: hidden;
  pointer-events: none; transform: scale(.97); transition: opacity .12s, transform .12s, visibility .12s;
}
.product-photo-preview.visible { opacity: 1; visibility: visible; transform: scale(1); }
.product-photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; background: #151920; }
.column-modal-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.62); backdrop-filter: blur(2px); }
.column-modal {
  position: fixed; z-index: 41; left: 50%; top: 50%; width: min(620px, 92vw); max-height: 82vh;
  padding: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: #11151d; box-shadow: 0 30px 80px rgba(0,0,0,.55); transform: translate(-50%, -50%);
}
.column-modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.column-modal > input { height: 38px; }
.column-modal-actions { display: flex; gap: 6px; margin: 9px 0; }
.column-modal-actions button, .column-modal-footer > button:first-child {
  min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); background: #0a0d12; cursor: pointer; font-size: 10px;
}
.column-options { max-height: 48vh; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 7px 0; }
.column-options label { display: flex; align-items: center; gap: 8px; padding: 7px; border-radius: 6px; color: #c5cad3; font-size: 10px; cursor: pointer; }
.column-options label:hover { background: #181d26; }
.column-options input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.column-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.column-modal-footer .primary-button { height: 34px; }
.table-panel { overflow: hidden; }
#detailsPanel { margin-top: 16px; }
#detailSort { width: 220px; }
.panel-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.segmented { display: flex; padding: 3px; border-radius: 9px; background: #090c11; }
.segmented button { padding: 7px 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; }
.segmented button.active { color: var(--text); background: var(--surface-2); }
.table-wrap { overflow: auto; max-height: 720px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1120px; }
th {
  position: sticky; top: 0; z-index: 2; padding: 12px 14px; color: var(--muted); background: #0d1016;
  border-bottom: 1px solid var(--line); font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .1em;
}
td { padding: 12px 14px; border-bottom: 1px solid rgba(37,43,54,.72); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.012); }
.group-cell { width: 150px; color: #b2b8c3; font-size: 11px; font-weight: 700; }
.group-cell span { padding-left: 9px; border-left: 2px solid var(--purple); }
.metric-name { min-width: 210px; font-weight: 600; font-size: 12px; }
.metric-value { min-width: 115px; font-size: 15px; font-weight: 750; }
.spark-cell { min-width: 160px; width: 190px; }
.sparkline { height: 34px; display: flex; align-items: end; gap: 3px; }
.sparkline i { flex: 1; min-width: 3px; max-width: 11px; border-radius: 2px 2px 0 0; background: #52606e; opacity: .7; }
.sparkline i.hot { background: var(--accent); opacity: .9; }
.sparkline i.missing { height: 4px; background: #343a45; opacity: .45; }
.change { font-size: 11px; font-weight: 700; }
.change.up { color: var(--good); }
.change.down { color: var(--bad); }
.change.neutral { color: var(--neutral); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.good { color: var(--good); background: rgba(85,214,138,.09); }
.status.warn { color: var(--warn); background: rgba(243,189,80,.09); }
.status.bad { color: var(--bad); background: rgba(255,104,104,.09); }
.status.neutral { color: var(--neutral); background: rgba(116,125,140,.09); }
.status.history { color: #9aa2af; background: rgba(116,125,140,.12); text-transform: none; max-width: 210px; line-height: 1.25; border-radius: 8px; }
.recommendation-cell { width: 330px; color: #a7aeba; font-size: 11px; line-height: 1.45; }
.daily-strip { display: flex; gap: 6px; overflow-x: auto; max-width: 520px; }
.daily-chip { min-width: 72px; padding: 7px; border-radius: 7px; background: #0c0f15; }
.daily-chip span { color: var(--muted); font-size: 9px; }
.daily-chip strong { display: block; margin-top: 4px; font-size: 10px; }

.insights-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.insights-grid article { padding: 24px; min-height: 310px; position: relative; overflow: hidden; }
.insights-grid article::after { content: ""; position: absolute; right: -100px; top: -120px; width: 260px; height: 260px; border-radius: 50%; background: rgba(199,255,61,.035); }
.section-icon { float: right; width: 40px; height: 40px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(199,255,61,.18); border-radius: 11px; background: var(--accent-soft); }
.diagnosis-list { margin-top: 24px; display: grid; gap: 9px; }
.diagnosis-item { display: grid; grid-template-columns: 7px 1fr; gap: 11px; padding: 11px 12px; background: #0c0f15; border-radius: 9px; }
.diagnosis-item .bar { border-radius: 3px; background: var(--neutral); }
.diagnosis-item.good .bar { background: var(--good); }
.diagnosis-item.warn .bar { background: var(--warn); }
.diagnosis-item.bad .bar { background: var(--bad); }
.diagnosis-item strong { display: block; font-size: 12px; }
.diagnosis-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.recommendations-panel ol { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: item; display: grid; gap: 12px; }
.recommendations-panel li { counter-increment: item; display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: #c5cad3; line-height: 1.5; font-size: 12px; }
.recommendations-panel li::before { content: counter(item); width: 26px; height: 26px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(199,255,61,.25); border-radius: 8px; font-weight: 800; font-size: 10px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.56); backdrop-filter: blur(3px); }
.settings-drawer { position: fixed; z-index: 31; inset: 0 0 0 auto; width: min(420px, 94vw); padding: 28px; background: #10131a; border-left: 1px solid var(--line); transform: translateX(105%); transition: transform .25s ease; overflow-y: auto; }
.settings-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.setting-row { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row label { font-size: 12px; }
.setting-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.setting-row input { text-align: right; }

.loading { position: fixed; z-index: 50; inset: 0; display: grid; place-content: center; justify-items: center; gap: 15px; background: rgba(7,9,13,.76); backdrop-filter: blur(4px); }
.loader { width: 38px; height: 38px; border: 3px solid #2c3329; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.loading span { color: #c8ced7; font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.unit-page { display: grid; gap: 16px; }
.unit-page.hidden { display: none; }
.unit-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 5px 0 8px;
}
.unit-header h1 { font-size: 32px; }
.unit-header-actions, .unit-toolbar-actions {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px;
}
.unit-more-wrap { position: relative; display: inline-flex; }
.unit-more-menu {
  position: absolute; z-index: 2000; top: calc(100% + 7px); right: 0; display: grid; gap: 4px;
  width: 250px; padding: 8px; border: 1px solid #34404d; border-radius: 12px;
  background: #0c1017; box-shadow: 0 18px 48px rgba(0,0,0,.55);
}
.unit-more-menu button {
  display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: 32px; text-align: left;
  background: transparent !important; border-color: transparent !important;
}
.unit-more-menu button:hover { background: rgba(199,255,61,.08) !important; border-color: rgba(199,255,61,.22) !important; }
.unit-header-actions button, .unit-header-actions select, .unit-toolbar-actions button,
.unit-toolbar-actions select, .unit-section-head button, .unit-column-buttons button,
.unit-column-footer button {
  min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
  color: #c5cbd4; background: #10141b; cursor: pointer; font-size: 10px; font-weight: 700;
}
.unit-header-actions button:hover, .unit-toolbar-actions button:hover, .unit-section-head button:hover {
  color: var(--accent); border-color: rgba(199,255,61,.38);
}
.unit-header-actions .primary-button { color: #0a0d08; background: var(--accent); }
.unit-kpis {
  display: block; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 14px; background: #0c1017;
}
.unit-kpi-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.unit-kpi-summary span {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px;
  border: 1px solid #27303c; border-radius: 999px; color: #b9c1cc; background: #111720;
  font-size: 10px; line-height: 1;
}
.unit-kpi-summary strong { margin-left: 4px; color: #f0f3f7; font-size: 12px; }
.unit-kpi-summary .good strong { color: var(--good); }
.unit-kpi-summary .warn strong { color: var(--warn); }
.unit-kpi-summary .bad strong { color: var(--bad); }
.unit-kpi-summary button {
  min-height: 28px; padding: 0 10px; border: 1px solid rgba(199,255,61,.28); border-radius: 999px;
  color: var(--accent); background: rgba(199,255,61,.08); cursor: pointer; font-size: 10px; font-weight: 800;
}
.unit-kpi-details {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px;
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line);
}
.unit-kpi-details article { min-height: 54px; padding: 9px; }
.unit-kpi-details span { display: block; min-height: 22px; color: var(--muted); font-size: 9px; line-height: 1.25; }
.unit-kpi-details strong { display: block; margin-top: 3px; color: #f0f3f7; font-size: 15px; }
.unit-kpi-details article.good strong { color: var(--good); }
.unit-kpi-details article.warn strong { color: var(--warn); }
.unit-kpi-details article.bad strong { color: var(--bad); }
.unit-settings-panel, .unit-table-panel { overflow: hidden; }
.unit-section-head, .unit-table-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 17px 19px; border-bottom: 1px solid var(--line); background: #12161d;
}
.unit-section-head h2, .unit-table-toolbar h2 { font-size: 18px; }
.unit-settings-grid {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px;
  padding: 16px 19px;
}
.unit-settings-grid label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.unit-settings-grid input, .unit-toolbar-actions input, .unit-toolbar-actions select {
  height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  background: #090c11;
}
.unit-filter-panel {
  width: 100%; margin-top: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: 14px; background: #0c1017;
}
.unit-filter-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 11px;
}
.unit-filter-head h3 { margin: 2px 0 0; color: #eef2f7; font-size: 16px; }
.unit-filter-head-actions, .unit-filter-actions, .unit-filter-presets, .unit-filter-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
}
.unit-filter-head-actions button, .unit-filter-actions button, .unit-filter-presets button, .unit-filter-chips button {
  min-height: 32px; padding: 0 11px; border: 1px solid #303946; border-radius: 8px;
  color: #cdd4de; background: #121821; cursor: pointer; font-size: 10px;
}
.unit-filter-head-actions button:hover, .unit-filter-actions button:hover, .unit-filter-presets button:hover {
  color: var(--accent); border-color: rgba(199,255,61,.36); background: rgba(199,255,61,.07);
}
.unit-filter-presets button.active {
  color: var(--accent); border-color: rgba(199,255,61,.45); background: rgba(199,255,61,.1);
}
.unit-filter-grid, .unit-filter-advanced {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 9px;
}
.unit-filter-grid label, .unit-filter-advanced label, .unit-range-filter {
  display: grid; gap: 5px; min-width: 0; color: #87919f; font-size: 9px; text-transform: uppercase; letter-spacing: .05em;
}
.unit-filter-grid input, .unit-filter-grid select, .unit-filter-advanced select, .unit-range-filter input {
  width: 100%; height: 34px; padding: 0 9px; border: 1px solid #2d3440; border-radius: 7px;
  color: #e5e9ef; background: #090d13; font-size: 11px; text-transform: none; letter-spacing: 0;
}
.unit-filter-grid .unit-check {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px;
  border: 1px solid #2d3440; border-radius: 8px; color: #c4cad3; background: #090d13;
  text-transform: none; letter-spacing: 0; font-size: 10px;
}
.unit-filter-grid .unit-check input { width: 14px; height: 14px; padding: 0; accent-color: var(--accent); }
.unit-filter-presets { margin-top: 10px; }
.unit-filter-advanced { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.unit-range-filter { grid-template-columns: 1fr 1fr; align-items: end; }
.unit-range-filter span { grid-column: 1 / -1; }
.unit-filter-actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.unit-filter-chips { margin-top: 10px; min-height: 28px; }
.unit-filter-chips button {
  min-height: 26px; padding: 0 9px; border-color: rgba(199,255,61,.25);
  color: #dce8b5; background: rgba(199,255,61,.08);
}
.unit-filter-chips button span { color: var(--accent); font-weight: 900; }
.unit-filter-empty { color: #697482; font-size: 10px; }
.unit-bulk-tax select { width: 78px; height: 30px; margin-left: 6px; }
.unit-settings-grid .unit-json-setting { grid-column: span 2; }
.unit-settings-grid textarea {
  min-height: 145px; padding: 9px; resize: vertical; border: 1px solid var(--line);
  border-radius: 8px; color: #d8dde5; background: #090c11; font: 10px/1.4 Consolas, monospace;
}
.unit-toolbar-actions input { width: 240px; }
.unit-toolbar-actions label { display: inline-flex; align-items: center; gap: 5px; color: #aab1bc; font-size: 9px; white-space: nowrap; }
.unit-toolbar-actions label input { width: 14px; height: 14px; accent-color: var(--accent); }
.unit-toolbar-actions .unit-filter-grid label,
.unit-toolbar-actions .unit-filter-advanced label,
.unit-toolbar-actions .unit-range-filter {
  display: grid; align-items: stretch; white-space: normal;
}
.unit-toolbar-actions .unit-filter-grid .unit-check {
  display: inline-flex; align-items: center; white-space: nowrap;
}
.unit-toolbar-actions .unit-filter-grid input,
.unit-toolbar-actions .unit-range-filter input { width: 100%; }
.unit-table-meta { padding: 8px 14px; color: var(--muted); background: #0d1016; border-bottom: 1px solid var(--line); font-size: 10px; }
.unit-table-wrap { max-height: 680px; overflow: auto; scrollbar-color: #3c4552 #0a0d12; scrollbar-width: thin; }
.unit-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.unit-table th {
  position: sticky; top: 0; z-index: 5; min-width: 105px; max-width: 165px; height: 48px;
  padding: 7px 8px; color: #aeb5c0; background: #1b2029; border-right: 1px solid #303744;
  border-bottom: 1px solid #3a424f; white-space: normal; line-height: 1.2;
}
.unit-table td {
  height: 48px; min-width: 105px; max-width: 190px; padding: 5px 7px; color: #d9dde4;
  background: #10141b; border-right: 1px solid #262c36; border-bottom: 1px solid #252b35;
  text-align: right; font-variant-numeric: tabular-nums;
}
.unit-table tr:nth-child(even) td { background: #0d1117; }
.unit-table tr:hover td { background: #171d26; }
.unit-table tr.dirty td { box-shadow: inset 0 1px rgba(199,255,61,.28), inset 0 -1px rgba(199,255,61,.28); }
.unit-table td.editable { padding: 3px; }
.unit-table td.editable input, .unit-table td.editable select {
  width: 100%; min-width: 96px; height: 34px; padding: 0 7px; border: 1px solid transparent;
  border-radius: 5px; color: #edf0f4; background: transparent; text-align: inherit; font-size: 10px;
}
.unit-table td.editable input:hover, .unit-table td.editable input:focus,
.unit-table td.editable select:hover, .unit-table td.editable select:focus {
  outline: none; border-color: #46505e; background: #090c11;
}
.unit-tax-select-button {
  width: 100%; min-width: 74px; height: 32px; padding: 0 22px 0 8px; border: 1px solid #343d49;
  border-radius: 6px; color: #edf0f4; background: #090c11; cursor: pointer; text-align: right;
  position: relative;
}
.unit-tax-select-button::after {
  content: ""; position: absolute; right: 8px; top: 13px; border: 4px solid transparent; border-top-color: #9aa3af;
}
.unit-tax-popover {
  position: fixed; z-index: 5000; width: 96px; padding: 6px; border: 1px solid #3a4553;
  border-radius: 9px; background: #0b0f15; box-shadow: 0 18px 50px rgba(0,0,0,.55);
}
.unit-tax-popover button {
  display: block; width: 100%; height: 30px; margin: 0 0 4px; border: 1px solid transparent;
  border-radius: 6px; color: #dfe4eb; background: transparent; cursor: pointer; text-align: center;
}
.unit-tax-popover button:last-child { margin-bottom: 0; }
.unit-tax-popover button:hover { color: var(--accent); border-color: rgba(199,255,61,.35); background: rgba(199,255,61,.08); }
.unit-table td.editable input + .unit-dimension-source { margin-top: 3px; }
.unit-dimension-source {
  display: block; color: #727c89; font-size: 8px; line-height: 1.1; text-align: right;
}
.unit-dimension-source.wb { color: var(--good); }
.unit-dimension-source.manual { color: var(--warn); }
.unit-dimension-source.missing { color: #68717d; }
.unit-source-restore {
  margin-left: 4px; width: 14px; height: 14px; padding: 0; border: 1px solid #3a4553;
  border-radius: 4px; color: var(--accent); background: #101721; font-size: 9px; line-height: 1;
  cursor: pointer;
}
.unit-table td.unit-text, .unit-table td.unit-subject { text-align: left; }
.unit-table td.unit-boolean { text-align: center; }
.unit-table td.unit-boolean input { min-width: 15px; width: 15px; accent-color: var(--accent); }
.unit-table td.unit-image { min-width: 72px; max-width: 72px; text-align: center; }
.unit-table td.unit-status-cell { min-width: 130px; max-width: 150px; text-align: left; }
.unit-table td.unit-link, .unit-table td.unit-nm { text-align: left; }
.unit-table a { color: var(--accent); font-weight: 700; text-decoration: none; }
.unit-table a:hover { text-decoration: underline; }
.unit-product-photo {
  display: block; width: 48px; height: 48px; margin: 0 auto; object-fit: cover;
  border: 1px solid #343c48; border-radius: 8px; background: #151920; cursor: zoom-in;
}
.unit-photo-placeholder {
  display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto;
  border: 1px dashed #3a424e; border-radius: 8px; color: #6e7785; background: #151920;
  font-size: 8px; line-height: 1.1; white-space: normal;
}
.unit-status {
  display: inline-flex; align-items: center; gap: 6px; max-width: 126px; padding: 5px 7px;
  border-radius: 999px; font-size: 9px; font-weight: 800; line-height: 1.1; white-space: normal;
}
.unit-status::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.unit-status.empty { color: #8b95a3; background: rgba(139,149,163,.1); }
.unit-status.partial { color: var(--warn); background: rgba(243,189,80,.1); }
.unit-status.ready { color: var(--good); background: rgba(85,214,138,.1); }
.unit-status.error { color: var(--bad); background: rgba(255,104,104,.1); }
.unit-cell-dirty { box-shadow: inset 0 0 0 1px rgba(243,189,80,.55); }
.unit-cell-saved { box-shadow: inset 0 0 0 1px rgba(85,214,138,.45); }
.unit-no-data { color: #737c89; font-size: 9px; white-space: nowrap; }
.unit-actions-column, .unit-row-actions {
  position: sticky !important; left: 0; z-index: 7 !important; min-width: 64px !important; max-width: 64px !important;
  text-align: center !important; background: #202631 !important;
}
.unit-row-actions { z-index: 4 !important; background: #141922 !important; }
.unit-row-actions button {
  width: 22px; height: 24px; padding: 0; border: 1px solid #343c48; border-radius: 6px;
  color: #b7bec8; background: #0c1016; cursor: pointer;
}
.unit-row-actions .unit-row-menu-button {
  width: 34px; height: 28px; border-radius: 8px; color: var(--accent); font-size: 18px; line-height: 1;
}
.unit-row-menu {
  position: fixed; z-index: 5000; display: grid; gap: 4px; width: 246px; padding: 8px;
  border: 1px solid #3a4553; border-radius: 12px; background: #0b0f15;
  box-shadow: 0 20px 60px rgba(0,0,0,.62);
}
.unit-row-menu a, .unit-row-menu button, .unit-row-menu span {
  display: flex; align-items: center; min-height: 34px; padding: 0 10px; border: 1px solid transparent;
  border-radius: 8px; color: #dce2e9; background: transparent; font-size: 11px; text-align: left;
  text-decoration: none; cursor: pointer;
}
.unit-row-menu a:hover, .unit-row-menu button:hover {
  color: var(--accent); border-color: rgba(199,255,61,.28); background: rgba(199,255,61,.08);
}
.unit-row-menu .danger { color: var(--bad); }
.unit-row-menu .danger:hover { border-color: rgba(255,104,104,.35); background: rgba(255,104,104,.08); }
.unit-row-menu .disabled { color: #68717d; cursor: default; }
.unit-tax-scope-body { display: grid; gap: 9px; padding: 18px 19px; color: #cbd1da; }
.unit-tax-scope-body p { margin: 0 0 4px; color: var(--muted); }
.unit-tax-scope-body button {
  min-height: 38px; border: 1px solid #343d49; border-radius: 8px; color: #dce2e9;
  background: #0c1118; cursor: pointer;
}
.unit-tax-scope-body button:hover { color: var(--accent); border-color: rgba(199,255,61,.38); }
.unit-empty { height: 100px !important; color: var(--muted) !important; text-align: center !important; }
.unit-columns-overlay {
  position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center;
  padding: 20px; background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
}
.unit-columns-modal {
  width: min(720px, 94vw); max-height: 84vh; overflow: hidden; border: 1px solid var(--line);
  border-radius: 14px; background: #11151d; box-shadow: 0 30px 80px rgba(0,0,0,.65);
}
.unit-columns-modal > input { width: calc(100% - 38px); height: 38px; margin: 14px 19px 7px; }
.unit-column-buttons { display: flex; gap: 7px; padding: 0 19px 10px; }
.unit-column-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px;
  max-height: 48vh; padding: 8px 19px; overflow: auto;
}
.unit-column-list label { display: flex; align-items: center; gap: 8px; padding: 7px; color: #c7ccd4; border-radius: 6px; font-size: 10px; }
.unit-column-list label:hover { background: #181d26; }
.unit-column-list input { width: 15px; height: 15px; accent-color: var(--accent); }
.unit-column-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 19px; border-top: 1px solid var(--line); }
.unit-commission-results { max-height: 55vh; padding: 8px 19px; overflow: auto; }
.unit-commission-results table { min-width: 100%; }
.unit-commission-results th, .unit-commission-results td { padding: 8px; font-size: 10px; }
.unit-commission-results td { color: #d3d8e0; border-bottom: 1px solid var(--line); }
.unit-check-ok { color: var(--good) !important; font-weight: 700; }
.unit-check-bad { color: var(--bad) !important; font-weight: 700; }

.warehouse-page { display: grid; gap: 18px; }
.warehouse-page.hidden { display: none; }
.warehouse-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start;
  padding: 4px 0 2px;
}
.warehouse-heading {
  flex: 0 1 430px;
  min-width: 260px;
}
.warehouse-header h1 { margin: 6px 0 6px; font-size: clamp(30px, 4vw, 52px); }
.warehouse-header-side {
  flex: 1 1 640px;
  min-width: min(100%, 520px);
  display: grid;
  justify-items: end;
  gap: 10px;
}
.warehouse-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.warehouse-header-side .warehouse-actions { width: 100%; }
.warehouse-actions button, .warehouse-filter-head button, .warehouse-tabs button {
  min-height: 36px; padding: 0 13px; border: 1px solid #313946; border-radius: 9px;
  color: #dce2e9; background: #111722; cursor: pointer;
}
.warehouse-actions button:hover, .warehouse-tabs button:hover {
  color: var(--accent); border-color: rgba(199,255,61,.35);
}
.warehouse-filters { display: grid; gap: 13px; }
.warehouse-filter-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
}
.warehouse-filter-head h2 { margin: 4px 0 0; }
.warehouse-filter-head span { color: var(--muted); font-size: 11px; }
.warehouse-filter-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
}
.warehouse-filter-grid label { display: grid; gap: 6px; color: #87909c; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.warehouse-filter-grid input, .warehouse-filter-grid select {
  width: 100%; min-height: 36px; border: 1px solid #2c3440; border-radius: 9px;
  color: #edf0f4; background: #0b1018; padding: 0 10px;
}
.warehouse-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px;
}
.warehouse-card {
  min-height: 74px; padding: 12px; border: 1px solid #252d38; border-radius: 14px;
  background: linear-gradient(145deg, #141922, #0e1219);
}
.warehouse-card span { display: block; color: #818b98; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.warehouse-card strong { display: block; margin-top: 8px; color: #f2f5f8; font-size: 22px; line-height: 1.1; }
.warehouse-card.good strong { color: var(--good); }
.warehouse-card.bad strong { color: var(--bad); }
.warehouse-ilirp {
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
}
.warehouse-ilirp h2 { margin: 3px 0 0; }
.warehouse-ilirp > div:last-child {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; color: #c8ced7; font-size: 11px;
}
.warehouse-ilirp span, .warehouse-ilirp strong {
  padding: 7px 9px; border: 1px solid #303946; border-radius: 999px; background: #0c1118;
}
.warehouse-ilirp {
  align-items: flex-start;
}
.warehouse-ilirp #warehouseIlIrp {
  flex: 1;
  display: grid;
  justify-content: stretch;
  gap: 10px;
  font-size: 12px;
}
.warehouse-localization-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}
.warehouse-localization-card {
  min-height: 58px;
  padding: 10px;
  border: 1px solid #29313c;
  border-radius: 12px;
  background: #0c1118;
}
.warehouse-localization-card span {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #87909c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.warehouse-localization-card strong {
  display: block;
  margin-top: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f2f5f8;
  font-size: 17px;
}
.warehouse-localization-card.good strong { color: var(--good); }
.warehouse-localization-card.warn strong { color: #ffd166; }
.warehouse-localization-card.bad strong { color: var(--bad); }
.warehouse-localization-warning {
  margin: 0;
  color: #ffd166;
  line-height: 1.45;
}
.warehouse-localization-warnings {
  margin: 0;
  padding-left: 18px;
  color: #aeb6c2;
}
.warehouse-localization-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.warehouse-localization-settings label {
  display: grid;
  gap: 5px;
  color: #87909c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.warehouse-localization-settings input,
.warehouse-localization-settings select {
  min-height: 34px;
  border: 1px solid #303946;
  border-radius: 8px;
  color: #edf0f4;
  background: #0b1018;
  padding: 0 9px;
}
.warehouse-localization-settings button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(199,255,61,.35);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(199,255,61,.08);
  cursor: pointer;
}
.warehouse-localization-settings .warehouse-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #303946;
  border-radius: 8px;
  background: #0c1118;
  text-transform: none;
  font-weight: 700;
}
.warehouse-localization-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}
.warehouse-localization-compact > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.warehouse-localization-compact strong,
.warehouse-localization-compact span,
.warehouse-localization-compact em {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.warehouse-localization-compact strong {
  color: #f2f5f8;
  font-size: 14px;
}
.warehouse-localization-compact span {
  color: #c8ced7;
  font-size: 12px;
  line-height: 1.35;
}
.warehouse-localization-compact em {
  color: #ffd166;
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
}
.warehouse-localization-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}
.warehouse-localization-actions button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #303946;
  border-radius: 8px;
  color: #dce2e9;
  background: #0c1118;
  cursor: pointer;
}
.warehouse-localization-actions button:hover {
  color: var(--accent);
  border-color: rgba(199,255,61,.35);
  background: rgba(199,255,61,.08);
}
.warehouse-localization-details {
  display: grid;
  gap: 8px;
}
.warehouse-localization-details .warehouse-localization-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}
.warehouse-localization-details .warehouse-localization-card {
  min-height: 56px;
  padding: 9px;
}
.warehouse-localization-details .warehouse-localization-card strong {
  font-size: 15px;
}
.warehouse-irp-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.warehouse-irp-toggle span {
  position: relative;
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #3a4350;
  border-radius: 999px;
  background: #151b24;
}
.warehouse-irp-toggle span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7d8793;
  transition: transform .15s ease, background .15s ease;
}
.warehouse-irp-toggle input:checked + span {
  border-color: rgba(199,255,61,.55);
  background: rgba(199,255,61,.14);
}
.warehouse-irp-toggle input:checked + span::after {
  transform: translateX(16px);
  background: var(--accent);
}
.warehouse-ilirp {
  display: block;
  padding: 12px;
  overflow: visible;
}
.warehouse-header-side .warehouse-ilirp {
  width: 100%;
  max-width: 980px;
  padding: 10px 12px;
  margin: 0;
}
.warehouse-ilirp #warehouseIlIrp {
  width: 100%;
  min-width: 0;
}
.warehouse-header-side .warehouse-localization-panel {
  gap: 6px;
}
.warehouse-header-side .warehouse-localization-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}
.warehouse-header-side .warehouse-localization-subline {
  font-size: 11px;
}
.warehouse-localization-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: visible;
}
.warehouse-localization-panel.expanded {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}
.warehouse-localization-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.warehouse-localization-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.warehouse-localization-title strong {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f2f5f8;
  font-size: 15px;
  white-space: nowrap;
}
.warehouse-localization-status {
  padding: 4px 8px;
  border: 1px solid #303946;
  border-radius: 999px;
  background: #0c1118;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.warehouse-localization-status.good { color: var(--good); border-color: rgba(110,231,183,.35); }
.warehouse-localization-status.warn { color: #ffd166; border-color: rgba(255,209,102,.35); }
.warehouse-localization-status.bad { color: var(--bad); border-color: rgba(255,107,107,.35); }
.warehouse-localization-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #aeb6c2;
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
}
.warehouse-localization-subline span,
.warehouse-localization-subline em {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.warehouse-localization-subline em {
  color: #ffd166;
  font-style: normal;
}
.warehouse-localization-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}
.warehouse-localization-tabs button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #303946;
  border-radius: 8px;
  color: #dce2e9;
  background: #0c1118;
  cursor: pointer;
}
.warehouse-localization-tabs button.active {
  color: #111;
  border-color: var(--accent);
  background: var(--accent);
  font-weight: 900;
}
.warehouse-localization-tab-body {
  min-width: 0;
  overflow: visible;
}
.warehouse-localization-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.warehouse-localization-grid.compact .warehouse-localization-card {
  min-height: 56px;
  padding: 8px;
}
.warehouse-localization-grid.compact .warehouse-localization-card strong {
  font-size: 15px;
}
.warehouse-localization-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}
.warehouse-localization-status-line {
  min-height: 52px;
  padding: 8px;
  border: 1px solid #29313c;
  border-radius: 10px;
  background: #0c1118;
}
.warehouse-localization-status-line span,
.warehouse-localization-status-line strong {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.warehouse-localization-status-line span {
  color: #87909c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.warehouse-localization-status-line strong {
  margin-top: 5px;
  color: #f2f5f8;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.warehouse-localization-status-line.ok strong { color: var(--good); }
.warehouse-localization-status-line.warn strong { color: #ffd166; }
.warehouse-localization-reason-table {
  width: 100%;
  table-layout: fixed;
  margin-top: 7px;
  border-collapse: collapse;
  color: #c8ced7;
  font-size: 12px;
}
.warehouse-localization-reason-table td {
  padding: 6px 8px;
  border: 1px solid #29313c;
  background: #0c1118;
  overflow-wrap: anywhere;
  white-space: normal;
}
.warehouse-localization-reason-table td:first-child {
  width: 38%;
  color: #87909c;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10px;
}
.warehouse-localization-settings.compact {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  align-items: end;
  gap: 8px;
}
.warehouse-localization-settings.compact .warehouse-irp-toggle {
  grid-column: span 2;
  min-height: 34px;
}
.warehouse-localization-settings.compact .warehouse-localization-warning {
  grid-column: 1 / -1;
}
.warehouse-localization-todo {
  display: grid;
  gap: 8px;
  color: #c8ced7;
}
.warehouse-localization-todo ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.warehouse-localization-todo li {
  padding: 8px;
  border: 1px solid #29313c;
  border-radius: 10px;
  background: #0c1118;
}
.warehouse-localization-todo li.done {
  color: var(--good);
  border-color: rgba(110,231,183,.35);
}
.warehouse-localization-todo p {
  margin: 0;
  color: #ffd166;
  font-size: 12px;
}
.warehouse-localization-todo button {
  justify-self: start;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(199,255,61,.35);
  border-radius: 8px;
  color: var(--accent);
  background: rgba(199,255,61,.08);
}
.warehouse-order-link-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.warehouse-order-link-toolbar > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.warehouse-order-link-toolbar button,
.warehouse-order-link-filter select {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
}
.warehouse-order-link-blockers,
.warehouse-order-link-toplists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.warehouse-order-link-blockers,
.warehouse-order-link-toplist {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.035);
  border-radius: 12px;
  padding: 10px;
}
.warehouse-order-link-blockers strong {
  color: var(--text);
}
.warehouse-order-link-blockers span,
.warehouse-order-link-toplist span {
  color: var(--muted);
  font-size: 12px;
}
.warehouse-order-link-filter {
  margin: 8px 0;
}
.warehouse-order-link-filter label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.warehouse-order-link-toplist {
  min-width: 0;
}
.warehouse-order-link-toplist strong,
.warehouse-order-link-toplist span {
  display: block;
}
.warehouse-order-link-toplist b {
  color: var(--text);
  font-weight: 700;
}
.warehouse-order-link-toplist em {
  display: block;
  color: var(--muted);
  font-style: normal;
  margin-top: 2px;
}
.warehouse-localization-warning.good {
  border-color: rgba(110,231,183,.25);
  color: var(--good);
}
.warehouse-localization-warning.bad {
  border-color: rgba(255,107,107,.25);
  color: var(--bad);
}
.warehouse-mapping-missing td {
  background: rgba(255, 209, 102, .07);
}
.warehouse-mapping-input {
  width: 100%;
  min-width: 120px;
  min-height: 30px;
  border: 1px solid #303946;
  border-radius: 7px;
  color: #edf0f4;
  background: #0b1018;
  padding: 0 8px;
}
.warehouse-mapping-notes {
  display: flex;
  gap: 6px;
  align-items: center;
}
.warehouse-mapping-notes button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(199,255,61,.35);
  border-radius: 7px;
  color: var(--accent);
  background: rgba(199,255,61,.08);
  cursor: pointer;
}
.warehouse-recommendation-row {
  cursor: pointer;
}
.warehouse-recommendation-row.bad td,
.warehouse-recommendation-row.warn td {
  background: transparent;
}
.warehouse-priority {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #303946;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}
.warehouse-priority.bad {
  color: var(--bad);
  border-color: rgba(255, 107, 107, .35);
  background: rgba(255, 107, 107, .08);
}
.warehouse-priority.warn {
  color: #ffd166;
  border-color: rgba(255, 209, 102, .35);
  background: rgba(255, 209, 102, .08);
}
.warehouse-priority.muted {
  color: #aeb6c2;
  background: #0c1118;
}
.warehouse-gap-plus {
  color: #e2e7ee;
  font-weight: 800;
}
.warehouse-gap-minus {
  color: #e2e7ee;
  font-weight: 800;
}
.warehouse-recommendation-note,
.warehouse-recommendation-formula {
  margin: 0 0 8px;
  color: #ffd166;
  font-size: 12px;
  line-height: 1.4;
}
.warehouse-recommendation-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.warehouse-recommendation-detail-card {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid #29313c;
  border-radius: 10px;
  background: #0c1118;
}
.warehouse-recommendation-detail-card strong {
  color: #f2f5f8;
  font-size: 12px;
}
.warehouse-recommendation-detail-card span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #c8ced7;
  font-size: 12px;
}
.warehouse-recommendation-detail-card em {
  color: #87909c;
  font-style: normal;
  white-space: nowrap;
}
@media (max-width: 1280px) {
  .warehouse-localization-grid.compact,
  .warehouse-localization-status-grid,
  .warehouse-localization-todo ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .warehouse-localization-settings.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .warehouse-recommendation-detail-grid,
  .warehouse-overview-grid,
  .warehouse-product-detail-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .warehouse-localization-topline {
    align-items: flex-start;
    flex-direction: column;
  }
  .warehouse-localization-actions {
    justify-content: flex-start;
  }
  .warehouse-localization-grid.compact,
  .warehouse-localization-status-grid,
  .warehouse-localization-settings.compact,
  .warehouse-localization-todo ol {
    grid-template-columns: 1fr;
  }
  .warehouse-quick-actions {
    align-items: stretch;
  }
  .warehouse-quick-actions .warehouse-sort,
  .warehouse-quick-actions button,
  .warehouse-more-menu {
    flex: 1 1 100%;
  }
  .warehouse-sort select {
    flex: 1;
    max-width: none;
  }
  .warehouse-more-menu-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }
  .warehouse-meta {
    align-items: stretch;
    flex-direction: column;
  }
  .warehouse-active-filters {
    justify-content: flex-start;
  }
}
.warehouse-table-panel { display: grid; gap: 9px; }
.warehouse-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.warehouse-tabs button.active {
  color: #111; border-color: var(--accent); background: var(--accent); font-weight: 900;
}
.warehouse-table-actions {
  display: grid; gap: 7px; padding: 0 0 2px;
}
.warehouse-quick-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
}
.warehouse-table-actions button, .warehouse-table-actions select, .warehouse-more-menu > summary {
  min-height: 30px; padding: 0 9px; border: 1px solid #303946; border-radius: 8px;
  color: #dce2e9; background: #0c1118;
  font-size: 11px;
}
.warehouse-table-actions button, .warehouse-more-menu > summary { cursor: pointer; }
.warehouse-table-actions button:hover, .warehouse-table-actions button.active, .warehouse-more-menu[open] > summary, .warehouse-more-menu > summary:hover {
  color: var(--accent); border-color: rgba(199,255,61,.35); background: rgba(199,255,61,.08);
}
.warehouse-more-menu {
  position: relative;
}
.warehouse-more-menu > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
}
.warehouse-more-menu > summary::-webkit-details-marker {
  display: none;
}
.warehouse-more-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 10px;
  width: min(360px, 88vw);
  padding: 12px;
  border: 1px solid #303946;
  border-radius: 13px;
  background: #0b1018;
  box-shadow: 0 18px 45px rgba(0,0,0,.45);
}
.warehouse-more-menu-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 9px;
  border-bottom: 1px solid #1f2732;
}
.warehouse-more-menu-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.warehouse-more-menu-group > span {
  flex: 0 0 100%;
  color: #87909c;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.warehouse-more-menu-panel .warehouse-sort,
.warehouse-more-menu-panel .warehouse-zero-toggle {
  width: 100%;
}
.warehouse-zero-toggle, .warehouse-sort {
  display: inline-flex; align-items: center; gap: 8px; color: #aeb6c2; font-size: 11px; cursor: pointer;
  min-height: 30px; padding: 0 9px; border: 1px solid #303946; border-radius: 8px; background: #0c1118;
  user-select: none;
}
.warehouse-sort select {
  width: auto;
  min-width: 145px;
  max-width: 230px;
}
.warehouse-more-menu-panel .warehouse-sort select {
  flex: 1;
  max-width: none;
}
.warehouse-zero-toggle input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 34px !important; min-width: 34px !important;
  height: 18px !important; min-height: 18px !important; margin: 0; padding: 0 !important;
  border: 1px solid #3a4553 !important; border-radius: 999px; background: #080c12; cursor: pointer;
  position: relative; transition: border-color .15s ease, background .15s ease;
}
.warehouse-zero-toggle input::after {
  content: ""; position: absolute; width: 12px; height: 12px; left: 2px; top: 2px;
  border-radius: 50%; background: #768190; transition: transform .15s ease, background .15s ease;
}
.warehouse-zero-toggle input:checked {
  border-color: rgba(199,255,61,.75) !important; background: rgba(199,255,61,.18);
}
.warehouse-zero-toggle input:checked::after {
  transform: translateX(16px); background: var(--accent);
}
.warehouse-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 10px;
  color: var(--muted);
  font-size: 11px;
}
.warehouse-meta-text {
  color: #aeb6c2;
}
.warehouse-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.warehouse-filter-chip,
.warehouse-reset-filters {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(199,255,61,.32);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(199,255,61,.08);
  font-size: 10px;
  cursor: pointer;
}
.warehouse-filter-chip span {
  color: #f0f4f8;
  font-weight: 900;
}
.warehouse-reset-filters {
  color: #c8ced7;
  border-color: #303946;
  background: #0c1118;
}
.warehouse-table-wrap {
  max-height: 68vh; overflow: auto; border: 1px solid #252d38; border-radius: 13px; background: #0a0e14;
}
.warehouse-table {
  width: 100%; min-width: 1320px; border-collapse: separate; border-spacing: 0;
}
.warehouse-table th {
  position: sticky; top: 0; z-index: 4; padding: 9px 10px; border-bottom: 1px solid #303846;
  color: #b9c1cc; background: #171d27; font-size: 10px; text-align: left; white-space: nowrap;
}
.warehouse-table td {
  padding: 8px 10px; border-bottom: 1px solid #1e2530; color: #e2e7ee; font-size: 11px; vertical-align: middle;
}
.warehouse-table tr:hover td { background: #111823; }
.warehouse-product-row { cursor: pointer; }
.warehouse-product-row.bad td,
.warehouse-product-row.warn td,
.warehouse-product-row.ok td,
.warehouse-product-row.muted td {
  color: #e2e7ee;
}
.warehouse-product-row.skew td { background: transparent; }
.warehouse-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.warehouse-table td.muted { color: #737d8a; }
.warehouse-table a { color: var(--accent); font-weight: 800; text-decoration: none; }
.warehouse-table a:hover { text-decoration: underline; }
.warehouse-title {
  max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warehouse-rec { min-width: 260px; color: #cdd3dc; }
.warehouse-expander { width: 38px; min-width: 38px; text-align: center; vertical-align: middle !important; }
.warehouse-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 28px !important; height: 28px !important;
  margin: 0; padding: 0 !important; border: 1px solid #34404d; border-radius: 7px;
  color: var(--accent); background: #0b1119; cursor: pointer; line-height: 1; vertical-align: middle;
}
.warehouse-toggle span {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  line-height: 1; font-size: 18px; transform-origin: 50% 50%; transition: transform .15s ease;
}
.warehouse-toggle.expanded span {
  transform: rotate(90deg);
}
.warehouse-status {
  display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px;
  border-radius: 999px; font-size: 10px; font-weight: 900; white-space: nowrap;
}
.warehouse-status.ok { color: var(--good); background: rgba(85,214,138,.1); }
.warehouse-status.bad { color: var(--bad); background: rgba(255,104,104,.1); }
.warehouse-status.warn { color: var(--warn); background: rgba(243,189,80,.1); }
.warehouse-status.skew { color: var(--warn); background: rgba(243,189,80,.12); }
.warehouse-status.muted { color: #8b95a3; background: rgba(139,149,163,.1); }
.warehouse-skew-value { color: #e2e7ee !important; font-weight: 900; }
.warehouse-nested-row td {
  padding: 0 !important; background: #080c12 !important; border-bottom: 1px solid #303846;
}
.warehouse-nested {
  margin: 0; padding: 10px 12px 12px 68px; border-top: 1px solid #252e3a;
  background: linear-gradient(180deg, #0a0f16, #080b11);
}
.warehouse-product-details {
  display: grid; gap: 10px; max-width: 100%; overflow-x: hidden;
}
.warehouse-nested-row.expanded-row .warehouse-product-details {
  border: 1px solid #1f2935; border-radius: 14px;
}
.warehouse-product-summary-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 7px;
}
.warehouse-summary-pill {
  display: grid; gap: 3px; padding: 7px 9px; border: 1px solid #25303d; border-radius: 10px; background: #0d141e;
}
.warehouse-summary-pill em {
  color: #87909c; font-size: 9px; font-style: normal; text-transform: uppercase; letter-spacing: .04em;
}
.warehouse-summary-pill b {
  color: #eef3f8; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warehouse-summary-pill.good b,
.warehouse-summary-pill.ok b,
.warehouse-summary-pill.warn b,
.warehouse-summary-pill.bad b {
  color: #eef3f8;
}
.warehouse-action-block {
  padding: 10px 12px; border: 1px solid #26313d; border-radius: 13px; background: #0c121b;
}
.warehouse-action-block span {
  display: block; margin-bottom: 3px; color: #87909c; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
}
.warehouse-action-block strong {
  display: block; color: #f0f5fa; font-size: 15px;
}
.warehouse-action-block p {
  margin: 5px 0 0; color: #aeb8c5; font-size: 11px; line-height: 1.45;
}
.warehouse-action-block.bad { border-color: rgba(255,104,104,.35); background: rgba(255,104,104,.055); }
.warehouse-action-block.warn { border-color: rgba(243,189,80,.35); background: rgba(243,189,80,.055); }
.warehouse-action-block.ok { border-color: rgba(85,214,138,.25); background: rgba(85,214,138,.045); }
.warehouse-product-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.warehouse-product-tabs button,
.warehouse-section-head button {
  padding: 7px 9px; border: 1px solid #2b3542; border-radius: 9px; color: #dce3ec; background: #101721; cursor: pointer; font-size: 11px;
}
.warehouse-product-tabs button.active,
.warehouse-section-head button:hover {
  color: #111; border-color: var(--accent); background: var(--accent); font-weight: 900;
}
.warehouse-product-detail-section {
  min-width: 0; padding: 10px; border: 1px solid #202a36; border-radius: 12px; background: rgba(13,18,26,.72);
}
.warehouse-product-detail-section h3 {
  margin: 0 0 8px; color: #e9eef5; font-size: 12px; letter-spacing: .02em;
}
.warehouse-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px;
}
.warehouse-section-head h3 { margin: 0; }
.warehouse-overview-section {
  max-height: 320px; overflow: hidden;
}
.warehouse-overview-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.warehouse-overview-card {
  display: grid; gap: 6px; min-width: 0; padding: 9px; border: 1px solid #242e3a; border-radius: 11px; background: #0b1119;
}
.warehouse-overview-card h3 {
  margin: 0 0 2px; color: #eef3f8; font-size: 11px;
}
.warehouse-overview-card span {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; color: #aeb8c5; font-size: 10px;
}
.warehouse-overview-card b {
  min-width: 0; overflow: hidden; color: #e8eef5; text-overflow: ellipsis; white-space: nowrap;
}
.warehouse-overview-card em {
  flex: 0 0 auto; color: #87909c; font-style: normal;
}
.warehouse-problem-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px;
}
.warehouse-problem-chip {
  max-width: 280px; padding: 6px 8px; border: 1px solid #2b3542; border-radius: 999px; color: #b8c2cf; background: #101721; font-size: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warehouse-problem-chip.bad { color: var(--bad); border-color: rgba(255,104,104,.3); background: rgba(255,104,104,.06); }
.warehouse-problem-chip.warn { color: var(--warn); border-color: rgba(243,189,80,.3); background: rgba(243,189,80,.06); }
.warehouse-problem-chip.ok { color: var(--good); border-color: rgba(85,214,138,.25); background: rgba(85,214,138,.05); }
.warehouse-product-detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.warehouse-locality-summary {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.warehouse-locality-summary span {
  padding: 6px 8px; border: 1px solid #25303d; border-radius: 999px; color: #aeb8c5; background: #0b1119; font-size: 10px;
}
.warehouse-locality-summary b { color: #eef3f8; }
.warehouse-nested-table {
  width: 100%; min-width: 920px; border-collapse: collapse; border: 1px solid #27313d;
  border-radius: 10px; overflow: hidden; background: #0d121a;
}
.warehouse-product-technical {
  overflow: hidden;
}
.warehouse-technical-scroll {
  display: grid; gap: 10px; overflow-x: auto; padding-bottom: 4px;
}
.warehouse-technical-scroll h4 {
  margin: 4px 0 0; color: #b9c3cf; font-size: 11px;
}
.warehouse-technical-scroll .warehouse-nested-table {
  min-width: 980px;
}
.warehouse-nested-table th {
  position: static; padding: 8px; border-bottom: 1px solid #27313d; color: #99a4b1;
  background: #131923; font-size: 10px; text-align: left; white-space: nowrap;
}
.warehouse-nested-table td {
  padding: 7px 8px !important; border-bottom: 1px solid #202834; color: #dce2e9; font-size: 10px;
  background: transparent !important;
}
.warehouse-nested-table.warehouse-compact-table {
  width: 100%; min-width: 0; table-layout: fixed;
}
.warehouse-nested-table.warehouse-compact-table th,
.warehouse-nested-table.warehouse-compact-table td {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.warehouse-nested-table.warehouse-compact-table th {
  vertical-align: bottom;
}
.warehouse-nested-table.warehouse-compact-table td.num,
.warehouse-nested-table.warehouse-compact-table th.num {
  text-align: right;
}
.warehouse-nested-table tr:last-child td { border-bottom: 0; }
.warehouse-top-row td { color: #e2e7ee !important; background: rgba(199,255,61,.045) !important; }
.warehouse-photo {
  display: block; width: 48px; height: 48px; object-fit: cover; border: 1px solid #343c48;
  border-radius: 8px; background: #151920; cursor: zoom-in;
}
.warehouse-photo-placeholder {
  display: grid; place-items: center; width: 48px; height: 48px; border: 1px dashed #3a424e;
  border-radius: 8px; color: #6e7785; background: #151920; font-size: 8px; text-align: center;
}
.warehouse-empty {
  height: 96px; color: var(--muted) !important; text-align: center !important;
}
.warehouse-detail {
  border: 1px solid #303846; border-radius: 13px; background: #0d121a; overflow: hidden;
}
.warehouse-detail-head {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid #252d38;
}
.warehouse-detail-head strong { display: block; color: #f0f3f7; }
.warehouse-detail-head span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.warehouse-detail-head button {
  margin-left: auto; width: 30px; height: 30px; border: 1px solid #343d49; border-radius: 8px;
  color: #dce2e9; background: #111722; cursor: pointer;
}
.warehouse-detail-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px;
}
.warehouse-detail-grid div { padding: 9px; border: 1px solid #242c37; border-radius: 10px; background: #101722; }
.warehouse-detail-grid strong { display: block; color: #e9eef5; }
.warehouse-detail-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 1250px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-panel { grid-template-columns: repeat(4, 1fr); }
  .primary-button { grid-column: span 4; }
  .unit-kpi-details { grid-template-columns: repeat(3, 1fr); }
  .unit-settings-grid { grid-template-columns: repeat(3, 1fr); }
  .warehouse-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warehouse-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: auto; height: auto; padding: 16px; flex-direction: row; justify-content: space-between; align-items: center; }
  .brand { padding: 0; }
  .brand-text { display: block; }
  .sidebar-toggle { display: none; }
  .sidebar nav { display: none; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; }
  .sidebar-status-text { display: block; }
  main { margin-left: 0; padding: 24px 15px 45px; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .category-field, .articles-field, .primary-button { grid-column: span 2; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-sort { justify-content: space-between; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-card { min-height: 150px; }
  .article-report-head { align-items: stretch; flex-direction: column; }
  .article-report-actions { justify-content: flex-start; }
  .article-report-actions input { width: 100%; }
  .column-options { grid-template-columns: 1fr; }
  .insights-grid { grid-template-columns: 1fr; }
  .generated { display: none; }
  .unit-header, .unit-table-toolbar { flex-direction: column; align-items: stretch; }
  .unit-header-actions, .unit-toolbar-actions { justify-content: flex-start; }
  .unit-filter-head { flex-direction: column; }
  .unit-filter-grid, .unit-filter-advanced { grid-template-columns: 1fr; }
  .unit-kpi-details { grid-template-columns: repeat(2, 1fr); }
  .unit-settings-grid { grid-template-columns: 1fr 1fr; }
  .unit-column-list { grid-template-columns: 1fr; }
  .warehouse-header, .warehouse-filter-head, .warehouse-ilirp { flex-direction: column; align-items: stretch; }
  .warehouse-header-side { width: 100%; min-width: 0; justify-items: stretch; }
  .warehouse-actions, .warehouse-header-side .warehouse-actions, .warehouse-ilirp > div:last-child { justify-content: flex-start; }
  .warehouse-filter-grid { grid-template-columns: 1fr; }
  .warehouse-summary, .warehouse-detail-grid { grid-template-columns: 1fr 1fr; }
}
