/* MZT mobile styles — desktop layout unchanged at md+ */

html {
  font-size: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 75%;
  }
}

body.mzt-nav-open {
  overflow: hidden;
}

body.mzt-nav-open .mzt-fallback-lk {
  display: none !important;
  pointer-events: none;
  opacity: 0;
}

/* Mobile nav drawer — closed state fully hidden */
#mztNavOverlay,
.mzt-mobile-nav-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#mztNavOverlay.mzt-nav-overlay--open,
.mzt-mobile-nav-overlay.mzt-nav-overlay--open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#mztNavDrawer,
.mzt-mobile-nav-drawer {
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s ease, visibility 0.25s ease;
}

#mztNavDrawer.mzt-nav-drawer--open,
.mzt-mobile-nav-drawer.mzt-nav-drawer--open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

@media (min-width: 768px) {
  #mztNavOverlay,
  #mztNavDrawer,
  .mzt-mobile-nav-overlay,
  .mzt-mobile-nav-drawer,
  #mztNavToggle {
    display: none !important;
  }
}

/* Critical mobile nav — не зависит от Tailwind CDN (реальные телефоны, режим auto) */
@media (max-width: 767px) {
  header {
    overflow: visible !important;
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  header .mzt-brand {
    flex-shrink: 0;
    min-width: 0;
  }

  header .mzt-desktop-nav,
  header .hidden.md\:flex {
    display: none !important;
  }

  #mztNavToggle {
    display: inline-flex !important;
    visibility: visible !important;
    flex-shrink: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin-left: auto;
  }

  #mztNavOverlay,
  #mztNavDrawer,
  .mzt-mobile-nav-overlay,
  .mzt-mobile-nav-drawer {
    display: block !important;
  }

  /* force-desktop на узком экране: всё равно бургер, не обрезанное меню */
  html.mzt-force-desktop header .mzt-desktop-nav,
  html.mzt-force-desktop header .hidden.md\:flex {
    display: none !important;
  }

  html.mzt-force-desktop #mztNavToggle {
    display: inline-flex !important;
    visibility: visible !important;
  }

  html.mzt-force-desktop #mztNavOverlay,
  html.mzt-force-desktop #mztNavDrawer,
  html.mzt-force-desktop .mzt-mobile-nav-overlay,
  html.mzt-force-desktop .mzt-mobile-nav-drawer {
    display: block !important;
  }

  html.mzt-compact-nav header .hidden.md\:flex {
    display: none !important;
  }

  html.mzt-compact-nav #mztNavToggle {
    display: inline-flex !important;
    visibility: visible !important;
  }

  .mzt-nav-toggle-label {
    display: inline;
  }
}

@media (min-width: 768px) {
  .mzt-nav-toggle-label {
    display: none !important;
  }
}

/* View mode segmented toggle */
.mzt-view-mode-switch {
  position: relative;
  z-index: 60;
}

/* Floating theme FAB (bottom-right; notif left of theme in pill) */
.mzt-view-mode-fab,
#mztViewModeFab.mzt-view-mode-fab {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  left: auto;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  z-index: 9990;
  pointer-events: none;
  display: block;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.mzt-view-mode-fab .mzt-view-mode-switch {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--mzt-border, #dbe0e6);
  background: var(--mzt-surface, #f8f9fb);
  box-shadow: 0 4px 18px rgba(17, 20, 24, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mzt-view-mode-fab .mzt-view-mode-btn--icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
}

body.mzt-nav-open .mzt-view-mode-fab,
body.mzt-nav-open #mztViewModeFab.mzt-view-mode-fab {
  opacity: 0.35;
  pointer-events: none;
}

html.mzt-theme-dark .mzt-view-mode-fab .mzt-view-mode-switch {
  background: var(--mzt-surface) !important;
  border-color: var(--mzt-border) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

html.mzt-theme-dark .mzt-view-mode-fab .mzt-view-mode-btn--icon {
  color: var(--mzt-text-muted);
}

html.mzt-theme-dark .mzt-view-mode-fab .mzt-view-mode-btn--icon:hover {
  color: var(--mzt-text-strong);
  background: rgba(255, 255, 255, 0.08);
}

/* Drawer: theme label only in force-mobile QA; view label otherwise */
#mztViewModeBlock > p[data-mzt-theme-label] {
  display: none;
}

html.mzt-force-mobile #mztViewModeBlock > p[data-mzt-theme-label] {
  display: block;
}

html.mzt-force-mobile #mztViewModeBlock > p[data-mzt-view-mode-label] {
  display: none;
}

/* Real phone: theme only in FAB; no PC/view toggle, no drawer view block */
@media (max-width: 767px) {
  #mztViewModeBlock {
    display: none !important;
  }

  [data-mzt-view-mode-toggle] {
    display: none !important;
  }
}

/* QA force-mobile: theme+view in drawer, FAB hidden */
html.mzt-force-mobile .mzt-view-mode-fab {
  display: none !important;
}

html.mzt-theme-dark #mztNotifPanel.mzt-notif-panel {
  background: var(--mzt-surface, #1f242b);
  border-color: var(--mzt-border, #3d4450);
  color: var(--mzt-text-strong, #f3f4f6);
}

#mztNotifBellRoot {
  display: inline-flex;
  align-items: center;
}

.mzt-view-mode-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #60758a;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.mzt-view-mode-btn--icon:hover {
  color: #111418;
  background: rgba(17, 20, 24, 0.06);
}

.mzt-view-mode-btn--icon:active {
  transform: scale(0.96);
}

.mzt-view-mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mzt-view-mode-icon[hidden] {
  display: none !important;
}

.mzt-view-mode-btn--active {
  background: #111418 !important;
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(17, 20, 24, 0.12);
}

html.mzt-view-transition .layout-container,
html.mzt-view-transition body > .relative {
  transition: max-width 0.3s ease, margin 0.3s ease, box-shadow 0.3s ease, font-size 0.25s ease;
}

/* Forced mobile layout (QA on desktop) */
html.mzt-force-mobile {
  font-size: 100% !important;
  background: #e5e7eb !important;
}

html.mzt-force-mobile body {
  background: #e5e7eb !important;
}

html.mzt-force-mobile .mzt-view-mode-switch {
  display: flex !important;
}

html.mzt-force-mobile #mztNavToggle {
  display: flex !important;
}

html.mzt-force-mobile header .mzt-desktop-nav,
html.mzt-force-mobile header .hidden.md\:flex:not(.mzt-view-mode-switch) {
  display: none !important;
}

html.mzt-force-mobile .md\:hidden {
  display: revert !important;
}

html.mzt-force-mobile #mztNavToggle.md\:hidden {
  display: flex !important;
}

html.mzt-force-mobile .md\:px-8,
html.mzt-force-mobile .lg\:px-16,
html.mzt-force-mobile .xl\:px-40 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

html.mzt-force-mobile .md\:w-auto {
  width: 100% !important;
}

html.mzt-force-mobile .md\:ml-auto {
  margin-left: 0 !important;
}

html.mzt-force-mobile .md\:min-w-72 {
  min-width: 0 !important;
}

html.mzt-force-mobile .md\:text-\[32px\] {
  font-size: 1.5rem !important;
  line-height: 2rem !important;
}

html.mzt-force-mobile .sm\:flex-row {
  flex-direction: column !important;
}

html.mzt-force-mobile .sm\:items-center {
  align-items: stretch !important;
}

html.mzt-force-mobile #marketplaceBlocks,
html.mzt-force-mobile [class*="grid-cols"] {
  grid-template-columns: minmax(0, 1fr) !important;
}

html.mzt-force-mobile .mzt-dashboard-kpi,
html.mzt-force-mobile .mzt-dashboard-kpi.grid,
html.mzt-force-mobile .mzt-dashboard-kpi .mzt-metric-grid,
html.mzt-force-mobile .mzt-dashboard-kpi .mzt-metric-grid--4,
html.mzt-force-mobile .mzt-dashboard-kpi [class*="grid-cols"] {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

html.mzt-force-mobile #mztNavOverlay,
html.mzt-force-mobile #mztNavDrawer,
html.mzt-force-mobile .mzt-mobile-nav-overlay,
html.mzt-force-mobile .mzt-mobile-nav-drawer {
  display: block !important;
}

html.mzt-force-mobile body > .relative.flex,
html.mzt-force-mobile body > .relative {
  max-width: 390px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 0 0 1px var(--mzt-border, #dbe0e6), 0 12px 48px rgba(17, 20, 24, 0.12);
  background: var(--mzt-bg, #f0f2f5);
}

html.mzt-force-mobile .mzt-table-scroll {
  overflow-x: visible;
  max-width: 100%;
}

html.mzt-force-mobile .mzt-table-cards thead {
  display: none;
}

html.mzt-force-mobile .mzt-table-cards tbody tr {
  display: block;
  margin-bottom: 0.75rem;
  border: 1px solid var(--mzt-border, #dbe0e6);
  border-radius: 0.5rem;
  padding: 0.5rem;
  background: var(--mzt-surface, #fff);
}

html.mzt-force-mobile .mzt-table-cards tbody td {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border: none;
  text-align: right;
  white-space: normal !important;
  position: static !important;
}

html.mzt-force-mobile .mzt-table-cards tbody td::before {
  content: attr(data-label);
  font-weight: 600;
  color: #60758a;
  text-align: left;
  flex-shrink: 0;
  max-width: 50%;
}

html.mzt-force-mobile .mzt-table-cards tbody td:empty {
  display: none;
}

html.mzt-force-mobile .mzt-table-cards tbody td:first-child {
  font-weight: 600;
  color: #111418;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
}

html.mzt-force-mobile .mzt-table-cards tbody td:first-child::before {
  display: none;
}

html.mzt-force-mobile a.mzt-fallback-lk {
  display: none !important;
}

/* Forced desktop layout */
html.mzt-force-desktop #mztNavToggle,
html.mzt-force-desktop #mztNavOverlay,
html.mzt-force-desktop #mztNavDrawer,
html.mzt-force-desktop .mzt-mobile-nav-overlay,
html.mzt-force-desktop .mzt-mobile-nav-drawer {
  display: none !important;
}

html.mzt-force-desktop header .hidden.md\:flex {
  display: flex !important;
}

html.mzt-force-desktop .md\:hidden {
  display: none !important;
}

html.mzt-force-desktop .mzt-view-mode-switch {
  display: flex !important;
}

html.mzt-force-desktop {
  font-size: 75% !important;
}

/* Card layout for tables on mobile */
@media (max-width: 767px) {
  .mzt-table-scroll {
    overflow-x: visible;
    max-width: 100%;
  }

  .mzt-table-cards thead {
    display: none;
  }

  .mzt-table-cards tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid var(--mzt-border, #dbe0e6);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: var(--mzt-surface, #fff);
  }

  .mzt-table-cards tbody td {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border: none;
    text-align: right;
    white-space: normal !important;
    position: static !important;
  }

  .mzt-table-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #60758a;
    text-align: left;
    flex-shrink: 0;
    max-width: 50%;
  }

  .mzt-table-cards tbody td:empty {
    display: none;
  }

  .mzt-table-cards tbody td:first-child {
    font-weight: 600;
    color: #111418;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
  }

  .mzt-table-cards tbody td:first-child::before {
    display: none;
  }

  /* Disable sticky headers inside ads tables on mobile */
  .ads-campaigns-table--compact thead th,
  .ads-products-table-scroll thead th {
    position: static !important;
  }

  .ads-campaigns-detail-scroll,
  .ads-products-table-scroll {
    overflow-x: visible;
    max-height: none;
  }

  /* Hide invisible fallback link on mobile */
  a[aria-label="Личный кабинет"].mzt-fallback-lk {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .mzt-table-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  header.sticky {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  #mztNavDrawer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Shared compact table pattern (sales, finance, supply) */
.mzt-compact-table thead tr,
.sales-report-table--compact thead tr,
.finance-table--compact thead tr,
.supply-table--compact thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #e5e9ef;
}

.mzt-compact-table tbody tr:nth-child(even),
.sales-report-table--compact tbody tr:nth-child(even),
.finance-table--compact tbody tr:nth-child(even),
.supply-table--compact tbody tr:nth-child(even) {
  background: #fafbfc;
}

.mzt-compact-table tbody tr:hover,
.sales-report-table--compact tbody tr:hover,
.finance-table--compact tbody tr:hover,
.supply-table--compact tbody tr:hover {
  background: #f3f6f9;
}

.sales-report-table--compact tbody td,
.finance-table--compact tbody td,
.supply-table--compact tbody td {
  font-size: 11px;
}

.sales-report-table--compact th,
.finance-table--compact th,
.supply-table--compact th {
  font-size: 11px;
}

.supply-table--compact th,
.supply-table--compact td {
  padding: 0.25rem 0.5rem;
}

/* Supply UX: sticky header + frozen identity columns */
.supply-scroll {
  position: relative;
}
.supply-table--compact {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: max(100%, 960px);
  --supply-sku-w: 6.75rem;
  --supply-art-w: 9.5rem;
}
.supply-table--compact thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8fafc;
  box-shadow: 0 1px 0 #e5e9ef;
}
.supply-table--compact .supply-sticky-1,
.supply-table--compact .supply-sticky-2,
.supply-table--compact .supply-sticky-3 {
  position: sticky;
  z-index: 2;
  background: #fff;
  overflow: hidden;
}
.supply-table--compact thead .supply-sticky-1,
.supply-table--compact thead .supply-sticky-2,
.supply-table--compact thead .supply-sticky-3 {
  z-index: 4;
  background: #f8fafc;
}
.supply-table--compact .supply-sticky-1 {
  left: 0;
  width: var(--supply-sku-w);
  min-width: var(--supply-sku-w);
  max-width: var(--supply-sku-w);
  z-index: 3;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}
.supply-table--compact .supply-sticky-2 {
  left: var(--supply-sku-w);
  width: var(--supply-art-w);
  min-width: var(--supply-art-w);
  max-width: var(--supply-art-w);
  z-index: 3;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}
.supply-table--compact .supply-sticky-3 {
  left: calc(var(--supply-sku-w) + var(--supply-art-w));
  width: 16rem;
  min-width: 16rem;
  max-width: 16rem;
  z-index: 3;
  box-shadow: 4px 0 8px -4px rgba(17, 20, 24, 0.12);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supply-table--compact thead .supply-sticky-1,
.supply-table--compact thead .supply-sticky-2,
.supply-table--compact thead .supply-sticky-3 {
  z-index: 5;
}
.supply-table--compact th.supply-cell-product,
.supply-table--compact td.supply-cell-product,
.supply-table--compact .supply-cell-product {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.supply-table--compact td.supply-cell-product .supply-cell-product,
.supply-table--compact .supply-sticky-3 > .supply-cell-product {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.supply-table--compact tbody td:not(.supply-sticky-1):not(.supply-sticky-2):not(.supply-sticky-3),
.supply-table--compact thead th:not(.supply-sticky-1):not(.supply-sticky-2):not(.supply-sticky-3) {
  white-space: nowrap;
  min-width: 4.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.supply-table--compact thead th.supply-th-short,
.supply-table--compact thead th.supply-col-total {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.supply-table--compact .supply-col-total {
  min-width: 3.75rem !important;
  width: 3.75rem;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}
.supply-table--compact .supply-col-group-start {
  border-left: 2px solid #dbe0e6;
}

/* Cluster tab: о / з / п in one cell */
.supply-cluster-dual {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  gap: 1px;
}
.supply-cluster-dual__lbl {
  font-weight: 600;
  opacity: 0.75;
  font-size: 9px;
  text-transform: lowercase;
}
.supply-cluster-dual__stock {
  font-weight: 600;
  color: #111418;
  font-size: 11px;
}
.supply-cluster-dual__orders {
  font-size: 10px;
  color: #60758a;
  font-weight: 500;
}
.supply-cluster-dual__ship {
  font-size: 10px;
  color: #078838;
  font-weight: 600;
}
.supply-table--clusters th.supply-cluster-col {
  min-width: 3rem;
}
.supply-table--clusters td.supply-cluster-col {
  white-space: nowrap !important;
  overflow: visible !important;
  vertical-align: top;
}

/* Category chip filter */
.supply-cat-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.75rem;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}
.supply-cat-chips::-webkit-scrollbar {
  height: 6px;
}
.supply-cat-chips::-webkit-scrollbar-thumb {
  background: #c5ced8;
  border-radius: 999px;
}
.supply-cat-chips::-webkit-scrollbar-track {
  background: transparent;
}
.supply-cat-chip {
  flex: 0 0 auto;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #d0dbe7;
  background: #fff;
  color: #60758a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.supply-cat-chip:hover {
  border-color: #078838;
  color: #078838;
}
.supply-cat-chip--active {
  background: #eef6f0;
  border-color: #078838;
  color: #078838;
  font-weight: 600;
}
/* Ship tab: readable cluster codes (not ellipsis "Кр…") */
.supply-table--ship th.supply-cluster-col {
  min-width: 3.25rem;
  max-width: 4.5rem;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.15;
  font-size: 10px;
  vertical-align: bottom;
  word-break: break-word;
  hyphens: auto;
}
.supply-table--ship td.supply-cluster-col {
  min-width: 3.25rem;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Click-to-expand product name */
.supply-table--compact td.supply-cell-product {
  cursor: pointer;
}
.supply-table--compact td.supply-cell-product--open {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
  max-width: 28rem !important;
  width: 20rem !important;
  z-index: 6;
  box-shadow: 0 4px 16px rgba(17, 20, 24, 0.12);
  background: #fff !important;
}
.supply-table--compact td.supply-cell-product--open .supply-cell-product {
  display: block;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none;
}

/* Urgency rows — must beat even/hover backgrounds */
.supply-table--compact tbody tr.supply-row--critical,
.supply-table--compact tbody tr.supply-row--critical:nth-child(even) {
  background: #fef2f2 !important;
  box-shadow: inset 3px 0 0 #dc2626;
}
.supply-table--compact tbody tr.supply-row--critical:hover {
  background: #fee2e2 !important;
  box-shadow: inset 3px 0 0 #dc2626;
}
.supply-table--compact tbody tr.supply-row--warn,
.supply-table--compact tbody tr.supply-row--warn:nth-child(even) {
  background: #fffbeb !important;
  box-shadow: inset 3px 0 0 #d97706;
}
.supply-table--compact tbody tr.supply-row--warn:hover {
  background: #fef3c7 !important;
  box-shadow: inset 3px 0 0 #d97706;
}
.supply-table--compact tbody tr.supply-row--critical .supply-sticky-1,
.supply-table--compact tbody tr.supply-row--critical .supply-sticky-2,
.supply-table--compact tbody tr.supply-row--critical .supply-sticky-3 {
  background: #fef2f2;
}
.supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-1,
.supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-2,
.supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-3 {
  background: #fee2e2;
}
.supply-table--compact tbody tr.supply-row--warn .supply-sticky-1,
.supply-table--compact tbody tr.supply-row--warn .supply-sticky-2,
.supply-table--compact tbody tr.supply-row--warn .supply-sticky-3 {
  background: #fffbeb;
}
.supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-1,
.supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-2,
.supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-3 {
  background: #fef3c7;
}
.supply-days-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 10px;
  line-height: 1.2;
}
.supply-days-badge--critical {
  background: #fecaca;
  color: #991b1b;
}
.supply-days-badge--warn {
  background: #fde68a;
  color: #92400e;
}

html.mzt-theme-dark .supply-table--compact thead th {
  background: var(--mzt-surface-muted) !important;
  box-shadow: 0 1px 0 var(--mzt-border);
}
html.mzt-theme-dark .supply-table--compact .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact .supply-sticky-3 {
  background: var(--mzt-surface) !important;
}
html.mzt-theme-dark .supply-table--compact thead .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact thead .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact thead .supply-sticky-3 {
  background: var(--mzt-surface-muted) !important;
}
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical:nth-child(even),
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical:hover {
  background: rgba(220, 38, 38, 0.18) !important;
  box-shadow: inset 3px 0 0 #f87171;
}
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn:nth-child(even),
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn:hover {
  background: rgba(217, 119, 6, 0.18) !important;
  box-shadow: inset 3px 0 0 #fbbf24;
}
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical .supply-sticky-3,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--critical:hover .supply-sticky-3 {
  background: rgba(220, 38, 38, 0.18) !important;
}
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn .supply-sticky-3,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-1,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-2,
html.mzt-theme-dark .supply-table--compact tbody tr.supply-row--warn:hover .supply-sticky-3 {
  background: rgba(217, 119, 6, 0.18) !important;
}
html.mzt-theme-dark .supply-table--compact td.supply-cell-product--open {
  background: var(--mzt-surface) !important;
}

/* FBO stock list (dashboard) — soft rows, not spreadsheet */
.dash-fbo-list-card {
  padding: 1rem 1.125rem;
}

/* Connections strip — compact framed chips */
.mzt-dash-conn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--mzt-border, #dbe0e6);
  border-radius: 0.75rem;
  background: var(--mzt-surface, #ffffff);
}

.mzt-dash-conn-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1;
}

.mzt-dash-conn-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.mzt-dash-conn-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1.2;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  background: var(--mzt-surface-muted, #f0f2f5);
  color: var(--mzt-text-muted, #60758a);
  border: 1px solid transparent;
  white-space: nowrap;
}

.mzt-dash-conn-chip--warn {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.28);
}

.mzt-dash-conn-chip--danger {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.28);
}

/* Period: desktop flat (like backup); framed only on mobile */
.mzt-dash-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.mzt-dash-period-label {
  font-size: 0.875rem;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1.25;
  white-space: nowrap;
}

.mzt-dash-period .mzt-dash-conn-label {
  display: none;
}

.mzt-period-picker,
.mzt-dash-period #periodRangePicker {
  flex: 0 0 auto;
  width: auto;
  min-width: 12rem;
  max-width: 100%;
}

html.mzt-theme-dark .mzt-dash-conn {
  background: var(--mzt-surface, #1f242b);
  border-color: var(--mzt-border, #3d4450);
}

html.mzt-theme-dark .mzt-dash-conn-chip {
  background: var(--mzt-surface-muted, #2f343c);
  color: var(--mzt-text-muted, #9aa4b2);
}

html.mzt-theme-dark .mzt-dash-conn-chip--warn {
  background: rgba(217, 119, 6, 0.2);
  color: #fbbf24;
  border-color: rgba(217, 119, 6, 0.35);
}

html.mzt-theme-dark .mzt-dash-conn-chip--danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
}

@media (min-width: 640px) {
  .mzt-dash-conn {
    width: auto;
  }
}

@media (max-width: 767px) {
  .mzt-dash-period {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    gap: 0.4rem 0.65rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--mzt-border, #dbe0e6);
    border-radius: 0.75rem;
    background: var(--mzt-surface, #ffffff);
    justify-content: space-between;
  }

  .mzt-dash-period-label {
    display: none;
  }

  .mzt-dash-period .mzt-dash-conn-label {
    display: block;
    flex: 0 0 auto;
  }

  .mzt-dash-period .mzt-period-toolbar {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .mzt-period-picker,
  .mzt-dash-period #periodRangePicker {
    flex: 0 0 auto;
    width: max-content;
    min-width: 0;
    max-width: min(100%, 14.5rem);
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  html.mzt-theme-dark .mzt-dash-period {
    background: var(--mzt-surface, #1f242b);
    border-color: var(--mzt-border, #3d4450);
  }
}

/* FBO list filters: search + cluster in one control language */
.dash-fbo-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 12rem);
  gap: 0.5rem 0.75rem;
  align-items: end;
}

.dash-fbo-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
}

.dash-fbo-filter-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1.2;
}

.dash-fbo-filter-shell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  height: 2.25rem;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1px solid var(--mzt-input-border, #d0dbe7);
  background: var(--mzt-surface-muted, #f0f2f5);
  padding: 0 0.7rem;
  transition: border-color 0.15s ease;
}

.dash-fbo-filter-shell:focus-within {
  border-color: var(--mzt-accent, #078838);
}

.dash-fbo-filter-icon {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  color: var(--mzt-text-muted, #60758a);
  opacity: 0.85;
}

.dash-fbo-filter-control {
  width: 100%;
  height: 2.25rem;
  box-sizing: border-box;
  border-radius: 0.75rem;
  border: 1px solid var(--mzt-input-border, #d0dbe7);
  background: var(--mzt-surface-muted, #f0f2f5);
  color: var(--mzt-text-strong, #111418);
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0 0.75rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.dash-fbo-filter-shell .dash-fbo-filter-control {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.dash-fbo-filter-control:focus {
  border-color: var(--mzt-accent, #078838);
}

.dash-fbo-filter-shell .dash-fbo-filter-control:focus {
  border-color: transparent;
}

.dash-fbo-filter-shell input[type="search"]::-webkit-search-decoration,
.dash-fbo-filter-shell input[type="search"]::-webkit-search-cancel-button,
.dash-fbo-filter-shell input[type="search"]::-webkit-search-results-button,
.dash-fbo-filter-shell input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

select.dash-fbo-filter-control {
  cursor: pointer;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2360758a'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.9rem;
}

.dash-fbo-filter-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

html.mzt-theme-dark .dash-fbo-filter-shell,
html.mzt-theme-dark .dash-fbo-filter-control {
  background: var(--mzt-surface-muted, #2f343c);
  border-color: var(--mzt-input-border, #3d4450);
  color: var(--mzt-text-strong, #f3f4f6);
}

html.mzt-theme-dark .dash-fbo-filter-shell .dash-fbo-filter-control {
  background: transparent;
  border-color: transparent;
}

html.mzt-theme-dark select.dash-fbo-filter-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239aa4b2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

@media (max-width: 767px) {
  .dash-fbo-filters {
    grid-template-columns: 1fr 1fr;
  }

  .dash-fbo-filter-cluster .dash-fbo-filter-control,
  .dash-fbo-filter-search .dash-fbo-filter-shell {
    min-width: 0;
  }

  .dash-fbo-filter-control,
  .dash-fbo-filter-shell {
    font-size: 0.6875rem;
  }
}

/* Keys page: actions under text on narrow screens */
.mzt-keys-card {
  min-width: 0;
  overflow: hidden;
}

.mzt-keys-card-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.mzt-keys-card-meta {
  min-width: 0;
}

.mzt-keys-card-meta p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mzt-keys-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.mzt-keys-card-actions button {
  width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .mzt-keys-card-view {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .mzt-keys-card-meta {
    flex: 1 1 auto;
  }

  .mzt-keys-card-actions {
    width: auto;
    grid-template-columns: auto auto;
  }

  .mzt-keys-card-actions button {
    width: auto;
  }
}

.dash-fbo-list-host {
  min-height: 3rem;
}

.dash-fbo-list-empty {
  text-align: center;
  font-size: 0.75rem;
  padding: 2rem 0.75rem;
}

.dash-fbo-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dash-fbo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.75rem;
  background: var(--mzt-surface, #fff);
  border: 1px solid var(--mzt-card-border, rgba(17, 20, 24, 0.06));
  box-shadow: var(--mzt-card-shadow);
}

.dash-fbo-list-card .dash-fbo-row {
  background: var(--mzt-surface-muted, #f0f2f5);
  box-shadow: none;
  border-color: transparent;
}

html.mzt-theme-dark .dash-fbo-list-card .dash-fbo-row {
  background: var(--mzt-surface-muted, #2f343c);
  border-color: var(--mzt-border, #3d4450);
}

.dash-fbo-row-main {
  flex: 1 1 10rem;
  min-width: 0;
}

.dash-fbo-name {
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--mzt-text-strong, #111418);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-fbo-cluster {
  margin-top: 0.125rem;
  font-size: 0.6875rem;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-fbo-metrics {
  display: grid;
  grid-template-columns: 5.75rem 5.25rem 2.75rem;
  column-gap: 1.25rem;
  align-items: start;
  flex: 0 0 auto;
  margin-left: auto;
}

.dash-fbo-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
}

.dash-fbo-metric-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1;
}

.dash-fbo-metric-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.125rem;
}

.dash-fbo-metric-val {
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mzt-text-strong, #111418);
  line-height: 1;
  min-width: 1.25rem;
  text-align: left;
}

.dash-fbo-metric--sku .dash-fbo-metric-body {
  /* только число — без полоски, но та же высота строки */
}

.dash-fbo-progress-track {
  width: 32px;
  flex: 0 0 32px;
  height: 4px;
  border-radius: 999px;
  background: rgba(96, 117, 138, 0.18);
  overflow: hidden;
}

.dash-fbo-progress-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.2s ease;
}

/* muted sage / warm sand — не кислотный зелёный */
.dash-fbo-progress-fill--available {
  background: #8a9a7e;
}

.dash-fbo-progress-fill--reserve {
  background: #c4a882;
}

html.mzt-theme-dark .dash-fbo-progress-fill--available {
  background: #9aab8e;
}

html.mzt-theme-dark .dash-fbo-progress-fill--reserve {
  background: #c4a882;
}

html.mzt-theme-dark .dash-fbo-progress-track {
  background: rgba(255, 255, 255, 0.12);
}

/* FBO warehouse/cluster chart */
.dash-fbo-spark-card {
  padding: 0.875rem 1rem;
}

.dash-fbo-bars-host {
  min-height: 7rem;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-fbo-bars-host.mzt-chart-scroll {
  justify-content: flex-start;
}

.dash-fbo-spark-empty {
  text-align: center;
  font-size: 0.75rem;
  padding: 2rem 0.75rem;
  margin: 0;
}

.dash-fbo-chart-toggle button {
  padding: 0 0.75rem;
  height: 2rem;
  font-weight: 500;
  background: var(--mzt-surface, #fff);
  color: var(--mzt-text-muted, #60758a);
  border: 0;
  cursor: pointer;
}

.dash-fbo-chart-toggle button.is-active {
  background: #e8e0d4;
  color: var(--mzt-text-strong, #111418);
}

html.mzt-theme-dark .dash-fbo-chart-toggle button.is-active {
  background: var(--mzt-surface-muted, #2f343c);
}

.dash-fbo-spark {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.35rem;
  min-height: 6.5rem;
}

.dash-fbo-spark-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  min-width: 2.5rem;
  gap: 0.3rem;
}

.dash-fbo-spark-val {
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mzt-text-strong, #111418);
  line-height: 1;
}

.dash-fbo-spark-bar {
  width: 12px;
  border-radius: 4px 4px 2px 2px;
  background: #c4a882;
  min-height: 4px;
  opacity: 0.95;
}

html.mzt-theme-dark .dash-fbo-spark-bar {
  background: #b89a78;
}

.dash-fbo-spark-label {
  font-size: 0.5625rem;
  color: var(--mzt-text-muted, #60758a);
  line-height: 1.15;
  text-align: center;
  max-width: 3.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mzt-dashboard-kpi .mzt-metric-cell {
  text-align: left;
}

/* Cabinet daily sparklines (dashboard — ordered-daily snapshots only) */
.dash-cab-spark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.625rem;
  padding: 0.25rem 0;
  width: 100%;
}

.dash-cab-spark-grid--single {
  grid-template-columns: 1fr;
}

.dash-cab-spark-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  background: var(--mzt-surface-muted, #f0f2f5);
  border: 1px solid transparent;
  min-width: 0;
}

html.mzt-theme-dark .dash-cab-spark-card {
  background: var(--mzt-surface-muted, #2f343c);
  border-color: var(--mzt-border, #3d4450);
}

.dash-cab-spark-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.dash-cab-spark-name {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--mzt-text-strong, #111418);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-cab-spark-mp {
  margin: 0.125rem 0 0;
  font-size: 0.625rem;
  color: var(--mzt-text-muted, #60758a);
}

.dash-cab-spark-amount {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--mzt-text-strong, #111418);
  white-space: nowrap;
}

.dash-cab-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
  width: 100%;
}

.dash-cab-spark-col {
  flex: 1 1 0;
  min-width: 3px;
  max-width: 10px;
  display: flex;
  align-items: flex-end;
  height: 100%;
}

.dash-cab-spark-col--today {
  max-width: 12px;
}

.dash-cab-spark-col--today .dash-cab-spark-bar {
  opacity: 1;
  outline: 1px solid rgba(47, 128, 237, 0.55);
  outline-offset: 1px;
}

.dash-cab-spark-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.88;
  background: var(--mzt-text-muted, #5b6b7a);
}

.dash-cab-spark-empty {
  font-size: 0.6875rem;
  color: var(--mzt-text-muted, #60758a);
  padding: 1rem 0;
  text-align: center;
}

@media (max-width: 767px) {
  .dash-fbo-row {
    gap: 0.625rem;
  }
  .dash-fbo-row-main {
    flex: 1 1 100%;
  }
  .dash-fbo-metrics {
    margin-left: 0;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, auto));
    justify-content: start;
    column-gap: 1rem;
  }
}

/* Supply page still uses vertical FBO bars */
#supplyFboBars {
  align-items: flex-end;
  padding-bottom: 3.25rem;
  gap: 0.375rem;
}

.supply-fbo-bar-col {
  position: relative;
  min-width: 2.75rem;
  max-width: 4rem;
  padding-bottom: 0.25rem;
}

.supply-fbo-bar-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  width: 4.5rem;
  transform: translateX(-20%) rotate(-40deg);
  transform-origin: top left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

@media (max-width: 767px) {
  #supplyFboBars {
    padding-bottom: 2.75rem;
  }
  .supply-fbo-bar-col {
    min-width: 2.25rem;
  }
  .supply-fbo-bar-label {
    width: 3.75rem;
    font-size: 8px;
  }
}

.ads-toolbar-btn {
  height: 1.75rem;
  padding: 0 0.625rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

.ads-toolbar-input {
  height: 1.75rem;
  font-size: 0.75rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid #d0dbe7;
  background: #f8fafc;
}

.ads-toolbar-input:focus {
  outline: none;
  border-color: #078838;
}

/* Theme tokens */
:root {
  --mzt-bg: #f0f2f5;
  --mzt-page-bg: #f5f6f8;
  --mzt-surface: #ffffff;
  --mzt-surface-muted: #e8ecf0;
  --mzt-border: #dbe0e6;
  --mzt-text: #111418;
  --mzt-text-strong: #111418;
  --mzt-text-muted: #60758a;
  --mzt-accent: #078838;
  --mzt-btn-muted: #e5e7eb;
  --mzt-btn-muted-hover: #d1d5db;
  --mzt-input-bg: #f8fafc;
  --mzt-input-border: #d0dbe7;
  --mzt-card-border: rgba(17, 20, 24, 0.06);
  --mzt-card-shadow: 0 1px 2px rgba(17, 20, 24, 0.05), 0 4px 12px rgba(17, 20, 24, 0.04);
  --mzt-table-border: #e5e9ef;
  --mzt-table-head-bg: #f8fafc;
  --mzt-table-row-alt: #fafbfc;
  --mzt-table-row-hover: #f3f6f9;
  --mzt-progress-track: #e8ecf0;
  --mzt-progress-available: #078838;
  --mzt-progress-reserve: #c4a882;
  --mzt-capsule-track: rgba(0, 0, 0, 0.06);
  --mzt-capsule-revenue: #c5ccd6;
  --mzt-capsule-ads: #2f80ed;
  --mzt-capsule-grid: rgba(96, 117, 138, 0.35);
  --mzt-capsule-select: #111418;
  --mzt-capsule-tip-bg: #ffffff;
  --mzt-capsule-tip-fg: #111418;
  --mzt-capsule-tip-border: #dbe0e6;
  --mzt-capsule-tip-shadow: 0 4px 16px rgba(17, 20, 24, 0.12);
}

.mzt-card {
  background: var(--mzt-surface);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: var(--mzt-card-shadow);
  border: 1px solid var(--mzt-card-border);
}

.mzt-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
}

.mzt-metric-grid--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 1024px) {
  .mzt-metric-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mzt-metric-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-align: center;
  min-width: 0;
}

html.mzt-theme-dark {
  color-scheme: dark;
  --mzt-bg: #1a1d21;
  --mzt-page-bg: #1a1d21;
  --mzt-surface: #252a31;
  --mzt-surface-muted: #2f343c;
  --mzt-border: #3d4450;
  --mzt-text: #b8bcc2;
  --mzt-text-strong: #d4d7dc;
  --mzt-text-muted: #7a828a;
  --mzt-accent: #3dba5c;
  --mzt-btn-muted: #2f343c;
  --mzt-btn-muted-hover: #3d4450;
  --mzt-input-bg: #2f343c;
  --mzt-input-border: #3d4450;
  --mzt-card-border: rgba(255, 255, 255, 0.06);
  --mzt-card-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  --mzt-table-border: rgba(255, 255, 255, 0.07);
  --mzt-table-head-bg: #2a2f36;
  --mzt-table-row-alt: rgba(255, 255, 255, 0.02);
  --mzt-table-row-hover: rgba(255, 255, 255, 0.04);
  --mzt-progress-track: #3d4450;
  --mzt-progress-available: #3dba5c;
  --mzt-progress-reserve: #c4a882;
  --mzt-capsule-track: rgba(255, 255, 255, 0.1);
  --mzt-capsule-revenue: #4a5058;
  --mzt-capsule-ads: #0095ff;
  --mzt-capsule-grid: rgba(255, 255, 255, 0.18);
  --mzt-capsule-select: #ffffff;
  --mzt-capsule-tip-bg: #2f343c;
  --mzt-capsule-tip-fg: #ffffff;
  --mzt-capsule-tip-border: #3d4450;
  --mzt-capsule-tip-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

html.mzt-theme-dark body,
html.mzt-theme-dark .layout-container,
html.mzt-theme-dark body > .relative {
  background-color: var(--mzt-bg) !important;
  color: var(--mzt-text);
}

body,
.layout-container,
body > .relative {
  background-color: var(--mzt-bg);
}

html.mzt-theme-dark .bg-white,
html.mzt-theme-dark .mzt-period-modal-panel {
  background-color: var(--mzt-surface) !important;
}

html.mzt-theme-dark #footerMount {
  background-color: var(--mzt-bg) !important;
}

html.mzt-theme-dark .bg-\[\#f0f2f5\],
html.mzt-theme-dark .bg-\[\#f3f6f9\],
html.mzt-theme-dark .bg-\[\#f5f6f8\],
html.mzt-theme-dark .bg-\[\#f8f9fa\],
html.mzt-theme-dark .bg-\[\#f8f9fb\],
html.mzt-theme-dark .bg-\[\#f8fafc\],
html.mzt-theme-dark .bg-\[\#fafbfc\],
html.mzt-theme-dark .bg-\[\#e5e7eb\],
html.mzt-theme-dark .hover\:bg-\[\#f0f2f5\]:hover,
html.mzt-theme-dark .hover\:bg-\[\#f3f6f9\]:hover {
  background-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark .bg-white\/70,
html.mzt-theme-dark .bg-white\/80 {
  background-color: rgba(37, 42, 49, 0.85) !important;
}

html.mzt-theme-dark .text-slate-600,
html.mzt-theme-dark .text-slate-700 {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .text-\[\#111418\] {
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark h1,
html.mzt-theme-dark h2,
html.mzt-theme-dark h3,
html.mzt-theme-dark .text-2xl,
html.mzt-theme-dark .text-\[22px\],
html.mzt-theme-dark .text-\[32px\],
html.mzt-theme-dark .text-base.font-bold,
html.mzt-theme-dark .font-bold.text-\[\#111418\],
html.mzt-theme-dark .mzt-metric-cell .font-bold,
html.mzt-theme-dark .mzt-metric-cell .text-sm.font-bold {
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .mzt-metric-cell .text-\[10px\],
html.mzt-theme-dark .mzt-metric-cell .text-xs {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .text-\[\#60758a\] {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .border-\[\#dbe0e6\],
html.mzt-theme-dark .border-\[\#d0dbe7\],
html.mzt-theme-dark .border-b-\[\#f0f2f5\],
html.mzt-theme-dark .border-t-\[\#dbe0e6\],
html.mzt-theme-dark .border-solid {
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark table th,
html.mzt-theme-dark table td {
  border-color: var(--mzt-table-border) !important;
}

html.mzt-theme-dark table th {
  color: var(--mzt-text-muted) !important;
  background-color: var(--mzt-table-head-bg) !important;
}

html.mzt-theme-dark table td {
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark header,
html.mzt-theme-dark #mztNavDrawer,
html.mzt-theme-dark .mzt-mobile-nav-drawer {
  background-color: var(--mzt-surface) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark .mzt-view-mode-switch {
  background-color: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark .mzt-view-mode-btn--icon {
  color: var(--mzt-text-muted);
}

html.mzt-theme-dark .mzt-view-mode-btn--icon:hover {
  color: var(--mzt-text);
  background: rgba(255, 255, 255, 0.06);
}

html.mzt-theme-dark .mzt-view-mode-btn--active {
  background: var(--mzt-text) !important;
  color: var(--mzt-bg) !important;
}

/* Calendar page — dark theme */
html.mzt-theme-dark .cal-cell.is-outside {
  background: var(--mzt-surface-muted) !important;
  color: var(--mzt-text-muted);
}

html.mzt-theme-dark .cal-cell.is-outside .cal-daynum {
  color: var(--mzt-text-muted);
}

html.mzt-theme-dark .cal-cell.is-today .cal-daynum {
  background: var(--mzt-accent);
  color: #fff;
}

html.mzt-theme-dark .cal-chip--shared {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

html.mzt-theme-dark .cal-chip--personal {
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.32);
}

html.mzt-theme-dark .cal-modal-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

/* Support page — dark theme */
html.mzt-theme-dark .support-messages {
  background: var(--mzt-page-bg) !important;
}

html.mzt-theme-dark .support-bubble--user {
  background: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .support-compose button {
  background: var(--mzt-accent) !important;
  color: #fff !important;
}

html.mzt-theme-dark input:not([type="checkbox"]):not([type="radio"]),
html.mzt-theme-dark select,
html.mzt-theme-dark textarea,
html.mzt-theme-dark .ads-toolbar-input {
  background-color: var(--mzt-input-bg) !important;
  border-color: var(--mzt-input-border) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .ads-toolbar-input:focus,
html.mzt-theme-dark input:focus,
html.mzt-theme-dark select:focus,
html.mzt-theme-dark textarea:focus {
  border-color: var(--mzt-accent) !important;
}

html.mzt-theme-dark .bg-\[\#e5e7eb\],
html.mzt-theme-dark button.bg-\[\#e5e7eb\] {
  background-color: var(--mzt-btn-muted) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .hover\:bg-\[\#d1d5db\]:hover,
html.mzt-theme-dark button.hover\:bg-\[\#d1d5db\]:hover {
  background-color: var(--mzt-btn-muted-hover) !important;
}

html.mzt-theme-dark .mzt-compact-table thead tr,
html.mzt-theme-dark .sales-report-table--compact thead tr,
html.mzt-theme-dark .finance-table--compact thead tr,
html.mzt-theme-dark .supply-table--compact thead tr {
  background: var(--mzt-table-head-bg) !important;
  border-bottom-color: var(--mzt-table-border) !important;
}

html.mzt-theme-dark .supply-fbo-bar-label {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark #supplyFboChartToggle button[data-fbo-mode] {
  border-color: var(--mzt-border);
}

html.mzt-theme-dark .mzt-compact-table tbody tr:nth-child(even),
html.mzt-theme-dark .sales-report-table--compact tbody tr:nth-child(even),
html.mzt-theme-dark .finance-table--compact tbody tr:nth-child(even),
html.mzt-theme-dark .supply-table--compact tbody tr:nth-child(even) {
  background: var(--mzt-table-row-alt) !important;
}

html.mzt-theme-dark .mzt-compact-table tbody tr:hover,
html.mzt-theme-dark .sales-report-table--compact tbody tr:hover,
html.mzt-theme-dark .finance-table--compact tbody tr:hover,
html.mzt-theme-dark .supply-table--compact tbody tr:hover {
  background: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark.mzt-force-mobile {
  background: #121418 !important;
}

html.mzt-theme-dark.mzt-force-mobile body {
  background: #121418 !important;
}

html.mzt-theme-dark.mzt-force-mobile body > .relative.flex,
html.mzt-theme-dark.mzt-force-mobile body > .relative {
  background: var(--mzt-bg) !important;
  box-shadow: 0 0 0 1px var(--mzt-card-border), 0 12px 48px rgba(0, 0, 0, 0.35);
}

html.mzt-theme-dark .mzt-period-modal {
  background-color: rgba(0, 0, 0, 0.65) !important;
}

html.mzt-theme-dark #customPeriodCancel {
  background-color: var(--mzt-surface-muted) !important;
  color: var(--mzt-text) !important;
}

/* Flatpickr + Tailwind: .hidden не должен display:none — иначе съезд Пн–Вс */
.flatpickr-calendar span.flatpickr-day.hidden,
.flatpickr-calendar span.flatpickr-day.prevMonthDay,
.flatpickr-calendar span.flatpickr-day.nextMonthDay {
  display: inline-block !important;
  visibility: hidden !important;
  pointer-events: none;
}

.flatpickr-calendar.multiMonth .dayContainer,
.flatpickr-calendar.multiMonth .flatpickr-weekdaycontainer {
  width: 245.875px;
  min-width: 245.875px;
  max-width: 245.875px;
}

.flatpickr-calendar .flatpickr-day {
  height: 35px;
  line-height: 35px;
  max-width: 35px;
  width: 14.2857143%;
}

.flatpickr-calendar .flatpickr-weekday {
  height: 35px;
  line-height: 35px;
  max-width: 35px;
  width: 14.2857143%;
}

html.mzt-theme-dark .flatpickr-calendar {
  background: var(--mzt-surface) !important;
  border-color: var(--mzt-border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

html.mzt-theme-dark .flatpickr-months .flatpickr-month,
html.mzt-theme-dark .flatpickr-current-month .flatpickr-monthDropdown-months,
html.mzt-theme-dark .flatpickr-weekdays,
html.mzt-theme-dark span.flatpickr-weekday {
  background: var(--mzt-surface) !important;
  color: var(--mzt-text) !important;
  fill: var(--mzt-text) !important;
}

html.mzt-theme-dark .flatpickr-day {
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .flatpickr-day.prevMonthDay,
html.mzt-theme-dark .flatpickr-day.nextMonthDay {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .flatpickr-day:hover,
html.mzt-theme-dark .flatpickr-day:focus {
  background: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark .flatpickr-day.selected,
html.mzt-theme-dark .flatpickr-day.startRange,
html.mzt-theme-dark .flatpickr-day.endRange {
  background: var(--mzt-accent) !important;
  border-color: var(--mzt-accent) !important;
  color: #fff !important;
}

html.mzt-theme-dark .flatpickr-day.inRange {
  background: rgba(61, 186, 92, 0.2) !important;
  border-color: transparent !important;
  color: var(--mzt-text) !important;
  box-shadow: -5px 0 0 rgba(61, 186, 92, 0.2), 5px 0 0 rgba(61, 186, 92, 0.2) !important;
}

html.mzt-theme-dark .flatpickr-months .flatpickr-prev-month,
html.mzt-theme-dark .flatpickr-months .flatpickr-next-month {
  fill: var(--mzt-text) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark #cabinetSalesBars [style*="opacity:0.85"] {
  opacity: 0.95 !important;
}

/* Ads — dark theme v3 (campaigns / products tables, chips, recommendations) */
html.mzt-theme-dark .ads-campaigns-table--compact thead tr,
html.mzt-theme-dark .ads-products-table--compact thead tr {
  background: var(--mzt-table-head-bg) !important;
  border-bottom-color: var(--mzt-table-border) !important;
}

html.mzt-theme-dark .ads-campaigns-table--compact tbody tr.campaign-row:nth-child(even),
html.mzt-theme-dark .ads-products-table--compact tbody tr:nth-child(even) {
  background: var(--mzt-table-row-alt) !important;
}

html.mzt-theme-dark .ads-campaigns-table--compact tbody tr.campaign-row:hover,
html.mzt-theme-dark .ads-products-table--compact tbody tr:hover,
html.mzt-theme-dark tr.campaign-row.hover\:bg-\[\#f8f9fa\]:hover {
  background: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark tr.bg-\[\#f0f2f5\],
html.mzt-theme-dark tr.bg-\[\#e8ecf0\] {
  background: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark tr.bg-\[\#f0f2f5\] td,
html.mzt-theme-dark tr.bg-\[\#e8ecf0\] td {
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .text-\[\#374151\] {
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .text-\[\#078838\] {
  color: var(--mzt-accent) !important;
}

html.mzt-theme-dark .hover\:text-\[\#06732f\]:hover {
  color: var(--mzt-accent) !important;
  opacity: 0.9;
}

html.mzt-theme-dark .hover\:bg-green-50:hover {
  background: rgba(61, 186, 92, 0.12) !important;
}

html.mzt-theme-dark .ads-rating-chip--excellent {
  background: rgba(61, 186, 92, 0.15) !important;
  color: #8fd4a4 !important;
  border-color: rgba(61, 186, 92, 0.35) !important;
}

html.mzt-theme-dark .ads-rating-chip--good {
  background: var(--mzt-surface-muted) !important;
  color: var(--mzt-text) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark .ads-rating-chip--fair {
  background: rgba(251, 191, 36, 0.12) !important;
  color: #d4b86a !important;
  border-color: rgba(251, 191, 36, 0.25) !important;
}

html.mzt-theme-dark .ads-rating-chip--attention {
  background: rgba(244, 63, 94, 0.12) !important;
  color: #e8a0ad !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
}

html.mzt-theme-dark .border-\[\#e5e9ef\] {
  border-color: var(--mzt-border) !important;
}

/* Index hero gradient fallback */
html.mzt-theme-dark .from-\[\#f8f8f8\].to-\[\#efefef\] {
  background: var(--mzt-surface) !important;
  background-image: none !important;
}

html.mzt-theme-dark .text-\[\#4b5563\] {
  color: var(--mzt-text-muted) !important;
}

/* Brand logo in dark mode */
html.mzt-theme-dark #mztBrandLink.mzt-brand .size-4,
html.mzt-theme-dark #mztBrandLink.mzt-brand svg {
  color: var(--mzt-accent);
}

html.mzt-theme-dark #mztBrandLink.mzt-brand h2 {
  color: var(--mzt-text-strong) !important;
}

/* Один кабинет: график внутри карточки МП; отдельный wrap скрыт */
#dashCabinetCluster.dash-few {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.mzt-authed #dashCabinetCluster.dash-few #dashCabinetSalesWrap,
#dashCabinetCluster.dash-few #dashCabinetSalesWrap {
  display: none !important;
}
#dashCabinetCluster.dash-few #dashMarketplaceHeading {
  text-align: left;
}
#dashCabinetCluster.dash-few #marketplaceBlocks {
  width: 100%;
}

.dash-fbo-cabinet-select {
  width: auto;
  max-width: min(320px, 70vw);
  field-sizing: content;
}

.dash-mp-card-body.mzt-metric-grid {
  width: 100%;
}

.dash-mp-spark {
  display: none;
  min-height: 0;
}

/* Один кабинет: карточка на всю ширину; метрики по краям, линия тянется по центру */
.dash-mp-card--single {
  width: 100%;
  max-width: none;
}

.dash-mp-card--single .dash-mp-card-body.mzt-metric-grid {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) minmax(0, 1fr) minmax(7rem, 10rem);
  grid-template-rows: auto auto;
  grid-template-areas:
    "amount spark orders"
    "ads    spark drr";
  align-items: center;
  column-gap: 1.5rem;
  row-gap: 0.55rem;
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  padding-inline: 0.25rem;
}

.dash-mp-card--single .dash-mp-cell-amount { grid-area: amount; text-align: center; }
.dash-mp-card--single .dash-mp-cell-orders { grid-area: orders; text-align: center; }
.dash-mp-card--single .dash-mp-cell-ads { grid-area: ads; text-align: center; }
.dash-mp-card--single .dash-mp-cell-drr { grid-area: drr; text-align: center; }

.dash-mp-card--single .dash-mp-cell-amount,
.dash-mp-card--single .dash-mp-cell-ads,
.dash-mp-card--single .dash-mp-cell-orders,
.dash-mp-card--single .dash-mp-cell-drr {
  max-width: 10rem;
  align-items: center;
}

.dash-mp-card--single .dash-mp-cell-amount p,
.dash-mp-card--single .dash-mp-cell-ads p,
.dash-mp-card--single .dash-mp-cell-orders p,
.dash-mp-card--single .dash-mp-cell-drr p {
  text-align: center;
  width: 100%;
}

.dash-mp-card--single .dash-mp-cell-spark,
.dash-mp-card--single .mzt-cabinet-sparks {
  grid-area: spark;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: 100%;
  min-width: 0;
  align-self: stretch;
  margin-inline: 0;
  padding: 0.15rem 0.35rem;
}

.dash-mp-card--single .mzt-cabinet-sparks .dash-mp-spark,
.dash-mp-card--single .dash-mp-cell-spark .dash-mp-spark {
  display: block;
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 3.25rem;
  margin-inline: 0;
  padding: 0;
  grid-area: auto;
}

.dash-mp-card--single .mzt-cabinet-sparks .dash-mp-spark.mzt-cabinet-spark--drr {
  min-height: 2.5rem;
}

.dash-mp-line-wrap {
  position: relative;
  width: 100%;
  height: 3.75rem;
}

.dash-mp-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  color: var(--dash-mp-line, #5c6b73);
  --dash-mp-line: #5c6b73;
}

html.mzt-theme-dark .dash-mp-line {
  --dash-mp-line: #9aa3ab;
  color: var(--dash-mp-line);
}

.dash-mp-line polyline {
  stroke: currentColor;
  fill: none;
}

.dash-mp-line-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dash-mp-line-pt {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--mzt-surface, #fff);
  border-radius: 50%;
  background: var(--dash-mp-line, #5c6b73);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: none;
}

.dash-mp-line-pt--today {
  width: 11px;
  height: 11px;
  background: #2f80ed;
  border-color: var(--mzt-surface, #fff);
}

html.mzt-theme-dark .dash-mp-line-pt {
  border-color: var(--mzt-surface, #1e2228);
  background: #9aa3ab;
}

html.mzt-theme-dark .dash-mp-line-pt--today {
  background: #0095ff;
}

.dash-mp-line-hit,
.dash-mp-line-dot {
  display: none;
}

.dash-mp-line-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
  background: rgba(28, 32, 38, 0.92);
  color: #f3f4f6;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.dash-mp-line-tip.is-on {
  opacity: 1;
  visibility: visible;
}

.dash-mp-line-tip strong {
  font-weight: 600;
  display: block;
}

html.mzt-theme-dark .dash-mp-line-tip {
  background: rgba(18, 20, 24, 0.94);
  color: #e8eaed;
}

@media (max-width: 640px) {
  .dash-mp-card--single .dash-mp-card-body.mzt-metric-grid {
    width: 100%;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "amount orders"
      "ads drr"
      "spark spark";
    column-gap: 1rem;
  }
  .dash-mp-card--single .dash-mp-spark {
    width: 100%;
    max-width: none;
    padding-inline: 0.25rem;
  }
  .dash-mp-card--single .dash-mp-cell-spark,
  .dash-mp-card--single .mzt-cabinet-sparks {
    grid-area: spark;
    width: 100%;
    padding-inline: 0.25rem;
  }
}

html.mzt-theme-dark .dash-fbo-cabinet-select {
  background: var(--mzt-surface-muted, #2f343c);
  border-color: var(--mzt-input-border, #3d4450);
  color: var(--mzt-text-strong, #d4d7dc);
}

/* ===== Dark: sticky cells / thead / white row flares ===== */
html.mzt-theme-dark .category-daily-sticky-name,
html.mzt-theme-dark .category-daily-total-sticky-name,
html.mzt-theme-dark td.category-daily-sticky-name,
html.mzt-theme-dark td.category-daily-total-sticky-name {
  background-color: var(--mzt-surface) !important;
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark tr.category-daily-total-row,
html.mzt-theme-dark tr.category-daily-total-row > td {
  background-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark tr.category-daily-total-row > td.category-daily-sticky-name,
html.mzt-theme-dark tr.category-daily-total-row > td.category-daily-total-sticky-name {
  background-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark tr.category-daily-row:hover,
html.mzt-theme-dark tr.category-daily-row:hover > td,
html.mzt-theme-dark tr.category-daily-row:hover > td.category-daily-sticky-name {
  background-color: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark thead.sticky,
html.mzt-theme-dark thead[class*="sticky"],
html.mzt-theme-dark th.sticky,
html.mzt-theme-dark td.sticky,
html.mzt-theme-dark .sticky.left-0,
html.mzt-theme-dark .sticky.bg-\[\#f8fafc\],
html.mzt-theme-dark .sticky.bg-white,
html.mzt-theme-dark th.bg-\[\#f8fafc\],
html.mzt-theme-dark thead.bg-\[\#f8fafc\] {
  background-color: var(--mzt-table-head-bg) !important;
}

html.mzt-theme-dark td.sticky.left-0:not(th) {
  background-color: var(--mzt-surface) !important;
}

html.mzt-theme-dark tr.product-row:hover,
html.mzt-theme-dark tr.product-row:hover > td,
html.mzt-theme-dark tr.hover\:bg-\[\#f8f9fb\]:hover,
html.mzt-theme-dark tr.hover\:bg-\[\#f8f9fb\]:hover > td {
  background-color: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark tr.bg-\[\#f8f9fb\],
html.mzt-theme-dark tr.bg-\[\#f0f4f8\],
html.mzt-theme-dark tr.bg-\[\#f8fafc\],
html.mzt-theme-dark tr.bg-\[\#f8f9fa\] {
  background-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark tr.bg-\[\#f8f9fb\] td,
html.mzt-theme-dark tr.bg-\[\#f0f4f8\] td,
html.mzt-theme-dark tr.bg-\[\#f8fafc\] td,
html.mzt-theme-dark tr.bg-\[\#f8f9fa\] td {
  background-color: transparent !important;
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .odd\:bg-white:nth-child(odd),
html.mzt-theme-dark tr.odd\:bg-white:nth-child(odd),
html.mzt-theme-dark .odd\:bg-white {
  background-color: var(--mzt-surface) !important;
}

html.mzt-theme-dark .even\:bg-slate-50\/80:nth-child(even),
html.mzt-theme-dark .even\:bg-violet-50\/40:nth-child(even),
html.mzt-theme-dark .even\:bg-indigo-50\/40:nth-child(even),
html.mzt-theme-dark .even\:bg-emerald-50\/40:nth-child(even),
html.mzt-theme-dark tr.even\:bg-slate-50\/80:nth-child(even) {
  background-color: var(--mzt-table-row-alt) !important;
}

html.mzt-theme-dark .hover\:bg-sky-50\/50:hover,
html.mzt-theme-dark tr.hover\:bg-sky-50\/50:hover {
  background-color: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark .bg-slate-50,
html.mzt-theme-dark .bg-slate-100,
html.mzt-theme-dark .sticky.bg-white,
html.mzt-theme-dark td.bg-white {
  background-color: var(--mzt-surface) !important;
}

html.mzt-theme-dark .border-t-\[\#dbe0e6\],
html.mzt-theme-dark .border-\[\#e5e9ef\],
html.mzt-theme-dark .border-b-\[\#e5e9ef\] {
  border-color: var(--mzt-table-border) !important;
}

html.mzt-theme-dark .sales-report-table--compact thead,
html.mzt-theme-dark .sales-report-table--compact thead th {
  background-color: var(--mzt-table-head-bg) !important;
  color: var(--mzt-text-muted) !important;
}

/* Pages dark v2 — ads / supply / price */
html.mzt-theme-dark #adsMetricsLegendBlock {
  background-color: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark #adsMetricsLegendBlock .bg-white {
  background-color: var(--mzt-surface) !important;
}

html.mzt-theme-dark th.bg-\[\#f8fafc\],
html.mzt-theme-dark td.bg-\[\#f8fafc\],
html.mzt-theme-dark th.sticky.bg-\[\#f8fafc\],
html.mzt-theme-dark td.sticky.bg-\[\#f8fafc\] {
  background-color: var(--mzt-table-head-bg) !important;
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .ads-campaigns-table--compact tbody tr.campaign-row:hover,
html.mzt-theme-dark .ads-products-table--compact tbody tr:hover {
  background: var(--mzt-table-row-hover) !important;
}

html.mzt-theme-dark .supply-tab.bg-white {
  background-color: var(--mzt-surface) !important;
  color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .supply-tab:not(.bg-white) {
  color: var(--mzt-text-muted);
}

html.mzt-theme-dark .supply-tab:not(.bg-white):hover {
  color: var(--mzt-text-strong);
}

html.mzt-theme-dark #priceWriteBanner {
  background: rgba(251, 191, 36, 0.12) !important;
  border-color: rgba(251, 191, 36, 0.28) !important;
  color: #e8c96a !important;
}

html.mzt-theme-dark #priceError {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(244, 63, 94, 0.28) !important;
  color: #f0a0ad !important;
}

html.mzt-theme-dark #priceArmWriteBtn {
  background: rgba(244, 63, 94, 0.12) !important;
  border-color: rgba(244, 63, 94, 0.35) !important;
  color: #f0a0ad !important;
}

html.mzt-theme-dark #priceConfirmModal .bg-white {
  background-color: var(--mzt-surface) !important;
  color: var(--mzt-text);
}

html.mzt-theme-dark #priceConfirmPayload {
  background-color: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
  color: var(--mzt-text);
}

html.mzt-theme-dark .price-mgmt-table thead th,
html.mzt-theme-dark .price-mgmt-table thead th.bg-\[\#f8fafc\],
html.mzt-theme-dark .price-mgmt-table thead th.bg-slate-50 {
  background-color: var(--mzt-table-head-bg) !important;
  color: var(--mzt-text-muted) !important;
  box-shadow: 0 1px 0 var(--mzt-border) !important;
}

html.mzt-theme-dark .price-mgmt-table .price-table-search {
  background: var(--mzt-input-bg) !important;
  border-color: var(--mzt-input-border) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .bg-emerald-50 {
  background-color: rgba(52, 211, 153, 0.14) !important;
}

html.mzt-theme-dark .bg-red-50 {
  background-color: rgba(244, 63, 94, 0.12) !important;
}

html.mzt-theme-dark .text-emerald-800 {
  color: #6ee7b7 !important;
}

html.mzt-theme-dark .text-red-700 {
  color: #f0a0ad !important;
}

html.mzt-theme-dark .border-emerald-400 {
  border-color: rgba(52, 211, 153, 0.45) !important;
}

html.mzt-theme-dark .border-red-400 {
  border-color: rgba(244, 63, 94, 0.4) !important;
}

html.mzt-theme-dark .bg-amber-50 {
  background-color: rgba(251, 191, 36, 0.12) !important;
}

html.mzt-theme-dark .text-amber-800 {
  color: #e8c96a !important;
}

html.mzt-theme-dark .border-amber-200 {
  border-color: rgba(251, 191, 36, 0.28) !important;
}

html.mzt-theme-dark .border-red-200 {
  border-color: rgba(244, 63, 94, 0.28) !important;
}

/* Loading states — dark v3 (overlay, bootstrap, sales amber, ads cabinet shells) */
html.mzt-theme-dark .bg-blue-50,
html.mzt-theme-dark .bg-blue-50\/90 {
  background-color: rgba(59, 130, 246, 0.12) !important;
}

html.mzt-theme-dark .bg-green-50 {
  background-color: rgba(61, 186, 92, 0.12) !important;
}

html.mzt-theme-dark .bg-yellow-50 {
  background-color: rgba(251, 191, 36, 0.1) !important;
}

html.mzt-theme-dark .bg-violet-50,
html.mzt-theme-dark .bg-violet-50\/90 {
  background-color: rgba(139, 92, 246, 0.12) !important;
}

html.mzt-theme-dark .bg-emerald-50\/90 {
  background-color: rgba(52, 211, 153, 0.14) !important;
}

html.mzt-theme-dark .border-blue-200 {
  border-color: rgba(59, 130, 246, 0.28) !important;
}

html.mzt-theme-dark .border-green-200 {
  border-color: rgba(61, 186, 92, 0.28) !important;
}

html.mzt-theme-dark .border-violet-200 {
  border-color: rgba(139, 92, 246, 0.28) !important;
}

html.mzt-theme-dark .border-emerald-200 {
  border-color: rgba(52, 211, 153, 0.32) !important;
}

html.mzt-theme-dark .border-yellow-200 {
  border-color: rgba(251, 191, 36, 0.25) !important;
}

html.mzt-theme-dark .text-blue-900,
html.mzt-theme-dark .text-blue-800 {
  color: #93c5fd !important;
}

html.mzt-theme-dark .text-green-900 {
  color: #8fd4a4 !important;
}

html.mzt-theme-dark .text-amber-900 {
  color: #e8c96a !important;
}

html.mzt-theme-dark .text-violet-950 {
  color: #c4b5fd !important;
}

html.mzt-theme-dark .text-emerald-950 {
  color: #6ee7b7 !important;
}

html.mzt-theme-dark .bg-\[\#fff7e6\] {
  background-color: rgba(251, 191, 36, 0.1) !important;
}

html.mzt-theme-dark .border-\[\#f3d6a0\] {
  border-color: rgba(251, 191, 36, 0.22) !important;
}

html.mzt-theme-dark .text-\[\#8a5a00\] {
  color: #c9a24a !important;
}

html.mzt-theme-dark .border-\[\#8a5a00\] {
  border-color: #c9a24a !important;
}

html.mzt-theme-dark .bg-\[\#e2e8f0\] {
  background-color: var(--mzt-progress-track) !important;
}

html.mzt-theme-dark [id$="_loading_indicator"],
html.mzt-theme-dark [id$="_loading_badge"] {
  background-color: rgba(251, 191, 36, 0.1) !important;
  border-color: rgba(251, 191, 36, 0.22) !important;
  color: #c9a24a !important;
}

html.mzt-theme-dark [id$="_loading_indicator"] .border-\[\#8a5a00\],
html.mzt-theme-dark [id$="_loading_badge"] .border-\[\#8a5a00\] {
  border-color: #c9a24a !important;
}

html.mzt-theme-dark #central_loading_overlay,
html.mzt-theme-dark .mzt-loading-overlay {
  background-color: rgba(22, 26, 31, 0.94) !important;
}

html.mzt-theme-dark #central_loading_overlay .border-\[\#f0f0f0\] {
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark #central_loading_overlay .border-\[\#111418\] {
  border-color: var(--mzt-text-strong) !important;
}

html.mzt-theme-dark .mzt-cabinet-bootstrap {
  background-color: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark .mzt-cabinet-bootstrap .h-full.bg-\[\#111418\] {
  background-color: var(--mzt-accent) !important;
}

html.mzt-theme-dark [data-ads-cabinet-loading],
html.mzt-theme-dark [data-wb-placeholder-card],
html.mzt-theme-dark #periodLoadingIndicator,
html.mzt-theme-dark .ads-historical-cache-banner,
html.mzt-theme-dark .ads-wb-partial-error-banner {
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark [data-ads-cabinet-loading] .bg-white\/60,
html.mzt-theme-dark [data-wb-placeholder-card] .bg-white\/60,
html.mzt-theme-dark [data-wb-placeholder-card] .bg-slate-200\/90 {
  background-color: var(--mzt-progress-track) !important;
}

html.mzt-theme-dark [data-ads-cabinet-loading] .bg-white\/80,
html.mzt-theme-dark [data-ads-cabinet-loading] .hover\:bg-white:hover {
  background-color: rgba(37, 42, 49, 0.85) !important;
}

html.mzt-theme-dark [data-wb-placeholder-card] .bg-blue-600 {
  background-color: var(--mzt-accent) !important;
}

html.mzt-theme-dark .from-green-50.to-green-100 {
  background: rgba(61, 186, 92, 0.12) !important;
  background-image: none !important;
}

/* Finance chrome — dark (neutral tabs/presets; semantic ± colors kept) */
html.mzt-theme-dark .finance-platform-btn--active,
html.mzt-theme-dark .finance-tab.bg-\[\#111418\] {
  background-color: var(--mzt-text-strong) !important;
  color: var(--mzt-bg) !important;
}

html.mzt-theme-dark .finance-period-preset {
  background-color: var(--mzt-surface) !important;
  border-color: var(--mzt-border) !important;
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark .finance-period-preset--active,
html.mzt-theme-dark .finance-period-preset:hover {
  border-color: var(--mzt-text) !important;
  background-color: var(--mzt-surface-muted) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .finance-flatpickr-presets {
  background: var(--mzt-surface-muted) !important;
  border-color: var(--mzt-border) !important;
}

html.mzt-theme-dark .flatpickr-calendar.finance-picker-with-presets .flatpickr-months .flatpickr-prev-month,
html.mzt-theme-dark .flatpickr-calendar.finance-picker-with-presets .flatpickr-months .flatpickr-next-month {
  background: var(--mzt-surface) !important;
  border-color: var(--mzt-border) !important;
  fill: var(--mzt-text) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .finance-flatpickr-presets button:hover {
  background: var(--mzt-surface) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .finance-table-scroll thead th,
html.mzt-theme-dark .finance-table--compact thead tr {
  background: var(--mzt-table-head-bg) !important;
}

html.mzt-theme-dark .finance-group-header-row,
html.mzt-theme-dark .finance-group-header-row > td,
html.mzt-theme-dark .finance-table-scroll tbody tr.finance-group-header-row > td {
  background: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark .finance-margin-insight-chip--warn {
  background: rgba(251, 191, 36, 0.14) !important;
  color: #e8c96a !important;
}

html.mzt-theme-dark .finance-margin-insight-chip--bad {
  background: rgba(244, 63, 94, 0.14) !important;
  color: #f0a0ad !important;
}

html.mzt-theme-dark .text-\[\#078838\] {
  color: var(--mzt-accent) !important;
}

html.mzt-theme-dark .text-\[\#c62828\] {
  color: #f0a0ad !important;
}

/* Dashboard sparkline + DRR second line */
.mzt-cabinet-sparks {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.2rem;
  min-width: 0;
  width: 100%;
}

.mzt-cabinet-spark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: stretch;
  min-height: 56px;
  min-width: 0;
  width: 100%;
}

.dash-mp-card--single .mzt-cabinet-spark {
  display: block;
  min-height: 3.25rem;
}

.mzt-cabinet-spark--drr {
  min-height: 40px;
  color: var(--mzt-accent, #3dba5c);
  opacity: 0.85;
}

.mzt-cabinet-spark-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
  background: #2f343c;
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(17, 20, 24, 0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}

.mzt-cabinet-spark-tip.is-visible {
  opacity: 1;
  visibility: visible;
}

html.mzt-theme-dark .mzt-cabinet-spark--drr {
  color: #8fd4a4;
  opacity: 0.9;
}


/* ── Ported from mztsite (20260911): matrix scroll, capsule chart, dark extras ── */

/* Lift FAB above cookie consent banner when present */
body:has(#mzt-cookie-banner) .mzt-view-mode-fab {
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
}

html.mzt-theme-dark #footerMount a,
html.mzt-theme-dark #footerMount button,
html.mzt-theme-dark #footerMount p {
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark #footerMount a:hover,
html.mzt-theme-dark #footerMount button:hover {
  color: var(--mzt-text-strong) !important;
}

/* Swipe hint: hidden by default */
.mzt-table-matrix-hint,
.mzt-chart-scroll-hint {
  display: none;
}

html.mzt-force-mobile .mzt-table-scroll.mzt-table-matrix {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

html.mzt-force-mobile .mzt-chart-scroll {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start !important;
  max-width: 100%;
}

html.mzt-force-mobile .mzt-chart-scroll-hint,
html.mzt-force-mobile .mzt-table-matrix-hint {
  display: block;
}

/* LK / profile anti-overlap (force-mobile) */
html.mzt-force-mobile .mzt-lk-cards > * {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

html.mzt-force-mobile .mzt-profile-page {
  overflow-x: hidden;
}

html.mzt-force-mobile .mzt-profile-card {
  padding: 1rem !important;
}

html.mzt-force-mobile .mzt-invite-item .font-mono,
html.mzt-force-mobile .mzt-invite-item .break-all {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 767px) {
  .mzt-table-scroll.mzt-table-matrix {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mzt-table-matrix th.sticky.left-0,
  .mzt-table-matrix td.category-daily-sticky-name {
    min-width: 100px !important;
    max-width: 110px !important;
  }

  .mzt-table-matrix-hint,
  .mzt-chart-scroll-hint {
    display: block;
  }

  .mzt-chart-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    max-width: 100%;
  }

  /* LK / profile cards: stack full-width on mobile */
  .mzt-lk-cards > * {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .mzt-profile-page {
    overflow-x: hidden;
  }

  .mzt-profile-cards {
    gap: 0.75rem !important;
  }

  .mzt-profile-card {
    padding: 1rem !important;
    border-radius: 0.75rem;
  }

  .mzt-profile-actions {
    width: 100%;
  }

  .mzt-profile-btn {
    max-width: 100%;
    box-sizing: border-box;
  }

  .mzt-invite-item,
  .mzt-invite-list,
  .mzt-invite-create {
    min-width: 0;
    max-width: 100%;
  }

  .mzt-invite-item .font-mono,
  .mzt-invite-item .break-all {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .finance-table-scroll {
    overflow-x: visible;
    max-height: none;
  }

  .finance-table-scroll thead th,
  .finance-table-scroll tbody tr.finance-group-header-row > td {
    position: static !important;
  }
}

/* Profile dark hooks (tokens only) */
html.mzt-theme-dark .mzt-profile-warn {
  background-color: rgba(180, 120, 20, 0.18) !important;
  border-color: rgba(212, 160, 40, 0.35) !important;
}

html.mzt-theme-dark .mzt-profile-danger {
  background-color: rgba(180, 50, 50, 0.16) !important;
  border-color: rgba(220, 90, 90, 0.35) !important;
}

html.mzt-theme-dark .mzt-profile-btn.bg-\[\#f0f2f5\] {
  background-color: var(--mzt-btn-muted) !important;
  color: var(--mzt-text) !important;
}

html.mzt-theme-dark .mzt-profile-btn.bg-\[\#111418\] {
  background-color: var(--mzt-accent) !important;
  color: #0f1410 !important;
}

html.mzt-theme-dark .mzt-profile-check {
  background-color: var(--mzt-surface-muted) !important;
}

html.mzt-theme-dark #twofaStatusBadge.bg-\[\#f0f2f5\] {
  background-color: var(--mzt-surface-muted) !important;
  color: var(--mzt-text-muted) !important;
}

html.mzt-theme-dark #twofaStatusBadge.bg-green-100 {
  background-color: rgba(61, 186, 92, 0.2) !important;
  color: #7ddea0 !important;
}

.mzt-cabinet-spark--capsule {
  align-items: flex-start;
  min-height: 132px;
  overflow: visible;
}

.mzt-cabinet-spark-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.mzt-capsule-track {
  fill: var(--mzt-capsule-track);
  cursor: pointer;
}

.mzt-capsule-revenue {
  fill: var(--mzt-capsule-revenue);
}

.mzt-capsule-ads {
  fill: var(--mzt-capsule-ads);
}

.mzt-capsule-select {
  fill: none;
  stroke: var(--mzt-capsule-select);
  stroke-width: 1.5;
  opacity: 0;
}

.mzt-capsule-bar.is-selected .mzt-capsule-select {
  opacity: 1;
}

.mzt-capsule-bar--today .mzt-capsule-track {
  stroke: var(--mzt-capsule-ads);
  stroke-width: 1.25;
  stroke-opacity: 0.55;
}

.mzt-capsule-day--today {
  font-weight: 600;
  fill: var(--mzt-capsule-ads);
}

.mzt-capsule-hit {
  cursor: pointer;
}

.mzt-capsule-grid {
  stroke: var(--mzt-capsule-grid);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  fill: none;
}

.mzt-capsule-axis,
.mzt-capsule-day {
  fill: var(--mzt-text-muted);
  font-size: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}

.mzt-cabinet-spark-tip.mzt-capsule-tip {
  background: var(--mzt-capsule-tip-bg);
  color: var(--mzt-capsule-tip-fg);
  border: 1px solid var(--mzt-capsule-tip-border);
  border-radius: 10px;
  padding: 8px 28px 8px 10px;
  box-shadow: var(--mzt-capsule-tip-shadow);
  transform: translate(-50%, calc(-100% - 10px));
  z-index: 8;
}

.mzt-cabinet-spark-tip.mzt-capsule-tip.is-visible {
  pointer-events: auto;
}

.mzt-cabinet-spark-tip-date {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--mzt-text-muted);
}

.mzt-cabinet-spark-tip-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--mzt-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}

.mzt-cabinet-spark-tip-close:hover {
  color: var(--mzt-text-strong);
  background: var(--mzt-surface-muted);
}

.mzt-capsule-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.mzt-capsule-tip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--mzt-capsule-revenue);
}

.mzt-capsule-tip-row--drr .mzt-capsule-tip-dot {
  background: var(--mzt-capsule-ads);
}

.mzt-capsule-tip-label {
  color: var(--mzt-text-muted);
  min-width: 4.5em;
}

.mzt-capsule-tip-val {
  font-weight: 600;
  color: var(--mzt-capsule-tip-fg);
  margin-left: auto;
  padding-left: 10px;
}

@media (max-width: 767px) {
  html:not(.mzt-force-desktop) .mzt-cabinet-spark--capsule {
    min-height: 118px;
    align-items: flex-start;
  }

  html:not(.mzt-force-desktop) .mzt-cabinet-spark--drr {
    display: none !important;
  }
}

html.mzt-force-mobile .mzt-cabinet-spark--capsule {
  min-height: 118px;
  align-items: flex-start;
}

html.mzt-force-mobile .mzt-cabinet-spark--drr {
  display: none !important;
}

html.mzt-force-desktop .mzt-cabinet-spark--drr {
  display: flex !important;
}

/* Period + refresh: one row, icon-only on mobile */
.mzt-period-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

html.mzt-force-mobile .mzt-period-toolbar .mzt-refresh-label,
html.mzt-force-mobile .mzt-period-toolbar .mzt-refresh-chevron {
  display: none !important;
}

html.mzt-force-mobile .mzt-period-toolbar .mzt-refresh-btn {
  width: 2.5rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
  gap: 0;
}

html.mzt-force-mobile .mzt-sales-header-refresh,
html.mzt-force-mobile #periodDisplay {
  display: none !important;
}

@media (max-width: 767px) {
  .mzt-period-toolbar .mzt-refresh-label,
  .mzt-period-toolbar .mzt-refresh-chevron {
    display: none !important;
  }

  .mzt-period-toolbar .mzt-refresh-btn {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    gap: 0;
  }

  .mzt-sales-header-refresh {
    display: none !important;
  }

  #periodDisplay {
    display: none !important;
  }
}
