/* Fonts are linked in base.html. */

/* EcomHub — компоненты. Все значения берутся из токенов. */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-100); color: var(--ink-100); font-family: var(--font-sans); font-weight: 500; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.eh-mono, .metric-xl, .metric-lg, .metric-md, .data, .data-sm { font-variant-numeric: tabular-nums lining-nums; }
.eh-code { font-family: var(--font-mono); font-size: 12px; line-height: 16px; }
.eh-up { }
.eh-muted { color: var(--ink-300); }
.eh-sec { color: var(--ink-200); }
.eh-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.eh-stack { display: flex; flex-direction: column; gap: var(--space-3); }
.eh-pad { padding: var(--space-4); }
.eh-grow { flex: 1 1 0; min-width: 0; }
.eh-num { text-align: right; }
:where(button, a, input, select, [tabindex]):focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Logo */
.eh-logo { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink-100); }
.eh-logo svg { display: block; }
.eh-logo__word { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; }

/* Icon */
.eh-icon { display: inline-block; flex: none; vertical-align: -0.15em; stroke-width: 1.75; }

/* Button */
.eh-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--size-control-md); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--line-control); background: var(--surface-100); color: var(--ink-100); font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s, transform .08s; }
.eh-btn:hover { background: var(--surface-300); border-color: var(--ink-300); }
.eh-btn:active { transform: translateY(1px); }
.eh-btn[disabled] { opacity: .45; cursor: not-allowed; }
.eh-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.eh-btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.eh-btn--ghost { background: transparent; border-color: transparent; color: var(--ink-200); }
.eh-btn--ghost:hover { color: var(--ink-100); border-color: transparent; }
.eh-btn--danger { background: transparent; border-color: var(--negative); color: var(--negative); }
.eh-btn--danger:hover { background: var(--negative-soft); border-color: var(--negative); }
.eh-btn--sm { height: var(--size-control-sm); padding: 0 var(--space-2); font-size: 12px; }
.eh-btn--lg { height: var(--size-control-lg); padding: 0 var(--space-4); font-size: 14px; }
.eh-btn--icon { width: var(--size-control-md); padding: 0; }
.eh-btn--icon.eh-btn--sm { width: var(--size-control-sm); }
.eh-kbd { font-family: var(--font-mono); font-size: 12px; line-height: 16px; padding: 1px var(--space-1); border-radius: var(--radius-xs); border: 1px solid var(--line-200); color: var(--ink-300); background: var(--bg-100); }

/* Fields */
.eh-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.eh-input { display: flex; align-items: center; gap: var(--space-2); height: var(--size-control-md); padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line-control); background: var(--surface-200); color: var(--ink-300); }
.eh-input:focus-within { box-shadow: var(--focus-ring); }
.eh-input--bad { border-color: var(--negative); }
.eh-input input, .eh-input select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink-100); font-size: 13px; appearance: none; box-shadow: none; }
.eh-input select option { background: var(--surface-200); color: var(--ink-100); }
.eh-input input::placeholder { color: var(--ink-300); }
.eh-hint { font-size: 12px; line-height: 16px; color: var(--ink-300); }
.eh-hint--bad { color: var(--negative); }

/* Switch */
.eh-switch { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; cursor: pointer; background: none; border: 0; padding: 0; color: var(--ink-100); border-radius: var(--radius-xs); }
.eh-switch__t { position: relative; width: 32px; height: 18px; border-radius: var(--radius-pill); border: 1px solid var(--line-control); background: var(--surface-200); transition: background .12s, border-color .12s; }
.eh-switch__t::after { content: ''; position: absolute; left: 2px; top: 2px; width: 12px; height: 12px; border-radius: var(--radius-pill); background: var(--ink-200); transition: transform .14s; }
.eh-switch[aria-checked='true'] .eh-switch__t { background: var(--accent); border-color: var(--accent); }
.eh-switch[aria-checked='true'] .eh-switch__t::after { transform: translateX(14px); background: var(--on-accent); }

/* Segmented */
.eh-seg { display: inline-flex; padding: 3px; gap: var(--space-half); border-radius: var(--radius-sm); border: 1px solid var(--line-200); background: var(--surface-200); }
.eh-seg button { height: 26px; padding: 0 var(--space-3); border: 0; border-radius: 6px; background: transparent; color: var(--ink-300); font-size: 12px; font-weight: 600; cursor: pointer; }
.eh-seg button:hover { color: var(--ink-100); }
.eh-seg button[aria-pressed='true'] { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Tabs */
.eh-tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--line-100); }
.eh-tabs button { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) 0; background: none; border: 0; color: var(--ink-300); font-size: 13px; line-height: 18px; font-weight: 500; cursor: pointer; }
.eh-tabs button:hover { color: var(--ink-100); }
.eh-tabs button[aria-selected='true'] { color: var(--ink-100); }
.eh-tabs button[aria-selected='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent-text); }

/* Badge */
.eh-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; background: var(--surface-300); color: var(--ink-200); }
.eh-badge--positive { background: var(--positive-soft); color: var(--positive); }
.eh-badge--negative { background: var(--negative-soft); color: var(--negative); }
.eh-badge--warning { background: var(--warning-soft); color: var(--warning); }
.eh-badge--ion { background: var(--ion-soft); color: var(--ion); }
.eh-badge--accent { background: var(--accent-soft); color: var(--accent-text); }

/* ChannelTag */
.eh-chan { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-200); white-space: nowrap; }
.eh-chan i { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--c, var(--ink-300)); }

/* Delta */
.eh-delta { display: inline-flex; align-items: center; gap: var(--space-half); font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.eh-delta--up { color: var(--positive); }
.eh-delta--down { color: var(--negative); }
.eh-delta--flat { color: var(--ink-300); }

/* LiveDot */
.eh-live { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-sans); font-size: 12px; line-height: 16px; color: var(--ink-200); white-space: nowrap; }
.eh-live i { position: relative; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--accent-text); }
.eh-live i::after { content: ''; position: absolute; inset: -4px; border-radius: var(--radius-pill); border: 1px solid var(--accent-text); opacity: 0; animation: eh-ping 2s ease-out infinite; }
.eh-live--off i { background: var(--ink-300); }
.eh-live--off i::after { animation: none; }
@keyframes eh-ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }

/* Panel: фирменные угловые засечки */
.eh-panel { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--surface-100); border: 1px solid var(--line-200); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.eh-panel--live { box-shadow: var(--glow-accent); border-color: transparent; }
.eh-panel--ticked::before, .eh-panel--ticked::after { content: ''; position: absolute; width: 9px; height: 9px; border: 0 solid var(--accent-text); pointer-events: none; }
.eh-panel--ticked::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; border-top-left-radius: var(--radius-md); }
.eh-panel--ticked::after { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; border-bottom-right-radius: var(--radius-md); }
.eh-panel__h { display: flex; align-items: center; gap: var(--space-2); min-height: 48px; padding: var(--space-2) var(--space-4) var(--space-2) var(--space-5); border-bottom: 1px solid var(--line-100); }
.eh-panel__t { display: flex; align-items: baseline; gap: var(--space-2); flex: 1; min-width: 0; }
.eh-panel__code { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-300); white-space: nowrap; }
.eh-panel__b { padding: var(--space-5); flex: 1; min-height: 0; font-size: 14px; line-height: 20px; }
.eh-panel__b--flush { padding: 0; }

/* KpiTile */
.eh-kpi { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-5); min-width: 0; }
.eh-kpi__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.eh-kpi__v { color: var(--ink-100); white-space: nowrap; }
.eh-kpi__s { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.eh-strip { display: grid; background: var(--surface-100); border: 1px solid var(--line-200); border-radius: var(--radius-md); box-shadow: var(--shadow-card); overflow: hidden; }
.eh-strip > * + * { border-left: 1px solid var(--line-100); }

/* Spark */
.eh-spark { display: block; overflow: visible; }

/* Table */
.eh-tablewrap { overflow: auto; }
.eh-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.eh-table th { position: sticky; top: 0; z-index: var(--z-sticky); height: 32px; padding: 0 var(--space-3); text-align: left; background: var(--surface-200); color: var(--ink-300); border-bottom: 1px solid var(--line-200); font-size: 12px; line-height: 16px; font-weight: 600;  white-space: nowrap; }
.eh-table th[data-sort] { cursor: pointer; }
.eh-table th[data-sort]:hover { color: var(--ink-100); }
.eh-table td { height: 44px; font-weight: 500; padding: 0 var(--space-3); border-bottom: 1px solid var(--line-100); white-space: nowrap; }
.eh-table tr:last-child td { border-bottom: 0; }
.eh-table tbody tr:hover td { background: var(--surface-300); }
.eh-table tbody tr[data-sel='true'] td { background: var(--accent-soft); }
.eh-table td.eh-mono { font-size: 13px; }
.eh-table .eh-num { text-align: right; }
.eh-heat { display: inline-block; min-width: 56px; padding: 2px 6px; border-radius: var(--radius-xs); text-align: right; }

/* Meter */
.eh-meter { display: flex; flex-direction: column; gap: var(--space-1); min-width: 72px; }
.eh-meter__bar { height: 6px; border-radius: var(--radius-xs); background: var(--surface-300); overflow: hidden; }
.eh-meter__bar i { display: block; height: 100%; border-radius: var(--radius-xs); background: var(--c, var(--accent-text)); }
.eh-meter__l { display: flex; justify-content: space-between; gap: var(--space-2); font-family: var(--font-sans); font-size: 12px; line-height: 16px; color: var(--ink-300); }

/* Chart */
.eh-chart { position: relative; }
.eh-chart svg { display: block; width: 100%; overflow: visible; }
.eh-chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-bottom: var(--space-3); font-size: 12px; line-height: 16px; color: var(--ink-200); }
.eh-chart__legend span { display: inline-flex; align-items: center; gap: 6px; }
.eh-chart__legend i { width: 10px; height: 2px; border-radius: var(--radius-xs); background: var(--c); }
.eh-chart__axis { fill: var(--ink-300); font-family: var(--font-sans); font-size: 11px; }
.eh-tip { position: absolute; z-index: var(--z-pop); top: 0; min-width: 160px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line-200); background: var(--surface-200); box-shadow: var(--shadow-pop); pointer-events: none; font-size: 12px; line-height: 16px; }
.eh-tip__r { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }
.eh-tip__r i { width: 8px; height: 2px; background: var(--c); }
.eh-tip__r b { margin-left: auto; font-family: var(--font-sans); font-weight: 500; }

/* BarList */
.eh-bars { display: flex; flex-direction: column; gap: var(--space-3); }
.eh-bars__r { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); align-items: baseline; font-size: 13px; line-height: 18px; }
.eh-bars__t { grid-column: 1 / -1; height: 6px; border-radius: var(--radius-xs); background: var(--surface-300); }
.eh-bars__t i { display: block; height: 100%; border-radius: var(--radius-xs); background: var(--c, var(--chart-1)); }

/* Funnel */
.eh-funnel { display: flex; flex-direction: column; gap: var(--space-half); }
.eh-funnel__r { display: grid; grid-template-columns: 84px 1fr 56px 48px; gap: var(--space-3); align-items: center; height: 30px; font-size: 13px; line-height: 18px; }
.eh-funnel__t { height: 22px; }
.eh-funnel__t i { display: block; height: 100%; border-radius: var(--radius-xs); background: var(--chart-1); opacity: var(--o, 1); }

/* Waterfall */
.eh-wf { display: flex; align-items: stretch; gap: var(--space-2); height: 240px; }
.eh-wf__c { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.eh-wf__p { position: relative; flex: 1; border-bottom: 1px solid var(--line-200); }
.eh-wf__p i { position: absolute; left: 12%; right: 12%; border-radius: var(--radius-xs); background: var(--c); }
.eh-wf__v { position: absolute; left: 0; right: 0; text-align: center; font-family: var(--font-sans); font-size: 12px; line-height: 16px; color: var(--ink-100); }
.eh-wf__l { font-size: 12px; line-height: 16px; color: var(--ink-300); text-align: center; height: 28px; }

/* Creative */
.eh-cr { display: flex; flex-direction: column; min-width: 0; background: var(--surface-100); border: 1px solid var(--line-200); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; transition: border-color .12s, transform .12s; }
.eh-cr:hover { border-color: var(--line-control); transform: translateY(-1px); }
.eh-cr__art { position: relative; aspect-ratio: 4 / 5; background: var(--surface-300); overflow: hidden; }
.eh-cr__art svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .82; }
.eh-cr__top { position: absolute; top: var(--space-2); left: var(--space-2); right: var(--space-2); display: flex; justify-content: space-between; gap: var(--space-1); }
.eh-cr__top .eh-badge { background: var(--surface-100); }
.eh-cr__b { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); }
.eh-cr__name { font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eh-cr__m { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.eh-cr__m div { display: flex; flex-direction: column; gap: var(--space-half); min-width: 0; }
.eh-cr__m b { font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 500; }

/* Insight */
.eh-ins { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line-100); }
.eh-ins:last-child { border-bottom: 0; }
.eh-ins__i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--ion-soft); color: var(--ion); }
.eh-ins__t { font-size: 13px; line-height: 18px; color: var(--ink-100); }
.eh-ins__s { font-size: 12px; line-height: 16px; color: var(--ink-300); margin-top: var(--space-half); }

/* Toast */
.eh-toast { display: inline-flex; align-items: center; gap: var(--space-3); max-width: 420px; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line-200); background: var(--surface-200); box-shadow: var(--shadow-pop); font-size: 13px; line-height: 18px; }

/* Empty */
.eh-empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); padding: var(--space-8) var(--space-6); text-align: center; border: 1px dashed var(--line-200); border-radius: var(--radius-md); }
.eh-empty p { margin: 0; max-width: 360px; font-size: 13px; line-height: 18px; color: var(--ink-200); }

/* Skeleton */
.eh-skel { display: block; border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--surface-200), var(--surface-300), var(--surface-200)); background-size: 200% 100%; animation: eh-shimmer 1.4s linear infinite; }
@keyframes eh-shimmer { to { background-position: -200% 0; } }

/* Command palette */
.eh-cmd { width: 100%; max-width: 620px; border-radius: var(--radius-lg); border: 1px solid var(--line-200); background: var(--surface-100); box-shadow: var(--shadow-modal); overflow: hidden; }
.eh-cmd__in { display: flex; align-items: center; gap: var(--space-3); height: 52px; padding: 0 var(--space-4); border-bottom: 1px solid var(--line-100); color: var(--ink-300); }
.eh-cmd__in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; color: var(--ink-100); box-shadow: none; }
.eh-cmd__in input::placeholder { color: var(--ink-300); }
.eh-cmd__g { padding: var(--space-3) var(--space-4) var(--space-1); }
.eh-cmd__i { display: flex; width: 100%; align-items: center; gap: var(--space-3); height: 38px; padding: 0 var(--space-4); border: 0; background: none; color: var(--ink-100); font-size: 13px; text-align: left; cursor: pointer; }
.eh-cmd__i[data-on='true'], .eh-cmd__i:hover { background: var(--surface-300); }
.eh-cmd__i .eh-icon { color: var(--ink-300); }
.eh-cmd__f { display: flex; gap: var(--space-4); padding: var(--space-2) var(--space-4); margin-top: var(--space-2); border-top: 1px solid var(--line-100); font-size: 12px; line-height: 16px; color: var(--ink-300); }

/* Shell */
.eh-shell { display: grid; grid-template-columns: var(--size-sidebar) minmax(0, 1fr); min-height: 100vh; background: var(--bg-000); }
.eh-side { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-3); background: var(--nav-bg); border-right: 1px solid var(--nav-line); color: var(--nav-ink); min-width: 0; }
.eh-side__brand { display: flex; align-items: center; height: 40px; padding: 0 var(--space-2); }
.eh-side .eh-logo { color: var(--nav-ink); }
.eh-store { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2); border: 1px solid var(--nav-line); border-radius: var(--radius-sm); background: var(--nav-hover); color: var(--nav-ink); text-align: left; cursor: pointer; font-size: 13px; line-height: 18px; font-weight: 600; }
.eh-store b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--volt); color: var(--on-volt); font-size: 12px; font-weight: 800; }
.eh-store .eh-icon { color: var(--nav-ink-muted); }
.eh-nav { display: flex; flex-direction: column; gap: var(--space-half); }
.eh-nav__g { padding: var(--space-3) var(--space-2) var(--space-1); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--nav-ink-muted); }
.eh-nav a { position: relative; display: flex; align-items: center; gap: var(--space-3); height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--nav-ink); font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; cursor: pointer; }
.eh-nav a .eh-icon { color: var(--nav-ink-muted); }
.eh-nav a:hover { background: var(--nav-hover); }
.eh-nav a[aria-current='page'] { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: 700; }
.eh-nav a[aria-current='page'] .eh-icon { color: var(--nav-active-ink); }
.eh-nav a span:last-child:not(:first-of-type) { margin-left: auto; font-size: 12px; color: var(--nav-ink-muted); }
.eh-nav a[aria-current='page'] span:last-child:not(:first-of-type) { color: var(--nav-active-ink); }
.eh-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--nav-line); border-radius: var(--radius-sm); background: var(--nav-hover); }
.eh-side__foot .eh-live { color: var(--nav-ink); }
.eh-side__foot .eh-live i, .eh-side__foot .eh-live i::after { background: var(--volt); border-color: var(--volt); }
.eh-side__foot .eh-live i::after { background: none; }
.eh-side__foot .eh-meter__l { color: var(--nav-ink-muted); }
.eh-side__foot .eh-meter__bar { background: var(--nav-line); }
.eh-side__foot .eh-meter__bar i { background: var(--volt); }
.eh-main { display: flex; flex-direction: column; min-width: 0; }
.eh-top { display: flex; align-items: center; gap: var(--space-3); height: var(--size-topbar); padding: 0 var(--space-6); border-bottom: 1px solid var(--line-100); background: var(--bg-100); }
.eh-top__s { flex: 1; max-width: 400px; display: flex; align-items: center; gap: var(--space-2); height: var(--size-control-md); padding: 0 var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--line-200); background: var(--surface-100); color: var(--ink-300); font-size: 13px; cursor: pointer; }
.eh-top__s .eh-kbd { margin-left: auto; }
.eh-ava { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-pill); background: var(--surface-300); color: var(--ink-100); font-family: var(--font-sans); font-size: 11px; font-weight: 600; }
.eh-canvas { flex: 1; padding: var(--space-6); background: var(--bg-100); }
.eh-pagehead { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); }
.eh-grid { display: grid; gap: var(--space-4); }
.eh-hero { display: grid; grid-template-columns: 1.1fr 2.2fr; gap: var(--space-4); margin-bottom: var(--space-4); }
.eh-herom { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); padding: var(--space-5); }
.eh-bulk { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line-100); background: var(--accent-soft); font-size: 13px; line-height: 18px; }
.eh-preview { padding: var(--space-4); }

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