:root {
  color-scheme: light;
  --bg: #f8ede4;
  --panel: #ffffff;
  --panel-soft: #fbf6f2;
  --text: #171717;
  --muted: #5f5b58;
  --line: #e4d8d0;
  --blue: #830a2c;
  --cyan: #a31842;
  --green: #1f6b48;
  --amber: #9a5a00;
  --brand: #830a2c;
  --brand-dark: #5f0822;
  --cream: #f8ede4;
  --shadow: 0 16px 44px rgba(54, 28, 36, 0.08);
  font-family: Montserrat, Avenir Next, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 8%, rgba(131, 10, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--cream) 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.login-portal {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-panel {
  display: grid;
  width: min(100%, 460px);
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  padding: 34px;
}

.login-panel__logo {
  width: min(100%, 250px);
  height: auto;
  justify-self: center;
}

.login-panel__copy {
  display: grid;
  gap: 8px;
  text-align: center;
}

.login-panel__copy h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1;
}

.login-panel__form {
  display: grid;
  gap: 16px;
}

.login-panel__form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.login-panel__form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
}

.login-panel__form input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(131, 10, 44, 0.14);
}

.login-panel__form button {
  min-height: 48px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}

.login-panel__form button:disabled,
.login-panel__form input:disabled {
  cursor: wait;
  opacity: 0.72;
}

.login-error {
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background: rgba(131, 10, 44, 0.08);
  color: var(--brand-dark);
  font-weight: 700;
  padding: 10px 12px;
}

.portal-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.portal-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 26px 20px;
}

.portal-logo-button {
  display: inline-flex;
  width: 210px;
  max-width: 100%;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}

.portal-logo-button:hover {
  opacity: 0.86;
}

.portal-logo-button:focus-visible {
  outline: 3px solid rgba(131, 10, 44, 0.18);
  outline-offset: 4px;
}

.portal-logo {
  width: 210px;
  max-width: 100%;
  height: auto;
}

.portal-copy {
  display: grid;
  gap: 8px;
}

.portal-copy strong {
  font-size: 1.1rem;
}

.portal-copy span,
.portal-header p,
.muted {
  color: var(--muted);
}

.audience-nav {
  display: grid;
  gap: 10px;
}

.audience-nav button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
  padding: 0 14px;
}

.audience-nav button span {
  color: var(--muted);
}

.audience-nav button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.audience-nav button.is-active span {
  color: rgba(255, 255, 255, 0.82);
}

.portal-logout-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  font-weight: 850;
  padding: 0 14px;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.portal-logout-button:hover {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.06);
  transform: translateY(-1px);
}

.portal-logout-button:focus-visible {
  outline: 3px solid rgba(131, 10, 44, 0.2);
  outline-offset: 2px;
}

.portal-main {
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 34px;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.portal-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
}

.portal-header p {
  margin: 8px 0 0;
}

.portal-header input {
  width: min(360px, 100%);
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.group-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 850;
  padding: 0 15px;
}

.group-tabs button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

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

.dashboard-tile {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-tile:hover {
  border-color: var(--brand);
  box-shadow: 0 14px 34px rgba(23, 23, 23, 0.08);
  transform: translateY(-2px);
}

.dashboard-tile span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-tile strong {
  font-size: 1rem;
  line-height: 1.22;
}

.sales-page {
  min-height: 100vh;
  padding: 22px;
  background:
    radial-gradient(circle at 10% 8%, rgba(131, 10, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--cream) 100%);
}

.sales-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(131, 10, 44, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--cream) 100%);
}

.sales-topbar {
  display: flex;
  max-width: 1480px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto 18px;
}

.sales-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sales-logo {
  width: 210px;
  max-width: 38vw;
  height: auto;
  object-fit: contain;
}

.sales-title h1 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1;
}

.sales-title--hero h1 {
  font-size: clamp(2.55rem, 4vw, 3.45rem);
  line-height: 0.95;
}

.sales-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.sales-mark {
  display: grid;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.2);
}

.lead-mark {
  background: linear-gradient(135deg, #f43f5e, var(--brand));
  box-shadow: 0 12px 28px rgba(131, 10, 44, 0.2);
}

.sales-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sales-actions input,
.back-button,
.refresh-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  padding: 8px 12px;
}

.refresh-button {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.refresh-button:hover,
.back-button:hover {
  border-color: var(--brand);
}

.sales-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  max-width: 1480px;
  margin: 0 auto;
}

.sales-filters {
  position: static;
  top: auto;
  align-self: start;
  display: grid;
  gap: 12px;
}

.filter-card,
.hero-kpis,
.metric-row article,
.analytics-card,
.loading-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filter-card {
  display: grid;
  gap: 13px;
  padding: 16px;
}

.filter-card small {
  color: var(--muted);
}

.lead-canal-card {
  gap: 14px;
}

.lead-canal-chart {
  display: grid;
  gap: 14px;
}

.lead-canal-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.9fr) minmax(68px, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.lead-canal-row span {
  min-width: 0;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.lead-canal-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e5df;
}

.lead-canal-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.lead-canal-row:nth-child(2) i {
  background: var(--green);
}

.lead-canal-row:nth-child(3) i {
  background: #b47b00;
}

.lead-canal-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 850;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 750;
  padding: 0 10px;
}

.chip.is-active {
  border-color: rgba(131, 10, 44, 0.24);
  background: rgba(131, 10, 44, 0.09);
  color: var(--brand);
}

.chip--reset {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.select-filter {
  width: 100%;
  min-height: 46px;
  appearance: none;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%) right 17px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--brand) 50%, transparent 50%) right 12px center / 7px 7px no-repeat,
    linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
  padding: 0 42px 0 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.select-filter:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(131, 10, 44, 0.08);
}

.select-filter:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(131, 10, 44, 0.12);
}

.simple-filter {
  position: relative;
  z-index: 4;
}

.simple-filter.is-open {
  z-index: 40;
}

.simple-filter-trigger {
  position: relative;
  z-index: 3;
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--brand) 50%) right 17px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--brand) 50%, transparent 50%) right 12px center / 7px 7px no-repeat,
    linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
  color: var(--text);
  font-weight: 850;
  padding: 0 42px 0 14px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.simple-filter-trigger:hover,
.simple-filter.is-open .simple-filter-trigger {
  border-color: var(--brand);
  box-shadow: 0 10px 24px rgba(131, 10, 44, 0.08);
}

.simple-filter-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-filter-trigger em {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(131, 10, 44, 0.1);
  color: var(--brand);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 900;
}

.simple-filter-trigger:not(.has-selection) em {
  display: none;
}

.simple-filter--single .simple-filter-trigger.has-selection {
  border-color: rgba(131, 10, 44, 0.38);
  color: var(--brand);
}

.simple-filter-menu {
  position: absolute;
  top: 54px;
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  max-height: 318px;
  overflow-y: auto;
  border: 1px solid rgba(131, 10, 44, 0.2);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 46px rgba(54, 28, 36, 0.18);
  padding: 8px;
}

.simple-filter-menu[hidden] {
  display: none !important;
}

.simple-filter-option,
.simple-filter-reset {
  display: grid;
  min-height: 38px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 760;
  padding: 7px 9px;
  text-align: left;
}

.simple-filter-option:hover,
.simple-filter-reset:hover {
  background: rgba(131, 10, 44, 0.06);
}

.simple-filter--single .simple-filter-option:hover {
  background: var(--brand);
  color: #fff;
}

.simple-filter-option.is-selected {
  background: rgba(131, 10, 44, 0.1);
  color: var(--brand);
  font-weight: 900;
}

.simple-filter--single .simple-filter-option.is-selected {
  background: var(--brand);
  color: #fff;
}

.simple-filter-option i,
.simple-filter-reset::before {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(131, 10, 44, 0.28);
  border-radius: 6px;
  color: #fff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.simple-filter-option.is-selected i {
  border-color: var(--brand);
  background: var(--brand);
}

.simple-filter-option.is-selected i::after {
  width: 8px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.simple-filter--single .simple-filter-option:hover i,
.simple-filter--single .simple-filter-option.is-selected i {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.14);
}

.simple-filter-option span,
.simple-filter-reset span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-filter-reset {
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 8px 8px 4px 4px;
  color: var(--brand);
  font-weight: 900;
}

.simple-filter-reset::before {
  border-color: transparent;
  color: var(--brand);
  content: "×";
}

.simple-filter-empty {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px dashed rgba(131, 10, 44, 0.22);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

.simple-filter-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.simple-filter-tag {
  display: inline-flex;
  min-height: 30px;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 999px;
  background: rgba(131, 10, 44, 0.06);
  color: var(--brand);
  font-weight: 900;
  padding: 0 8px 0 12px;
}

.simple-filter-tag span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-filter-tag b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  line-height: 1;
}

.simple-filter-tag:hover {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.1);
}

.filter-static-value {
  display: inline-flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background: rgba(131, 10, 44, 0.06);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 900;
}

.sales-content {
  display: grid;
  gap: 18px;
}

.leads-page .sales-layout {
  align-items: stretch;
}

.leads-page .sales-layout > .sales-filters,
.leads-page .sales-layout > .sales-content {
  align-self: stretch;
}

.leads-page .sales-layout > .sales-filters {
  grid-template-rows: auto minmax(0, 1fr);
}

.leads-page .sales-layout > .sales-filters > .lead-canal-card {
  min-height: 0;
  height: 100%;
  align-content: start;
}

.b2b-dashboard-layout {
  grid-template-columns: 1fr;
}

.b2b-top-filters {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.b2b-top-filters .filter-card {
  width: 100%;
}

.hero-kpis {
  display: grid;
  grid-template-columns: 1.5fr repeat(2, minmax(150px, 0.55fr));
  gap: 12px;
  padding: 14px;
}

.main-kpi {
  position: relative;
  display: grid;
  min-height: 178px;
  gap: 12px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 36%),
    linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: white;
  padding: 20px;
}

.main-kpi span,
.side-kpi span,
.metric-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.main-kpi span {
  color: rgba(255, 255, 255, 0.74);
}

.main-kpi strong {
  font-size: clamp(2.25rem, 4vw, 4.1rem);
  line-height: 0.95;
}

.main-kpi div {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.main-kpi em {
  color: rgba(255, 255, 255, 0.82);
  font-style: normal;
}

.budget-line {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.2;
  text-transform: none;
}

.budget-line--light {
  color: rgba(255, 255, 255, 0.8);
}

.budget-line b {
  font-size: 0.9rem;
  font-weight: 900;
}

.budget-line .is-positive {
  color: var(--green);
}

.budget-line .is-negative {
  color: #c62828;
}

.budget-line--light .is-positive {
  color: #a7f3d0;
}

.budget-line--light .is-negative {
  color: #fecaca;
}

.info-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.info-dot:hover {
  background: #fff;
  color: var(--brand);
}

.spark {
  height: 48px;
  align-items: end;
  margin-top: auto;
}

.spark i {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #ffffff, #f0b5c7);
}

.side-kpi {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  padding: 18px;
}

.side-kpi strong {
  color: var(--green);
  font-size: clamp(1.45rem, 2vw, 1.72rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.side-kpi--warning strong {
  color: var(--amber);
}

.side-kpi--large strong {
  color: var(--green);
  font-size: clamp(2.35rem, 4vw, 4.1rem);
  line-height: 0.95;
}

.sales-hero-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.sales-hero-kpis .sales-kpi-card {
  min-height: 180px;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  gap: 12px;
}

.sales-hero-kpis .sales-kpi-card > span {
  align-self: start;
}

.sales-hero-kpis .sales-kpi-card > strong {
  align-self: center;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.sales-hero-kpis .main-kpi > strong,
.sales-hero-kpis .side-kpi > strong {
  font-size: clamp(2rem, 3vw, 3rem);
}

.sales-hero-kpis .budget-line {
  align-self: end;
}

.side-kpi--gap {
  grid-template-rows: auto 1fr;
  justify-items: center;
  text-align: center;
}

.side-kpi--gap > span {
  justify-self: start;
}

.side-kpi--gap > strong {
  align-self: center;
  justify-self: center;
}

.side-kpi--gap.is-negative > strong {
  color: #c62828;
}

.side-kpi--gap.is-positive > strong {
  color: var(--green);
}

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

.ads-top-filters {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 420px);
}

.ads-top-filters .filter-card {
  width: 100%;
  min-height: 0;
}

.ads-hero-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.ads-hero-kpis > article {
  display: grid;
  min-height: 178px;
  grid-template-rows: auto 1fr auto;
  align-content: stretch;
  justify-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.ads-hero-kpis > article > span {
  justify-self: start;
  align-self: start;
  font-size: 0.82rem;
}

.ads-hero-kpis > article > strong {
  align-self: center;
  justify-self: center;
  font-size: clamp(2.8rem, 4vw, 3.85rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  overflow-wrap: normal;
}

.ads-hero-kpis > article > small,
.ads-hero-kpis > article > em {
  align-self: end;
  justify-self: start;
  max-width: 100%;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: left;
}

.ads-hero-kpis .main-kpi em {
  color: rgba(255, 255, 255, 0.86);
}

.ads-roi-card.is-roi-good strong,
.ads-roi-card.is-roi-good small,
.ads-leader-row .is-roi-good,
.ads-table .is-roi-good {
  color: var(--green);
}

.ads-roi-card.is-roi-medium strong,
.ads-roi-card.is-roi-medium small,
.ads-leader-row .is-roi-medium,
.ads-table .is-roi-medium {
  color: var(--amber);
}

.ads-roi-card.is-roi-low strong,
.ads-roi-card.is-roi-low small,
.ads-leader-row .is-roi-low,
.ads-table .is-roi-low {
  color: #c62828;
}

.metric-row.ads-metric-row {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-row.ads-metric-row article {
  min-width: 0;
  min-height: 128px;
  width: 100%;
  grid-template-rows: auto auto auto;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.metric-row.ads-metric-row span,
.metric-row.ads-metric-row small {
  justify-self: center;
  align-self: center;
  text-align: center;
}

.metric-row.ads-metric-row strong {
  justify-self: center;
  align-self: center;
  font-size: clamp(2.25rem, 3.35vw, 3.05rem);
  line-height: 1;
  white-space: nowrap;
}

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

.ads-cpl-card {
  display: grid;
  gap: 16px;
  width: 100%;
}

.ads-leader-row {
  grid-template-columns: minmax(170px, 0.25fr) minmax(260px, 0.75fr) minmax(260px, max-content);
  column-gap: 28px;
}

.ads-leader-row > strong,
.ads-leader-row > span {
  min-width: 0;
}

.ads-leader-row > span {
  width: 100%;
}

.ads-leader-row em {
  min-width: 260px;
  justify-self: end;
  font-size: 1rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.ads-leader-row em b {
  font: inherit;
}

.ads-leader-row em.is-positive,
.ads-table .is-positive,
.ads-insight-list .is-positive {
  color: var(--green);
}

.ads-leader-row em.is-negative,
.ads-table .is-negative,
.ads-insight-list .is-negative {
  color: #c62828;
}

.ads-insight-list {
  display: grid;
  gap: 10px;
}

.ads-insight-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 10px;
  background: rgba(251, 246, 242, 0.78);
  color: var(--muted);
  font-weight: 850;
  padding: 12px;
}

.ads-insight-list b {
  color: var(--text);
  font-weight: 950;
  white-space: nowrap;
}

.ads-table-card {
  overflow: hidden;
}

.ads-table {
  min-width: 1180px;
  font-size: 0.98rem;
}

.ads-table th,
.ads-table td {
  padding: 12px 10px;
  font-size: 0.98rem;
  line-height: 1.22;
  white-space: nowrap;
}

.ads-table thead th {
  font-size: 0.74rem;
}

.ads-table tbody th {
  min-width: 180px;
  font-size: 1rem;
}

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

.metric-row article {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  gap: 12px;
  padding: 16px;
}

.metric-row strong {
  font-size: clamp(1.35rem, 1.8vw, 1.55rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.next-budget-section {
  gap: 16px;
}

.next-budget-section header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.next-budget-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.next-budget-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 116px;
  border: 1px solid rgba(228, 216, 208, 0.92);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, rgba(251, 246, 242, 0.78));
  padding: 14px;
}

.next-budget-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.next-budget-card strong {
  color: var(--brand);
  font-size: clamp(1.05rem, 1.45vw, 1.42rem);
  line-height: 1.05;
  white-space: nowrap;
}

.next-budget-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 18px;
}

.ads-page .ads-grid {
  grid-template-columns: minmax(0, 1fr);
}

.ads-page .ads-ranking-card {
  width: 100%;
}

.analytics-card {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 20px;
}

.analytics-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.analytics-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.source-row,
.leader-row {
  display: grid;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.analytics-card--origins {
  align-content: start;
  gap: 12px;
}

.analytics-card--origins header {
  margin-bottom: 0;
}

.source-row {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  min-height: 0;
  border: 1px solid rgba(228, 216, 208, 0.92);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, rgba(251, 246, 242, 0.72));
  padding: 12px;
}

.leader-row {
  grid-template-columns: minmax(120px, 1fr) 1.2fr 92px;
}

.source-row:first-of-type {
  border-top: 1px solid rgba(228, 216, 208, 0.92);
}

.source-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.22;
  overflow-wrap: normal;
}

.source-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  justify-self: stretch;
  min-width: 0;
}

.source-metric {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(228, 216, 208, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.source-metric header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.source-metric header span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.source-metric header strong {
  color: var(--brand);
  font-size: 1.14rem;
  font-weight: 950;
  line-height: 1.05;
  text-align: right;
  white-space: nowrap;
}

.source-metric--muted header strong {
  color: var(--green);
}

.source-metric-details {
  display: grid;
  gap: 6px;
}

.source-metric-details small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border-radius: 8px;
  background: rgba(251, 246, 242, 0.95);
  padding: 7px 8px;
}

.source-metric-details span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.03em;
  line-height: 1;
  text-transform: uppercase;
}

.source-metric-details b {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1.08;
  text-align: right;
  white-space: nowrap;
}

.source-metric-details .is-positive {
  color: var(--green);
}

.source-metric-details .is-negative {
  color: #c62828;
}

.source-row em,
.leader-row em {
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.source-bars {
  display: grid;
  gap: 6px;
}

.source-bars span,
.leader-row span {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e5df;
}

.source-bars i,
.leader-row i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.source-bars span + span i {
  background: var(--green);
}

.leader-row i {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
}

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

.leads-analysis-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(420px, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.leads-analysis-main,
.leads-analysis-side {
  display: grid;
  gap: 18px;
}

.leads-analysis-main .lead-card {
  min-height: 100%;
}

.lead-card {
  align-content: start;
}

.lead-card--wide {
  min-height: 100%;
}

.lead-row {
  grid-template-columns: minmax(112px, 0.8fr) minmax(90px, 1fr) minmax(150px, auto);
}

.lead-row strong {
  overflow-wrap: anywhere;
}

.lead-row em {
  min-width: 150px;
  white-space: nowrap;
}

.lead-date-row {
  grid-template-columns: 112px 1fr minmax(190px, 0.8fr);
}

.lead-list-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 112px minmax(180px, 0.65fr) 92px;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.lead-list-row span,
.lead-list-row em {
  color: var(--muted);
  font-style: normal;
}

.lead-list-row em {
  font-weight: 850;
  text-align: right;
}

.lead-calendar-card {
  gap: 18px;
}

.lead-calendar-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.calendar-range-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 108px;
  min-width: 108px;
  height: 34px;
  border: 1px solid rgba(131, 10, 44, 0.2);
  border-radius: 999px;
  background: #fff;
  padding: 3px;
  overflow: hidden;
}

.calendar-range-toggle button {
  min-width: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.calendar-range-toggle button.is-active {
  background: var(--brand);
  color: #fff;
}

.calendar-range-toggle button:not(.is-active):hover {
  color: var(--brand);
  background: rgba(131, 10, 44, 0.08);
}

.lead-calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 10px;
}

.lead-calendar-grid--7 {
  grid-template-columns: repeat(7, minmax(92px, 1fr));
}

.lead-calendar-grid--30 {
  grid-template-columns: repeat(6, minmax(118px, 1fr));
}

.lead-calendar-day {
  display: grid;
  min-height: 88px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  padding: 12px;
}

.lead-calendar-day span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: normal;
}

.lead-calendar-day strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
}

.lead-calendar-day.has-leads {
  border-color: rgba(131, 10, 44, 0.24);
  background: rgba(131, 10, 44, 0.07);
}

.lead-calendar-day.has-leads strong {
  color: var(--brand);
}

.annual-leads-card {
  gap: 18px;
}

.leads-page .sales-layout > .lead-calendar-card,
.leads-page .sales-layout > .leads-latest-card {
  grid-column: 1 / -1;
  width: 100%;
}

.annual-leads-card h2 {
  font-size: 1.45rem;
}

.annual-leads-chart {
  display: grid;
  gap: 14px;
}

.annual-leads-chart svg {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--panel-soft) 100%);
}

.chart-grid-line {
  stroke: rgba(228, 216, 208, 0.95);
  stroke-width: 1;
}

.chart-month-label {
  fill: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-anchor: middle;
  text-transform: uppercase;
}

.pipeline-axis-label {
  text-anchor: end;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-linejoin: round;
  stroke-width: 7px;
}

.chart-y-label {
  fill: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-anchor: end;
}

.annual-leads-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.annual-leads-point {
  cursor: pointer;
  opacity: 0;
  stroke: #fff;
  stroke-width: 2;
}

.chart-point-group:hover .annual-leads-point {
  opacity: 1;
}

.chart-tooltip {
  display: none;
  paint-order: stroke;
  fill: var(--brand);
  font-size: 0.86rem;
  font-weight: 950;
  stroke: #fff;
  stroke-width: 5px;
  text-anchor: middle;
}

.chart-point-group:hover .chart-tooltip {
  display: block;
}

.annual-leads-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.annual-leads-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
}

.annual-leads-legend i {
  display: inline-block;
  width: 20px;
  height: 4px;
  border-radius: 999px;
}

.summary-card {
  grid-column: 1 / -1;
  overflow: hidden;
}

.summary-table-wrap {
  overflow-x: visible;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.66rem;
}

.summary-col-zone {
  width: 23%;
}

.summary-col-count {
  width: 5%;
}

.summary-col-money {
  width: 9%;
}

.summary-col-money-wide {
  width: 10%;
}

.summary-col-rate {
  width: 8%;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid rgba(228, 216, 208, 0.9);
  padding: 7px 4px;
  text-align: right;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--brand);
  color: #fff;
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.summary-table th:first-child,
.summary-table td:first-child {
  text-align: left;
}

.ads-table-card .summary-table-wrap {
  overflow-x: auto;
}

.ads-table-card .ads-table {
  min-width: 1180px;
  table-layout: auto;
  font-size: 1.08rem;
}

.ads-table-card .ads-table th,
.ads-table-card .ads-table td {
  padding: 13px 12px;
  font-size: 1.02rem;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.ads-table-card .ads-table thead th {
  font-size: 0.82rem;
  line-height: 1.05;
}

.ads-table-card .ads-table tbody th {
  min-width: 190px;
  font-size: 1.04rem;
}

.summary-row th {
  min-width: 0;
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.summary-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.summary-row--zone,
.summary-row--total {
  background: #0b0b0b;
  color: #fff;
  font-weight: 900;
}

.summary-row--zone th {
  background: var(--brand);
}

.summary-row--commercial {
  background: #fbf6f2;
  font-weight: 850;
}

.summary-row--commercial th {
  padding-left: 14px;
  color: var(--brand-dark);
}

.summary-row--canal th {
  padding-left: 30px;
  font-weight: 700;
}

.summary-row--total th {
  background: var(--brand);
}

.summary-toggle {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  font-size: 0.65rem;
}

.summary-spacer {
  width: 16px;
  flex: 0 0 16px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(23, 23, 23, 0.42);
  padding: 28px;
}

.opportunity-modal {
  display: grid;
  width: min(940px, 96vw);
  max-height: min(760px, 88vh);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(131, 10, 44, 0.2);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(23, 23, 23, 0.28);
}

.recap-modal {
  display: grid;
  width: min(520px, 96vw);
  gap: 20px;
  border: 1px solid rgba(131, 10, 44, 0.2);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(23, 23, 23, 0.28);
  padding: 22px;
}

.recap-modal header,
.recap-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.recap-modal h2 {
  margin: 0;
  font-size: 1.18rem;
}

.recap-modal p {
  margin: 6px 0 0;
  color: var(--muted);
}

.recap-date-grid {
  display: grid;
  gap: 12px;
}

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

.recap-date-range .date-control {
  width: 100%;
  min-width: 0;
  height: 46px;
  background: var(--panel-soft);
}

.recap-date-range .date-picker-popover {
  right: 0;
  left: auto;
  z-index: 120;
}

.recap-error {
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 8px;
  background: rgba(131, 10, 44, 0.08);
  color: var(--brand-dark);
  font-weight: 800;
  padding: 10px 12px;
}

.recap-visual-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 4%, rgba(131, 10, 44, 0.12), transparent 28%),
    linear-gradient(180deg, #fff 0%, #f4ece8 100%);
  padding: 22px;
}

.recap-visual-toolbar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto 20px;
  border: 1px solid rgba(131, 10, 44, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 50px rgba(43, 31, 31, 0.12);
  backdrop-filter: blur(18px);
  padding: 16px 18px;
}

.recap-visual-toolbar span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recap-visual-toolbar h1 {
  margin: 2px 0;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.recap-visual-toolbar p {
  margin: 0;
  color: var(--muted);
}

.recap-visual-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.recap-visual-stack {
  display: grid;
  gap: 28px;
  max-width: 1500px;
  margin: 0 auto;
}

.recap-screenshot {
  overflow: hidden;
  border: 1px solid rgba(131, 10, 44, 0.16);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(43, 31, 31, 0.14);
}

.recap-screenshot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 14px 18px;
}

.recap-screenshot-header > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.recap-screenshot-header small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}

.recap-screenshot-header strong {
  display: block;
  margin-top: 2px;
  font-size: 1.1rem;
}

.recap-screenshot-body {
  background: #f6efec;
  pointer-events: none;
}

.recap-screenshot-body > .sales-shell,
.recap-screenshot-body > .portal-shell {
  min-height: auto;
}

.recap-screenshot-body .portal-sidebar {
  position: relative;
  min-height: 900px;
}

.recap-screenshot-body .sales-page {
  min-height: 900px;
}

.opportunity-modal header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 20px 22px;
}

.opportunity-modal h2 {
  margin: 0;
  font-size: 1.15rem;
}

.opportunity-modal p {
  margin: 5px 0 0;
  color: var(--muted);
}

.modal-close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(131, 10, 44, 0.2);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand);
  font-weight: 900;
  padding: 0;
}

.modal-close:hover {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.08);
}

.opportunity-table-wrap {
  overflow: auto;
}

.opportunity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.opportunity-table th,
.opportunity-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  text-align: right;
  vertical-align: top;
}

.opportunity-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--brand);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.opportunity-table th:first-child,
.opportunity-table td:first-child {
  text-align: left;
}

.opportunity-table tbody th {
  color: var(--text);
  font-weight: 850;
}

.opportunity-table tbody td {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.budget-cell {
  min-width: 0;
  color: var(--muted);
}

.budget-rate-cell {
  color: var(--text);
  font-weight: 850;
}

.budget-gap-cell {
  font-weight: 950;
}

.budget-gap-cell.is-positive {
  color: var(--green);
}

.budget-gap-cell.is-negative {
  color: #d32f2f;
}

.summary-row--zone .budget-cell,
.summary-row--zone .budget-rate-cell,
.summary-row--total .budget-cell,
.summary-row--total .budget-rate-cell {
  color: #fff;
}

.summary-row--zone .budget-gap-cell.is-positive,
.summary-row--total .budget-gap-cell.is-positive {
  color: #8fd8a9;
}

.summary-row--zone .budget-gap-cell.is-negative,
.summary-row--total .budget-gap-cell.is-negative {
  color: #ffb3b3;
}

.leads-page .hero-kpis > article {
  display: grid;
  grid-template-rows: minmax(34px, auto) 1fr minmax(18px, auto);
  align-items: center;
  min-height: 178px;
  text-align: center;
}

.leads-page .hero-kpis > article > span {
  align-self: start;
  justify-self: center;
}

.leads-page .hero-kpis > article > strong {
  align-self: center;
  justify-self: center;
  font-size: clamp(3.1rem, 4.4vw, 4.1rem);
  line-height: 0.95;
  text-align: center;
}

.leads-page .hero-kpis > article > small {
  align-self: end;
  justify-self: center;
}

.leads-page .hero-kpis .side-kpi {
  align-content: initial;
}

.leads-page .filter-card,
.leads-page .side-kpi,
.leads-page .metric-row article,
.leads-page .analytics-card,
.leads-page .lead-calendar-day,
.leads-page .lead-list-row {
  overflow-wrap: anywhere;
}

.leads-page .filter-card strong,
.leads-page .filter-card small,
.leads-page .metric-row span,
.leads-page .side-kpi span,
.leads-page .side-kpi small,
.leads-page .analytics-card h2,
.leads-page .analytics-card p,
.leads-page .leader-row strong,
.leads-page .leader-row em,
.leads-page .lead-list-row strong,
.leads-page .lead-list-row span,
.leads-page .lead-list-row em {
  white-space: normal;
  min-width: 0;
}

.empty-state,
.loading-panel {
  color: var(--muted);
  text-align: center;
}

.inline-notice {
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 12px;
  background: rgba(131, 10, 44, 0.06);
  color: var(--brand);
  font-weight: 700;
  padding: 14px 16px;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 24px;
}

.loading-panel {
  max-width: 1480px;
  margin: 0 auto;
  padding: 34px;
}

.loading-panel--error {
  color: #dc2626;
}

@media (max-width: 1180px) {
  .sales-layout,
  .sales-shell,
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar,
  .sales-filters {
    position: static;
    height: auto;
  }

  .sales-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .next-budget-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .main-kpi {
    grid-column: 1 / -1;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .lead-distribution-grid {
    grid-template-columns: 1fr;
  }

  .leads-analysis-grid {
    grid-template-columns: 1fr;
  }

  .lead-calendar-grid {
    grid-template-columns: repeat(6, minmax(72px, 1fr));
  }

  .lead-calendar-grid--7 {
    grid-template-columns: repeat(7, minmax(72px, 1fr));
  }

  .lead-calendar-grid--30 {
    grid-template-columns: repeat(6, minmax(72px, 1fr));
  }

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

@media (max-width: 760px) {
  .portal-main,
  .portal-sidebar,
  .sales-page {
    padding: 18px;
  }

  .portal-header,
  .sales-topbar,
  .sales-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sales-logo {
    width: 190px;
    max-width: 100%;
  }

  .sales-filters,
  .hero-kpis,
  .metric-row,
  .next-budget-grid,
  .dashboard-grid,
  .lead-calendar-grid {
    grid-template-columns: 1fr;
  }

  .source-row,
  .leader-row,
  .lead-date-row,
  .lead-list-row {
    grid-template-columns: 1fr;
  }

  .source-metrics {
    justify-self: stretch;
  }

  .source-metrics span {
    text-align: left;
  }

  .source-row em,
  .leader-row em,
  .lead-list-row em {
    text-align: left;
  }
}

/* Uniform button treatment */
button {
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audience-nav button,
.group-tabs button,
.dashboard-tile,
.chip,
.back-button,
.refresh-button,
.sales-actions input {
  border-radius: 8px;
}

.audience-nav button,
.group-tabs button,
.chip,
.back-button,
.refresh-button {
  min-width: 132px;
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.audience-nav button:hover,
.group-tabs button:hover,
.chip:hover,
.back-button:hover,
.refresh-button:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.audience-nav button:hover span,
.audience-nav button.is-active span {
  color: rgba(255, 255, 255, 0.86);
}

.audience-nav button.is-active,
.group-tabs button.is-active,
.chip.is-active,
.chip--reset,
.refresh-button {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.dashboard-grid {
  grid-template-columns: repeat(auto-fill, minmax(224px, 224px));
  align-items: start;
}

.dashboard-tile {
  width: 224px;
  height: 132px;
  min-height: 132px;
  max-width: 224px;
  align-content: space-between;
}

.dashboard-tile span,
.dashboard-tile strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-tile:hover,
.dashboard-tile.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.dashboard-tile:hover span,
.dashboard-tile.is-active span {
  color: rgba(255, 255, 255, 0.86);
}

.dashboard-tile:hover strong,
.dashboard-tile.is-active strong {
  color: #fff;
}

@media (max-width: 760px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-tile {
    width: 100%;
    max-width: none;
  }

  .activity-category-grid,
  .activity-timing-grid {
    grid-template-columns: 1fr;
  }

  .audience-nav button,
  .group-tabs button,
  .chip,
  .back-button,
  .refresh-button {
    min-width: 0;
    width: 100%;
  }
}

/* Filter cards sizing */
.sales-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.sales-filters {
  width: 300px;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
}

.filter-card {
  width: 300px;
  height: auto;
  min-height: 0;
  align-content: start;
}

.filter-card .chips {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
}

.filter-card .chip {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.ads-page .sales-layout,
.ads-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.ads-page .sales-content {
  width: 100%;
  min-width: 0;
}

.ads-page .sales-filters,
.ads-page .filter-card {
  width: 100%;
}

.ads-page .ads-top-filters {
  grid-template-columns: minmax(240px, 420px);
}

.activities-page .sales-content {
  width: 100%;
  min-width: 0;
}

.activities-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.activities-top-filters {
  grid-template-columns: minmax(240px, 420px);
  width: 100%;
}

.activities-page .filter-card {
  width: 100%;
}

.activities-hero-kpis {
  grid-template-columns: minmax(320px, 1.4fr) minmax(210px, 0.8fr) minmax(210px, 0.8fr);
}

.activities-hero-kpis > article {
  min-height: 170px;
}

.activities-hero-kpis > article > strong {
  font-size: clamp(2.35rem, 4vw, 4.1rem);
  line-height: 0.95;
}

.activities-hero-kpis .main-kpi em,
.activities-hero-kpis .side-kpi small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 850;
}

.activities-hero-kpis .side-kpi small {
  color: var(--muted);
}

.activity-category-grid,
.activity-timing-grid {
  display: grid;
  gap: 12px;
}

.activity-category-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.activity-timing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.activity-category-card,
.activity-timing-card {
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 126px;
  padding: 16px;
}

.activity-category-card span,
.activity-timing-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-category-card strong,
.activity-timing-card strong {
  color: var(--brand);
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
  line-height: 1;
  white-space: nowrap;
}

.activity-timing-card strong {
  color: var(--green);
}

.activity-category-card small,
.activity-timing-card small {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.3;
}

.activity-table-card,
.activity-latest-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.activity-table-card header,
.activity-latest-card header {
  display: grid;
  gap: 4px;
}

.activity-table-card h2,
.activity-latest-card h2 {
  font-size: 1.08rem;
}

.activity-table-card p,
.activity-latest-card p {
  color: var(--muted);
}

.activity-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.activity-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.activity-table th,
.activity-table td {
  border-bottom: 1px solid rgba(228, 216, 208, 0.92);
  padding: 11px 10px;
  text-align: right;
  white-space: nowrap;
}

.activity-table th:first-child,
.activity-table td:first-child {
  text-align: left;
}

.activity-table thead th {
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-table tbody th {
  color: var(--brand);
  font-weight: 900;
}

.activity-latest-card .opportunity-table {
  min-width: 1100px;
}

.appointments-page .sales-content {
  width: 100%;
  min-width: 0;
}

.appointments-layout {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.appointments-top-filters {
  grid-template-columns: minmax(260px, 480px);
  width: 100%;
}

.appointments-page .filter-card {
  width: 100%;
}

.appointments-hero-kpis {
  grid-template-columns: minmax(320px, 1.45fr) repeat(3, minmax(190px, 0.75fr));
}

.appointments-hero-kpis > article {
  min-height: 164px;
}

.appointments-hero-kpis > article > strong {
  font-size: clamp(2.1rem, 3.4vw, 3.6rem);
  line-height: 0.95;
}

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

.appointment-split-card,
.appointment-ranking-card,
.appointment-table-card,
.appointment-list-card,
.appointment-cadence-card {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.appointment-split-card header,
.appointment-ranking-card header,
.appointment-table-card header,
.appointment-list-card header,
.appointment-cadence-card header {
  display: grid;
  gap: 4px;
}

.appointment-split-card h2,
.appointment-ranking-card h2,
.appointment-table-card h2,
.appointment-list-card h2,
.appointment-cadence-card h2 {
  font-size: 1.08rem;
}

.appointment-split-card p,
.appointment-ranking-card p,
.appointment-table-card p,
.appointment-list-card p,
.appointment-cadence-card p {
  color: var(--muted);
}

.appointment-cadence-wrap {
  overflow-x: auto;
  padding-bottom: 2px;
}

.appointment-cadence-grid {
  display: grid;
  min-width: 1040px;
  grid-template-columns: minmax(160px, 0.9fr) repeat(8, minmax(78px, 1fr)) minmax(128px, 0.75fr);
  align-items: stretch;
  gap: 8px;
}

.appointment-cadence-head,
.appointment-cadence-name,
.appointment-cadence-cell,
.appointment-cadence-foot {
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 10px;
  background: rgba(251, 246, 242, 0.76);
}

.appointment-cadence-head {
  display: grid;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 9px 8px;
  text-align: center;
}

.appointment-cadence-head strong {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.appointment-cadence-head span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.appointment-cadence-head.is-current {
  border-color: rgba(131, 10, 44, 0.34);
  background: rgba(131, 10, 44, 0.08);
}

.appointment-cadence-commercial,
.appointment-cadence-summary {
  text-align: left;
}

.appointment-cadence-name {
  display: grid;
  min-height: 58px;
  align-items: center;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 950;
  padding: 10px 12px;
}

.appointment-cadence-cell {
  position: relative;
  display: grid;
  min-height: 58px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  transition: filter 0.15s ease, transform 0.15s ease;
}

.appointment-cadence-cell:hover {
  filter: brightness(1.08);
}

.appointment-cadence-cell.is-high {
  border-color: rgba(30, 112, 76, 0.42);
  background: var(--green);
}

.appointment-cadence-cell.is-medium {
  border-color: rgba(154, 90, 0, 0.42);
  background: var(--amber);
}

.appointment-cadence-cell.is-low {
  border-color: rgba(131, 10, 44, 0.42);
  background: var(--brand);
}

.appointment-cadence-cell strong {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 950;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.appointment-cadence-foot {
  display: grid;
  min-height: 58px;
  align-content: center;
  gap: 3px;
  padding: 9px 10px;
}

.appointment-cadence-foot strong {
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 950;
}

.appointment-cadence-foot span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.appointment-cadence-empty {
  grid-column: 1 / -1;
}

.appointment-cadence-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.appointment-cadence-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.appointment-cadence-legend i {
  width: 22px;
  height: 6px;
  border-radius: 999px;
}

.appointment-cadence-legend .is-high {
  background: var(--green);
}

.appointment-cadence-legend .is-medium {
  background: var(--amber);
}

.appointment-cadence-legend .is-low {
  background: var(--brand);
}

.appointment-split-bar {
  display: flex;
  min-height: 42px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(228, 216, 208, 0.82);
}

.appointment-split-bar i {
  display: grid;
  min-width: 3px;
  place-items: center;
  color: #fff;
  font-style: normal;
  font-weight: 950;
  transition: filter 0.15s ease;
}

.appointment-split-bar i:hover {
  filter: brightness(1.08);
}

.appointment-split-bar .is-past,
.appointment-split-legend .is-past {
  background: var(--brand);
}

.appointment-split-bar .is-upcoming,
.appointment-split-legend .is-upcoming {
  background: var(--green);
}

.appointment-split-bar span {
  padding: 0 12px;
  white-space: nowrap;
}

.appointment-split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.appointment-split-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.appointment-split-legend i {
  width: 22px;
  height: 6px;
  border-radius: 999px;
}

.appointment-ranking-row {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.8fr) minmax(150px, auto);
}

.appointment-table {
  min-width: 1060px;
}

.appointment-list {
  display: grid;
  gap: 10px;
}

.appointment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(228, 216, 208, 0.92);
  padding-top: 10px;
}

.appointment-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.appointment-item strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 950;
}

.appointment-item span,
.appointment-item time span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.appointment-item time {
  display: grid;
  justify-items: end;
  gap: 2px;
  color: var(--brand);
  font-weight: 950;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .sales-filters,
  .filter-card {
    width: 100%;
  }

  .activity-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .activity-timing-grid,
  .activities-hero-kpis,
  .appointments-hero-kpis,
  .appointments-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .activity-category-grid,
  .appointment-ranking-row,
  .appointment-item,
  .activity-timing-grid {
    grid-template-columns: 1fr;
  }
}

.rank-badge {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  margin-right: 10px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
}

.leader-row strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.date-control {
  display: inline-flex;
  height: 42px;
  min-width: 188px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-weight: 850;
  padding: 0 12px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.date-control span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.date-control input {
  width: 122px;
  min-height: 0;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  padding: 0;
}

.date-control:focus-within,
.date-control:hover {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.06);
}

.date-control input:focus {
  outline: none;
}

@media (max-width: 760px) {
  .date-control {
    width: 100%;
  }

  .date-control input {
    width: 100%;
  }
}

/* Period controls */
.sales-actions .date-control {
  min-width: 164px;
}

.sales-actions .date-control input {
  width: 116px;
}

@media (max-width: 760px) {
  .sales-actions .date-control {
    width: 100%;
    min-width: 0;
  }
}

/* Custom period picker */
.date-range-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.date-control--button {
  cursor: pointer;
  appearance: none;
  min-width: 164px;
}

.date-control--button strong {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
  white-space: nowrap;
}

.date-control--button em {
  color: var(--brand);
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.date-control--button:hover,
.date-control--button:focus-visible {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.06);
  outline: none;
}

.date-picker-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 318px;
  border: 1px solid rgba(131, 10, 44, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(34, 30, 27, 0.18);
  padding: 14px;
}

.date-picker-head {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-picker-head strong,
.date-picker-title {
  text-align: center;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 900;
  text-transform: capitalize;
}

.date-picker-title {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.date-picker-title:hover,
.date-picker-title:focus-visible {
  border-color: var(--brand);
  background: rgba(131, 10, 44, 0.06);
  color: var(--brand);
  outline: none;
}

.date-picker-nav {
  width: 38px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--brand);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.date-picker-nav:hover,
.date-picker-nav:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  outline: none;
}

.date-picker-weekdays,
.date-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.date-picker-weekdays {
  margin-bottom: 6px;
}

.date-picker-weekdays span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.date-picker-yearbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  background: var(--soft);
}

.date-picker-yearbar strong {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 950;
}

.date-picker-yearbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 900;
}

.date-picker-yearbar button:hover,
.date-picker-yearbar button:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  outline: none;
}

.date-picker-months {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.date-picker-month {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  text-transform: capitalize;
}

.date-picker-month:hover,
.date-picker-month:focus-visible,
.date-picker-month.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  outline: none;
}

.date-picker-blank,
.date-picker-day {
  height: 34px;
}

.date-picker-day {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.date-picker-day:hover,
.date-picker-day:focus-visible,
.date-picker-day.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  outline: none;
}

.date-picker-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.date-picker-foot button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 760px) {
  .date-range-control {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .date-control--button {
    width: 100%;
  }

  .date-picker-popover {
    left: 0;
    right: 0;
    width: auto;
  }
}

/* B2B leads dashboard */
.b2b-dashboard-layout {
  grid-template-columns: 1fr;
}

.b2b-dashboard-layout .sales-content {
  min-width: 0;
}

.b2b-top-filters {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}

.b2b-top-filters .filter-card {
  width: 100%;
}

@media (max-width: 760px) {
  .b2b-top-filters {
    grid-template-columns: 1fr;
  }
}

.b2b-ranking-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.b2b-ranking-card {
  align-content: start;
  gap: 0;
  min-height: 0;
  padding: 20px;
}

.b2b-ranking-card header {
  min-height: 58px;
  margin-bottom: 0;
}

.b2b-ranking-card header + .b2b-ranking-row {
  border-top: 1px solid var(--line);
}

.b2b-ranking-row {
  grid-template-columns: minmax(170px, 1.1fr) minmax(180px, 1.2fr) 104px;
  min-height: 67px;
  gap: 16px;
  padding: 13px 0;
}

.b2b-ranking-row strong {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  line-height: 1.25;
}

.b2b-ranking-row span {
  width: 100%;
  max-width: none;
}

.b2b-ranking-row em {
  white-space: nowrap;
}

.b2b-orders-card {
  overflow: hidden;
}

.b2b-orders-filter-row {
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  align-items: start;
  margin-bottom: 14px;
}

.b2b-orders-filter-row .filter-card {
  min-height: 0;
  padding: 16px;
}

.b2b-orders-kpis {
  grid-template-columns: minmax(360px, 1.35fr) minmax(320px, 0.95fr) minmax(260px, 0.7fr);
  align-items: stretch;
}

.b2b-orders-kpi {
  min-height: 178px;
  min-width: 0;
  align-content: center;
  gap: 18px;
  padding: 22px;
}

.b2b-orders-kpi span {
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.b2b-orders-kpi strong {
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
  line-height: 0.95;
}

.b2b-orders-kpi--total strong {
  font-size: clamp(2.8rem, 4.35vw, 4.2rem);
}

.b2b-orders-kpi--billed strong {
  font-size: clamp(2.65rem, 3.75vw, 3.95rem);
}

.b2b-orders-kpi--pareto strong {
  font-size: clamp(1.45rem, 1.8vw, 1.75rem);
  white-space: nowrap;
}

.b2b-orders-kpi small,
.b2b-orders-kpi em {
  font-size: 0.84rem;
  line-height: 1.25;
  white-space: nowrap;
}

.b2b-orders-kpi--pareto small {
  max-width: 250px;
  white-space: normal;
}

.b2b-orders-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.b2b-orders-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.b2b-orders-table th,
.b2b-orders-table td {
  border-bottom: 1px solid rgba(228, 216, 208, 0.9);
  padding: 12px 14px;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.b2b-orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--brand);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.b2b-orders-table th:first-child,
.b2b-orders-table td:first-child {
  min-width: 250px;
  text-align: left;
}

.b2b-orders-table tbody th {
  color: var(--text);
  font-weight: 900;
}

.b2b-orders-total-row {
  background: #fbf6f2;
  color: var(--brand-dark);
  font-weight: 900;
}

.b2b-orders-total-row th {
  color: var(--brand-dark);
}

.b2b-orders-total-row .summary-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.b2b-orders-total-row .summary-toggle {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(131, 10, 44, 0.12);
}

.b2b-orders-total-row .summary-toggle:hover,
.b2b-orders-total-row .summary-toggle:focus-visible {
  background: var(--brand);
  color: #fff;
  outline: none;
}

.b2b-orders-subtotal-row {
  background: rgba(251, 246, 242, 0.72);
}

.pareto-gauge {
  display: grid;
  min-width: 190px;
  grid-template-columns: minmax(110px, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.pareto-gauge span {
  position: relative;
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1e5df;
}

.pareto-gauge span::after {
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 80%;
  width: 2px;
  background: rgba(131, 10, 44, 0.45);
  content: "";
}

.pareto-gauge i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--amber);
}

.pareto-gauge.is-core i {
  background: var(--brand);
}

.pareto-gauge em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.pareto-excluded {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(131, 10, 44, 0.16);
  border-radius: 999px;
  background: rgba(131, 10, 44, 0.06);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0 10px;
}

.pipeline-layout {
  grid-template-columns: 1fr;
}

.pipeline-page .sales-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.pipeline-page .sales-filters {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.pipeline-page .filter-card {
  width: 100%;
}

.pipeline-page .filter-card .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pipeline-page .filter-card .chip {
  width: auto;
  min-width: 150px;
}

.pipeline-kpis article {
  min-height: 128px;
  background: rgba(255, 255, 255, 0.94);
}

.pipeline-focus-stack {
  display: grid;
  gap: 20px;
}

.pipeline-focus-block {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.pipeline-kpis strong {
  color: var(--brand);
  font-size: clamp(1.55rem, 2.1vw, 2rem);
}

.losses-layout {
  grid-template-columns: 1fr;
}

.losses-page .sales-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.losses-page .sales-filters {
  width: 100%;
  display: grid;
  gap: 18px;
}

.losses-page .filter-card {
  width: 100%;
}

.losses-kpis {
  grid-template-columns: minmax(250px, 1.25fr) repeat(3, minmax(180px, 1fr));
}

.losses-kpis article {
  min-height: 128px;
}

.losses-kpis strong {
  max-width: 100%;
  color: var(--brand);
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.losses-kpis .hero-metric {
  background: var(--brand);
  color: #fff;
}

.losses-kpis .hero-metric span,
.losses-kpis .hero-metric strong {
  color: #fff;
}

.losses-kpis small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.losses-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.loss-ranking-list {
  display: grid;
  gap: 0;
}

.loss-ranking-row {
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 0.75fr) minmax(84px, auto);
}

.loss-month-chart-wrap {
  overflow-x: auto;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 246, 242, 0.84));
}

.loss-month-chart-wrap svg {
  display: block;
  width: 100%;
  min-width: 780px;
  height: auto;
}

.loss-month-bar {
  fill: var(--brand);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.loss-month-bar:hover {
  filter: brightness(1.06);
  opacity: 0.92;
}

.loss-month-value {
  fill: var(--text);
  font-size: 1.08rem;
  font-weight: 950;
  text-anchor: middle;
}

.loss-axis-label {
  text-anchor: end;
}

.loss-table-card {
  overflow: hidden;
}

.loss-table {
  min-width: 1080px;
}

.loss-status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(131, 10, 44, 0.16);
  border-radius: 999px;
  background: rgba(131, 10, 44, 0.07);
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
}

.cycle-layout,
.cycle-grid {
  display: grid;
  gap: 18px;
}

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

.cycle-kpis article {
  min-height: 118px;
}

.cycle-kpis strong {
  color: var(--brand);
}

.cycle-grid {
  grid-template-columns: 1fr;
}

.cycle-card {
  overflow: hidden;
}

.cycle-table-wrap {
  overflow-x: auto;
}

.cycle-table {
  width: 100%;
  border-collapse: collapse;
}

.cycle-table th,
.cycle-table td {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  text-align: right;
  white-space: nowrap;
}

.cycle-table thead th {
  border-top: 0;
  background: var(--brand);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.cycle-table th:first-child,
.cycle-table td:first-child {
  text-align: left;
}

.cycle-table tbody th {
  color: var(--text);
  font-weight: 900;
}

.cycle-table tbody td {
  color: var(--text);
  font-weight: 850;
}

.transformation-layout {
  display: grid;
  gap: 18px;
}

.transformation-filters {
  width: 100%;
  display: grid;
  gap: 18px;
}

.transformation-filters .filter-card {
  width: 100%;
}

.transformation-kpis article {
  min-height: 118px;
}

.transformation-kpis strong {
  color: var(--brand);
}

.transformation-summary,
.transformation-card {
  align-content: start;
}

.transformation-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.transformation-card-head h2 {
  margin: 0;
}

.transformation-card-head strong {
  color: var(--brand);
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  line-height: 1;
  white-space: nowrap;
}

.transformation-count-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.transformation-count-grid--summary {
  padding-bottom: 2px;
}

.transformation-count {
  display: grid;
  gap: 8px;
  min-height: 82px;
  align-content: space-between;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 10px;
  background: rgba(251, 246, 242, 0.76);
  padding: 12px;
}

.transformation-count span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.18;
  text-transform: uppercase;
}

.transformation-count strong {
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
}

.transformation-count--lost strong {
  color: var(--brand);
}

.transformation-count--open strong {
  color: var(--amber);
}

.transformation-count--won strong {
  color: var(--green);
}

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

.transformation-rate-group {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 12px;
  background: #fff;
  padding: 14px;
}

.transformation-rate-group h3 {
  margin: 0;
  font-size: 0.92rem;
}

.transformation-rate-row {
  display: grid;
  grid-template-columns: 54px minmax(70px, 1fr) 58px;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.transformation-rate-row span,
.transformation-rate-row strong {
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.transformation-rate-row span {
  color: var(--muted);
}

.transformation-rate-row strong {
  color: var(--text);
  text-align: right;
}

.transformation-rate-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(228, 216, 208, 0.85);
}

.transformation-rate-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.transformation-rate-row--min .transformation-rate-track i {
  background: var(--amber);
}

.transformation-rate-row--max .transformation-rate-track i {
  background: var(--green);
}

.transformation-commercial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.transformation-month-card {
  gap: 18px;
}

.transformation-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.transformation-month-cell {
  display: grid;
  gap: 11px;
  min-width: 0;
  border: 1px solid rgba(228, 216, 208, 0.95);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, rgba(251, 246, 242, 0.82));
  padding: 14px;
}

.transformation-month-cell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.transformation-month-cell header strong {
  color: var(--text);
  font-size: 0.92rem;
  text-transform: capitalize;
}

.transformation-month-cell header em {
  border-radius: 999px;
  background: rgba(131, 10, 44, 0.1);
  color: var(--brand);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 950;
  padding: 5px 8px;
  white-space: nowrap;
}

.transformation-month-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(228, 216, 208, 0.9);
}

.transformation-month-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

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

.transformation-month-metrics span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
}

.transformation-month-metrics b {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1;
}

.transformation-month-cell small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

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

.pipeline-chart-card {
  overflow: hidden;
}

.pipeline-chart-wrap {
  position: relative;
  overflow-x: auto;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 246, 242, 0.84));
}

.pipeline-chart-wrap svg {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.pipeline-bar {
  cursor: default;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.pipeline-bar:hover {
  filter: brightness(1.06);
  opacity: 0.92;
}

.pipeline-bar--potential {
  fill: var(--brand);
}

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

.pipeline-chart-tooltip {
  position: fixed;
  z-index: 40;
  max-width: min(320px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(21, 21, 24, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
  opacity: 0;
  padding: 9px 11px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 0.12s ease;
  white-space: nowrap;
}

.pipeline-chart-tooltip.is-visible {
  opacity: 1;
}

.pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

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

.pipeline-legend-dot {
  display: inline-block;
  width: 24px;
  height: 4px;
  border-radius: 999px;
}

.pipeline-legend-dot--potential {
  background: var(--brand);
}

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

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

.pipeline-breakdown-row {
  grid-template-columns: minmax(190px, 1fr) minmax(110px, 1fr) minmax(180px, auto);
}

.pipeline-table-card {
  overflow: hidden;
}

.pipeline-table {
  min-width: 980px;
}

.pipeline-issue-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
}

.pipeline-issue-badge.is-missing {
  border: 1px solid rgba(154, 90, 0, 0.22);
  background: rgba(154, 90, 0, 0.1);
  color: var(--amber);
}

.pipeline-issue-badge.is-overdue {
  border: 1px solid rgba(131, 10, 44, 0.22);
  background: rgba(131, 10, 44, 0.1);
  color: var(--brand);
}

.chantiers-layout {
  display: grid;
  gap: 18px;
}

.chantiers-kpis {
  grid-template-columns: 1.15fr repeat(5, minmax(0, 1fr));
}

.chantiers-kpis article {
  display: grid;
  min-height: 118px;
  align-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.chantiers-kpis .main-kpi {
  min-height: 118px;
  padding: 16px;
}

.chantiers-kpis .main-kpi strong,
.chantiers-kpis article strong {
  color: var(--brand);
  max-width: 100%;
  font-size: clamp(1.8rem, 2.35vw, 2.55rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.chantiers-kpis .main-kpi span,
.chantiers-kpis .main-kpi strong {
  color: #fff;
}

.chantiers-kpis article small {
  display: block;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.18;
  text-align: center;
}

.chantiers-kpis .main-kpi small {
  color: rgba(255, 255, 255, 0.78);
}

.chantier-count-kpi strong {
  color: var(--brand);
}

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

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

.chantiers-pie-grid,
.chantiers-mixed-grid {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chantiers-focus-grid {
  align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chantiers-focus-grid > .analytics-card,
.chantier-comparison-card,
.chantier-motorisation-card {
  height: 100%;
}

.chantiers-mixed-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.chantiers-side-stack {
  display: grid;
  gap: 18px;
  align-content: start;
}

.chantier-ranking-row {
  grid-template-columns: minmax(170px, 1fr) minmax(100px, 0.8fr) minmax(120px, auto);
}

.chantier-chart-wrap {
  overflow-x: auto;
  border: 1px solid rgba(228, 216, 208, 0.9);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 246, 242, 0.84));
}

.chantier-chart-wrap svg {
  display: block;
  width: 100%;
  min-width: 780px;
  height: auto;
}

.chantier-chart-bar {
  fill: var(--brand);
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.chantier-chart-bar:hover {
  filter: brightness(1.06);
  opacity: 0.92;
}

.chantier-chart-value {
  fill: var(--text);
  font-size: 1.08rem;
  font-weight: 950;
  text-anchor: middle;
}

.chantier-axis-label {
  text-anchor: end;
}

.chantier-pie-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.chantier-pie {
  width: 168px;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 14px 22px rgba(65, 39, 34, 0.14));
  overflow: visible;
}

.chantier-pie-slice {
  cursor: default;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.chantier-pie-slice:hover {
  filter: brightness(1.08);
  opacity: 0.92;
  transform: scale(1.018);
}

.chantier-pie-legend {
  display: grid;
  gap: 10px;
}

.chantier-pie-legend div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(228, 216, 208, 0.78);
  padding-bottom: 9px;
}

.chantier-pie-legend div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.chantier-pie-legend strong,
.chantier-pie-legend em {
  color: var(--text);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 900;
}

.chantier-pie-legend strong {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.chantier-pie-legend strong i {
  width: 20px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.chantier-pie-legend em {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

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

.chantier-stack-row {
  display: grid;
  grid-template-columns: 72px minmax(140px, 1fr) 48px;
  align-items: center;
  gap: 12px;
}

.chantier-stack-row strong,
.chantier-stack-row em {
  color: var(--text);
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 950;
}

.chantier-stack-row em {
  text-align: right;
}

.chantier-stack-row > span {
  display: flex;
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(228, 216, 208, 0.86);
}

.chantier-stack-row i {
  position: relative;
  display: block;
  min-width: 3px;
  height: 100%;
}

.chantier-stack-row b {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.chantier-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
}

.chantier-stack-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.chantier-stack-legend i {
  width: 18px;
  height: 5px;
  border-radius: 999px;
}

.chantier-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: stretch;
  gap: 10px;
}

.chantier-comparison div {
  display: grid;
  min-height: 96px;
  align-content: space-between;
  border: 1px solid rgba(228, 216, 208, 0.95);
  border-radius: 10px;
  background: rgba(251, 246, 242, 0.76);
  padding: 12px;
}

.chantier-comparison span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chantier-comparison strong {
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
}

.chantier-comparison em {
  display: grid;
  min-width: 72px;
  place-items: center;
  border-radius: 10px;
  background: rgba(131, 10, 44, 0.08);
  color: var(--brand);
  font-size: 1.2rem;
  font-style: normal;
  font-weight: 950;
}

.chantier-comparison em.is-positive {
  background: rgba(30, 112, 76, 0.1);
  color: var(--green);
}

.chantier-comparison em.is-negative {
  background: rgba(198, 40, 40, 0.1);
  color: #c62828;
}

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

.chantier-mini-metrics div {
  display: grid;
  min-height: 112px;
  align-content: space-between;
  border: 1px solid rgba(228, 216, 208, 0.95);
  border-radius: 10px;
  background: rgba(251, 246, 242, 0.76);
  padding: 12px;
}

.chantier-mini-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.chantier-mini-metrics strong {
  color: var(--brand);
  font-size: 2rem;
  line-height: 1;
}

.chantier-mini-metrics em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
}

.chantier-satisfaction-grid {
  display: grid;
  gap: 12px;
}

.chantier-satisfaction-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(140px, 1fr) minmax(80px, auto);
  align-items: center;
  gap: 12px;
  border-top: 1px solid rgba(228, 216, 208, 0.9);
  padding-top: 12px;
}

.chantier-satisfaction-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.chantier-satisfaction-row strong,
.chantier-satisfaction-row em {
  color: var(--text);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 900;
}

.chantier-satisfaction-row em {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.chantier-satisfaction-row em small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.chantier-satisfaction-row span {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(228, 216, 208, 0.9);
}

.chantier-satisfaction-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

@media (max-width: 1180px) {
  .pipeline-layout,
  .pipeline-chart-grid,
  .pipeline-ranking-grid,
  .losses-kpis,
  .losses-grid,
  .chantiers-kpis,
  .chantiers-grid,
  .chantiers-category-grid,
  .chantiers-pie-grid,
  .chantiers-focus-grid,
  .chantiers-mixed-grid,
  .cycle-kpis,
  .transformation-kpis,
  .transformation-rate-grid,
  .transformation-commercial-grid,
  .b2b-ranking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pipeline-page .sales-filters {
    grid-template-columns: 1fr;
  }

  .pipeline-kpis--pair {
    grid-template-columns: 1fr;
  }

  .pipeline-page .filter-card .chip {
    width: 100%;
  }

  .pipeline-breakdown-row,
  .loss-ranking-row,
  .chantier-ranking-row,
  .chantier-pie-layout,
  .chantier-comparison,
  .chantier-mini-metrics,
  .chantier-satisfaction-row,
  .b2b-ranking-row {
    grid-template-columns: 1fr;
  }

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

  .transformation-count-grid .transformation-count:last-child {
    grid-column: 1 / -1;
  }

  .transformation-card-head {
    display: grid;
  }
}

/* Smartphone layout layer. Desktop rules above remain unchanged. */
@media (max-width: 820px) {
  html,
  body,
  #app,
  .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    min-width: 0;
  }

  .portal-shell,
  .sales-shell {
    display: block;
    min-width: 0;
    min-height: 100vh;
  }

  .portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: auto;
    min-height: 0;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(228, 216, 208, 0.92);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    padding: 14px;
  }

  .portal-logo-button,
  .portal-logo {
    width: 168px;
  }

  .portal-copy {
    gap: 3px;
  }

  .portal-copy strong {
    font-size: 0.98rem;
  }

  .portal-copy span {
    font-size: 0.82rem;
  }

  .audience-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-logout-button {
    min-height: 40px;
    margin-top: 0;
  }

  .portal-main,
  .sales-page {
    width: 100%;
    max-width: 100%;
    padding: 14px;
  }

  .portal-header,
  .sales-topbar {
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .portal-header h1,
  .sales-title--hero h1 {
    font-size: 2rem;
    line-height: 1;
  }

  .sales-title h1 {
    font-size: 1.7rem;
    line-height: 1.02;
  }

  .portal-header input,
  .sales-actions,
  .sales-actions > *,
  .sales-actions input,
  .date-range-control,
  .date-control,
  .date-control--button,
  .refresh-button,
  .back-button {
    width: 100%;
    max-width: 100%;
  }

  .sales-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .date-range-control {
    grid-template-columns: 1fr;
  }

  .sales-layout,
  .ads-layout,
  .activities-layout,
  .appointments-layout,
  .pipeline-layout,
  .losses-layout,
  .b2b-dashboard-layout {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .sales-content,
  .ads-page .sales-content,
  .activities-page .sales-content,
  .appointments-page .sales-content,
  .pipeline-page .sales-content,
  .losses-page .sales-content,
  .b2b-dashboard-layout .sales-content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .sales-filters,
  .ads-top-filters,
  .activities-top-filters,
  .appointments-top-filters,
  .b2b-top-filters,
  .pipeline-page .sales-filters,
  .losses-page .sales-filters,
  .transformation-filters {
    width: 100% !important;
    max-width: 100%;
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .filter-card,
  .ads-page .filter-card,
  .activities-page .filter-card,
  .appointments-page .filter-card,
  .pipeline-page .filter-card,
  .losses-page .filter-card,
  .b2b-top-filters .filter-card {
    width: 100% !important;
    max-width: 100%;
    padding: 14px;
    border-radius: 12px;
  }

  .filter-card .chips,
  .pipeline-page .filter-card .chips {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-card .chip,
  .pipeline-page .filter-card .chip {
    width: 100%;
    min-width: 0;
  }

  .simple-filter-menu {
    max-height: min(58vh, 360px);
  }

  .simple-filter-option,
  .simple-filter-reset {
    min-height: 44px;
  }

  .simple-filter-tags {
    gap: 7px;
  }

  .simple-filter-tag {
    max-width: 100%;
  }

  .dashboard-grid,
  .hero-kpis,
  .sales-hero-kpis,
  .ads-hero-kpis,
  .activities-hero-kpis,
  .appointments-hero-kpis,
  .pipeline-kpis,
  .pipeline-kpis--pair,
  .losses-kpis,
  .cycle-kpis,
  .transformation-kpis,
  .b2b-orders-kpis,
  .chantiers-kpis,
  .metric-row,
  .analytics-grid,
  .lead-distribution-grid,
  .leads-analysis-grid,
  .ads-summary-grid,
  .ads-ranking-grid,
  .activity-category-grid,
  .activity-timing-grid,
  .appointments-grid,
  .pipeline-chart-grid,
  .pipeline-ranking-grid,
  .losses-grid,
  .transformation-rate-grid,
  .transformation-commercial-grid,
  .chantiers-grid,
  .chantiers-category-grid,
  .chantiers-pie-grid,
  .chantiers-focus-grid,
  .chantiers-mixed-grid,
  .b2b-ranking-grid {
    grid-template-columns: 1fr !important;
  }

  .dashboard-tile {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 104px;
  }

  .analytics-card,
  .hero-kpis,
  .metric-row article,
  .loading-panel {
    min-width: 0;
    border-radius: 12px;
  }

  .analytics-card,
  .loading-panel,
  .summary-card,
  .pipeline-chart-card,
  .pipeline-breakdown-card,
  .pipeline-table-card,
  .loss-card,
  .loss-table-card,
  .cycle-card,
  .transformation-card,
  .chantiers-card,
  .activity-table-card,
  .appointment-cadence-card,
  .appointment-table-card,
  .appointment-ranking-card,
  .b2b-orders-card {
    padding: 16px;
  }

  .hero-kpis > article,
  .sales-hero-kpis .sales-kpi-card,
  .ads-hero-kpis > article,
  .activities-hero-kpis > article,
  .appointments-hero-kpis > article,
  .b2b-orders-kpi,
  .pipeline-kpis article,
  .losses-kpis article,
  .cycle-kpis article,
  .transformation-kpis article,
  .chantiers-kpis article {
    min-height: 118px;
    padding: 18px;
  }

  .hero-kpis > article > strong,
  .sales-hero-kpis .sales-kpi-card > strong,
  .ads-hero-kpis > article > strong,
  .activities-hero-kpis > article > strong,
  .appointments-hero-kpis > article > strong,
  .b2b-orders-kpi strong,
  .pipeline-kpis strong,
  .losses-kpis strong,
  .cycle-kpis strong,
  .transformation-kpis strong,
  .chantiers-kpis strong {
    font-size: 2.15rem;
    line-height: 1;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .main-kpi > strong,
  .sales-hero-kpis .main-kpi > strong,
  .b2b-orders-kpi--total strong {
    font-size: 2.35rem;
  }

  .lead-calendar-grid,
  .lead-calendar-grid--7,
  .lead-calendar-grid--30,
  .transformation-count-grid {
    display: flex;
    grid-template-columns: none !important;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .lead-calendar-grid > *,
  .lead-calendar-grid--7 > *,
  .lead-calendar-grid--30 > *,
  .transformation-count-grid > * {
    min-width: 128px;
    scroll-snap-align: start;
  }

  .annual-leads-chart,
  .summary-table-wrap,
  .opportunity-table-wrap,
  .activity-table-wrap,
  .appointment-cadence-wrap,
  .appointment-table-wrap,
  .b2b-orders-table-wrap,
  .loss-month-chart-wrap,
  .cycle-table-wrap,
  .pipeline-chart-wrap,
  .chantier-chart-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .annual-leads-chart svg,
  .pipeline-chart-wrap svg,
  .loss-month-chart-wrap svg,
  .chantier-chart-wrap svg {
    min-width: 720px;
  }

  .summary-table,
  .opportunity-table,
  .activity-table,
  .appointment-table,
  .b2b-orders-table,
  .loss-table,
  .cycle-table,
  .pipeline-table {
    min-width: 760px;
  }

  .source-row,
  .leader-row,
  .lead-date-row,
  .lead-list-row,
  .pipeline-breakdown-row,
  .loss-ranking-row,
  .appointment-ranking-row,
  .chantier-ranking-row,
  .chantier-pie-layout,
  .chantier-comparison,
  .chantier-mini-metrics,
  .chantier-satisfaction-row,
  .b2b-ranking-row {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .source-row em,
  .leader-row em,
  .lead-list-row em,
  .b2b-ranking-row em,
  .loss-ranking-row em,
  .appointment-ranking-row em,
  .chantier-ranking-row em {
    text-align: left;
  }

  .source-metrics,
  .pareto-gauge {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }
}

@media print {
  body {
    background: #fff;
  }

  .recap-visual-page {
    background: #fff;
    padding: 0;
  }

  .recap-visual-toolbar {
    display: none;
  }

  .recap-visual-stack {
    display: block;
    max-width: none;
  }

  .recap-screenshot {
    page-break-after: always;
    break-after: page;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .recap-screenshot:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .recap-screenshot-header {
    border-bottom: 1px solid #e4d8d0;
  }

  .recap-screenshot-body .portal-sidebar {
    position: relative;
  }
}
