﻿:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #18202b;
  --muted: #697383;
  --line: #d9dee7;
  --green: #12805c;
  --green-soft: #d9f1e7;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --amber: #b7791f;
  --amber-soft: #fff2cc;
  --red: #c2413b;
  --red-soft: #ffe1df;
  --violet: #6d5bd0;
  --violet-soft: #ebe7ff;
  --ink-soft: #eef2f7;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #f9fbfd 0, #f6f7f9 320px),
    var(--bg);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 28px;
  padding-top: 40px;
  padding-bottom: 48px;
}

.portal-topbar {
  min-height: 0;
  padding-bottom: 0;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.fiscal-hub-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-card {
  position: relative;
  display: grid;
  gap: 11px;
  min-height: 230px;
  padding: 20px;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.portal-card::before {
  content: "";
  position: absolute;
  inset: auto 18px 18px auto;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(105, 115, 131, 0.22);
  border-radius: 999px;
}

.portal-card > :not(.portal-card-icon) {
  position: relative;
  z-index: 2;
}

.portal-card-icon {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid rgba(105, 115, 131, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  pointer-events: none;
}

.portal-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-card.sales {
  background:
    linear-gradient(135deg, rgba(217, 241, 231, 0.88), rgba(255, 255, 255, 0.92) 52%),
    var(--surface);
}

.portal-card.finance {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(255, 255, 255, 0.92) 52%),
    var(--surface);
}

.portal-card.purchase {
  background:
    linear-gradient(135deg, rgba(217, 241, 231, 0.9), rgba(255, 250, 232, 0.72) 52%, rgba(255, 255, 255, 0.94)),
    var(--surface);
}

.portal-card.complete {
  background:
    linear-gradient(135deg, rgba(255, 242, 204, 0.9), rgba(255, 255, 255, 0.92) 52%),
    var(--surface);
}

.portal-card.lab {
  background:
    linear-gradient(135deg, rgba(244, 232, 255, 0.9), rgba(255, 255, 255, 0.92) 52%),
    var(--surface);
}

.portal-card.fiscal {
  background:
    linear-gradient(135deg, rgba(230, 240, 255, 0.92), rgba(230, 255, 245, 0.78) 52%, rgba(255, 255, 255, 0.94)),
    var(--surface);
}

.portal-card-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.portal-card-title {
  max-width: 520px;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
}

.portal-card-description {
  max-width: 520px;
  color: #445064;
  font-size: 14px;
  line-height: 1.45;
}

.portal-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
  padding-top: 14px;
}

.portal-card-stats i {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #344052;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.portal-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  background: #18202b;
  color: #fff;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.portal-card-actions {
  display: grid;
  gap: 8px;
  align-self: end;
  justify-items: start;
}

.portal-card-action.secondary {
  background: rgba(255, 255, 255, 0.82);
  color: #18202b;
  border: 1px solid rgba(24, 32, 43, 0.14);
}

.portal-grid-farmacias {
  align-items: stretch;
}

.portal-card-farmacias {
  grid-template-columns: minmax(0, 1fr) 116px;
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: 18px;
  row-gap: 10px;
  min-height: 248px;
}

.portal-card-farmacias::before {
  inset: auto 20px 18px auto;
}

.portal-card-farmacias .portal-card-kicker,
.portal-card-farmacias .portal-card-title,
.portal-card-farmacias .portal-card-description,
.portal-card-farmacias .portal-card-stats,
.portal-card-farmacias .portal-card-action {
  grid-column: 1;
  min-width: 0;
}

.portal-card-farmacias .portal-card-title,
.portal-card-farmacias .portal-card-description {
  max-width: none;
}

.portal-card-farmacias .portal-card-stats {
  align-self: end;
  max-width: 100%;
  padding-top: 2px;
}

.portal-card-farmacias .portal-card-stats i {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.portal-card-farmacias .portal-card-icon {
  position: relative;
  right: auto;
  bottom: auto;
  grid-column: 2;
  grid-row: 1 / span 5;
  align-self: end;
  justify-self: end;
}

.portal-health-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.portal-health-strip div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.portal-health-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.portal-health-strip strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.lab-shell {
  gap: 14px;
  padding-bottom: 34px;
}

.lab-hero {
  display: grid;
  grid-template-columns: minmax(280px, 0.52fr) minmax(0, 1.48fr);
  gap: 14px;
  align-items: stretch;
}

.lab-hero > div:first-child,
.lab-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lab-hero > div:first-child {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(244, 232, 255, 0.82), rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.lab-hero h2 {
  max-width: 680px;
  font-size: 31px;
  line-height: 1.08;
}

.lab-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.lab-hero-grid article {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lab-hero-grid span,
.lab-flow-row small,
.lab-idea-card span,
.lab-store-row span,
.lab-priority-list small,
.lab-alert span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lab-hero-grid strong {
  align-self: end;
  font-size: 24px;
  line-height: 1.05;
}

.lab-layout,
.lab-grid {
  display: grid;
  gap: 14px;
}

.lab-layout {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.lab-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.lab-ideas {
  grid-column: 1 / -1;
}

.lab-panel {
  padding: 18px;
}

.lab-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.lab-status,
.lab-alert strong,
.lab-store-row em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  white-space: nowrap;
}

.lab-status {
  padding: 4px 9px;
}

.lab-status.green {
  background: var(--green-soft);
  color: #09613f;
}

.lab-priority-list {
  display: grid;
  gap: 11px;
}

.lab-priority-list > div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.lab-priority-list strong {
  line-height: 1.25;
}

.lab-priority-list small {
  grid-column: 2;
}

.lab-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 999px;
}

.lab-dot.blue {
  background: #2f6bed;
}

.lab-dot.amber {
  background: #c37a16;
}

.lab-dot.green {
  background: #13865d;
}

.lab-flow-list,
.lab-store-list,
.lab-alert-stack,
.lab-idea-grid {
  display: grid;
  gap: 10px;
}

.lab-flow-row {
  display: grid;
  grid-template-columns: minmax(112px, 0.9fr) repeat(2, minmax(130px, 1fr)) minmax(128px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.lab-flow-row > span {
  font-size: 13px;
  font-weight: 760;
}

.lab-flow-row div {
  display: grid;
  gap: 3px;
}

.lab-flow-row strong,
.lab-flow-row em {
  font-variant-numeric: tabular-nums;
}

.lab-flow-row em {
  justify-self: end;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.lab-flow-row em.positive {
  background: var(--green-soft);
  color: #09613f;
}

.lab-flow-row em.negative {
  background: var(--red-soft);
  color: #8b2722;
}

.lab-store-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.95fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.lab-store-row > div:first-child {
  display: grid;
  gap: 4px;
}

.lab-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.lab-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #13865d;
}

.lab-store-row.watch .lab-meter i {
  background: #c37a16;
}

.lab-store-row.danger .lab-meter i {
  background: #d6423a;
}

.lab-store-row em {
  padding: 4px 8px;
  background: var(--green-soft);
  color: #09613f;
}

.lab-store-row.watch em {
  background: var(--amber-soft);
  color: #7a4c10;
}

.lab-store-row.danger em {
  background: var(--red-soft);
  color: #8b2722;
}

.lab-alert {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lab-alert strong {
  justify-self: start;
  padding: 4px 8px;
}

.lab-alert.danger {
  background: #fff5f4;
}

.lab-alert.danger strong {
  background: var(--red-soft);
  color: #8b2722;
}

.lab-alert.amber {
  background: #fffaf0;
}

.lab-alert.amber strong {
  background: var(--amber-soft);
  color: #7a4c10;
}

.lab-alert.green {
  background: #f4fbf7;
}

.lab-alert.green strong {
  background: var(--green-soft);
  color: #09613f;
}

.lab-idea-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lab-idea-card {
  display: grid;
  gap: 9px;
  min-height: 218px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 3px solid #8b9bb2;
  border-radius: 8px;
  background: var(--surface-alt);
}

.lab-idea-card.good {
  border-top-color: #13865d;
  background: #f4fbf7;
}

.lab-idea-card.watch {
  border-top-color: #c37a16;
  background: #fffaf0;
}

.lab-idea-card.danger {
  border-top-color: #d6423a;
  background: #fff5f4;
}

.lab-idea-card.neutral {
  border-top-color: #2f6bed;
  background: #f6f9ff;
}

.lab-idea-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.lab-idea-card > strong {
  font-size: 22px;
  line-height: 1.12;
}

.lab-idea-card > small {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lab-idea-rows {
  display: grid;
  gap: 7px;
  align-self: end;
  padding-top: 8px;
  border-top: 1px solid rgba(105, 115, 131, 0.16);
}

.lab-idea-rows p {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.lab-idea-rows span {
  color: var(--muted);
  font-size: 12px;
}

.lab-idea-rows b {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 18px;
}

.topbar-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.topbar-side .brand-logo-link {
  order: 1;
}

.topbar-side .meta-stack {
  order: 2;
  justify-items: center;
  text-align: center;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 104px;
  height: 92px;
  text-decoration: none;
}

.brand-logo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.portal-topbar .brand-logo-link {
  width: 128px;
  height: 118px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 780;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 760;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-transform: uppercase;
  font-weight: 760;
}

.meta-stack {
  display: grid;
  gap: 6px;
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  align-items: stretch;
  gap: 12px;
  margin: 4px 0 14px;
}

.overview-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overview-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.summary-metric {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.summary-metric span {
  font-size: 12px;
  font-weight: 760;
}

.summary-metric strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.summary-metric small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.summary-metric.blue {
  background: var(--blue-soft);
  border-color: #c8dcff;
}

.summary-metric.blue span {
  color: #1746a2;
}

.summary-metric.green {
  background: var(--green-soft);
  border-color: #bfe8d6;
}

.summary-metric.green span {
  color: #09613f;
}

.summary-metric.amber {
  background: var(--amber-soft);
  border-color: #f3dda3;
}

.summary-metric.amber span {
  color: #7a4c10;
}

.kpi-card {
  min-height: 132px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.supplier-card {
  min-height: 0;
}

.merged-split {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.merged-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.merged-split-item {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.merged-split-item span {
  font-size: 12px;
  font-weight: 760;
}

.merged-split-item strong {
  font-size: 19px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.merged-split-item small {
  color: var(--muted);
  font-size: 12px;
}

.merged-split-item.blue {
  background: var(--blue-soft);
  border-color: #c8dcff;
}

.merged-split-item.blue span {
  color: #1746a2;
}

.merged-split-item.amber {
  background: var(--amber-soft);
  border-color: #f3dda3;
}

.merged-split-item.amber span {
  color: #7a4c10;
}

.kpi-card .kpi-value {
  display: block;
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.05;
}

.kpi-detail {
  display: grid;
  gap: 6px;
}

.kpi-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-line strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  text-align: right;
  white-space: nowrap;
}

.kpi-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.finance-executive-section {
  grid-template-columns: minmax(360px, 0.85fr) minmax(0, 1.15fr);
  align-items: stretch;
  margin-top: 12px;
}

.data-health-panel,
.cashflow-insights-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.health-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #09613f;
  font-size: 12px;
  font-weight: 780;
}

.health-grid,
.cashflow-insight-grid {
  display: grid;
  gap: 10px;
}

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

.health-item,
.cashflow-insight-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.health-item span,
.cashflow-insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.health-item strong,
.cashflow-insight-card strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.12;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.cashflow-insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cashflow-insight-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.cashflow-insight-card.good {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, #e8f8ef, #fff 74%);
}

.cashflow-insight-card.good strong {
  color: #09613f;
}

.cashflow-insight-card.watch {
  border-color: #f3dda3;
  background: linear-gradient(135deg, #fff7dd, #fff 74%);
}

.cashflow-insight-card.watch strong {
  color: #7a4c10;
}

.cashflow-insight-card.danger {
  border-color: #fac8bf;
  background: linear-gradient(135deg, #ffe9e7, #fff 74%);
}

.cashflow-insight-card.danger strong {
  color: #b42318;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.chip.green {
  background: var(--green-soft);
  color: #09613f;
}

.chip.blue {
  background: var(--blue-soft);
  color: #1746a2;
}

.chip.amber {
  background: var(--amber-soft);
  color: #7a4c10;
}

.chip.red {
  background: var(--red-soft);
  color: #8b2722;
}

.dashboard-section {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 12px;
}

.panel-grid-compact {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.7fr);
}

.panel-grid-single {
  grid-template-columns: 1fr;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.wide-panel {
  min-height: 0;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-heading > span {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.sales-shell {
  max-width: 1500px;
}

.sales-dashboard-list {
  display: grid;
  gap: 14px;
}

.sales-image-panel {
  overflow: hidden;
}

.sales-image-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sales-image-panel img {
  display: block;
  width: max(100%, 1320px);
  max-width: none;
  height: auto;
  background: #fff;
}

.sales-image-wide img {
  width: auto;
  min-width: 100%;
}

.sales-image-tall img {
  width: max(100%, 1680px);
}

.sales-image-compact img {
  width: min(100%, 1060px);
  max-width: 100%;
}

.sales-summary-shell {
  max-width: 1500px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.sales-summary-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 14px;
}

.sales-summary-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sales-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.sales-summary-card strong {
  font-size: 21px;
  line-height: 1.05;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sales-executive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.sales-executive-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.sales-executive-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.sales-executive-card strong {
  min-width: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 790;
  font-variant-numeric: tabular-nums;
}

.sales-executive-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.sales-executive-card.good {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, #e8f8ef, #fff 72%);
}

.sales-executive-card.good strong {
  color: #09613f;
}

.sales-executive-card.warn {
  border-color: #f3dda3;
  background: linear-gradient(135deg, #fff7dd, #fff 72%);
}

.sales-executive-card.warn strong {
  color: #7a4c10;
}

.sales-executive-card.danger {
  border-color: #fac8bf;
  background: linear-gradient(135deg, #ffe9e7, #fff 72%);
}

.sales-executive-card.danger strong {
  color: #b42318;
}

.comparison-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.comparison-kpi-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #fff);
  box-shadow: var(--shadow);
}

.comparison-kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.comparison-kpi-card strong {
  font-size: 22px;
  line-height: 1.05;
  font-weight: 790;
  font-variant-numeric: tabular-nums;
}

.comparison-kpi-card div,
.comparison-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comparison-kpi-card i,
.comparison-badges i {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.comparison-kpi-card i.positive,
.comparison-badges i.positive {
  background: var(--green-soft);
  color: #09613f;
}

.comparison-kpi-card i.negative,
.comparison-badges i.negative {
  background: var(--red-soft);
  color: #8b2722;
}

.comparison-kpi-card i.neutral {
  background: var(--ink-soft);
  color: #344052;
}

.sales-comparison-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.comparison-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.comparison-panel-wide {
  grid-column: 1 / -1;
}

.comparison-chart {
  display: grid;
  gap: 11px;
}

.comparison-group {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.comparison-group-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.comparison-group-head strong {
  min-width: 0;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 760;
}

.comparison-series-row {
  display: grid;
  grid-template-columns: 92px minmax(140px, 1fr) minmax(88px, auto);
  align-items: center;
  gap: 9px;
}

.comparison-series-row span {
  color: #5b6677;
  font-size: 11px;
  font-weight: 720;
}

.comparison-series-row strong {
  color: #172033;
  font-size: 12px;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.comparison-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.comparison-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.comparison-track.current i {
  background: var(--blue);
}

.comparison-track.previous i {
  background: #f97316;
}

.comparison-track.year i {
  background: var(--green);
}

.comparison-track.target i {
  background: #f97316;
}

.comparison-track.projection i {
  background: #15803d;
}

.supplements-panel {
  overflow: hidden;
}

.supplements-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 10px;
}

.supplements-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  align-content: center;
  padding: 9px 11px;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef6ff, #fff 78%);
  box-shadow: 0 7px 16px rgba(23, 32, 48, 0.045);
}

.supplements-summary div:nth-child(2) {
  background: linear-gradient(135deg, #fff8e8, #fff);
}

.supplements-summary div:nth-child(3) {
  background: linear-gradient(135deg, #edf8f2, #fff);
}

.supplements-summary div:nth-child(4) {
  background: linear-gradient(135deg, #f2f0ff, #fff);
}

.supplements-summary span {
  display: block;
  color: #526176;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 760;
  text-transform: uppercase;
}

.supplements-summary strong {
  display: block;
  color: #172033;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.supplements-table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.supplements-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.supplements-table th,
.supplements-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf4;
  border-right: 1px solid #edf1f6;
  vertical-align: middle;
}

.supplements-table th:last-child,
.supplements-table td:last-child {
  border-right: 0;
}

.supplements-table thead th {
  background: #303b4d;
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 820;
  text-align: center;
}

.supplements-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.supplements-table tbody tr:hover td {
  background: #eef6ff;
}

.supplements-table tbody td {
  color: #172033;
  font-variant-numeric: tabular-nums;
}

.supplements-table tbody tr:last-child td {
  border-bottom: 0;
}

.supplements-table td:first-child {
  min-width: 320px;
  font-weight: 760;
}

.supplements-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.sales-category-comparison-panel {
  overflow: hidden;
}

.sales-category-heading > span {
  max-width: 420px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.sales-category-heading small {
  display: block;
  margin-top: 3px;
  color: #334155;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.3;
}

.sales-store-category-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}

.sales-store-category-filter a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  max-width: 190px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 780;
  line-height: 1.15;
  overflow: hidden;
  text-align: center;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-store-category-filter a.active {
  border-color: #2563eb;
  background: #eaf1ff;
  color: #1d4ed8;
}

.sales-category-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sales-category-summary-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.sales-category-summary-card span,
.sales-category-values span,
.sales-category-profit span,
.sales-category-bar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.sales-category-summary-card strong {
  color: #172033;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sales-category-summary-card.positive strong {
  color: #09613f;
}

.sales-category-summary-card.negative strong {
  color: #8b2722;
}

.sales-category-list {
  display: grid;
  gap: 8px;
}

.sales-category-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.78fr) minmax(190px, 0.9fr) minmax(180px, 1fr) minmax(190px, 0.9fr) minmax(128px, 0.46fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e4eaf2;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.sales-category-row.positive {
  border-left-color: #12805c;
}

.sales-category-row.negative {
  border-left-color: #d9483f;
}

.sales-category-name,
.sales-category-values,
.sales-category-profit,
.sales-category-delta {
  min-width: 0;
}

.sales-category-name {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
}

.sales-category-name > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef3f9;
  color: #334155;
  font-size: 11px;
  font-weight: 820;
}

.sales-category-name strong {
  min-width: 0;
  color: #172033;
  font-size: 13px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sales-category-name i {
  grid-column: 2;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  white-space: nowrap;
}

.sales-category-name i.positive,
.sales-category-pill.positive {
  background: var(--green-soft);
  color: #09613f;
}

.sales-category-name i.negative,
.sales-category-pill.negative {
  background: var(--red-soft);
  color: #8b2722;
}

.sales-category-name i.neutral,
.sales-category-pill.neutral {
  background: var(--ink-soft);
  color: #344052;
}

.sales-category-values,
.sales-category-profit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sales-category-values div,
.sales-category-profit div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sales-category-values strong,
.sales-category-profit strong {
  color: #172033;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sales-category-bars {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.sales-category-bar {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.sales-category-bar i {
  display: block;
  height: 11px;
  min-width: 2px;
  border-radius: 999px;
}

.sales-category-bar.previous i {
  background: #f97316;
}

.sales-category-bar.current i {
  background: #2563eb;
}

.sales-category-delta {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.sales-category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sales-category-delta small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend-panel {
  min-height: 360px;
}

.trend-chart {
  --trend-color: var(--blue);
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.trend-chart.green {
  --trend-color: var(--green);
}

.trend-chart.amber {
  --trend-color: var(--amber);
}

.trend-chart.purple {
  --trend-color: #7c3aed;
}

.trend-chart-legend {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  padding: 14px 18px 0;
  color: #46546a;
  font-size: 12px;
  font-weight: 800;
}

.trend-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trend-chart-legend span::before {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: var(--trend-color);
  content: "";
}

.trend-chart-legend .previous::before {
  height: 0;
  border-top: 3px dashed #66758b;
  border-radius: 0;
  background: transparent;
}

.trend-chart svg {
  display: block;
  width: 100%;
  height: 300px;
}

.trend-chart line {
  stroke: #d6dde8;
  stroke-width: 2;
}

.trend-chart polyline {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-chart circle {
  fill: #fff;
  stroke-width: 4;
}

.trend-chart .trend-series.current polyline,
.trend-chart .trend-series.current circle {
  stroke: var(--trend-color);
}

.trend-chart .trend-series.previous polyline,
.trend-chart .trend-series.previous circle {
  stroke: #66758b;
}

.trend-chart .trend-series.previous polyline {
  stroke-dasharray: 10 8;
}

.trend-chart .trend-series.previous text {
  fill: #5d6a7d;
  font-size: 15px;
}

.trend-chart text {
  fill: #172033;
  font-size: 18px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.trend-chart .trend-month {
  fill: var(--muted);
  font-size: 15px;
  font-weight: 720;
}

.panel-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #cdd8e6;
  background: #f8fbff;
  color: #18314f;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.panel-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(24, 49, 79, 0.08);
}

.purchase-trend-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.purchase-trend-card {
  padding: 12px;
  border: 1px solid #e4eaf2;
  border-radius: 14px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.purchase-trend-card strong {
  font-size: 13px;
}

.purchase-trend-card span {
  font-size: 18px;
  font-weight: 800;
  color: #132238;
}

.purchase-trend-card small {
  color: var(--muted);
  font-size: 12px;
}

.sales-goals-panel {
  display: grid;
  gap: 12px;
}

.sales-complete-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.chart-panel {
  display: grid;
  gap: 12px;
}

.wide-chart-panel {
  grid-column: 1 / -1;
}

.labeled-chart {
  display: grid;
  gap: 10px;
}

.labeled-chart-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(220px, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
}

.labeled-chart-name {
  min-width: 0;
  color: #273244;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.25;
}

.labeled-chart-track {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.labeled-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.labeled-chart-track.amber i {
  background: var(--amber);
}

.labeled-chart-track.green i {
  background: var(--green);
}

.labeled-chart-track.violet i {
  background: var(--violet);
}

.labeled-chart-track.orange i {
  background: #d97706;
}

.labeled-chart-track.teal i {
  background: #0f766e;
}

.labeled-chart-track.blue-soft-fill i {
  background: #3b82f6;
}

.labeled-chart-row strong {
  color: #172033;
  font-size: 13px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.user-chart {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 18px;
}

.store-name {
  font-weight: 800;
}

.strong-value {
  font-weight: 800;
}

.projection-value {
  background: #eff6ff;
  font-weight: 800;
}

.goal-cell {
  display: grid;
  gap: 5px;
  vertical-align: top;
}

.goal-cell strong {
  font-size: 13px;
}

.goal-cell span,
.goal-cell small {
  color: #4b5563;
  font-size: 12px;
}

.goal-badge {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 24px;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-style: normal;
  font-weight: 780;
  white-space: nowrap;
}

.goal-badge.good {
  background: var(--green-soft);
  color: #14532d;
  border: 1px solid #bfe8d6;
}

.goal-badge.warn {
  background: var(--amber-soft);
  color: #7a4c10;
  border: 1px solid #f3dda3;
}

.sales-goal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.store-goal-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--tone-bg, #fbfcfe), #fff 64%),
    #fff;
  color: var(--text);
  text-decoration: none;
}

.store-goal-card:hover {
  border-color: var(--tone-border, var(--line));
}

.tone-1 {
  --tone-bg: #edf7ff;
  --tone-border: #c8e3fb;
  --tone-pill-bg: #dbeafe;
  --tone-pill-text: #1746a2;
}

.tone-2 {
  --tone-bg: #eefaf3;
  --tone-border: #c8ecd8;
  --tone-pill-bg: #d9f1e7;
  --tone-pill-text: #09613f;
}

.tone-3 {
  --tone-bg: #fff7df;
  --tone-border: #f3dda3;
  --tone-pill-bg: #fff2cc;
  --tone-pill-text: #7a4c10;
}

.tone-4 {
  --tone-bg: #f3efff;
  --tone-border: #d9d2fb;
  --tone-pill-bg: #ebe7ff;
  --tone-pill-text: #5140a3;
}

.tone-5 {
  --tone-bg: #fff0ed;
  --tone-border: #fac8bf;
  --tone-pill-bg: #ffe1df;
  --tone-pill-text: #8b2722;
}

.tone-6 {
  --tone-bg: #edfdf9;
  --tone-border: #bdebe0;
  --tone-pill-bg: #d6f7ef;
  --tone-pill-text: #086456;
}

.tone-7 {
  --tone-bg: #f5f7ff;
  --tone-border: #d6ddfb;
  --tone-pill-bg: #e3e9ff;
  --tone-pill-text: #2c439c;
}

.tone-8 {
  --tone-bg: #fff3e8;
  --tone-border: #f8d4b7;
  --tone-pill-bg: #ffe8d6;
  --tone-pill-text: #8a4519;
}

.store-goal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.store-goal-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.store-goal-head span,
.store-goal-values span,
.goal-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.store-goal-head strong {
  font-size: 16px;
  line-height: 1.2;
}

.store-goal-head i {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--tone-pill-bg, var(--green-soft));
  color: var(--tone-pill-text, #09613f);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
}

.store-goal-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.store-goal-values div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.store-goal-values strong {
  font-size: 15px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.goal-stack {
  display: grid;
  gap: 10px;
}

.goal-progress-row {
  display: grid;
  gap: 7px;
}

.goal-progress-head,
.goal-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.goal-progress-head strong {
  font-size: 13px;
}

.goal-progress-meta b {
  color: var(--text);
}

.goal-progress-track {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.goal-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.goal-progress-fill.good {
  background: var(--green);
}

.goal-progress-fill.warn {
  background: var(--amber);
}

.goal-progress-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  border-radius: 999px;
  background: #18202b;
  opacity: 0.55;
}

.store-card-action {
  justify-self: start;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #18202b;
  color: #fff;
  font-size: 12px;
  font-weight: 780;
}

.store-detail-shell {
  --tone-bg: #fbfcfe;
  --tone-border: var(--line);
}

.store-detail-hero {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 18px;
  border: 1px solid var(--tone-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--tone-bg), #fff 66%),
    #fff;
  box-shadow: var(--shadow);
}

.store-detail-hero h2 {
  font-size: 22px;
}

.store-detail-hero p {
  max-width: 900px;
  color: #445064;
  font-size: 14px;
  line-height: 1.45;
}

.store-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.store-projection-card {
  border-color: #c7d2fe;
  background:
    linear-gradient(135deg, #eef2ff, #fff 72%),
    #fff;
}

.store-projection-card span {
  color: #4338ca;
}

.store-projection-status {
  gap: 6px;
}

.store-projection-status small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.25;
}

.store-projection-status.good {
  border-color: #bfe8d6;
  background:
    linear-gradient(135deg, #d9f1e7, #fff 74%),
    #fff;
}

.store-projection-status.good span,
.store-projection-status.good strong {
  color: #09613f;
}

.store-projection-status.warn {
  border-color: #fac8bf;
  background:
    linear-gradient(135deg, #ffe1df, #fff 74%),
    #fff;
}

.store-projection-status.warn span,
.store-projection-status.warn strong {
  color: #b42318;
}

.store-daily-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.25;
}

.store-daily-card.good {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, #e8f8ef, #fff 74%);
}

.store-daily-card.good span,
.store-daily-card.good strong {
  color: #09613f;
}

.store-daily-card.warn {
  border-color: #f3dda3;
  background: linear-gradient(135deg, #fff7dd, #fff 74%);
}

.store-daily-card.warn span,
.store-daily-card.warn strong {
  color: #7a4c10;
}

.store-detail-grid {
  display: grid;
  grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.store-detail-goals {
  gap: 14px;
}

.user-ranking-wrap {
  margin: 0 -18px;
}

.user-ranking-table {
  min-width: 1160px;
}

.user-ranking-table th:first-child,
.user-ranking-table td:first-child {
  width: 44px;
  text-align: center;
}

.user-ranking-table td {
  font-size: 13px;
  font-weight: 500;
}

.user-ranking-table .store-name {
  color: #202a38;
  font-weight: 650;
  letter-spacing: 0;
}

.user-ranking-table .strong-value {
  color: #111827;
  font-weight: 680;
}

.store-insight-grid,
.store-comparison-panel {
  margin-top: 12px;
}

.store-insight-grid {
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.25fr);
}

.store-metric-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.store-metric-list > div {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.store-metric-list span {
  color: #64748b;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-metric-list strong {
  align-self: end;
  color: #172033;
  font-size: 17px;
}

.meta-c-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.store-metric-list .metric-good {
  border-color: #bfe8d6;
  background: #eaf8f0;
}

.store-metric-list .metric-danger {
  border-color: #fac8bf;
  background: #fff0ee;
}

.store-metric-list .metric-good strong {
  color: #09613f;
}

.store-metric-list .metric-danger strong {
  color: #b42318;
}

.store-comparison-table {
  min-width: 900px;
}

.store-comparison-table th:first-child,
.store-comparison-table td:first-child {
  width: auto;
  text-align: left;
}

.variation-cell {
  font-weight: 780;
}

.variation-cell.positive,
.store-comparison-chart-head span.positive {
  color: #087443;
}

.variation-cell.negative,
.store-comparison-chart-head span.negative {
  color: #b42318;
}

.variation-cell.neutral,
.store-comparison-chart-head span.neutral {
  color: #64748b;
}

.store-comparison-chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.store-comparison-chart-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfcfe;
}

.store-comparison-chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.store-comparison-chart-head strong {
  min-width: 0;
  color: #111827;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 780;
}

.store-comparison-chart-head span {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.store-comparison-bars {
  display: grid;
  gap: 8px;
}

.store-comparison-bar-row {
  display: grid;
  grid-template-columns: 84px minmax(82px, 1fr) minmax(82px, auto);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.store-comparison-bar-row span {
  color: #64748b;
  font-size: 11px;
  font-weight: 720;
}

.store-comparison-bar-row strong {
  color: #172033;
  font-size: 11px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.store-comparison-bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}

.store-comparison-bar-track i {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.store-comparison-bar-track.current i {
  background: var(--blue);
}

.store-comparison-bar-track.previous i {
  background: #f97316;
}

.store-comparison-bar-track.year i {
  background: var(--green);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #09613f;
  font-weight: 780;
  font-size: 12px;
}

.search-input {
  width: min(240px, 100%);
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  background: #fff;
}

.status-chart {
  display: grid;
  gap: 12px;
}

.status-row,
.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.row-label {
  min-width: 0;
  color: var(--text);
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-value {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-align: right;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--blue);
}

.bar-fill.green {
  background: var(--green);
}

.bar-fill.amber {
  background: var(--amber);
}

.bar-fill.red {
  background: var(--red);
}

.split-metrics {
  display: grid;
  gap: 10px;
}

.split-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.split-card strong {
  font-size: 22px;
}

.forecast-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.forecast-card {
  position: relative;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
  overflow: hidden;
}

.forecast-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--blue);
}

.month-card.month-1 {
  background: #eef6ff;
  border-color: #b9d8ff;
}

.month-card.month-1::before {
  background: var(--blue);
}

.month-card.month-2 {
  background: #edf8f1;
  border-color: #b9e5ca;
}

.month-card.month-2::before {
  background: var(--green);
}

.month-card.month-3 {
  background: #fff8e7;
  border-color: #f0d89a;
}

.month-card.month-3::before {
  background: var(--amber);
}

.month-card.month-4 {
  background: #f1efff;
  border-color: #cbc4ff;
}

.month-card.month-4::before {
  background: var(--violet);
}

.forecast-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: baseline;
}

.forecast-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.month-card.month-1 .forecast-card-head span {
  color: #1746a2;
}

.month-card.month-2 .forecast-card-head span {
  color: #09613f;
}

.month-card.month-3 .forecast-card-head span {
  color: #7a4c10;
}

.month-card.month-4 .forecast-card-head span {
  color: #5746b0;
}

.forecast-card-head strong {
  font-size: 24px;
  line-height: 1.1;
  white-space: nowrap;
}

.forecast-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.forecast-card-grid div {
  display: grid;
  gap: 4px;
}

.forecast-card-grid span {
  color: var(--muted);
  font-size: 12px;
}

.forecast-card-grid strong {
  font-size: 14px;
  font-weight: 740;
  white-space: nowrap;
}

.forecast-card-grid .forecast-target-positive {
  color: var(--green);
}

.forecast-card-grid .forecast-target-negative {
  color: var(--red);
}

.daily-chart {
  display: grid;
  grid-template-columns: repeat(30, minmax(16px, 1fr));
  align-items: end;
  gap: 5px;
  height: 330px;
  padding-top: 18px;
}

.day-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.day-bars {
  display: flex;
  align-items: end;
  gap: 3px;
  min-height: 0;
}

.day-bar {
  width: 50%;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}

.day-bar.paid {
  background: var(--green);
}

.day-bar.remaining {
  background: var(--amber);
}

.day-label {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.dual-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-list h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.mini-row strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stacked-chart {
  display: grid;
  gap: 11px;
}

.stacked-row {
  display: grid;
  grid-template-columns: minmax(140px, 270px) minmax(0, 1fr) 118px;
  align-items: center;
  gap: 10px;
  min-height: 30px;
}

.stacked-track {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.stacked-part {
  height: 100%;
  min-width: 1px;
}

.stacked-part.launched {
  background: var(--blue);
}

.stacked-part.orders {
  background: var(--violet);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--blue);
}

.legend-dot.orders {
  background: var(--violet);
}

.legend-dot.paid {
  background: var(--green);
}

.legend-dot.remaining {
  background: var(--amber);
}

.schedule-list {
  display: grid;
  gap: 9px;
  max-height: 364px;
  overflow: auto;
  padding-right: 4px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.schedule-date {
  font-weight: 760;
}

.schedule-values {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.category-layout {
  display: grid;
  grid-template-columns: 154px minmax(260px, 1fr);
  gap: 20px;
  align-items: center;
}

.donut {
  width: 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--blue) 0deg, var(--blue) 120deg, var(--green) 120deg, var(--green) 240deg, var(--amber) 240deg);
}

.donut::after {
  content: "";
  width: 90px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

.category-list {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.category-item {
  display: grid;
  grid-template-columns: minmax(126px, 1fr) max-content;
  gap: 14px;
  align-items: center;
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.category-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 620;
  white-space: nowrap;
}

.category-item strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  justify-self: end;
  letter-spacing: 0;
  white-space: nowrap;
}

.category-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue);
}

.category-dot.perfumaria {
  background: var(--green);
}

.category-dot.outros {
  background: var(--amber);
}

.category-dot.summary {
  background: var(--violet);
}

.category-bars {
  display: grid;
  gap: 14px;
}

.category-status-block {
  display: grid;
  gap: 8px;
}

.category-status-block h3 {
  margin: 0;
  font-size: 13px;
}

.target-panel {
  grid-column: 1 / -1;
}

.target-list {
  display: grid;
  gap: 12px;
}

.target-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.target-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.receivable-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.receivable-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--green);
}

.legend-swatch.open {
  background: var(--amber);
}

.legend-swatch.projected {
  background: var(--blue);
}

.legend-swatch.over {
  background: var(--red);
}

.target-general {
  display: grid;
}

.target-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.target-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.target-item:last-child {
  padding-bottom: 14px;
}

.target-summary {
  background: var(--surface-alt);
}

.target-head,
.target-values,
.target-detail,
.target-balance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
}

.target-head strong {
  font-size: 18px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.target-values div {
  display: grid;
  gap: 3px;
}

.target-values span,
.target-detail,
.target-balance span {
  color: var(--muted);
  font-size: 12px;
}

.target-values strong,
.target-balance strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.target-track {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.target-fill {
  height: 100%;
  min-width: 0;
}

.target-fill.paid {
  background: var(--green);
}

.target-fill.open {
  background: var(--amber);
}

.target-detail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.target-balance {
  padding-top: 2px;
}

.target-balance.over strong {
  color: var(--red);
}

.table-panel {
  padding-bottom: 0;
}

.table-wrap {
  overflow: auto;
  margin: 0 -18px;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}

.weekly-flow-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.weekly-flow-table th,
.weekly-flow-table td {
  padding: 10px 6px;
}

.weekly-flow-table th:first-child,
.weekly-flow-table td:first-child {
  width: 112px;
}

.weekly-flow-table th {
  font-size: 10px;
}

.weekly-flow-table .numeric {
  white-space: nowrap;
}

.receivables-table {
  min-width: 0;
  table-layout: fixed;
  font-size: 12px;
}

.receivables-table th,
.receivables-table td {
  padding: 10px 7px;
}

.receivables-table th:first-child,
.receivables-table td:first-child {
  width: 118px;
}

.receivables-table th {
  font-size: 10px;
}

.receivables-table .numeric {
  white-space: nowrap;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

td {
  max-width: 320px;
}

.truncate {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.money-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 760;
  white-space: nowrap;
}

.money-pill.effective {
  background: var(--green-soft);
  color: #09613f;
}

.money-pill.projected {
  background: var(--blue-soft);
  color: #1746a2;
}

.cashflow-balance {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 780;
  white-space: nowrap;
}

.cashflow-balance.positive {
  background: var(--green-soft);
  color: #09613f;
}

.cashflow-balance.negative {
  background: var(--red-soft);
  color: #8b2722;
}

.purchase-shell {
  max-width: 1500px;
}

.purchase-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 0 14px;
}

.purchase-kpi-card,
.purchase-category-card,
.purchase-signal {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.purchase-kpi-card span,
.purchase-category-card span,
.purchase-signal span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.purchase-kpi-card strong {
  font-size: 25px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.purchase-kpi-card small,
.purchase-category-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.purchase-kpi-card.blue,
.purchase-category-card.blue {
  background: linear-gradient(135deg, #eaf3ff, #fff 74%);
  border-color: #c8dcff;
}

.purchase-kpi-card.green,
.purchase-category-card.green {
  background: linear-gradient(135deg, #e8f8ef, #fff 74%);
  border-color: #bfe8d6;
}

.purchase-kpi-card.amber {
  background: linear-gradient(135deg, #fff7dd, #fff 74%);
  border-color: #f3dda3;
}

.purchase-kpi-card.red {
  background: linear-gradient(135deg, #ffe9e7, #fff 74%);
  border-color: #fac8bf;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 12px;
  margin-top: 12px;
}

.purchase-layout-stacked {
  grid-template-columns: minmax(0, 1fr);
}

.purchase-stock-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
}

.purchase-panel {
  display: grid;
  align-content: start;
}

.purchase-filter-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.purchase-filter-field {
  display: grid;
  gap: 8px;
  min-width: min(320px, 100%);
}

.purchase-filter-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.purchase-filter-field select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.purchase-filter-note {
  color: #445064;
  font-size: 13px;
  line-height: 1.4;
}

.purchase-week-list,
.purchase-store-list {
  display: grid;
  gap: 9px;
}

.purchase-week-row,
.purchase-store-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.92fr) minmax(160px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.purchase-week-row > div:first-child,
.purchase-store-row > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.purchase-week-row span,
.purchase-store-row span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-week-row strong,
.purchase-store-row strong {
  font-variant-numeric: tabular-nums;
}

.purchase-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.purchase-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.stock-evolution-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(76px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 230px;
  overflow-x: auto;
  padding-top: 8px;
  padding-bottom: 4px;
}

.stock-evolution-item {
  display: grid;
  grid-template-rows: 150px auto auto;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.stock-evolution-track {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 150px;
  border-radius: 8px;
  background: #eef3f8;
  overflow: hidden;
}

.stock-evolution-track i {
  display: block;
  width: min(42px, 58%);
  min-height: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #24a148, #2454d6);
}

.stock-evolution-item strong {
  font-size: 12px;
  line-height: 1.1;
}

.stock-evolution-item span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.purchase-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.purchase-category-card strong {
  font-size: 23px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.purchase-category-card div {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid rgba(105, 115, 131, 0.18);
}

.purchase-month-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.purchase-table {
  min-width: 980px;
  font-size: 12px;
}

.purchase-alert-table {
  min-width: 1320px;
}

.purchase-table th {
  font-size: 10px;
}

.purchase-table td {
  max-width: 270px;
}

.purchase-table tfoot td {
  border-top: 1px solid #dbe3ed;
  color: var(--text);
  font-weight: 800;
}

.purchase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 780;
  line-height: 1.2;
  white-space: normal;
}

.purchase-pill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.purchase-pill.blue {
  background: var(--blue-soft);
  color: #1746a2;
}

.purchase-pill.amber {
  background: var(--amber-soft);
  color: #7a4c10;
}

.purchase-pill.red {
  background: var(--red-soft);
  color: #8b2722;
}

.purchase-pill.green {
  background: var(--green-soft);
  color: #09613f;
}

.purchase-cost-cell {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.purchase-cost-cell strong {
  font-size: 12px;
  font-weight: 780;
}

.purchase-cost-cell small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.purchase-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.purchase-signal {
  box-shadow: none;
}

.purchase-signal strong {
  font-size: 22px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.purchase-signal.good {
  background: var(--green-soft);
  border-color: #bfe8d6;
}

.purchase-signal.watch {
  background: var(--amber-soft);
  border-color: #f3dda3;
}

.purchase-signal.danger {
  background: var(--red-soft);
  border-color: #fac8bf;
}

.purchase-signal-grid-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.purchase-signal small {
  color: var(--muted);
  font-size: 11px;
}

.purchase-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.purchase-toolbar-meta {
  margin-top: -4px;
  padding-top: 0;
}

.purchase-filter {
  display: grid;
  gap: 6px;
  min-width: 180px;
  flex: 1 1 180px;
}

.purchase-filter span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.purchase-filter input,
.purchase-filter select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(105, 115, 131, 0.24);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.purchase-toolbar-summary {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 10px 14px;
  border: 1px solid rgba(105, 115, 131, 0.18);
  border-radius: 14px;
  background: rgba(243, 247, 255, 0.8);
}

.purchase-toolbar-summary strong {
  font-size: 22px;
  line-height: 1;
}

.purchase-toolbar-summary span {
  color: var(--muted);
  font-size: 11px;
}

.purchase-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.purchase-action-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #1546a0;
  border-radius: 12px;
  background: #1546a0;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.purchase-action-button.secondary {
  background: #fff;
  color: #1546a0;
}

.fiscal-shell {
  padding-bottom: 32px;
}

.fiscal-strip strong {
  color: #1546a0;
}

.fiscal-kpi-grid {
  margin-top: 16px;
}

.fiscal-period-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.fiscal-period-filter a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.fiscal-period-filter a.active {
  background: #1546a0;
  color: #fff;
}

.fiscal-steps,
.fiscal-question-list {
  display: grid;
  gap: 12px;
}

.fiscal-step,
.fiscal-question {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-alt);
}

.fiscal-step strong,
.fiscal-question strong {
  font-size: 16px;
  line-height: 1.2;
}

.fiscal-step span,
.fiscal-question span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.fiscal-table {
  min-width: 1180px;
}

.fiscal-key {
  display: inline-block;
  max-width: 320px;
}

.fiscal-column-header-sales,
.fiscal-cell-sales {
  background: linear-gradient(135deg, #e8f8ef, #f9fffb 72%);
}

.fiscal-column-header-tax,
.fiscal-cell-tax {
  background: linear-gradient(135deg, #ffe7e5, #fff7f6 72%);
}

.fiscal-column-header-credit,
.fiscal-cell-credit {
  background: linear-gradient(135deg, #e7f1ff, #f8fbff 72%);
}

.fiscal-column-header {
  border-bottom-color: #bfd4f5;
}

.fiscal-cell-highlight {
  min-width: 150px;
}

.fiscal-cell-highlight strong {
  color: #143a84;
  font-variant-numeric: tabular-nums;
}

.fiscal-cell-sales strong {
  color: #0f6a46;
}

.fiscal-cell-tax strong {
  color: #a12b22;
}

.fiscal-cell-credit strong {
  color: #1c56b5;
}

.fiscal-cell-highlight div {
  margin-top: 4px;
  color: #5d6b7d;
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink-soft);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.status-badge.paid {
  background: var(--green-soft);
  color: #09613f;
}

.status-badge.open {
  background: var(--amber-soft);
  color: #7a4c10;
}

.status-badge.cancelled {
  background: var(--red-soft);
  color: #8b2722;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.hub-shell {
  max-width: 1160px;
}

.hub-topbar h1 {
  font-size: 34px;
}

.executive-alert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.executive-alert-card {
  display: grid;
  gap: 10px;
  min-height: 206px;
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.executive-alert-card.good {
  background: linear-gradient(135deg, #edf9f2, #ffffff 68%);
}

.executive-alert-card.warn {
  background: linear-gradient(135deg, #fff6df, #ffffff 68%);
}

.executive-alert-card.danger {
  background: linear-gradient(135deg, #ffe9e6, #ffffff 68%);
}

.executive-alert-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-transform: uppercase;
}

.executive-alert-title {
  font-size: 20px;
  line-height: 1.15;
}

.executive-alert-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.executive-alert-description {
  color: #445064;
  font-size: 14px;
  line-height: 1.45;
}

.executive-alert-link {
  align-self: end;
  color: #143a84;
  font-size: 12px;
  font-weight: 780;
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.branch-card {
  min-height: 300px;
}

@media (max-width: 1280px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar-side {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .topbar-side .meta-stack {
    justify-items: start;
    text-align: left;
  }

  .portal-card-title {
    font-size: 26px;
  }

  .portal-card-description {
    font-size: 13px;
  }
}

.portal-card.factory {
  background:
    linear-gradient(135deg, rgba(232, 248, 239, 0.94), rgba(219, 234, 254, 0.58) 52%, rgba(255, 255, 255, 0.95)),
    var(--surface);
}

.factory-hub-shell {
  max-width: 1240px;
}

.factory-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
}

.factory-hub-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-hub-card {
  min-height: 286px;
  padding-right: 132px;
}

.factory-hub-card::before {
  right: 18px;
  bottom: 20px;
  width: 92px;
  height: 92px;
}

.factory-hub-card .portal-card-icon {
  right: 18px;
  bottom: 20px;
  width: 92px;
  height: 92px;
}

.factory-hub-card .portal-card-title,
.factory-hub-card .portal-card-description {
  max-width: 100%;
}

.factory-hub-card .portal-card-stats {
  align-self: end;
  max-width: 100%;
  padding-top: 10px;
  padding-right: 0;
}

.factory-hub-card .portal-card-stats i {
  min-height: 26px;
  max-width: 100%;
  padding: 4px 8px;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.15;
}

.factory-hub-card .portal-card-stats i.negative {
  background: var(--red-soft);
  color: #8b2722;
}

.factory-hub-grid:not(.two) > .factory-hub-card.clients {
  grid-column: auto / span 1;
}

.factory-hub-card.summary {
  background:
    linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(255, 255, 255, 0.93) 54%, rgba(232, 248, 239, 0.75)),
    var(--surface);
}

.factory-hub-card.stock {
  background:
    linear-gradient(135deg, rgba(255, 242, 204, 0.95), rgba(255, 255, 255, 0.94) 58%),
    var(--surface);
}

.factory-hub-card.finance {
  background:
    linear-gradient(135deg, rgba(235, 231, 255, 0.94), rgba(255, 255, 255, 0.94) 58%, rgba(219, 234, 254, 0.58)),
    var(--surface);
}

.factory-hub-card.clients,
.factory-hub-card.buyers {
  background:
    linear-gradient(135deg, rgba(232, 248, 239, 0.95), rgba(255, 255, 255, 0.94) 58%),
    var(--surface);
}

.factory-hub-card.inactive {
  background:
    linear-gradient(135deg, rgba(255, 225, 223, 0.82), rgba(255, 255, 255, 0.94) 58%),
    var(--surface);
}

.factory-shell {
  max-width: 1480px;
}

.factory-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}

.factory-kpi-grid.sales-only {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-kpi-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.factory-kpi-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.factory-kpi-card strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.factory-kpi-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.factory-kpi-card.green {
  background: linear-gradient(135deg, var(--green-soft), #fff 74%);
  border-color: #bfe8d6;
}

.factory-kpi-card.blue {
  background: linear-gradient(135deg, var(--blue-soft), #fff 74%);
  border-color: #c8dcff;
}

.factory-kpi-card.violet {
  background: linear-gradient(135deg, var(--violet-soft), #fff 74%);
  border-color: #d8d0ff;
}

.factory-kpi-card.amber {
  background: linear-gradient(135deg, var(--amber-soft), #fff 74%);
  border-color: #f3dda3;
}

.factory-day-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}

.factory-day-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.factory-day-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.factory-day-card strong {
  font-size: 26px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.factory-day-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.factory-day-card.blue {
  border-color: #c8dcff;
  background: linear-gradient(135deg, var(--blue-soft), #fff 76%);
}

.factory-day-card.amber {
  border-color: #f3dda3;
  background: linear-gradient(135deg, var(--amber-soft), #fff 76%);
}

.factory-day-card.positive {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, var(--green-soft), #fff 76%);
}

.factory-day-card.positive strong {
  color: #09613f;
}

.factory-day-card.negative {
  border-color: #fac8bf;
  background: linear-gradient(135deg, var(--red-soft), #fff 76%);
}

.factory-day-card.negative strong {
  color: #b42318;
}

.factory-finance-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(2, minmax(240px, 0.65fr));
  gap: 12px;
  margin: 4px 0 14px;
}

.factory-finance-main {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 190px;
  overflow: hidden;
}

.factory-finance-main.positive {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, #e8f8ef, #fff 72%);
}

.factory-finance-main.negative {
  border-color: #fac8bf;
  background: linear-gradient(135deg, #ffe9e7, #fff 72%);
}

.factory-finance-main strong {
  font-size: 36px;
  line-height: 1.03;
  font-variant-numeric: tabular-nums;
}

.factory-finance-main.positive strong {
  color: #09613f;
}

.factory-finance-main.negative strong {
  color: #9d2821;
}

.factory-finance-main span,
.factory-finance-mini span,
.factory-finance-signal span,
.factory-finance-foot-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.factory-finance-mini {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 190px;
}

.factory-finance-mini strong {
  font-size: 25px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.factory-finance-mini small,
.factory-finance-signal small,
.factory-finance-foot-card small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.factory-finance-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.factory-finance-signal,
.factory-finance-foot-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.factory-finance-signal strong,
.factory-finance-foot-card strong {
  font-size: 22px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.factory-finance-signal strong.positive,
.factory-finance-foot-card strong.positive {
  color: #09613f;
}

.factory-finance-signal strong.negative,
.factory-finance-foot-card strong.negative {
  color: #9d2821;
}

.factory-finance-signal.good {
  background: linear-gradient(135deg, #e8f8ef, #fff 72%);
  border-color: #bfe8d6;
}

.factory-finance-signal.watch {
  background: linear-gradient(135deg, #fff7dd, #fff 72%);
  border-color: #f3dda3;
}

.factory-finance-signal.danger {
  background: linear-gradient(135deg, #ffe9e7, #fff 72%);
  border-color: #fac8bf;
}

.factory-weekly-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.factory-week-flow-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-week-flow-card > div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.factory-week-flow-card strong {
  font-size: 13px;
}

.factory-week-flow-card span {
  font-size: 12px;
  font-weight: 820;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.factory-week-flow-card span.positive {
  color: #09613f;
}

.factory-week-flow-card span.negative {
  color: #9d2821;
}

.factory-week-flow-card p {
  display: grid;
  gap: 5px;
}

.factory-week-flow-card i {
  display: block;
  height: 8px;
  min-width: 4%;
  border-radius: 999px;
}

.factory-week-flow-card i.receive {
  background: #12805c;
}

.factory-week-flow-card i.pay {
  background: #b7791f;
}

.factory-week-flow-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.factory-finance-foot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.factory-sales-need-panel {
  display: grid;
  gap: 12px;
}

.factory-sales-need-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.factory-sales-need-summary div,
.factory-sales-need-empty {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 13px;
  border: 1px solid #d8d0ff;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet-soft), #fff 78%);
}

.factory-sales-need-summary span,
.factory-sales-need-row span,
.factory-sales-need-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.factory-sales-need-summary strong {
  font-size: 23px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.factory-sales-need-summary small,
.factory-sales-need-row small {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.35;
}

.factory-sales-need-list {
  display: grid;
  gap: 9px;
}

.factory-sales-need-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(160px, 1fr) minmax(170px, 0.72fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-sales-need-row.urgent {
  border-color: #fac8bf;
  background: #fff5f4;
}

.factory-sales-need-row.watch {
  border-color: #f3dda3;
  background: #fffaf0;
}

.factory-sales-need-row.planned {
  border-color: #c8dcff;
  background: #f6f9ff;
}

.factory-sales-need-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-sales-need-row strong {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.factory-sales-need-row > div:last-child {
  justify-items: end;
  text-align: right;
}

.factory-sales-need-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.factory-sales-need-meter i {
  display: block;
  height: 100%;
  min-width: 4%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #2563eb);
}

.factory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 12px;
}

.factory-month-layout,
.factory-customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(360px, 0.76fr);
  gap: 12px;
  margin-bottom: 12px;
}

.factory-month-card,
.factory-comparison-card,
.factory-customer-panel {
  min-width: 0;
}

.factory-month-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.factory-inventory-summary span,
.factory-client-products span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.factory-product-ranking,
.factory-comparison-list,
.factory-customer-list,
.factory-inventory-list {
  display: grid;
  gap: 9px;
}

.factory-product-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-product-row > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #09613f;
  font-size: 12px;
  font-weight: 800;
}

.factory-product-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-product-row strong,
.factory-customer-card strong,
.factory-inventory-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.factory-product-row small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.factory-product-row > strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.factory-comparison-list {
  grid-template-columns: 1fr;
}

.factory-comparison-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-comparison-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.factory-comparison-row strong {
  font-size: 24px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.factory-comparison-row small {
  color: #4b5563;
  font-size: 12px;
}

.factory-comparison-row.current {
  border-color: #c8dcff;
  background: linear-gradient(135deg, var(--blue-soft), #fff 75%);
}

.factory-comparison-row.positive {
  border-color: #bfe8d6;
  background: linear-gradient(135deg, var(--green-soft), #fff 75%);
}

.factory-comparison-row.negative {
  border-color: #fac8bf;
  background: linear-gradient(135deg, var(--red-soft), #fff 75%);
}

.factory-inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.factory-inventory-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: var(--surface-alt);
}

.factory-inventory-summary strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.factory-inventory-item {
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-inventory-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.factory-inventory-item summary::-webkit-details-marker {
  display: none;
}

.factory-inventory-item summary > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-inventory-item summary span {
  color: var(--muted);
  font-size: 12px;
}

.factory-inventory-item summary > strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.factory-inventory-item summary em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1746a2;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.factory-inventory-item[open] summary em {
  background: var(--green-soft);
  color: #09613f;
}

.factory-lot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.factory-lot-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(105, 115, 131, 0.18);
  border-radius: 8px;
  background: #fff;
}

.factory-lot-card strong,
.factory-lot-card span,
.factory-lot-card small {
  overflow-wrap: anywhere;
}

.factory-lot-card span,
.factory-lot-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.factory-customer-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.factory-customer-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-customer-card.attention {
  border-color: #f3dda3;
  background: linear-gradient(135deg, #fffaf0, #fff 76%);
}

.factory-customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.factory-customer-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-customer-head span {
  color: var(--muted);
  font-size: 12px;
}

.factory-customer-head > strong {
  flex: 0 0 auto;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.factory-client-products {
  display: grid;
  gap: 4px;
  padding-top: 9px;
  border-top: 1px solid rgba(105, 115, 131, 0.15);
}

.factory-client-products p {
  color: #344052;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.factory-client-products.suggest span {
  color: #09613f;
}

.factory-panel {
  min-width: 0;
}

.factory-bar-list,
.factory-seller-list {
  display: grid;
  gap: 9px;
}

.factory-bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.55fr) minmax(180px, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-bar-row > div:first-child,
.factory-seller-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.factory-bar-row strong,
.factory-seller-row strong {
  font-variant-numeric: tabular-nums;
}

.factory-bar-row span,
.factory-seller-row small {
  color: var(--muted);
  font-size: 12px;
}

.factory-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.factory-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #12805c, #2563eb);
}

.factory-seller-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: #fbfcfe;
}

.factory-seller-row > span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #1746a2;
  font-size: 12px;
  font-weight: 800;
}

.factory-daily-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 278px;
}

.factory-daily-column {
  display: grid;
  grid-template-rows: 190px auto auto;
  gap: 6px;
  min-width: 0;
}

.factory-daily-bar {
  display: flex;
  align-items: end;
  min-height: 190px;
  border-radius: 8px;
  background: #eef2f7;
  overflow: hidden;
}

.factory-daily-bar i {
  display: block;
  width: 100%;
  min-height: 4%;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2563eb, #12805c);
}

.factory-daily-column span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-align: center;
}

.factory-daily-column strong {
  color: var(--text);
  font-size: 11px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.factory-weekly-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.factory-weekly-table th,
.factory-weekly-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.factory-weekly-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.factory-weekly-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1060px) {
  .kpi-grid,
  .panel-grid,
  .panel-grid-compact,
  .forecast-cards {
    grid-template-columns: 1fr 1fr;
  }

  .portal-grid,
  .executive-alert-grid,
  .factory-hub-grid,
  .factory-hub-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-card {
    min-height: 248px;
  }

  .portal-card-farmacias {
    grid-template-columns: minmax(0, 1fr) 108px;
    column-gap: 14px;
  }

  .branch-grid,
  .factory-finance-hero,
  .factory-finance-signal-grid,
  .factory-weekly-flow,
  .factory-finance-foot-grid,
  .factory-sales-need-summary,
  .factory-kpi-grid,
  .factory-day-grid,
  .factory-layout,
  .factory-month-layout,
  .factory-customer-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .factory-finance-main {
    grid-column: 1 / -1;
  }

  .factory-sales-need-row {
    grid-template-columns: minmax(180px, 0.9fr) minmax(140px, 1fr);
  }

  .factory-sales-need-row > div:last-child {
    grid-column: 1 / -1;
    justify-items: start;
    text-align: left;
  }

  .factory-month-grid {
    grid-template-columns: 1fr;
  }

  .factory-lot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-health-strip,
  .finance-executive-section,
  .sales-executive-grid,
  .purchase-layout,
  .purchase-stock-layout {
    grid-template-columns: 1fr;
  }

  .lab-hero,
  .lab-layout,
  .lab-grid {
    grid-template-columns: 1fr;
  }

  .lab-hero-grid,
  .lab-idea-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-summary-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-kpi-grid,
  .purchase-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comparison-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sales-comparison-section {
    grid-template-columns: 1fr;
  }

  .supplements-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sales-category-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-category-row {
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr);
  }

  .sales-category-bars,
  .sales-category-profit,
  .sales-category-delta {
    grid-column: 1 / -1;
  }

  .sales-category-delta {
    justify-items: start;
    text-align: left;
  }

  .sales-goal-grid {
    grid-template-columns: 1fr;
  }

  .sales-complete-grid,
  .user-chart {
    grid-template-columns: 1fr;
  }

  .store-kpis,
  .store-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-metrics {
    grid-template-columns: 1fr;
  }

  .wide-panel {
    grid-column: 1 / -1;
  }
}

@media (min-width: 761px) and (max-width: 920px) {
  .table-panel:not(.sales-goals-panel) {
    padding-bottom: 14px;
  }

  .table-panel:not(.sales-goals-panel) .table-wrap {
    overflow: visible;
    margin: 0;
    border-top: 0;
  }

  .weekly-flow-table,
  .receivables-table,
  .weekly-flow-table tbody,
  .receivables-table tbody,
  .weekly-flow-table tr,
  .receivables-table tr,
  .weekly-flow-table td,
  .receivables-table td {
    display: block;
    width: 100%;
  }

  .weekly-flow-table,
  .receivables-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .weekly-flow-table thead,
  .receivables-table thead {
    display: none;
  }

  .weekly-flow-table tbody,
  .receivables-table tbody {
    display: grid;
    gap: 10px;
  }

  .weekly-flow-table tr,
  .receivables-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .weekly-flow-table td,
  .receivables-table td {
    max-width: none;
    padding: 7px 0;
    border-bottom: 0;
    text-align: right;
  }

  .weekly-flow-table td:not(:first-child),
  .receivables-table td:not(:first-child) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .weekly-flow-table td::before,
  .receivables-table td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .weekly-flow-table td:first-child,
  .receivables-table td:first-child {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
  }

  .weekly-flow-table td:first-child::before,
  .receivables-table td:first-child::before {
    content: "Semana";
    display: block;
    margin-bottom: 3px;
  }

  .weekly-flow-table td:nth-child(2)::before {
    content: "Fornecedores";
  }

  .weekly-flow-table td:nth-child(3)::before {
    content: "Demais contas";
  }

  .weekly-flow-table td:nth-child(4)::before {
    content: "Pedidos";
  }

  .weekly-flow-table td:nth-child(5)::before {
    content: "Total a pagar";
  }

  .weekly-flow-table td:nth-child(6)::before {
    content: "A receber";
  }

  .weekly-flow-table td:nth-child(7)::before {
    content: "Para entrar";
  }

  .weekly-flow-table td:nth-child(8)::before {
    content: "Pode entrar";
  }

  .weekly-flow-table td:nth-child(9)::before {
    content: "Diferença";
  }

  .receivables-table td:nth-child(2)::before {
    content: "Débito";
  }

  .receivables-table td:nth-child(3)::before {
    content: "Crédito";
  }

  .receivables-table td:nth-child(4)::before {
    content: "Crédito parc.";
  }

  .receivables-table td:nth-child(5)::before {
    content: "PIX";
  }

  .receivables-table td:nth-child(6)::before {
    content: "Dinheiro";
  }

  .receivables-table td:nth-child(7)::before {
    content: "Para entrar";
  }

  .receivables-table td:nth-child(8)::before {
    content: "Projeção";
  }

  .receivables-table td:nth-child(9)::before {
    content: "Total";
  }

  .weekly-flow-table .numeric,
  .receivables-table .numeric {
    white-space: nowrap;
  }

  .money-pill,
  .cashflow-balance {
    flex: 0 0 auto;
    justify-content: center;
    min-width: max-content;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1060px) {
  .factory-shell {
    width: min(100% - 18px, 1480px);
    padding-top: 10px;
  }

  .factory-shell .topbar {
    min-height: 0;
    align-items: center;
    flex-direction: row;
    padding: 8px 0 12px;
  }

  .factory-shell .brand-logo-link {
    width: 70px;
    height: 62px;
  }

  .factory-shell h1 {
    font-size: 24px;
  }

  .factory-kpi-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 8px;
  }

  .factory-day-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 8px;
  }

  .factory-kpi-card,
  .factory-day-card,
  .factory-panel {
    padding: 13px;
  }

  .factory-kpi-card {
    min-height: 116px;
  }

  .factory-kpi-card strong {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  .factory-day-card strong {
    font-size: 19px;
  }

  .factory-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
    gap: 10px;
  }

  .factory-month-layout,
  .factory-customer-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .factory-month-grid {
    grid-template-columns: 1fr;
  }

  .factory-bar-row,
  .factory-seller-row,
  .factory-product-row,
  .factory-customer-card {
    gap: 8px;
    padding: 9px;
  }

  .factory-comparison-row,
  .factory-inventory-summary div {
    padding: 10px;
  }

  .factory-comparison-row strong,
  .factory-inventory-summary strong {
    font-size: 18px;
  }

  .factory-lot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .factory-daily-chart {
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    min-height: 214px;
  }

  .factory-daily-column {
    grid-template-rows: 136px auto auto;
  }

  .factory-daily-bar {
    min-height: 136px;
  }
}

@media (max-width: 760px) {
  .branch-grid,
  .factory-hub-grid,
  .factory-hub-grid.two,
  .factory-finance-hero,
  .factory-finance-signal-grid,
  .factory-weekly-flow,
  .factory-finance-foot-grid,
  .factory-sales-need-summary,
  .factory-sales-need-row,
  .factory-kpi-grid,
  .factory-day-grid,
  .factory-layout,
  .factory-month-layout,
  .factory-month-grid,
  .factory-customer-layout,
  .factory-inventory-summary,
  .factory-lot-grid {
    grid-template-columns: 1fr;
  }

  .factory-finance-main {
    grid-column: auto;
    min-height: 170px;
  }

  .factory-sales-need-row > div:last-child {
    grid-column: auto;
    justify-items: start;
    text-align: left;
  }

  .factory-hub-card,
  .factory-hub-card.summary,
  .factory-hub-card.clients {
    grid-column: auto;
    min-height: 230px;
    padding-right: 20px;
  }

  .factory-hub-card::before,
  .factory-hub-card .portal-card-icon {
    width: 78px;
    height: 78px;
  }

  .factory-hub-card .portal-card-stats {
    max-width: calc(100% - 88px);
  }

  .branch-card {
    min-height: 220px;
  }

  .factory-kpi-card {
    min-height: 126px;
  }

  .factory-day-card {
    padding: 14px;
  }

  .factory-kpi-card strong {
    font-size: 24px;
    overflow-wrap: anywhere;
  }

  .factory-day-card strong {
    font-size: 23px;
  }

  .factory-bar-row,
  .factory-seller-row,
  .factory-product-row,
  .factory-inventory-item summary {
    grid-template-columns: 1fr;
  }

  .factory-bar-row > strong,
  .factory-seller-row > strong,
  .factory-product-row > strong,
  .factory-inventory-item summary > strong {
    justify-self: start;
  }

  .factory-customer-head {
    display: grid;
  }

  .factory-customer-head > strong {
    white-space: normal;
  }

  .factory-daily-chart {
    display: flex;
    gap: 10px;
    min-height: 248px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .factory-daily-column {
    flex: 0 0 68px;
  }

  .factory-weekly-table,
  .factory-weekly-table tbody,
  .factory-weekly-table tr,
  .factory-weekly-table td {
    display: block;
    width: 100%;
  }

  .factory-weekly-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .factory-weekly-table thead {
    display: none;
  }

  .factory-weekly-table tbody {
    display: grid;
    gap: 10px;
  }

  .factory-weekly-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .factory-weekly-table td {
    max-width: none;
    padding: 7px 0;
    border-bottom: 0;
    text-align: right;
  }

  .factory-weekly-table td:not(:first-child) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .factory-weekly-table td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .factory-weekly-table td:first-child {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
  }

  .factory-weekly-table td:first-child::before {
    content: "Semana";
    display: block;
    margin-bottom: 3px;
  }

  .factory-weekly-table td:nth-child(2)::before {
    content: "A receber";
  }

  .factory-weekly-table td:nth-child(3)::before {
    content: "Receber aberto";
  }

  .factory-weekly-table td:nth-child(4)::before {
    content: "A pagar";
  }

  .factory-weekly-table td:nth-child(5)::before {
    content: "Pagar aberto";
  }

  .factory-weekly-table td:nth-child(6)::before {
    content: "Diferença";
  }

  .factory-weekly-table .numeric {
    white-space: nowrap;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1060px) {
  .purchase-shell {
    width: min(100% - 18px, 1480px);
    padding-top: 10px;
  }

  .purchase-shell .topbar {
    min-height: 0;
    align-items: center;
    flex-direction: row;
    padding: 8px 0 12px;
  }

  .purchase-shell .topbar-side {
    align-items: center;
    justify-content: center;
    width: auto;
  }

  .purchase-shell .topbar-side .meta-stack {
    justify-items: end;
    text-align: right;
    font-size: 11px;
  }

  .purchase-shell .brand-logo-link {
    width: 70px;
    height: 62px;
  }

  .purchase-shell h1 {
    font-size: 24px;
  }

  .purchase-shell .topbar-actions {
    margin-top: 8px;
  }

  .purchase-shell .purchase-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
  }

  .purchase-shell .purchase-kpi-card,
  .purchase-shell .purchase-category-card,
  .purchase-shell .purchase-signal {
    gap: 6px;
    padding: 11px;
  }

  .purchase-shell .purchase-kpi-card strong,
  .purchase-shell .purchase-category-card strong,
  .purchase-shell .purchase-signal strong {
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .purchase-shell .purchase-layout,
  .purchase-shell .purchase-stock-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
    gap: 10px;
  }

  .purchase-shell .purchase-layout-stacked {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-shell .purchase-category-grid,
  .purchase-shell .purchase-month-grid,
  .purchase-shell .purchase-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .purchase-shell .purchase-week-row,
  .purchase-shell .purchase-store-row {
    grid-template-columns: minmax(118px, 0.9fr) minmax(112px, 1fr) max-content;
    gap: 8px;
    padding: 9px;
  }

  .purchase-shell .purchase-week-row > strong,
  .purchase-shell .purchase-store-row > strong {
    justify-self: end;
    font-size: 12px;
    white-space: nowrap;
  }

  .purchase-shell .purchase-week-row strong,
  .purchase-shell .purchase-store-row strong {
    font-size: 12px;
  }

  .purchase-shell .purchase-week-row span,
  .purchase-shell .purchase-store-row span,
  .purchase-shell .purchase-kpi-card small,
  .purchase-shell .purchase-category-card small {
    font-size: 11px;
  }

  .purchase-shell .panel {
    padding: 13px;
  }

  .purchase-shell .panel-heading {
    margin-bottom: 10px;
  }

  .purchase-shell .table-wrap {
    overflow-x: auto;
    margin: 0 -13px;
    border-top: 1px solid var(--line);
  }

  .purchase-shell .purchase-table {
    min-width: 900px;
  }

  .purchase-shell .purchase-alert-table {
    min-width: 1180px;
  }
}

@media (max-width: 760px) {
  .fiscal-period-filter {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .fiscal-period-filter a {
    flex: 0 0 auto;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 14px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-side {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
  }

  .topbar-side .meta-stack {
    justify-items: start;
    text-align: left;
  }

  .brand-logo-link,
  .portal-topbar .brand-logo-link {
    width: 94px;
    height: 84px;
  }

  .portal-shell {
    align-content: start;
    padding-top: 18px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .executive-alert-grid {
    grid-template-columns: 1fr;
  }

  .portal-health-strip,
  .health-grid,
  .cashflow-insight-grid,
  .sales-executive-grid,
  .sales-category-summary,
  .purchase-kpi-grid,
  .purchase-category-grid,
  .purchase-month-grid,
  .purchase-signal-grid {
    grid-template-columns: 1fr;
  }

  .sales-category-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .sales-category-heading > span {
    max-width: none;
    text-align: left;
  }

  .sales-category-row,
  .sales-category-values,
  .sales-category-profit {
    grid-template-columns: 1fr;
  }

  .sales-category-row {
    gap: 10px;
  }

  .sales-category-bars,
  .sales-category-profit,
  .sales-category-delta {
    grid-column: auto;
  }

  .lab-shell {
    width: min(100% - 14px, 1480px);
    gap: 12px;
    padding-top: 10px;
  }

  .lab-hero {
    gap: 10px;
  }

  .lab-hero > div:first-child,
  .lab-panel,
  .lab-hero-grid article,
  .lab-idea-card {
    padding: 14px;
  }

  .lab-hero h2 {
    font-size: 25px;
  }

  .lab-hero-grid,
  .lab-idea-grid {
    grid-template-columns: 1fr;
  }

  .purchase-signal-grid-wide {
    grid-template-columns: 1fr;
  }

  .lab-flow-row,
  .lab-store-row,
  .purchase-week-row,
  .purchase-store-row {
    grid-template-columns: 1fr;
  }

  .purchase-toolbar {
    align-items: stretch;
  }

  .purchase-filter,
  .purchase-toolbar-summary,
  .purchase-toolbar-actions {
    width: 100%;
  }

  .purchase-action-button {
    width: 100%;
  }

  .lab-panel-head {
    flex-direction: column;
    gap: 8px;
  }

  .lab-status {
    justify-self: start;
  }

  .lab-hero-grid article {
    min-height: auto;
  }

  .lab-hero-grid strong,
  .lab-idea-card > strong {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .lab-hero-grid small,
  .lab-alert span,
  .lab-idea-card > small {
    overflow-wrap: anywhere;
  }

  .lab-flow-row {
    gap: 8px;
    padding: 12px;
  }

  .lab-flow-row div {
    padding: 9px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.68);
  }

  .lab-flow-row em {
    justify-content: center;
    justify-self: stretch;
    text-align: center;
  }

  .lab-store-row {
    gap: 9px;
    padding: 12px;
  }

  .lab-store-row > div:first-child {
    gap: 5px;
  }

  .lab-store-row strong,
  .lab-store-row span {
    overflow-wrap: anywhere;
  }

  .lab-store-row em {
    justify-self: start;
  }

  .lab-idea-card {
    min-height: auto;
  }

  .lab-idea-rows p {
    display: grid;
    gap: 3px;
  }

  .lab-idea-rows b {
    text-align: left;
    overflow-wrap: anywhere;
  }

  .portal-card {
    min-height: 205px;
    padding: 18px;
  }

  .portal-card-farmacias {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    min-height: 220px;
  }

  .portal-card-farmacias .portal-card-icon {
    grid-column: 1;
    grid-row: auto;
    justify-self: end;
    align-self: start;
    width: 84px;
    height: 84px;
  }

  .portal-card-farmacias::before {
    width: 84px;
    height: 84px;
  }

  .portal-card-farmacias .portal-card-stats {
    padding-right: 92px;
  }

  .portal-card-title {
    font-size: 27px;
  }

  .sales-summary-kpis {
    grid-template-columns: 1fr;
  }

  .purchase-kpi-card strong,
  .purchase-category-card strong {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .purchase-week-row,
  .purchase-store-row {
    gap: 8px;
    padding: 12px;
  }

  .purchase-week-row > strong,
  .purchase-store-row > strong {
    justify-self: start;
  }

  .comparison-kpi-grid,
  .sales-comparison-section {
    grid-template-columns: 1fr;
  }

  .supplements-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comparison-kpi-card strong {
    overflow-wrap: anywhere;
  }

  .meta-stack {
    justify-items: start;
  }

  .kpi-grid,
  .panel-grid,
  .panel-grid-compact,
  .forecast-cards {
    grid-template-columns: 1fr;
  }

  .target-segments {
    grid-template-columns: 1fr;
  }

  .status-row,
  .bar-row,
  .stacked-row {
    grid-template-columns: 1fr;
  }

  .row-value {
    text-align: left;
  }

  .daily-chart {
    grid-template-columns: repeat(15, minmax(16px, 1fr));
    height: 300px;
  }

  .category-layout {
    grid-template-columns: 1fr;
  }

  .category-item {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .panel-heading {
    flex-direction: column;
  }

  .panel-heading > span {
    max-width: none;
    text-align: left;
  }

  .sales-image-panel {
    overflow-x: auto;
  }

  .sales-image-panel img {
    width: max(100%, 760px);
  }

  .sales-image-wide img,
  .sales-image-tall img,
  .sales-image-compact img {
    width: max(100%, 760px);
    max-width: none;
  }

  .sales-complete-grid,
  .user-chart {
    grid-template-columns: 1fr;
  }

  .labeled-chart-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .labeled-chart-row strong {
    text-align: left;
  }

  .comparison-group-head {
    align-items: start;
    flex-direction: column;
  }

  .comparison-series-row {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 5px 8px;
  }

  .comparison-series-row span,
  .comparison-series-row strong {
    overflow-wrap: anywhere;
  }

  .comparison-series-row strong {
    grid-column: 2;
    white-space: normal;
    text-align: left;
  }

  .trend-chart {
    overflow-x: auto;
  }

  .trend-chart svg {
    width: max(100%, 680px);
    max-width: none;
    height: 270px;
  }

  .store-goal-head,
  .goal-progress-meta {
    align-items: start;
    flex-direction: column;
  }

  .store-goal-values {
    grid-template-columns: 1fr;
  }

  .store-kpis,
  .store-detail-grid,
  .store-comparison-chart-grid {
    grid-template-columns: 1fr;
  }

  .store-metric-list,
  .meta-c-list {
    grid-template-columns: 1fr;
  }

  .user-ranking-wrap {
    overflow-x: auto;
    margin: 0 -18px;
  }

  .table-panel {
    padding-bottom: 14px;
  }

  .table-wrap {
    overflow: visible;
    margin: 0;
    border-top: 0;
  }

  .weekly-flow-table,
  .receivables-table,
  .weekly-flow-table tbody,
  .receivables-table tbody,
  .weekly-flow-table tr,
  .receivables-table tr,
  .weekly-flow-table td,
  .receivables-table td {
    display: block;
    width: 100%;
  }

  .weekly-flow-table,
  .receivables-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
  }

  .weekly-flow-table thead,
  .receivables-table thead {
    display: none;
  }

  .weekly-flow-table tbody,
  .receivables-table tbody {
    display: grid;
    gap: 10px;
  }

  .weekly-flow-table tr,
  .receivables-table tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }

  .weekly-flow-table td,
  .receivables-table td {
    max-width: none;
    padding: 7px 0;
    border-bottom: 0;
    text-align: right;
  }

  .weekly-flow-table td:not(:first-child),
  .receivables-table td:not(:first-child) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .weekly-flow-table td::before,
  .receivables-table td::before {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .weekly-flow-table td:first-child,
  .receivables-table td:first-child {
    margin-bottom: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    text-align: left;
  }

  .weekly-flow-table td:first-child::before,
  .receivables-table td:first-child::before {
    content: "Semana";
    display: block;
    margin-bottom: 3px;
  }

  .weekly-flow-table td:nth-child(2)::before {
    content: "Fornecedores";
  }

  .weekly-flow-table td:nth-child(3)::before {
    content: "Demais contas";
  }

  .weekly-flow-table td:nth-child(4)::before {
    content: "Pedidos";
  }

  .weekly-flow-table td:nth-child(5)::before {
    content: "Total a pagar";
  }

  .weekly-flow-table td:nth-child(6)::before {
    content: "A receber";
  }

  .weekly-flow-table td:nth-child(7)::before {
    content: "Para entrar";
  }

  .weekly-flow-table td:nth-child(8)::before {
    content: "Pode entrar";
  }

  .weekly-flow-table td:nth-child(9)::before {
    content: "Diferença";
  }

  .receivables-table td:nth-child(2)::before {
    content: "Débito";
  }

  .receivables-table td:nth-child(3)::before {
    content: "Crédito";
  }

  .receivables-table td:nth-child(4)::before {
    content: "Crédito parc.";
  }

  .receivables-table td:nth-child(5)::before {
    content: "PIX";
  }

  .receivables-table td:nth-child(6)::before {
    content: "Dinheiro";
  }

  .receivables-table td:nth-child(7)::before {
    content: "Para entrar";
  }

  .receivables-table td:nth-child(8)::before {
    content: "Projeção";
  }

  .receivables-table td:nth-child(9)::before {
    content: "Total";
  }

  .weekly-flow-table .numeric,
  .receivables-table .numeric {
    white-space: nowrap;
  }

  .money-pill,
  .cashflow-balance {
    flex: 0 0 auto;
    justify-content: center;
    min-width: max-content;
  }
}

@media (max-width: 760px) {
  .factory-hub-shell {
    gap: 16px;
  }

  .factory-hub-shell .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    min-height: 0;
    padding-bottom: 8px;
  }

  .factory-hub-shell .hub-topbar h1 {
    font-size: 30px;
  }

  .factory-hub-shell .topbar-side {
    justify-self: end;
    align-items: flex-end;
    width: auto;
  }

  .factory-hub-shell .topbar-side .meta-stack {
    display: none;
    justify-items: end;
    gap: 3px;
    text-align: right;
    font-size: 11px;
  }

  .factory-hub-shell .brand-logo-link,
  .factory-hub-shell .portal-topbar .brand-logo-link {
    width: 76px;
    height: 68px;
  }

  .factory-hub-grid {
    grid-auto-rows: auto;
    gap: 12px;
  }

  .factory-hub-grid:not(.two) > .factory-hub-card.clients {
    grid-column: auto / span 1;
  }

  .factory-hub-card,
  .factory-hub-card.summary,
  .factory-hub-card.clients {
    min-height: 218px;
    padding: 16px 96px 16px 16px;
  }

  .factory-hub-card::before,
  .factory-hub-card .portal-card-icon {
    right: 14px;
    bottom: 18px;
    width: 70px;
    height: 70px;
  }

  .factory-hub-card .portal-card-title {
    font-size: 25px;
  }

  .factory-hub-card .portal-card-description {
    font-size: 13px;
    line-height: 1.38;
  }

  .factory-hub-card .portal-card-stats {
    max-width: calc(100% - 82px);
    gap: 6px;
    padding-top: 8px;
  }

  .factory-hub-card .portal-card-stats i {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .factory-hub-card .portal-card-action {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
  }
}
