/* ══ Каркас і вміст 2.0 ═══════════════════════════════════════════════════
 *
 * Оновлення вигляду 06.10.2026 за зразком дашборда Digitalnia (той самий
 * підхід, що в UAnimals): атмосферне тло з розмитими плямами, скляне меню
 * зі світінням і згортанням до іконок, липка плашка з крихтами й пошуком
 * ⌘K, картки з кольоровим світінням, сегменти в стилі iOS.
 *
 * Фірмові кольори й шрифт SkinKits не змінено: бордовий --brand (#6c0019,
 * у темній темі #e2597a) і Onest. Шар підключається ПІСЛЯ style.css і
 * перекриває лише вигляд — розмітка сторінок та сама.
 */

:root {
  --brand-rgb: 108, 0, 25;
  --brand-soft-rgb: 226, 89, 122;
  --brand-fill: linear-gradient(135deg, #8d0d2c, #6c0019 55%, #520013);
  --brand-line: linear-gradient(180deg, #e2597a, #6c0019);
  --brand-hairline: linear-gradient(
    90deg,
    rgba(23, 23, 23, 0.06),
    rgba(108, 0, 25, 0.32) 30%,
    rgba(226, 89, 122, 0.3) 70%,
    rgba(23, 23, 23, 0.06)
  );
  --chrome-bg: rgba(255, 255, 255, 0.74);
  --chrome-solid: #ffffff;
  --hover: rgba(23, 23, 23, 0.045);
  --active-bg: linear-gradient(90deg, rgba(108, 0, 25, 0.1), rgba(226, 89, 122, 0.05));
  --active-ring: inset 0 0 0 1px rgba(108, 0, 25, 0.14);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84));
  --card-border: rgba(23, 23, 23, 0.07);
  --card-shadow: 0 1px 2px rgba(23, 23, 23, 0.04), 0 14px 34px -24px rgba(108, 0, 25, 0.28);
  --card-glow: 0 0 0 1px rgba(108, 0, 25, 0.08), 0 16px 36px -20px rgba(108, 0, 25, 0.35);
  --card-glow-border: rgba(108, 0, 25, 0.28);
  --row-hover: rgba(108, 0, 25, 0.035);
  --kbd-border: rgba(23, 23, 23, 0.12);
  --blob-a: rgba(108, 0, 25, 0.1);
  --blob-b: rgba(226, 89, 122, 0.14);
  --grid-line: rgba(108, 0, 25, 0.045);
  --shadow-raised: 0 24px 64px rgba(23, 23, 23, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tip-bg: rgba(28, 20, 22, 0.96);
  --tip-text: #f6f1f2;
  --tip-border: rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-rgb: 226, 89, 122;
    --brand-soft-rgb: 240, 138, 163;
    --brand-fill: linear-gradient(135deg, #f08aa3, #e2597a 55%, #c9405f);
    --brand-line: linear-gradient(180deg, #f5a3b7, #e2597a);
    --brand-hairline: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05),
      rgba(226, 89, 122, 0.36) 30%,
      rgba(240, 138, 163, 0.24) 70%,
      rgba(255, 255, 255, 0.05)
    );
    --chrome-bg: rgba(14, 14, 15, 0.7);
    --chrome-solid: #151516;
    --hover: rgba(255, 255, 255, 0.05);
    --active-bg: linear-gradient(90deg, rgba(226, 89, 122, 0.18), rgba(226, 89, 122, 0.05));
    --active-ring: inset 0 0 0 1px rgba(226, 89, 122, 0.2), 0 8px 24px -14px rgba(226, 89, 122, 0.55);
    --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.022));
    --card-border: rgba(255, 255, 255, 0.075);
    --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
    --card-glow: 0 0 0 1px rgba(226, 89, 122, 0.1), 0 16px 40px -22px rgba(226, 89, 122, 0.45);
    --card-glow-border: rgba(226, 89, 122, 0.32);
    --row-hover: rgba(226, 89, 122, 0.05);
    --kbd-border: rgba(255, 255, 255, 0.14);
    --blob-a: rgba(226, 89, 122, 0.12);
    --blob-b: rgba(108, 0, 25, 0.28);
    --grid-line: rgba(255, 255, 255, 0.035);
    --shadow-raised: 0 24px 64px rgba(0, 0, 0, 0.75);
    --tip-bg: rgba(38, 30, 33, 0.97);
    --tip-text: #f6f1f2;
    --tip-border: rgba(226, 89, 122, 0.22);
  }
}

:root[data-theme="dark"] {
  --brand-rgb: 226, 89, 122;
  --brand-soft-rgb: 240, 138, 163;
  --brand-fill: linear-gradient(135deg, #f08aa3, #e2597a 55%, #c9405f);
  --brand-line: linear-gradient(180deg, #f5a3b7, #e2597a);
  --brand-hairline: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05),
    rgba(226, 89, 122, 0.36) 30%,
    rgba(240, 138, 163, 0.24) 70%,
    rgba(255, 255, 255, 0.05)
  );
  --chrome-bg: rgba(14, 14, 15, 0.7);
  --chrome-solid: #151516;
  --hover: rgba(255, 255, 255, 0.05);
  --active-bg: linear-gradient(90deg, rgba(226, 89, 122, 0.18), rgba(226, 89, 122, 0.05));
  --active-ring: inset 0 0 0 1px rgba(226, 89, 122, 0.2), 0 8px 24px -14px rgba(226, 89, 122, 0.55);
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.022));
  --card-border: rgba(255, 255, 255, 0.075);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 18px 40px -28px rgba(0, 0, 0, 0.9);
  --card-glow: 0 0 0 1px rgba(226, 89, 122, 0.1), 0 16px 40px -22px rgba(226, 89, 122, 0.45);
  --card-glow-border: rgba(226, 89, 122, 0.32);
  --row-hover: rgba(226, 89, 122, 0.05);
  --kbd-border: rgba(255, 255, 255, 0.14);
  --blob-a: rgba(226, 89, 122, 0.12);
  --blob-b: rgba(108, 0, 25, 0.28);
  --grid-line: rgba(255, 255, 255, 0.035);
  --shadow-raised: 0 24px 64px rgba(0, 0, 0, 0.75);
  --tip-bg: rgba(38, 30, 33, 0.97);
  --tip-text: #f6f1f2;
  --tip-border: rgba(226, 89, 122, 0.22);
}

body {
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* ── Тло ─────────────────────────────────────────────────────────────── */

.atmo {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.atmo-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: atmo-float 18s ease-in-out infinite alternate;
}

.atmo-blob-a {
  width: 560px;
  height: 560px;
  left: 14%;
  top: -260px;
  background: var(--blob-a);
}

.atmo-blob-b {
  width: 480px;
  height: 480px;
  right: -140px;
  bottom: -180px;
  background: var(--blob-b);
  animation-delay: -9s;
}

.atmo-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 60% 20%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 20%, #000 20%, transparent 70%);
}

@keyframes atmo-float {
  to {
    transform: translate(30px, -20px) scale(1.12);
  }
}

.app-shell {
  isolation: isolate;
}

/* ── Меню ────────────────────────────────────────────────────────────── */

.sidebar {
  position: sticky;
  z-index: 60;
  width: 248px;
  background: var(--chrome-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  transition: width 0.22s var(--ease), transform 0.24s var(--ease);
}

.sb-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.sb-glow span {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(70px);
}

.sb-glow span:first-child {
  left: -170px;
  top: -150px;
  background: rgba(var(--brand-rgb), 0.14);
}

.sb-glow span:last-child {
  right: -180px;
  bottom: -130px;
  background: rgba(var(--brand-soft-rgb), 0.14);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 18px;
  flex-shrink: 0;
}

.sidebar-logo .brand-logo {
  height: 24px;
}

.sb-mark {
  display: none;
  width: 30px;
  height: 30px;
}

.sb-product {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.sidebar-logo,
.sidebar-logo:hover {
  text-decoration: none;
}

.sidebar-nav {
  padding: 10px 12px 16px;
}

.sb-group-title {
  margin: 16px 0 6px;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.sb-group-title:first-child {
  margin-top: 4px;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  font-size: 0.88rem;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-link:hover,
.sidebar-sublink:hover,
.sidebar-toggle:hover {
  background: var(--hover);
}

.sidebar-link.active {
  background: var(--active-bg);
  box-shadow: var(--active-ring);
  color: var(--text-primary);
}

.sidebar-link.active .nav-icon {
  opacity: 1;
  color: var(--brand);
}

/* Світна смужка ліворуч від активного пункту — фірмовий градієнт */
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-line);
  box-shadow: 0 0 12px rgba(var(--brand-soft-rgb), 0.7);
}

.sidebar-sublist {
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 6px 21px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.sidebar-sublink {
  padding: 6px 10px;
}

.sidebar-sublink.active {
  background: var(--active-bg);
  color: var(--brand);
}

.sidebar-footer {
  padding: 10px 12px 14px;
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.86rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.logout-link:hover {
  background: var(--hover);
  color: var(--text-primary);
}

/* Режим іконок: лишаються знаки, підписи — у підказці title */
@media (min-width: 861px) {
  .app-shell[data-rail="true"] .sidebar {
    width: 68px;
  }

  .app-shell[data-rail="true"] .sidebar-logo {
    padding: 0;
    justify-content: center;
  }

  .app-shell[data-rail="true"] .sidebar-logo .brand-logo {
    display: none;
  }

  .app-shell[data-rail="true"] .sb-mark {
    display: block;
  }

  .app-shell[data-rail="true"] .sb-product,
  .app-shell[data-rail="true"] .sb-label,
  .app-shell[data-rail="true"] .sidebar-toggle,
  .app-shell[data-rail="true"] .sidebar-sublist {
    display: none !important;
  }

  .app-shell[data-rail="true"] .sb-group-title {
    font-size: 0;
    height: 1px;
    margin: 10px 8px;
    padding: 0;
    background: var(--border);
  }

  .app-shell[data-rail="true"] .sidebar-link,
  .app-shell[data-rail="true"] .logout-link {
    justify-content: center;
    padding: 10px 0;
  }
}

/* ── Верхня плашка ───────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--chrome-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: none;
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--brand-hairline);
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
}

.tb-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.crumbs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crumb-section {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.crumb-sep {
  font-weight: 300;
  color: var(--text-muted);
  transform: skewX(-8deg);
  opacity: 0.7;
}

.page-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 28vw);
  height: 36px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.tb-search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.tb-search:hover {
  border-color: var(--card-glow-border);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.08);
}

.tb-search-text {
  flex: 1;
  text-align: left;
}

.tb-search-keys {
  display: flex;
  gap: 3px;
}

.kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  color: var(--text-secondary);
  border: 1px solid var(--kbd-border);
  border-bottom-width: 2px;
  border-radius: 5px;
}

/* Перемикач теми: у плашці — звичайна кнопка-іконка, на сторінці входу плаває */
.theme-toggle {
  position: static;
  box-shadow: none;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0;
}

.theme-toggle:hover {
  background: var(--hover);
  color: var(--text-primary);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .tt-moon,
.theme-toggle[data-mode="dark"] .tt-sun {
  display: block;
}

.theme-toggle .tt-sun,
.theme-toggle[data-mode="dark"] .tt-moon {
  display: none;
}

.login-page ~ .theme-toggle,
body > .theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: var(--surface-1);
  border: 1px solid var(--border);
}

/* ── Пошук ⌘K ────────────────────────────────────────────────────────── */

.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 16px 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cmdk-backdrop[hidden] {
  display: none;
}

.cmdk {
  width: min(540px, 100%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--chrome-solid);
  box-shadow: var(--shadow-raised);
  animation: cmdk-in 0.16s var(--ease) both;
  transform-origin: top center;
}

@keyframes cmdk-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

.cmdk-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.cmdk-input svg {
  width: 17px;
  height: 17px;
}

.cmdk-input input {
  flex: 1;
  height: 52px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

.cmdk-list {
  max-height: min(420px, 55vh);
  overflow-y: auto;
  padding: 6px;
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.88rem;
}

.cmdk-item[data-active="true"] {
  background: var(--active-bg);
  box-shadow: var(--active-ring);
}

.cmdk-label {
  font-weight: 550;
}

.cmdk-group {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cmdk-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
}

.cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cmdk-foot .kbd {
  margin-right: 3px;
}

/* ── Сторінка й картки ───────────────────────────────────────────────── */

.page {
  max-width: 1240px;
  padding: 28px 32px 48px;
}

.stat-tile,
.chart-card,
.sync-card,
.page-notes {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.stat-tile:hover,
.chart-card:hover,
.sync-card:hover {
  border-color: var(--card-glow-border);
  box-shadow: var(--card-glow), var(--card-shadow);
}

.stat-tile {
  overflow: hidden;
  padding: 16px 18px;
}

/* Смужка фірмового градієнта згори KPI — видно на hover */
.stat-tile::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, rgb(var(--brand-rgb)), rgba(var(--brand-soft-rgb), 0.9));
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.stat-tile:hover::before {
  opacity: 0.9;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 550;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 6px;
}

.chart-card h2,
.sync-card h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

/* ── Таблиці ─────────────────────────────────────────────────────────── */

.sync-table th {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.sync-table td {
  border-bottom: 1px solid var(--gridline);
}

.sync-table tbody tr {
  transition: background 0.14s var(--ease);
}

.sync-table tbody tr:hover {
  background: var(--row-hover);
}

/* ── Кнопки, перемикачі періоду, бейджі ──────────────────────────────── */

.btn-save,
.btn-refresh,
.btn-shopify,
.btn-generate,
.login-card button {
  background: var(--brand-fill);
  color: var(--brand-contrast);
  box-shadow: 0 8px 20px -10px rgba(var(--brand-rgb), 0.75);
  transition: box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn-save:hover:not(:disabled),
.btn-refresh:hover,
.btn-shopify:hover,
.btn-generate:hover,
.login-card button:hover {
  opacity: 1;
  filter: brightness(1.08);
  box-shadow: 0 10px 26px -10px rgba(var(--brand-rgb), 0.9);
}

/* Періоди — сегменти в стилі iOS: світла «таблетка» на треку */
.period-picker {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.1);
}

.period-pill {
  border: none;
  border-radius: 9px;
  padding: 6px 12px;
}

.period-pill:hover {
  color: var(--text-primary);
  background: var(--hover);
}

.period-pill-active,
.period-pill-active:hover {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14), inset 0 0 0 1px var(--border);
}

.status-badge {
  border-radius: 7px;
  font-weight: 600;
  padding: 2px 8px;
}

/* Поля — фірмовий фокус */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(var(--brand-rgb), 0.6) !important;
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}

.page-notes {
  border-style: solid;
}

/* ── Вхід ────────────────────────────────────────────────────────────── */

.login-card {
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow), 0 30px 80px -40px rgba(var(--brand-rgb), 0.5);
}

/* ── Скролбар ────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--brand-rgb), 0.22);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--brand-rgb), 0.45);
}

/* ── Вузькі екрани ───────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .tb-search {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .tb-search-text,
  .tb-search-keys {
    display: none;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: auto;
    width: min(290px, 86vw);
    background: var(--chrome-solid);
    box-shadow: var(--shadow-raised);
    transform: translateX(-102%);
  }

  .sidebar[data-open="true"] {
    transform: none;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.45);
  }

  .nav-toggle {
    display: inline-grid;
  }

  .rail-toggle,
  .tb-divider,
  .crumb-section,
  .crumb-sep {
    display: none !important;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .page {
    padding: 16px 12px 32px;
  }

  .atmo-blob {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmo-blob,
  .cmdk {
    animation: none;
  }
}

/* ── Інформери (06.10.2026) ───────────────────────────────────────────
   Один вигляд на всіх сторінках: м'який кружечок у фірмовому відтінку.
   Підказку показує info-tip.js окремим елементом у <body>. */

.info-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 50%;
  vertical-align: -2px;
  background: rgba(var(--brand-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.14);
  color: rgba(var(--brand-rgb), 0.8);
  cursor: help;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.info-dot svg {
  width: 10px;
  height: 10px;
  pointer-events: none;
}

.info-dot:hover,
.info-dot:focus-visible {
  background: rgba(var(--brand-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-rgb), 0.3);
  color: rgb(var(--brand-rgb));
  outline: none;
}

/* старий вбудований текст підказки більше не використовується */
.info-dot .info-tooltip {
  display: none;
}

.info-tip,
.ads-tooltip-fixed {
  border-radius: 10px;
  padding: 9px 12px;
  font-family: "Onest", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;
  background: var(--tip-bg);
  color: var(--tip-text);
  border: 1px solid var(--tip-border);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.info-tip {
  position: fixed;
  z-index: 1000;
  max-width: min(280px, calc(100vw - 16px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease);
}

.info-tip[data-side="bottom"] {
  transform: translateY(-3px);
}

.info-tip.is-visible {
  opacity: 1;
  transform: none;
}

/* хвостик до іконки */
.info-tip::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  transform: rotate(45deg);
}

.info-tip[data-side="top"]::after {
  bottom: -5px;
  border-top: none;
  border-left: none;
}

.info-tip[data-side="bottom"]::after {
  top: -5px;
  border-bottom: none;
  border-right: none;
}

.ads-tooltip-fixed strong {
  color: #fff;
}

.info-glue {
  white-space: nowrap;
}

/* Друга сума під значенням плитки (напр. «з ПДВ: …», правка 13.10.2026) */
.stat-note {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Нові й повторні покупці по місяцях (правка 13.10.2026) */
.nr-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.nr-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.nr-stack {
  width: 100%;
  max-width: 46px;
  display: flex;
  flex-direction: column;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.nr-stack > div {
  min-height: 0;
}

.nr-pct {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Когорти «Повторні покупки» (правка 13.10.2026) */
.cohort-table td.cohort-cell {
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
}

/* Пошук бренду на «Наявність по брендах» (правка 13.10.2026) */
.stock-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  flex-wrap: wrap;
}

.stock-search .edit-input {
  width: min(340px, 100%);
}

/* Смуги діаграм - у фірмових кольорах замість синього старого дизайну */
.bar-fill {
  background: linear-gradient(90deg, rgba(var(--brand-rgb), 0.85), rgba(var(--brand-soft-rgb), 0.85));
  border-radius: 999px;
}

.bar-track {
  background: rgba(var(--brand-rgb), 0.07);
  border-radius: 999px;
}

.stock-variant {
  margin: 2px 0 0 46px;
  font-size: 11.5px;
  color: var(--text-muted);
}
