/* Scoped to analytics. Calculator, auth and public-page styles are unchanged. */
.workspace-page .portal-table-card,.workspace-page .portal-grid>article,.workspace-page .quality-ledger,.workspace-page .quality-unknown{min-width:0}
.workspace-page .portal-card-head{flex-wrap:wrap;gap:12px}
.workspace-page .portal-card-head>span{max-width:100%;text-align:left}
.mm-table{min-width:0;max-width:100%;color:#172a41;font-size:13px}
.mm-table [hidden]{display:none!important}
.mm-table-tools{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}
.mm-table label{display:grid;gap:6px;color:#506077;font-size:12px}
.mm-table input,.mm-table select,.mm-table button{font:inherit;color:#263c55;line-height:1.4;border:1px solid #c4d1df;background:#fff;border-radius:7px;min-height:38px;padding:8px 10px;width:auto;max-width:100%}
.mm-table input{min-width:0}
.mm-table-tools input{width:240px}
.mm-table button{cursor:pointer;font-weight:600}
.mm-table button:disabled{opacity:.48;cursor:default}
.mm-table button:hover:enabled{background:#eef7f6;border-color:#169783}
.mm-table :focus-visible{outline:2px solid #087c70;outline-offset:3px}
.mm-table-scroll{width:100%;overflow:auto;border:1px solid #e0e7ee;border-radius:10px;overscroll-behavior-x:contain}
.mm-table table{border-collapse:collapse;width:100%;min-width:1000px;table-layout:auto;margin:0}
.mm-table th,.mm-table td{padding:13px 12px;text-align:left;vertical-align:top;border:0;border-bottom:1px solid #e6ecf2;line-height:1.5;height:auto;max-width:360px}
.mm-table th{background:#f4f7fa;color:#41536b;font-size:12px;position:static;text-transform:none;letter-spacing:normal}
.mm-table th button{background:transparent;border:0;padding:0;min-height:36px;text-align:left;font-size:12px;display:flex;align-items:center;gap:6px;white-space:normal}
.mm-table td:first-child{min-width:200px;max-width:330px}
.mm-table td strong{display:block;font-size:13px;font-weight:650;line-height:1.5}
.mm-table td small{display:block;color:#56667b;font-size:12px;margin-top:5px;line-height:1.45;overflow-wrap:anywhere}
.mm-table td{overflow-wrap:anywhere}
.mm-table .mm-number{font-variant-numeric:tabular-nums;min-width:115px;white-space:normal;overflow-wrap:anywhere}
.mm-table .mm-negative{color:#bd2848}
.mm-table tr:hover td{background:#f8fbfd}
.mm-table .mm-column-filters th{padding:7px 10px}
.mm-table .mm-column-filters input{width:130px;background:white;font-size:12px}
.mm-range{display:grid;gap:5px}
.mm-table-status,.mm-table-notes p{color:#526379;font-size:12px;line-height:1.6;margin:10px 0}
.mm-pagination{display:flex;align-items:center;justify-content:flex-end;gap:15px;margin-top:14px;flex-wrap:wrap}
.mm-table-error,.mm-warning{color:#93500d!important}
.mm-table .mm-table-explanation{max-width:1050px;font-size:12px;line-height:1.65;color:#526379;margin:10px 0 14px}
.mm-table .mm-profit-open{display:block;margin-top:9px;color:#087c70;background:#f0f8f6;border-color:#c8e5df;font-size:12px}
.mm-profit-panel{box-sizing:border-box;border:1px solid #c6ddd8;border-radius:12px;background:#f5faf9;padding:20px;margin:14px 0 20px;max-width:800px;scroll-margin-top:90px}
.mm-profit-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.mm-profit-heading h3{font-size:17px;margin:0 0 8px;color:#17304a}
.mm-profit-heading strong{display:block;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.mm-profit-heading small{display:block;margin-top:5px;color:#526379;font-size:12px;overflow-wrap:anywhere}
.mm-profit-heading .mm-profit-close{flex-shrink:0;font-size:12px}
.mm-profit-panel p{font-size:12px;line-height:1.65;color:#526379;margin:12px 0}
.mm-profit-lines{margin:14px 0;max-width:640px}
.mm-profit-lines>div{display:flex;justify-content:space-between;align-items:baseline;gap:18px;border-bottom:1px solid #dce9e6;padding:8px 0;font-size:13px;line-height:1.5}
.mm-profit-lines dt{min-width:0;overflow-wrap:anywhere}.mm-profit-lines dd{margin:0;white-space:nowrap;font-variant-numeric:tabular-nums}
.mm-profit-lines .mm-profit-total{border-top:2px solid #b9d4cd;border-bottom:0;font-weight:700;font-size:15px;margin-top:6px;padding-top:13px}
.mm-profit-panel .mm-profit-check{color:#086e67}
@media(max-width:660px){.mm-profit-panel{padding:14px}.mm-profit-heading{flex-direction:column;gap:10px}.mm-profit-lines>div{font-size:12px;gap:10px}.mm-profit-lines .mm-profit-total{font-size:14px}}
.mm-source summary,.mm-table-notes summary{cursor:pointer;font-weight:600;color:#086e67}
.mm-source dl{display:grid;gap:5px;min-width:180px;max-width:270px;font-size:12px}
.mm-source dt{font-weight:600}.mm-source dd{margin:0;overflow-wrap:anywhere}
.quality-unknown,.quality-ledger{margin-top:18px;padding-top:14px;border-top:1px solid #dfdfce;max-width:100%}
.quality-unknown h3{margin:10px 0}.quality-unknown-rows{margin-top:25px;min-width:0}
.workspace-page #portal-chart{display:block;height:auto;min-height:365px;padding:0;position:relative;isolation:isolate;overflow:visible;margin:0}
.workspace-page #portal-chart>svg{display:block;width:100%;height:auto;max-height:none;overflow:visible}
.workspace-page #portal-chart .mm-chart-readout{position:static;display:block;height:auto;min-height:42px;width:auto;margin:6px 0 0;padding:9px 12px;background:#f4f7fb;border-radius:8px;color:#31465e;font-size:12px;line-height:1.6;flex:none}
#portal-chart svg text{font-family:inherit;font-size:12px;fill:#536278}
#portal-chart svg .mm-chart-label{font-size:13px;fill:#17304a;font-weight:650}
#portal-chart svg .mm-point:focus{outline:none;stroke:#087c70;stroke-width:2}
@media(max-width:660px){.mm-table-tools{gap:8px}.mm-table-tools label:first-child{width:100%}.mm-table-tools input{width:100%}.mm-table .mm-table-scroll{border-radius:7px}.mm-table table{min-width:940px}.mm-pagination{justify-content:space-between;gap:6px;font-size:12px}.workspace-page #portal-chart{min-height:335px}.workspace-page .quality-actions{width:100%;flex-wrap:wrap}.workspace-page .quality-actions button{min-height:42px}}


/* Public demo reuses the production workspace UI; these styles only mark the context. */
.demo-banner {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(67, 227, 177, .28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(67, 227, 177, .10), rgba(47, 124, 246, .08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.demo-banner > div { display: grid; gap: 3px; min-width: 0; }
.demo-banner strong { color: #16343f; font-size: .95rem; font-weight: 800; }
.demo-banner span { color: #4a6572; font-size: .78rem; font-weight: 500; line-height: 1.4; }
.demo-banner .button { flex: 0 0 auto; }
.demo-restricted { max-width: 760px; padding: 28px; }
.demo-restricted h2 { margin: 8px 0 10px; }
.demo-restricted p:not(.eyebrow) { max-width: 680px; margin: 0 0 20px; color: #8fa0b5; line-height: 1.55; }
.demo-mode .workspace-user i { color: #43e3b1; }

@media (max-width: 720px) {
  .demo-banner { align-items: flex-start; flex-direction: column; }
  .demo-banner .button { width: 100%; text-align: center; }
}


/* Shared analytics loading state: first load, filter reloads and sync start. */
.workspace-loader {
  position: fixed;
  z-index: 8;
  inset: 0 0 0 224px;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 250, .78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .18s ease, visibility .18s ease;
}
.workspace-loader[hidden] { display: none; }
.workspace-loader-card {
  width: min(440px, 100%);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 17px;
  border: 1px solid rgba(47, 211, 162, .28);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 22px 70px rgba(20, 42, 66, .13);
}
.workspace-loader-card > div:last-child { display: grid; gap: 5px; min-width: 0; }
.workspace-loader-card strong { color: #15283a; font-size: .98rem; }
.workspace-loader-card span { color: #63758a; font-size: .72rem; line-height: 1.45; }
.workspace-loader-logo {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
  background: #0b2030;
  box-shadow: 0 9px 24px rgba(47, 211, 162, .18);
}
.workspace-loader-logo i {
  width: 7px;
  border-radius: 5px;
  background: #43e3b1;
  transform-origin: bottom;
  animation: workspace-loader-bars .9s ease-in-out infinite alternate;
}
.workspace-loader-logo i:nth-child(1) { height: 42%; animation-delay: -.45s; }
.workspace-loader-logo i:nth-child(2) { height: 76%; animation-delay: -.22s; }
.workspace-loader-logo i:nth-child(3) { height: 58%; animation-delay: 0s; }
.button.is-loading { position: relative; pointer-events: none; }
.button.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 7px;
  display: inline-block;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: workspace-loader-spin .65s linear infinite;
}
@keyframes workspace-loader-bars {
  0% { transform: scaleY(.45); opacity: .55; }
  100% { transform: scaleY(1); opacity: 1; }
}
@keyframes workspace-loader-spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .workspace-loader { inset: 0; z-index: 20; }
}
@media (max-width: 520px) {
  .workspace-loader { padding: 14px; }
  .workspace-loader-card { padding: 18px; align-items: flex-start; }
  .workspace-loader-logo { width: 44px; height: 44px; flex-basis: 44px; padding: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-loader-logo i, .button.is-loading::before { animation-duration: 1.8s; }
}


/* v3.17.3: desktop tables fit the workspace; headers stay visible while browsing rows. */
.mm-table-scroll {
  max-height: min(72vh, 760px);
  overflow: auto;
  scrollbar-gutter: stable;
}
.mm-table thead {
  position: sticky;
  top: 0;
  z-index: 6;
}
.mm-table thead th {
  background: #f4f7fa;
  box-shadow: inset 0 -1px 0 #d8e1ea;
}
.mm-table .mm-column-filters th {
  background: #eef3f7;
}

@media (min-width: 901px) {
  .mm-table table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
  .mm-table th,
  .mm-table td {
    min-width: 0;
    max-width: none;
    padding: 10px 7px;
    font-size: 11px;
    line-height: 1.35;
  }
  .mm-table th button {
    min-height: 0;
    font-size: 11px;
    line-height: 1.25;
    gap: 3px;
  }
  .mm-table td:first-child {
    min-width: 0;
    max-width: none;
  }
  .mm-table td strong {
    font-size: 11.5px;
    line-height: 1.35;
  }
  .mm-table td small {
    margin-top: 3px;
    font-size: 10.5px;
    line-height: 1.35;
  }
  .mm-table .mm-number {
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: 10.8px;
    letter-spacing: -.015em;
  }
  .mm-table .mm-profit-open {
    min-height: 29px;
    margin-top: 6px;
    padding: 5px 7px;
    font-size: 10.5px;
  }

  /* Products is the widest business table: give identity columns room and
     keep every financial metric visible without horizontal scrolling. */
  .mm-table-products [data-col="display_name"] { width: 17%; }
  .mm-table-products [data-col="account_label"] { width: 8%; }
  .mm-table-products [data-col="revenue_minor"],
  .mm-table-products [data-col="cogs_minor"] { width: 8%; }
  .mm-table-products [data-col="commission_expense_minor"],
  .mm-table-products [data-col="logistics_expense_minor"],
  .mm-table-products [data-col="advertising_expense_minor"],
  .mm-table-products [data-col="other_expense_minor"],
  .mm-table-products [data-col="taxes_expense_minor"],
  .mm-table-products [data-col="profit_minor"] { width: 7%; }
  .mm-table-products [data-col="margin_percent"],
  .mm-table-products [data-col="drr_percent"] { width: 5.5%; }

  .mm-table-finance [data-col="date"] { width: 9%; }
  .mm-table-finance [data-col="account_label"] { width: 15%; }
  .mm-table-stocks [data-col="display_name"] { width: 27%; }
  .mm-table-stocks [data-col="account_label"] { width: 15%; }
  .mm-table-ads [data-col="display_name"] { width: 17%; }
  .mm-table-ads [data-col="account_label"] { width: 8%; }
  .mm-table-ads [data-col="campaign_id"] { width: 12%; }

  .mm-table-scroll {
    overflow-x: hidden;
  }
}

@media (max-width: 900px) {
  .mm-table table {
    min-width: 1040px;
    table-layout: auto;
  }
  .mm-table th:first-child,
  .mm-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #fff;
    box-shadow: 1px 0 0 #e1e8ef, 8px 0 14px rgba(32, 53, 74, .04);
  }
  .mm-table thead th:first-child {
    z-index: 8;
    background: #f4f7fa;
  }
  .mm-table .mm-column-filters th:first-child {
    background: #eef3f7;
  }
  .mm-table tr:hover td:first-child {
    background: #f8fbfd;
  }
}


/* v3.17.4: calm motion, KPI context, sticky controls and product detail drawer. */
#analytics-view.analytics-reveal > .portal-kpis,
#analytics-view.analytics-reveal > .data-quality-card:not([hidden]),
#analytics-view.analytics-reveal > .attention-card:not([hidden]),
#analytics-view.analytics-reveal > .portal-grid:not([hidden]),
#analytics-view.analytics-reveal > .portal-table-card {
  animation: analytics-reveal .18s ease-out both;
}
#analytics-view.analytics-reveal > .data-quality-card:not([hidden]) { animation-delay: .025s; }
#analytics-view.analytics-reveal > .attention-card:not([hidden]) { animation-delay: .045s; }
#analytics-view.analytics-reveal > .portal-grid:not([hidden]) { animation-delay: .07s; }
#analytics-view.analytics-reveal > .portal-table-card { animation-delay: .095s; }

@keyframes analytics-reveal {
  from { opacity: .35; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-delta {
  width: fit-content;
  margin-top: 8px;
  padding: 4px 7px;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  border-radius: 999px;
  background: #eef3f7;
  color: #607287;
  font-size: .62rem;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}
.kpi-delta small {
  display: inline;
  color: inherit;
  font-size: .58rem;
  font-weight: 600;
}
.kpi-delta.good { background: #e9f8f2; color: #14765d; }
.kpi-delta.bad { background: #fff0f2; color: #b33e57; }
.kpi-delta.neutral { background: #f1f4f7; color: #77879a; }

/* Table controls remain available while the user browses deep into a table. */
.mm-table-tools {
  position: sticky;
  top: 8px;
  z-index: 12;
  margin: 8px -2px 10px;
  padding: 8px 2px 9px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #edf1f5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mm-table-scroll {
  scroll-padding-top: 56px;
}

/* Product profit breakdown appears without moving the table. */
.mm-profit-drawer-root {
  position: fixed;
  z-index: 60;
  inset: 0;
}
.mm-profit-drawer-root[hidden] { display: none; }
.mm-profit-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(9, 21, 37, .28);
  cursor: default;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.mm-profit-drawer {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(480px, calc(100vw - 24px));
  padding: 24px;
  overflow-y: auto;
  background: #fff;
  color: #172a41;
  border-left: 1px solid #dce4ec;
  box-shadow: -28px 0 80px rgba(14, 33, 54, .16);
  animation: mm-drawer-in .2s ease-out both;
}
.mm-drawer-open { overflow: hidden; }
.mm-profit-drawer .mm-profit-heading {
  position: sticky;
  top: -24px;
  z-index: 2;
  margin: -24px -24px 10px;
  padding: 24px 24px 15px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #edf1f5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mm-profit-drawer .mm-profit-heading h3 {
  font-size: 1.18rem;
}
.mm-profit-drawer .mm-profit-close {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #cbd7e3;
  border-radius: 8px;
  background: #fff;
  color: #334a62;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.mm-profit-drawer .mm-profit-close:hover { background: #f3f7fa; border-color: #aebfce; }
.mm-profit-drawer p {
  margin: 12px 0;
  color: #526379;
  font-size: 12px;
  line-height: 1.65;
}
.mm-profit-drawer .mm-profit-check { color: #086e67; }
.mm-profit-drawer .mm-warning { color: #93500d; }
.mm-profit-drawer .mm-profit-lines {
  max-width: none;
}
.mm-profit-drawer .mm-profit-lines > div {
  padding: 10px 0;
}
.mm-profit-drawer .mm-profit-total {
  margin-top: 10px;
}
@keyframes mm-drawer-in {
  from { opacity: .35; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 660px) {
  .kpi-delta { margin-top: 6px; }
  .mm-table-tools { top: 0; margin-left: 0; margin-right: 0; }
  .mm-profit-drawer {
    inset: auto 0 0;
    width: 100%;
    max-height: 88vh;
    border-left: 0;
    border-top: 1px solid #dce4ec;
    border-radius: 18px 18px 0 0;
    animation-name: mm-drawer-up;
  }
  .mm-profit-drawer .mm-profit-heading {
    top: -24px;
  }
  @keyframes mm-drawer-up {
    from { opacity: .35; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  #analytics-view.analytics-reveal > *,
  .mm-profit-drawer { animation-duration: .01ms !important; }
}


/* v3.18: actionable management attention block. */
.attention-card {
  margin: 0 0 10px;
  padding: 16px 18px 17px;
  border: 1px solid #d9e2ea;
  border-radius: 14px;
  background: #fff;
}
.attention-card[hidden] { display: none !important; }
.attention-card-head {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
.attention-card-head > div { display: grid; gap: 4px; }
.attention-card-head span {
  color: #b36b24;
  font-size: .58rem;
  font-weight: 820;
  letter-spacing: .12em;
}
.attention-card-head strong {
  color: #172a41;
  font-size: .9rem;
}
.attention-card-head small {
  color: #8492a3;
  font-size: .62rem;
}
.attention-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.attention-item {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 9px;
  border: 1px solid #e3e9ef;
  border-radius: 11px;
  background: #f8fafc;
}
.attention-item > i {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #8292a4;
}
.attention-item > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.attention-item strong {
  color: #1b3046;
  font-size: .72rem;
  line-height: 1.35;
}
.attention-item span {
  color: #718196;
  font-size: .62rem;
  line-height: 1.4;
}
.attention-item > a,
.attention-item > button {
  grid-column: 2;
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #187d67;
  font: inherit;
  font-size: .64rem;
  font-weight: 760;
  cursor: pointer;
  text-decoration: none;
}
.attention-item > a:hover,
.attention-item > button:hover { color: #0f5f4f; }
.attention-item.danger { background: #fff7f8; border-color: #f1d9de; }
.attention-item.danger > i { background: #d5536d; }
.attention-item.warning { background: #fffaf2; border-color: #f0e1c7; }
.attention-item.warning > i { background: #d18a2d; }
.attention-item.info { background: #f4f8fc; border-color: #dce6ef; }
.attention-item.info > i { background: #5185b4; }

@media (max-width: 1100px) {
  .attention-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .attention-card { padding: 14px; }
  .attention-card-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .attention-list { grid-template-columns: 1fr; }
}


/* v3.18.2: filters live above the table instead of occupying two header rows. */
.mm-active-filters {
  margin: 2px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.mm-active-filters[hidden] { display: none !important; }
.mm-active-filter {
  min-height: 30px !important;
  padding: 5px 9px !important;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #bfe0d7 !important;
  border-radius: 999px !important;
  background: #eef9f6 !important;
  color: #176d5b !important;
  font-size: 11px !important;
  font-weight: 720 !important;
}
.mm-active-filter span {
  color: #6e8f86;
  font-size: 14px;
  line-height: 1;
}
.mm-filter-panel {
  margin: 4px 0 12px;
  padding: 14px;
  border: 1px solid #dce5ed;
  border-radius: 12px;
  background: #f8fafc;
}
.mm-filter-panel[hidden] { display: none !important; }
.mm-filter-panel-head {
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.mm-filter-panel-head > div {
  display: grid;
  gap: 3px;
}
.mm-filter-panel-head strong {
  color: #20364d;
  font-size: 13px;
}
.mm-filter-panel-head span {
  color: #7a8a9d;
  font-size: 11px;
}
.mm-filter-panel-head button {
  min-height: 32px;
  padding: 5px 10px;
  background: #fff;
}
.mm-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.mm-filter-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8ee;
  border-radius: 10px;
  background: #fff;
}
.mm-filter-field > span {
  margin-bottom: 7px;
  display: block;
  color: #40536a;
  font-size: 11px;
  font-weight: 720;
}
.mm-filter-field > input {
  width: 100%;
}
.mm-filter-bounds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.mm-filter-bounds label {
  min-width: 0;
  gap: 4px;
}
.mm-filter-bounds small {
  color: #8b99aa;
  font-size: 9.5px;
}
.mm-filter-bounds input {
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}
@media (max-width: 1000px) {
  .mm-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .mm-filter-panel { padding: 11px; }
  .mm-filter-panel-head { flex-direction: column; gap: 8px; }
  .mm-filter-grid { grid-template-columns: 1fr; }
}


/* v3.18.3: compact financial operation rows and give the source document room. */
@media (min-width: 901px) {
  .mm-table-operations [data-col="date"] { width: 7%; }
  .mm-table-operations [data-col="account_label"] { width: 11%; }
  .mm-table-operations [data-col="raw_operation"] { width: 17%; }
  .mm-table-operations [data-col="operation_type_id"] { width: 6%; }
  .mm-table-operations [data-col="category_label"] { width: 9%; }
  .mm-table-operations [data-col="sku"] { width: 9%; }
  .mm-table-operations [data-col="amount_minor"] { width: 10%; }
  .mm-table-operations [data-col="source_key"] { width: 31%; }

  .mm-table-unknown-rows [data-col="date"] { width: 7%; }
  .mm-table-unknown-rows [data-col="account_label"] { width: 11%; }
  .mm-table-unknown-rows [data-col="raw_operation"] { width: 18%; }
  .mm-table-unknown-rows [data-col="sku"] { width: 10%; }
  .mm-table-unknown-rows [data-col="category_label"] { width: 9%; }
  .mm-table-unknown-rows [data-col="amount_minor"] { width: 10%; }
  .mm-table-unknown-rows [data-col="source_key"] { width: 35%; }

  .mm-table-operations th,
  .mm-table-operations td,
  .mm-table-unknown-rows th,
  .mm-table-unknown-rows td {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .mm-table-operations .mm-source dl,
  .mm-table-unknown-rows .mm-source dl {
    min-width: 0;
    max-width: none;
    grid-template-columns: minmax(72px, .42fr) minmax(0, 1.58fr);
    column-gap: 10px;
    row-gap: 4px;
    align-items: start;
  }

  .mm-table-operations .mm-source dt,
  .mm-table-unknown-rows .mm-source dt {
    color: #66778b;
    font-size: 10.5px;
    line-height: 1.35;
  }

  .mm-table-operations .mm-source dd,
  .mm-table-unknown-rows .mm-source dd {
    min-width: 0;
    color: #243950;
    font-size: 10.7px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
}


/* v3.18.4: grouped other operations. */
.quality-unknown-help {
  margin: -2px 0 12px;
  color: #77879a;
  font-size: 11px;
  line-height: 1.5;
}
@media (min-width: 901px) {
  .mm-table-unknown [data-col="raw_operation"] { width: 22%; }
  .mm-table-unknown [data-col="type_id"] { width: 6%; }
  .mm-table-unknown [data-col="account_label"] { width: 12%; }
  .mm-table-unknown [data-col="category_label"] { width: 9%; }
  .mm-table-unknown [data-col="rows"] { width: 7%; }
  .mm-table-unknown [data-col="sku_count"] { width: 6%; }
  .mm-table-unknown [data-col="amount_minor"] { width: 10%; }
  .mm-table-unknown [data-col="period_label"] { width: 13%; }
  .mm-table-unknown [data-col="classification_label"] { width: 9%; }
  .mm-table-unknown [data-col="_open"] { width: 10%; }
  .mm-table-unknown .mm-open {
    min-height: 30px;
    padding: 5px 8px;
    white-space: nowrap;
  }
}


/* v3.18.5: expandable product other-expense breakdown. */
.mm-profit-other {
  margin: 0;
  border-top: 1px solid #dce9e6;
  border-bottom: 1px solid #dce9e6;
}
.mm-profit-other > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  color: #243950;
}
.mm-profit-other > summary::-webkit-details-marker { display: none; }
.mm-profit-other > summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}
.mm-profit-other > summary small {
  color: #7a899a;
  font-size: 10.5px;
  font-weight: 500;
}
.mm-profit-other > summary strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mm-profit-other > summary i {
  color: #678095;
  font-style: normal;
  font-size: 15px;
  transition: transform .16s ease;
}
.mm-profit-other[open] > summary i { transform: rotate(180deg); }
.mm-profit-other-body {
  padding: 4px 0 12px;
}
.mm-profit-other-body > p {
  margin: 8px 0 0;
}
.mm-profit-other-groups {
  display: grid;
  gap: 0;
  border: 1px solid #e2e9ee;
  border-radius: 10px;
  overflow: hidden;
  background: #fbfcfd;
}
.mm-profit-other-group {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e8edf1;
}
.mm-profit-other-group:last-child { border-bottom: 0; }
.mm-profit-other-group span {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.mm-profit-other-group b {
  color: #22364c;
  font-size: 12px;
  line-height: 1.35;
}
.mm-profit-other-group small {
  color: #8090a2;
  font-size: 10.5px;
  line-height: 1.35;
}
.mm-profit-other-group strong {
  flex: 0 0 auto;
  color: #22364c;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.mm-profit-lines-after-other { margin-top: 0 !important; }

@media(max-width:660px) {
  .mm-profit-other > summary {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    gap: 8px;
  }
  .mm-profit-other-group {
    align-items: flex-start;
    gap: 10px;
  }
}


/* Today pulse */
#today-view { display: grid; gap: 18px; }
#today-view[hidden] { display: none; }
.today-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.today-status-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px;
  border: 1px solid #dce6ee;
  border-radius: 12px;
  background: #f8fbfd;
  color: #506277;
  font-size: 12px;
  line-height: 1.5;
}
.today-status-card strong { color: #17304a; }
.today-status-card .today-status-warning { color: #93500d; }
.today-platform-split {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 4px;
  color: #6d7f91;
  font-size: 11px;
}
.today-platform-split b { color: #344c64; font-weight: 700; }
.today-kpis article strong.negative-value,
.today-table .negative-value { color: #bd2848; }
.today-kpis article strong.positive-value,
.today-table .positive-value { color: #087c70; }
.today-table .today-marketplace {
  display: inline-flex;
  align-items: center;
  min-width: 36px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef3f7;
  color: #43576c;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
.today-table .today-forecast-partial { color: #93500d; font-size: 11px; }
.today-table .today-muted { color: #718196; }
.today-table .mm-table-scroll { max-height: min(66vh, 720px); }
.today-table table { min-width: 1240px; }
@media (max-width: 1180px) {
  .today-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .today-kpis { grid-template-columns: 1fr 1fr; }
  .today-status-card { flex-direction: column; }
}
@media (max-width: 460px) {
  .today-kpis { grid-template-columns: 1fr; }
}


.today-yesterday-comparison {
  display: block;
  margin-top: 4px;
  opacity: .78;
}


/* Today: fit all business columns into the desktop workspace without horizontal scroll. */
.today-table .mm-table-scroll {
  overflow-x: hidden !important;
}
.today-table table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.today-table th,
.today-table td {
  min-width: 0 !important;
  padding-left: 8px;
  padding-right: 8px;
}
.today-table th {
  white-space: normal;
  line-height: 1.15;
  font-size: 11px;
}
.today-table th:nth-child(1),
.today-table td:nth-child(1) { width: 24%; }
.today-table th:nth-child(2),
.today-table td:nth-child(2) { width: 10%; }
.today-table th:nth-child(3),
.today-table td:nth-child(3) { width: 6%; }
.today-table th:nth-child(4),
.today-table td:nth-child(4) { width: 9%; }
.today-table th:nth-child(5),
.today-table td:nth-child(5) { width: 9%; }
.today-table th:nth-child(6),
.today-table td:nth-child(6) { width: 8%; }
.today-table th:nth-child(7),
.today-table td:nth-child(7) { width: 7%; }
.today-table th:nth-child(8),
.today-table td:nth-child(8) { width: 11%; }
.today-table th:nth-child(9),
.today-table td:nth-child(9) { width: 16%; }

.today-table td:first-child strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
}
.today-table td:first-child > small {
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-table td.mm-number {
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: break-word;
}
.today-table td.mm-number > small,
.today-table td.mm-number .today-forecast-partial {
  display: block;
  width: 100%;
  max-width: none !important;
  margin-top: 4px;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal;
  line-height: 1.3;
}
.today-table td:nth-child(8),
.today-table td:nth-child(9) {
  vertical-align: top;
}
.today-yesterday-comparison small {
  display: block;
  margin-top: 2px;
  white-space: normal;
  opacity: .82;
}

@media (max-width: 1180px) {
  .today-table .mm-table-scroll {
    overflow-x: auto !important;
  }
  .today-table table {
    min-width: 1040px;
  }
}


.cost-onboarding-card{
  margin:0 0 18px;
  padding:18px 20px;
  border:1px solid #f0d6a3;
  border-radius:14px;
  background:#fffaf0;
  color:#5f4718;
}
.cost-onboarding-card.critical{border-color:#e9c77e;background:#fff8e8}
.cost-onboarding-main{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.cost-onboarding-main>div{min-width:0}
.cost-onboarding-main span{
  display:block;
  margin-bottom:4px;
  color:#956813;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
}
.cost-onboarding-main strong{
  display:block;
  color:#5d4312;
  font-size:18px;
  line-height:1.3;
}
.cost-onboarding-main p{
  margin:6px 0 0;
  color:#755b27;
  font-size:13px;
  line-height:1.55;
}
.cost-onboarding-steps{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin-top:16px;
}
.cost-onboarding-steps span{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  padding:8px 10px;
  border:1px solid #eadfc6;
  border-radius:10px;
  background:rgba(255,255,255,.62);
  color:#796746;
  font-size:11px;
  font-weight:700;
}
.cost-onboarding-steps i{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 22px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#f1e4c8;
  color:#81601d;
  font-style:normal;
  font-size:11px;
}
.cost-onboarding-steps .done{color:#45695f}
.cost-onboarding-steps .done i{background:#dff4ed;color:#08745d}
.mm-table td .mm-warning{
  display:block;
  margin-top:4px;
  font-size:10px;
  line-height:1.25;
}
@media(max-width:900px){
  .cost-onboarding-main{align-items:flex-start;flex-direction:column}
  .cost-onboarding-steps{grid-template-columns:1fr 1fr}
}
@media(max-width:560px){
  .cost-onboarding-steps{grid-template-columns:1fr}
}


.cost-unidentified-operations{
  margin-top:14px;
  border-top:1px solid #ead9b5;
  padding-top:12px;
}
.cost-unidentified-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:8px;
  color:#6e531c;
  font-size:12px;
}
.cost-unidentified-row{
  display:grid;
  grid-template-columns:140px minmax(220px,1fr) 90px 120px;
  gap:12px;
  align-items:start;
  padding:10px 0;
  border-top:1px solid #eee3cc;
  font-size:12px;
}
.cost-unidentified-row:first-of-type{border-top:0}
.cost-unidentified-row span{min-width:0}
.cost-unidentified-row b{display:block;color:#3f3524;overflow-wrap:anywhere}
.cost-unidentified-row small{display:block;margin-top:3px;color:#8a7653;overflow-wrap:anywhere}
.cost-unidentified-note{margin:8px 0 0;color:#8a7653;font-size:11px}
@media(max-width:780px){
  .cost-unidentified-row{grid-template-columns:1fr 1fr}
}

.connection-warning{
  display:block;
  margin-top:6px;
  color:#8a5a00;
  font-size:12px;
  line-height:1.45;
}
