: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,
.audience-nav .app-nav-link {
  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;
  text-decoration: none;
}

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

.audience-nav .app-nav-link:hover {
  border-color: rgba(131, 10, 44, 0.45);
  background: rgba(131, 10, 44, 0.05);
}

.audience-nav .app-nav-link:focus-visible {
  outline: 3px solid rgba(131, 10, 44, 0.2);
  outline-offset: 2px;
}

.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;
}

.commercial-home {
  gap: 26px;
}

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

.commercial-home-tile {
  display: grid;
  min-height: 150px;
  align-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(23, 23, 23, 0.05);
  color: var(--text);
  padding: 18px;
  text-align: left;
}

.commercial-home-tile--primary {
  border-color: rgba(131, 10, 44, 0.28);
  background: linear-gradient(180deg, #fff 0%, #fbf2f5 100%);
}

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

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

.commercial-home-tile strong {
  font-size: 1.1rem;
  line-height: 1.18;
}

.commercial-home-tile p {
  margin: 0;
  color: var(--muted);
}

.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,
  .commercial-home-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;
  }
}

.image-bank-page {
  gap: 18px;
}

.image-bank-header-actions,
.image-bank-filter-actions,
.image-bank-upload-actions,
.image-bank-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.image-bank-toolbar,
.image-bank-upload {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(145, 7, 47, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(36, 29, 33, 0.07);
}

.image-bank-search,
.image-bank-filter,
.image-bank-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #5f5360;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.image-bank-search {
  grid-column: span 2;
}

.image-bank-search input,
.image-bank-filter select,
.image-bank-field input,
.image-bank-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid #e0d6d2;
  border-radius: 9px;
  background: #fff;
  color: #1f1c1f;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 11px 12px;
  text-transform: none;
}

.image-bank-filter-actions,
.image-bank-field--wide,
.image-bank-upload-actions {
  grid-column: 1 / -1;
}

.image-bank-chantier-search {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(145, 7, 47, 0.16);
  border-radius: 8px;
  background: #fcf7f5;
}

.image-bank-chantier-search h3,
.image-bank-chantier-search p {
  margin: 0;
}

.image-bank-chantier-search h3 {
  color: #241d21;
  font-size: 1rem;
}

.image-bank-chantier-search p {
  color: #5f5552;
}

.image-bank-chantier-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.image-bank-chantier-search-row .back-button {
  min-height: 46px;
}

.image-bank-chantier-feedback {
  min-height: 20px;
  font-size: 0.9rem;
  font-weight: 700;
}

.image-bank-chantier-feedback[data-tone="error"] {
  color: #b42318;
}

.image-bank-chantier-feedback[data-tone="success"] {
  color: #1e704c;
}

.image-bank-chantier-feedback[data-tone="info"] {
  color: #5f5552;
}

.image-bank-chantier-results {
  display: grid;
  gap: 8px;
}

.image-bank-chantier-result {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(145, 7, 47, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #241d21;
  text-align: left;
  cursor: pointer;
}

.image-bank-chantier-result:hover,
.image-bank-chantier-result:focus-visible {
  border-color: #91072f;
  background: #fff5f7;
  outline: none;
}

.image-bank-chantier-result strong {
  color: #91072f;
}

.image-bank-chantier-result span {
  color: #6f625f;
  font-size: 0.9rem;
}

.image-bank-feedback {
  margin: 0;
  color: #91072f;
  font-weight: 800;
}

.image-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.image-bank-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0 0 14px;
  border: 1px solid #e8ddd8;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 12px 28px rgba(36, 29, 33, 0.08);
}

.image-bank-card:hover,
.image-bank-card:focus-visible {
  border-color: rgba(145, 7, 47, 0.42);
  transform: translateY(-1px);
}

.image-bank-card-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: #f3eeeb;
  overflow: hidden;
}

.image-bank-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-bank-card-visual.is-loaded img {
  opacity: 1;
}

.image-bank-card-visual i {
  position: absolute;
  color: #8d7f7c;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
}

.image-bank-card-visual.is-loaded i,
.image-bank-card-visual.is-error i {
  display: none;
}

.image-bank-card strong,
.image-bank-card small {
  padding: 0 14px;
  min-width: 0;
}

.image-bank-card strong {
  color: #241d21;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.image-bank-card small {
  color: #766a67;
  font-weight: 700;
}

.image-bank-pagination {
  justify-content: center;
}

.image-bank-detail {
  position: fixed;
  inset: 5vh 4vw;
  z-index: 60;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(18, 14, 16, 0.32);
}

.image-bank-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.image-bank-detail-header span {
  color: #91072f;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.image-bank-detail-header h2 {
  margin: 4px 0 0;
  color: #171316;
}

.image-bank-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 18px;
  min-height: 0;
}

.image-bank-detail-visual {
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 12px;
  background: #f3eeeb;
  overflow: hidden;
}

.image-bank-detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-bank-placeholder {
  color: #7a6f6c;
  font-weight: 800;
}

.image-bank-detail-summary {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  overflow: auto;
}

.image-bank-detail-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid #eee5e0;
}

.image-bank-detail-row span {
  color: #746865;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.image-bank-detail-row strong {
  color: #21191d;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .image-bank-toolbar,
  .image-bank-upload {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-bank-search {
    grid-column: 1 / -1;
  }

  .image-bank-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .image-bank-toolbar,
  .image-bank-upload,
  .image-bank-grid {
    grid-template-columns: 1fr;
  }

  .image-bank-detail {
    inset: 0;
    border-radius: 0;
  }

  .image-bank-chantier-search-row {
    grid-template-columns: 1fr;
  }

  .image-bank-chantier-search-row .back-button {
    width: 100%;
  }
}

.commercial-home-tile--map {
  border-color: #b8ccc2;
  background: #f5faf7;
}

.field-map-page {
  min-width: 0;
  padding: 26px;
  background: #f4f5f3;
}

.field-map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.field-map-header > div {
  display: grid;
  gap: 3px;
}

.field-map-header span {
  color: #727a76;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-map-header h1 {
  margin: 0;
  color: #171a18;
  font-size: 1.75rem;
  letter-spacing: 0;
}

.field-map-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-map-header-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #cfd5d1;
  border-radius: 5px;
  background: #fff;
  color: #303833;
  font-weight: 800;
}

.field-map-header-actions .refresh-button {
  border-color: #980b35;
  background: #980b35;
  color: #fff;
}

.field-map-alert {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #b7d3c3;
  border-radius: 6px;
  background: #edf8f1;
  color: #15583f;
  font-weight: 700;
}

.field-map-alert[data-tone="error"] {
  border-color: #e1b7c2;
  background: #fbf0f3;
  color: #8b0c31;
}

.field-home-editor {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #bfd0d8;
  border-radius: 6px;
  background: #f3f8fa;
}

.field-home-editor label {
  display: grid;
  gap: 6px;
}

.field-home-editor label span,
.field-attribute-filter span {
  color: #555d59;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-home-editor input,
.field-attribute-filter select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c9d2cd;
  border-radius: 5px;
  background: #fff;
  color: #1c211e;
  font: inherit;
  padding: 0 11px;
}

.field-home-editor button,
.field-attribute-filters > button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #bdc9c3;
  border-radius: 5px;
  background: #fff;
  color: #35413a;
  font-weight: 800;
}

.field-home-editor button[type="submit"] {
  border-color: #17628f;
  background: #17628f;
  color: #fff;
}

.field-home-editor p {
  grid-column: 1 / -1;
  margin: 0;
  color: #8b0c31;
  font-size: 0.76rem;
  font-weight: 700;
}

.field-map-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d7dbd8;
  border-radius: 6px;
  background: #ffffff;
}

.field-attribute-filters {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(5, minmax(135px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding-top: 13px;
  border-top: 1px solid #e0e4e1;
}

.field-attribute-filter {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field-attribute-filter select {
  min-width: 0;
  font-size: 0.78rem;
}

.field-map-search {
  display: grid;
  gap: 6px;
}

.field-map-search span,
.field-kind-filters legend,
.field-scheduler-controls label > span,
.field-scheduler-controls > div > span {
  color: #555d59;
  font-size: 0.76rem;
  font-weight: 800;
}

.field-map-search input,
.field-scheduler-controls input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfd5d1;
  border-radius: 5px;
  background: #fff;
  color: #171a18;
  font: inherit;
  padding: 0 12px;
}

.field-map-search input:focus,
.field-scheduler-controls input:focus {
  border-color: #980b35;
  outline: 3px solid rgba(152, 11, 53, 0.1);
}

.field-kind-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 210px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-kind-filters legend {
  margin-bottom: 6px;
}

.field-kind-filters label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid #d6dbd8;
  border-radius: 5px;
  background: #f8f9f8;
  color: #29302c;
  font-weight: 750;
  cursor: pointer;
}

.field-kind-filters input {
  width: 16px;
  height: 16px;
  accent-color: #980b35;
}

.field-map-progress {
  display: grid;
  justify-items: end;
  min-width: 130px;
  padding-bottom: 3px;
}

.field-map-progress strong {
  color: #1c211e;
  font-size: 1.05rem;
}

.field-map-progress span {
  color: #737b77;
  font-size: 0.72rem;
}

.field-map-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(400px, 1fr) minmax(310px, 390px);
  min-height: 680px;
  height: calc(100vh - 190px);
  overflow: hidden;
  border: 1px solid #d1d6d3;
  border-radius: 7px;
  background: #fff;
}

.field-lead-list,
.field-planning-panel {
  min-width: 0;
  overflow: hidden;
  background: #fff;
}

.field-lead-list {
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid #dde1de;
}

.field-lead-list > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 14px 12px;
  border-bottom: 1px solid #e1e4e2;
}

.field-lead-list > header strong {
  color: #202521;
  font-size: 0.9rem;
}

.field-lead-list > header span {
  color: #7b827e;
  font-size: 0.68rem;
}

.field-lead-list > div {
  overflow-y: auto;
}

.field-lead-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 72px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid #edf0ee;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.field-lead-row:hover {
  background: #f6f8f7;
}

.field-lead-row.is-selected {
  background: #fbf2f5;
  box-shadow: inset 3px 0 #980b35;
}

.field-lead-row > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.field-lead-row strong {
  overflow: hidden;
  color: #1c211e;
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-lead-row small {
  overflow: hidden;
  color: #6d7571;
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-lead-row em {
  grid-column: 2;
  color: #838b87;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 700;
}

.field-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: #980b35;
}

.field-dot--client {
  background: #176b4d;
}

.field-dot--prospect {
  background: #980b35;
}

.field-dot--home {
  background: #17628f;
}

.field-map-stage {
  position: relative;
  min-width: 0;
  background: #dce5df;
}

#field-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: #e5ebe7;
}

.field-map-legend {
  position: absolute;
  z-index: 500;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(43, 51, 46, 0.15);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(30, 38, 33, 0.12);
}

.field-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #38403b;
  font-size: 0.7rem;
  font-weight: 750;
}

.field-map-legend .field-dot {
  margin: 0;
}

.field-planning-panel {
  overflow-y: auto;
  border-left: 1px solid #dde1de;
}

.field-lead-detail {
  display: grid;
  gap: 14px;
  padding: 17px;
  border-bottom: 1px solid #dfe3e0;
}

.field-lead-contact {
  display: grid;
  gap: 4px;
}

.field-lead-contact strong {
  color: #1b201d;
  font-size: 0.92rem;
}

.field-lead-contact span {
  color: #626b66;
  font-size: 0.77rem;
  line-height: 1.45;
}

.field-lead-contact a {
  width: fit-content;
  color: #8f0a31;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.field-assignment-row,
.field-finance-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field-home-route-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbdbe2;
  border-radius: 5px;
  background: #f3f8fa;
}

.field-home-route-summary > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding-left: 8px;
  border-left: 2px solid #17628f;
}

.field-home-route-summary small {
  color: #66747b;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-home-route-summary strong {
  color: #174e6e;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.field-assignment-row > span,
.field-finance-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding-left: 8px;
  border-left: 2px solid #cbd6d0;
}

.field-assignment-row small,
.field-finance-row small,
.field-chantier-timeline small,
.field-satisfaction small {
  color: #7a827e;
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-assignment-row strong,
.field-finance-row strong {
  color: #303732;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.field-request-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-request-tags span {
  padding: 5px 7px;
  border: 1px solid #d8deda;
  border-radius: 4px;
  background: #f5f7f5;
  color: #424a45;
  font-size: 0.67rem;
  font-weight: 700;
}

.field-chantier-timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dce2de;
  border-radius: 5px;
  background: #dce2de;
}

.field-chantier-timeline > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 8px 6px;
  background: #f7f9f8;
}

.field-chantier-timeline strong {
  color: #2f3732;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.field-finance-row {
  padding: 10px;
  border: 1px solid #d9e4de;
  border-radius: 5px;
  background: #f1f7f3;
}

.field-finance-row > span {
  border-left-color: #398064;
}

.field-finance-row strong {
  color: #15583f;
  font-size: 0.78rem;
}

.field-satisfaction {
  display: grid;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid #e1e5e2;
}

.field-satisfaction > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-satisfaction > header span {
  color: #5d6661;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field-satisfaction > header strong {
  color: #176b4d;
  font-size: 0.66rem;
}

.field-satisfaction > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.field-satisfaction > div > span {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 6px;
  border: 1px solid #dfe4e1;
  border-radius: 4px;
  background: #fafbfa;
}

.field-satisfaction > div strong {
  color: #333a36;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.field-satisfaction > p {
  margin: 0;
  color: #58615c;
  font-size: 0.71rem;
  line-height: 1.45;
}

.field-description {
  display: grid;
  gap: 5px;
}

.field-description > span {
  color: #747c78;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field-description p {
  max-height: 105px;
  margin: 0;
  overflow-y: auto;
  color: #343a36;
  font-size: 0.76rem;
  line-height: 1.5;
}

.field-navigation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-navigation-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #ccd4cf;
  border-radius: 5px;
  color: #35413a;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

.field-navigation-actions a:hover {
  border-color: #8aa698;
  background: #f1f7f3;
}

.field-scheduler {
  display: grid;
  gap: 14px;
  padding: 17px;
}

.field-scheduler > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field-scheduler > header > div {
  display: grid;
  gap: 3px;
}

.field-scheduler > header span {
  color: #747c78;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field-scheduler > header h2 {
  margin: 0;
  color: #1b201d;
  font-size: 1.02rem;
  letter-spacing: 0;
}

.field-kind {
  flex: none;
  padding: 5px 7px;
  border-radius: 4px;
  background: #f8e9ee;
  color: #8f0a31 !important;
  font-size: 0.63rem !important;
}

.field-kind--client {
  background: #e8f4ed;
  color: #176b4d !important;
}

.field-scheduler-controls {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.field-scheduler-controls label,
.field-scheduler-controls > div {
  display: grid;
  gap: 6px;
}

.field-duration-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: 42px;
  overflow: hidden;
  border: 1px solid #cfd5d1;
  border-radius: 5px;
}

.field-duration-control button {
  border: 0;
  border-right: 1px solid #d8ddda;
  background: #fff;
  color: #515a55;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.field-duration-control button:last-child {
  border-right: 0;
}

.field-duration-control button.is-active {
  background: #980b35;
  color: #fff;
}

.field-route-warning {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #be7d1d;
  background: #fff8e9;
  color: #76501b;
  font-size: 0.7rem;
  line-height: 1.4;
}

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

.field-suggestion {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid #dfe4e1;
  border-radius: 6px;
  background: #fff;
}

.field-suggestion.is-best {
  border-color: #86ad99;
  background: #f2f8f4;
}

.field-suggestion-time {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.field-suggestion-time strong {
  color: #161b18;
  font-size: 0.9rem;
}

.field-suggestion-time span {
  color: #7b837f;
  font-size: 0.65rem;
}

.field-suggestion-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.field-suggestion-copy strong {
  color: #26302a;
  font-size: 0.75rem;
}

.field-suggestion-copy span,
.field-suggestion-copy small {
  overflow: hidden;
  color: #68716c;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-suggestion button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: #980b35;
  color: #fff;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 850;
  cursor: pointer;
}

.field-suggestion button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.field-empty-detail,
.field-no-results,
.field-no-slots {
  padding: 24px 16px;
  color: #737c77;
  font-size: 0.77rem;
  line-height: 1.5;
  text-align: center;
}

.leaflet-tooltip {
  border: 0;
  border-radius: 4px;
  color: #2a302c;
  font-family: inherit;
  font-size: 0.72rem;
  box-shadow: 0 5px 18px rgba(23, 30, 26, 0.16);
}

.field-map-preview-tooltip {
  max-width: 270px;
  padding: 0;
  background: #fff;
}

.field-map-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.field-map-preview > span {
  color: #76817a;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-map-preview strong {
  color: #202722;
  font-size: 0.82rem;
}

.field-map-preview small,
.field-map-preview p {
  margin: 0;
  color: #5e6962;
  font-size: 0.69rem;
  line-height: 1.35;
}

.pipeline-workspace-page {
  min-width: 0;
  padding: 26px;
  background: #f4f5f3;
}

.pipeline-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.pipeline-workspace-header > div {
  display: grid;
  gap: 3px;
}

.pipeline-workspace-header span {
  color: #727a76;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pipeline-workspace-header h1 {
  margin: 0;
  color: #171a18;
  font-size: 1.75rem;
  letter-spacing: 0;
}

.pipeline-workspace-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.pipeline-workspace-tabs button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #cfd5d1;
  border-radius: 5px;
  background: #fff;
  color: #4d5751;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.pipeline-workspace-tabs button.is-active {
  border-color: #176b4d;
  background: #176b4d;
  color: #fff;
}

.pipeline-workspace-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.25fr) repeat(3, minmax(180px, 1fr));
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9dfdb;
  border-radius: 7px;
  background: #fff;
}

.pipeline-workspace-filter,
.pipeline-workspace-search {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #555d59;
  font-size: 0.74rem;
  font-weight: 800;
}

.pipeline-workspace-search input {
  min-height: 42px;
  border: 1px solid #cfd5d1;
  border-radius: 5px;
  background: #fff;
  color: #171a18;
  font: inherit;
  padding: 0 12px;
}

.pipeline-workspace-search input:focus {
  border-color: #176b4d;
  outline: 3px solid rgba(23, 107, 77, 0.1);
}

.pipeline-workspace-filters .simple-filter {
  width: 100%;
}

.pipeline-workspace-count {
  margin: 14px 0;
  color: #68736c;
  font-size: 0.78rem;
  font-weight: 750;
}

.pipeline-action-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.pipeline-action-column,
.pipeline-kanban-column {
  min-width: 220px;
  border: 1px solid #d9dfdb;
  border-radius: 7px;
  background: #edf1ee;
}

.pipeline-action-column > header,
.pipeline-kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid #d9dfdb;
}

.pipeline-action-column h2,
.pipeline-kanban-column h2 {
  margin: 0;
  color: #303a33;
  font-size: 0.84rem;
}

.pipeline-action-column header span,
.pipeline-kanban-column header span {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #4d5a52;
  font-size: 0.72rem;
  font-weight: 850;
}

.pipeline-action-column--overdue {
  border-color: #dfb7c2;
  background: #fbf0f3;
}

.pipeline-action-column--overdue > header {
  border-bottom-color: #dfb7c2;
}

.pipeline-action-column--today {
  border-color: #e6cf9f;
  background: #fff8e9;
}

.pipeline-action-column--today > header {
  border-bottom-color: #e6cf9f;
}

.pipeline-action-column > div,
.pipeline-kanban-column > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 150px;
  max-height: calc(100vh - 330px);
  overflow-y: auto;
  padding: 10px;
}

.pipeline-action-column > div > p {
  margin: 6px 0;
  color: #7a847e;
  font-size: 0.76rem;
  text-align: center;
}

.pipeline-workspace-record {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid #dce2de;
  border-radius: 5px;
  background: #fff;
  color: #303833;
  font: inherit;
  padding: 10px;
  text-align: left;
}

.pipeline-workspace-record:hover {
  border-color: #176b4d;
  box-shadow: 0 4px 12px rgba(20, 60, 40, 0.1);
}

.pipeline-workspace-record__stage {
  color: #176b4d;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pipeline-workspace-record strong {
  overflow: hidden;
  color: #202722;
  font-size: 0.81rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-workspace-record small,
.pipeline-workspace-record em {
  overflow: hidden;
  color: #68736c;
  font-size: 0.69rem;
  font-style: normal;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-kanban {
  display: grid;
  grid-auto-columns: minmax(250px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pipeline-list-card {
  overflow: hidden;
  border: 1px solid #d9dfdb;
  border-radius: 7px;
  background: #fff;
}

.pipeline-list-table-wrap {
  overflow-x: auto;
}

.pipeline-list-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

.pipeline-list-table th,
.pipeline-list-table td {
  border-bottom: 1px solid #e6ebe8;
  color: #4d5751;
  font-size: 0.76rem;
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

.pipeline-list-table thead th {
  background: #f2f5f3;
  color: #67736b;
  font-size: 0.69rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pipeline-list-table tbody tr:last-child th,
.pipeline-list-table tbody tr:last-child td {
  border-bottom: 0;
}

.pipeline-list-table th > button {
  display: grid;
  gap: 3px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  text-align: left;
}

.pipeline-list-table th > button:hover strong {
  color: #176b4d;
  text-decoration: underline;
}

.pipeline-list-table th strong {
  color: #202722;
  font-size: 0.8rem;
}

.pipeline-list-table th small {
  color: #707a74;
  font-weight: 600;
}

.pipeline-record-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 28, 23, 0.46);
}

.pipeline-record-modal {
  width: min(680px, 100%);
  max-height: min(740px, calc(100vh - 40px));
  overflow-y: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(12, 21, 15, 0.28);
}

.pipeline-record-modal > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid #e4e9e5;
}

.pipeline-record-modal header span,
.pipeline-record-modal small {
  color: #68736c;
  font-size: 0.7rem;
  font-weight: 800;
}

.pipeline-record-modal h2 {
  margin: 4px 0 0;
  color: #1d241f;
  font-size: 1.35rem;
}

.pipeline-record-modal header button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: #f1f4f2;
  color: #39433d;
  font-size: 1.3rem;
}

.pipeline-record-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: #e4e9e5;
}

.pipeline-record-detail-grid > span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 20px;
  background: #fff;
}

.pipeline-record-detail-grid strong {
  overflow-wrap: anywhere;
  color: #303833;
  font-size: 0.82rem;
}

.pipeline-record-detail-grid__wide {
  grid-column: 1 / -1;
}

.pipeline-record-description {
  padding: 18px 20px 22px;
}

.pipeline-record-description p {
  margin: 6px 0 0;
  color: #4f5a53;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.pipeline-record-configurations {
  display: grid;
  gap: 10px;
  padding: 18px 20px 22px;
  border-top: 1px solid #e4e9e5;
}

.pipeline-record-configurations > div:first-child {
  display: grid;
  gap: 4px;
}

.pipeline-record-configurations strong {
  color: #303833;
  font-size: 0.94rem;
}

.pipeline-record-configurations p {
  margin: 0;
  color: #4f5a53;
  font-size: 0.82rem;
  line-height: 1.55;
}

.pipeline-record-configurations__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.commercial-configurator-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: grid;
  padding: 14px;
  background: rgba(20, 28, 23, 0.56);
}

.commercial-configurator-frame {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(12, 21, 15, 0.32);
}

.commercial-configurator-close {
  position: absolute;
  z-index: 1;
  top: 26px;
  right: 28px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  background: #fff;
  color: #8f0a32;
  box-shadow: 0 8px 24px rgba(12, 21, 15, 0.18);
  font-size: 1.7rem;
  line-height: 1;
}

.commercial-configurator-error {
  align-self: center;
  justify-self: center;
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(12, 21, 15, 0.32);
}

.commercial-configurator-error h2,
.commercial-configurator-error p {
  margin-top: 0;
}

@media (max-width: 680px) {
  .pipeline-record-configurations__actions {
    display: grid;
  }

  .commercial-configurator-overlay {
    padding: 0;
  }

  .commercial-configurator-frame {
    border-radius: 0;
  }

  .commercial-configurator-close {
    top: 10px;
    right: 10px;
  }
}

@media (max-width: 1280px) {
  .field-map-page {
    padding: 20px;
  }

  .field-map-workspace {
    grid-template-columns: 230px minmax(360px, 1fr) 330px;
  }

  .field-attribute-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .field-attribute-filters > button {
    width: 100%;
  }

  .field-suggestion {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .field-suggestion button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 1040px) {
  .field-attribute-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .field-map-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .field-map-stage {
    min-height: 620px;
  }

  .field-planning-panel {
    grid-column: 1 / -1;
    overflow: visible;
    border-top: 1px solid #dde1de;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .app-nav button,
  .app-nav .app-nav-link {
    min-width: 0;
    justify-content: center;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .app-nav button span,
  .app-nav .app-nav-link span {
    display: none;
  }

  .field-map-page {
    padding: 14px;
  }

  .field-map-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .field-map-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .field-map-header-actions button {
    width: 100%;
    min-width: 0;
  }

  .field-map-header .refresh-button {
    width: 100%;
  }

  .field-home-editor {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .field-map-toolbar {
    grid-template-columns: 1fr;
  }

  .field-attribute-filters {
    grid-template-columns: 1fr;
  }

  .field-kind-filters {
    width: 100%;
  }

  .field-kind-filters label {
    flex: 1;
    justify-content: center;
  }

  .field-map-progress {
    justify-items: start;
  }

  .field-map-workspace {
    display: flex;
    flex-direction: column;
  }

  .field-lead-list {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid #dde1de;
  }

  .field-map-stage {
    min-height: 480px;
  }

  .field-planning-panel {
    border-top: 1px solid #dde1de;
  }

  .field-scheduler-controls {
    grid-template-columns: 1fr;
  }

  .field-suggestion {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .field-suggestion button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1040px) {
  .pipeline-workspace-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .pipeline-workspace-page {
    padding: 14px;
  }

  .pipeline-workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .pipeline-workspace-header .refresh-button {
    width: 100%;
  }

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

  .pipeline-action-column > div,
  .pipeline-kanban-column > div {
    max-height: 420px;
  }

  .pipeline-record-backdrop {
    align-items: end;
    padding: 0;
  }

  .pipeline-record-modal {
    width: 100%;
    max-height: min(82vh, 740px);
    border-radius: 10px 10px 0 0;
  }

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

  .pipeline-record-detail-grid__wide {
    grid-column: auto;
  }
}

.commercial-home-tile--calendar {
  border-left-color: #17628f;
}

.calendar-page {
  min-width: 0;
  padding: 28px;
  background: #f6f7f6;
}

.calendar-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto 20px;
  max-width: 1500px;
}

.calendar-page-header > div > span {
  color: #6b716e;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-page-header h1 {
  margin: 4px 0 0;
  color: #161918;
  font-size: clamp(1.65rem, 2.6vw, 2.3rem);
  letter-spacing: 0;
}

.calendar-page-header > button,
.calendar-editor footer button:last-child {
  min-height: 44px;
  border: 1px solid #94052f;
  border-radius: 7px;
  padding: 0 18px;
  background: #94052f;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.calendar-inline-message,
.calendar-alert {
  max-width: 1500px;
  margin: 0 auto 14px;
  border: 1px solid #b7d7ca;
  border-radius: 6px;
  padding: 11px 14px;
  background: #edf8f3;
  color: #155c43;
  font-weight: 700;
}

.calendar-inline-message[data-tone="error"],
.calendar-alert[data-tone="error"] {
  border-color: #e5b9c6;
  background: #fbf0f3;
  color: #85082d;
}

.calendar-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.calendar-workspace.has-editor {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.calendar-canvas-wrap,
.calendar-editor {
  min-width: 0;
  border: 1px solid #dfe3e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 39, 35, 0.06);
}

.calendar-canvas-wrap {
  overflow: hidden;
  padding: 20px;
}

#commercial-calendar {
  min-height: 650px;
}

#commercial-calendar.fc {
  color: #242927;
  font-family: inherit;
}

#commercial-calendar .fc-toolbar {
  gap: 12px;
}

#commercial-calendar .fc-toolbar-title {
  font-size: 1.18rem;
  font-weight: 850;
  letter-spacing: 0;
}

#commercial-calendar .fc-button {
  min-height: 36px;
  border-color: #d7dcda;
  border-radius: 5px;
  padding: 6px 10px;
  background: #fff;
  box-shadow: none;
  color: #313735;
  font-size: 0.82rem;
  font-weight: 750;
  text-transform: none;
}

#commercial-calendar .fc-button:hover,
#commercial-calendar .fc-button:focus {
  border-color: #94052f;
  background: #fbf2f5;
  color: #85082d;
}

#commercial-calendar .fc-button-primary:not(:disabled).fc-button-active,
#commercial-calendar .fc-button-primary:not(:disabled):active {
  border-color: #94052f;
  background: #94052f;
  color: #fff;
}

#commercial-calendar .fc-col-header-cell-cushion,
#commercial-calendar .fc-daygrid-day-number {
  color: #3f4643;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

#commercial-calendar .fc-timegrid-slot-label-cushion {
  color: #737a76;
  font-size: 0.72rem;
}

#commercial-calendar .fc-event {
  border-radius: 4px;
  padding: 2px 3px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

#commercial-calendar .fc-day-today {
  background: #faf5f6;
}

.calendar-unavailable {
  display: grid;
  min-height: 520px;
  place-items: center;
  color: #7d1537;
  font-weight: 800;
}

.calendar-editor {
  align-self: start;
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.calendar-editor > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e6e9e7;
  padding: 18px 20px;
}

.calendar-editor > header span {
  color: #94052f;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-editor > header h2 {
  margin: 4px 0 0;
  font-size: 1.16rem;
  letter-spacing: 0;
}

.calendar-editor > header > button {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #d8ddda;
  border-radius: 5px;
  background: #fff;
  color: #505753;
  font-size: 1.35rem;
  cursor: pointer;
  place-items: center;
}

.calendar-editor form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.calendar-editor label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.calendar-editor label > span,
.calendar-contact-search > span {
  color: #323734;
  font-size: 0.82rem;
  font-weight: 800;
}

.calendar-editor input,
.calendar-editor select,
.calendar-editor textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #ccd3cf;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: #1d211f;
  font: inherit;
}

.calendar-editor textarea {
  resize: vertical;
}

.calendar-editor input:focus,
.calendar-editor select:focus,
.calendar-editor textarea:focus {
  border-color: #94052f;
  outline: 2px solid rgba(148, 5, 47, 0.11);
}

.calendar-all-day {
  display: flex !important;
  align-items: center;
}

.calendar-all-day input {
  width: 18px;
  height: 18px;
  accent-color: #94052f;
}

.calendar-date-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr) minmax(0, 0.8fr);
  gap: 9px;
}

.calendar-contact-results {
  display: grid;
  gap: 5px;
  max-height: 210px;
  overflow: auto;
}

.calendar-contact-results > button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #e0e5e2;
  border-radius: 5px;
  padding: 10px;
  background: #fafbfa;
  color: #262c29;
  text-align: left;
  cursor: pointer;
}

.calendar-contact-results > button:hover {
  border-color: #94052f;
  background: #fbf2f5;
}

.calendar-contact-results span,
.calendar-contact-status,
.calendar-event-opportunity {
  color: #69716d;
  font-size: 0.78rem;
}

.calendar-selected-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-left: 3px solid #176b4d;
  padding: 8px 10px;
  background: #edf7f2;
  color: #174f3c;
  font-weight: 750;
}

.calendar-selected-contact button {
  border: 0;
  background: transparent;
  color: #85082d;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.calendar-editor footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid #e6e9e7;
  padding-top: 16px;
}

.calendar-editor footer button:first-child {
  min-height: 44px;
  border: 1px solid #d4dad6;
  border-radius: 7px;
  padding: 0 16px;
  background: #fff;
  color: #4b524e;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.calendar-editor button:disabled {
  cursor: wait;
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .calendar-workspace.has-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .calendar-editor {
    position: static;
  }
}

@media (max-width: 760px) {
  .calendar-page {
    padding: 14px;
  }

  .calendar-page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-page-header > button {
    width: 100%;
  }

  .calendar-canvas-wrap {
    padding: 12px 8px;
  }

  #commercial-calendar {
    min-height: 560px;
  }

  #commercial-calendar .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  #commercial-calendar .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }

  #commercial-calendar .fc-toolbar-title {
    padding: 4px 0;
    text-align: center;
  }

  .calendar-date-row {
    grid-template-columns: 1fr;
  }

  .calendar-editor form {
    padding: 16px;
  }
}

@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;
  }
}
