:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --text: #17212b;
  --muted: #607083;
  --line: #dce4ec;
  --brand: #246a73;
  --brand-2: #1b4d57;
  --accent: #d96c3f;
  --success: #2e8f68;
  --danger: #b84a4a;
  --shadow: 0 18px 42px rgba(31, 47, 66, 0.1);
}

/* PWA/Web Push: controls remain fully scoped to the Mobile breakpoint. */
.mobile-push-entry { display: none; }

@media (max-width: 920px) {
  .mobile-push-entry {
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 12px 0;
    font-weight: 700;
  }

  .push-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 7200;
    display: grid;
    align-items: end;
    padding: 0;
    background: rgba(8, 15, 38, .72);
  }

  .push-settings-overlay[hidden] { display: none; }
  .push-settings-panel {
    width: 100%;
    max-height: 88dvh;
    overflow: auto;
    padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-radius: 20px 20px 0 0;
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .3);
  }
  .push-settings-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
  .push-settings-panel > header div { display: grid; gap: 3px; }
  .push-settings-panel > header span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
  .push-device-label { display: grid; gap: 7px; margin: 16px 0; }
  .push-device-label input { min-height: 44px; }
  .push-preferences { display: grid; gap: 10px; margin: 16px 0; }
  .push-preferences label { display: flex; align-items: center; gap: 10px; min-height: 44px; }
  .push-actions { display: grid; gap: 9px; }
  .push-message { min-height: 22px; margin-top: 14px; color: #087c47; }
  .push-message.error { color: #b42318; }
  .push-device-list { display: grid; gap: 8px; margin-top: 16px; }
  .push-device-list > div { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
}

body.auth-loading .app-shell,
body.auth-login-required .app-shell,
body.auth-loading .drawer,
body.auth-login-required .drawer {
  display: none;
}

body.authenticated .auth-screen {
  display: none;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(circle at 18% 18%, rgba(34, 197, 94, 0.22), transparent 28%),
    linear-gradient(135deg, rgba(12, 47, 59, 0.94), rgba(15, 118, 110, 0.82)),
    #0f172a;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 20px;
  padding: 34px 34px 30px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 126px;
}

.auth-brand img {
  width: min(300px, 86%);
  height: auto;
  object-fit: contain;
}

.auth-card h1 {
  margin: 4px 0 0;
  font-size: 28px;
  text-align: center;
  color: var(--text);
}

.auth-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
}

.auth-form .primary-button {
  justify-content: center;
  margin-top: 4px;
}

.auth-message {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.auth-user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user-chip {
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  line-height: 1.1;
}

.auth-user-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-user-chip strong {
  font-size: 13px;
}

.auth-logout-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  padding: 9px 11px;
  font-weight: 800;
  cursor: pointer;
}

.auth-logout-button:hover {
  background: var(--surface-2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.sidebar {
  background:
    radial-gradient(circle at 22% 18%, rgba(37, 106, 115, 0.28), transparent 28%),
    linear-gradient(180deg, #082b2f 0%, #0b252c 48%, #071e25 100%);
  color: #fff;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: grid;
  gap: 10px;
  align-items: start;
}

.brand-logo {
  width: min(188px, 100%);
  height: auto;
  display: block;
  object-fit: contain;
}

.brand span,
.storage-card span,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sidebar .brand span,
.sidebar .storage-card span {
  color: #a7bac6;
}

.nav {
  display: grid;
  gap: 0;
}

.nav-item,
.ghost-button,
.primary-button,
.small-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 13px 14px;
  border-radius: 8px;
  background: transparent;
  color: #eef7f5;
  font-weight: 700;
  line-height: 1.15;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  margin: 18px 6px 20px;
}

.nav-section-title {
  margin: 0 8px 10px;
  color: #b6df18;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: currentColor;
}

.nav-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item > span:not(.nav-icon) {
  min-width: 0;
}

.nav-badge {
  margin-left: auto;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ed3b4d;
  box-shadow: 0 10px 20px rgba(237, 59, 77, 0.28);
  color: #fff;
  padding: 0 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.nav-badge:empty {
  display: none;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.16);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 10px;
  bottom: 10px;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: #b6df18;
}

.nav-item.active .nav-icon {
  color: #b6df18;
}

.storage-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 10px;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 10px;
}

.main {
  padding: 24px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1,
.panel h2 {
  margin: 0;
}

.search-box {
  flex: 0 1 430px;
}

.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 13px 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 0.8fr);
  gap: 16px;
}

.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.25fr) minmax(280px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.insight-list,
.workload-chart,
.portfolio-chart {
  padding: 14px 16px 16px;
}

.insight-row,
.portfolio-row {
  display: grid;
  grid-template-columns: minmax(105px, 1fr) minmax(120px, 2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.insight-row:last-child,
.portfolio-row:last-child {
  border-bottom: 0;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.9fr) minmax(120px, 2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.progress-row:last-child {
  border-bottom: 0;
}

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

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--brand);
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-total {
  height: 100%;
  border-radius: 999px;
  background: #2b7780;
  position: relative;
}

.progress-remaining {
  height: 100%;
  background: var(--danger);
  border-radius: 999px;
}

.workload-bars {
  display: grid;
  grid-template-columns: repeat(14, minmax(28px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 150px;
}

.workload-day {
  display: grid;
  gap: 6px;
  align-content: end;
  justify-items: center;
}

.workload-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: var(--brand);
}

.workload-day.weekend .workload-bar {
  background: #9fb2bf;
}

.workload-day strong {
  font-size: 12px;
}

.workload-day span {
  color: var(--muted);
  font-size: 11px;
}

.portfolio-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.portfolio-total strong {
  font-size: 26px;
}

.dashboard-risk-panel {
  margin-bottom: 16px;
}

.risk-dashboard {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.4fr);
  gap: 16px;
  padding: 14px 16px 16px;
}

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

.risk-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
}

.risk-card.critical {
  border-color: #f0b8b8;
  background: #fff5f5;
}

.risk-card:hover {
  border-color: var(--brand);
}

.risk-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.risk-card strong {
  font-size: 26px;
}

.risk-dashboard h3 {
  margin: 0 0 8px;
}

.activity-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.quick-filter,
.date-filter {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-filter {
  padding: 10px 13px;
  cursor: pointer;
  color: var(--brand-2);
}

.quick-filter.active,
.quick-filter:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.date-filter span {
  color: var(--muted);
  font-size: 12px;
}

.date-filter input {
  border: 0;
  min-height: 28px;
}

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-day {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.calendar-day span {
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.calendar-day strong {
  font-size: 16px;
}

.calendar-day em {
  width: fit-content;
  min-width: 28px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand-2);
  font-style: normal;
  font-weight: 700;
}

.calendar-day.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(36, 106, 115, 0.18);
}

.calendar-day.weekend {
  opacity: 0.62;
}

.panel {
  overflow: hidden;
}

.panel-header {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact {
  align-items: flex-start;
}

.panel-header select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.panel-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-tools select {
  max-width: 190px;
}

.deals-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.deal-summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.deal-summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: 0.15s ease;
}

.deal-summary-card span {
  display: block;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.deal-summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  color: var(--text);
}

.deal-summary-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.deal-summary-card.active,
.deal-summary-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.deal-summary-card.analysis { border-left: 4px solid #2563eb; }
.deal-summary-card.balance { border-left: 4px solid #7c3aed; }
.deal-summary-card.pending { border-left: 4px solid #f97316; }
.deal-summary-card.averbacao { border-left: 4px solid #7c3aed; }
.deal-summary-card.payment { border-left: 4px solid #eab308; }
.deal-summary-card.paid { border-left: 4px solid #16a34a; }
.deal-summary-card.commission { border-left: 4px solid #64748b; }
.deal-summary-card.done { border-left: 4px solid #166534; }

.cockpit-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cockpit-header h2 {
  margin: 0;
  color: var(--ink);
}

.cockpit-header small {
  color: var(--muted);
}

.cockpit-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cockpit-metrics .metric strong {
  font-size: 24px;
}

.cockpit-priority-panel,
.cockpit-grid,
#dashboardDealsSummary {
  margin-bottom: 16px;
}

.cockpit-grid {
  display: grid;
  gap: 16px;
}

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

.cockpit-production-panel-header {
  flex-wrap: wrap;
}

.cockpit-production-panel-header > div:first-child small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.cockpit-period-tools {
  display: grid;
  justify-items: end;
  gap: 7px;
  max-width: 100%;
  margin-left: auto;
}

.cockpit-period-segment {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.cockpit-period-segment button {
  min-height: 32px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 6px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.cockpit-period-segment button:last-child {
  border-right: 0;
}

.cockpit-period-segment button:hover {
  background: #eef6f6;
  color: var(--brand);
}

.cockpit-period-segment button.active {
  background: var(--brand);
  color: #fff;
}

.cockpit-period-segment button:disabled {
  cursor: wait;
  opacity: .72;
}

.cockpit-custom-period {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.cockpit-custom-period[hidden] {
  display: none;
}

.cockpit-custom-period label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.cockpit-custom-period input {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}

.cockpit-custom-period .small-button {
  min-height: 32px;
}

.cockpit-period-status {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
}

.cockpit-block-body {
  padding: 0 16px 16px;
}

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

.cockpit-mini-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.cockpit-mini-grid span,
.cockpit-funnel-row span,
.cockpit-funnel-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.cockpit-mini-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.cockpit-mini-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cockpit-mini-grid.compact div {
  padding: 8px;
}

.cockpit-mini-grid.compact strong {
  font-size: 16px;
}

.cockpit-priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.cockpit-priority-badge.overdue {
  background: #fee2e2;
  color: #991b1b;
}

.cockpit-priority-badge.balance {
  background: #ede9fe;
  color: #5b21b6;
}

.cockpit-priority-badge.averbacao {
  background: #dbeafe;
  color: #1d4ed8;
}

.cockpit-priority-badge.payment {
  background: #fef3c7;
  color: #92400e;
}

.cockpit-priority-badge.activity {
  background: #dcfce7;
  color: #166534;
}

.cockpit-priority-badge.deal {
  background: #f1f5f9;
  color: #334155;
}

.cockpit-product-bar {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.cockpit-product-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
}

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

.cockpit-latest-list button {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  cursor: pointer;
}

.cockpit-latest-list button:hover {
  border-color: var(--brand);
  background: #f8fbff;
}

.cockpit-latest-list strong,
.cockpit-latest-list span {
  display: block;
}

.cockpit-latest-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cockpit-funnel {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}

.cockpit-funnel-row {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr) 54px 118px;
  gap: 10px;
  align-items: center;
}

.cockpit-funnel-row strong {
  color: var(--ink);
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  opacity: .82;
}

.alert-item span {
  color: var(--muted);
}

.alert-item strong {
  color: var(--ink);
}

.cockpit-quality-alerts {
  background: #f8fafc;
}

.deals-filter-grid label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.deals-filter-grid .toggle-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.deals-filter-grid .toggle-filter input {
  width: auto;
  min-height: auto;
}

.deals-filter-grid input,
.deals-filter-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.deal-actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-status {
  min-height: 18px;
  padding: 6px 14px 0;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
}

.success-note {
  margin: 0 0 10px;
  color: var(--success);
  font-weight: 800;
}

.view-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(248, 251, 253, 0.92));
  border-bottom: 1px solid var(--line);
}

.compact-summary {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.activity-insights-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 14px;
  margin-bottom: 12px;
}

.activity-summary-panel,
.activity-auto-panel {
  overflow: hidden;
}

.activity-summary-panel .panel-header,
.activity-auto-panel .panel-header {
  padding-bottom: 10px;
}

.activity-summary-panel .view-summary-grid {
  border-bottom: 0;
  padding-top: 0;
}

.activity-auto-panel {
  padding: 16px;
}

.activity-auto-panel .panel-header {
  padding: 0;
  margin-bottom: 12px;
}

.activity-auto-panel .primary-button {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

.promosys-connector-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.promosys-connector-status strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
}

.promosys-connector-status small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.connector-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #cbd5e1;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.14);
}

.connector-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(46, 143, 104, 0.14);
}

.connector-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(184, 74, 74, 0.14);
}

.promosys-connector-status .small-button {
  padding: 8px 10px;
  white-space: nowrap;
}

.auto-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.auto-metrics > div {
  padding: 0 12px;
}

.auto-metrics > div:first-child {
  padding-left: 0;
  border-right: 1px solid var(--line);
}

.auto-metrics > div:last-child {
  padding-right: 0;
}

.auto-metrics strong {
  display: block;
  color: var(--brand-2);
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
}

.auto-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .activity-insights-row {
    grid-template-columns: 1fr;
  }

  .activity-auto-panel {
    max-width: none;
  }
}

.summary-card {
  position: relative;
  min-height: 94px;
  padding: 16px 64px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31, 47, 66, 0.06);
  display: grid;
  gap: 6px;
  align-content: center;
}

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

.summary-card strong {
  font-size: 28px;
  line-height: 1;
  color: var(--brand-2);
}

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

.summary-card.warning strong {
  color: #c77913;
}

.summary-card.danger strong {
  color: var(--danger);
}

.summary-card.success strong {
  color: var(--success);
}

.summary-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  background: #e6f5ec;
  color: var(--success);
}

.summary-card .summary-icon {
  color: var(--success);
}

.summary-card.warning .summary-icon {
  background: #fff2d8;
  color: #c77913;
}

.summary-card.danger .summary-icon {
  background: #f9e4e4;
  color: var(--danger);
}

.summary-icon svg,
.icon-meta svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 220px);
  padding: 10px 12px 14px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  min-width: 780px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: #445566;
  z-index: 1;
  border-bottom: 0;
}

td small {
  color: var(--muted);
}

tbody tr.card-row td {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

tbody tr.card-row td:first-child {
  border-left: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
}

tbody tr.card-row td:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}

tbody tr.card-row:hover td {
  background: #fbfdfd;
  box-shadow: 0 8px 22px rgba(31, 47, 66, 0.06);
}

.entity-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.entity-cell strong {
  display: block;
  line-height: 1.2;
}

.entity-cell small {
  display: block;
  margin-top: 3px;
}

.avatar-badge {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #dff2e7;
  color: var(--brand-2);
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.inline-meta {
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
  color: var(--success);
  font-weight: 700;
  font-size: 12px;
}

.whatsapp-meta::before {
  content: "•";
  font-size: 18px;
  line-height: 0;
  margin-right: 4px;
}

.icon-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  color: var(--success);
  vertical-align: -4px;
}

.icon-meta svg {
  width: 18px;
  height: 18px;
}

.whatsapp-meta::before {
  content: none;
}

.action-cell {
  white-space: nowrap;
}

.icon-more-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: default;
}

.muted {
  color: var(--muted);
}

.count-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: #405366;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.late {
  background: #f7e7e7;
  color: var(--danger);
}

.status-pill.today {
  background: #e3f2ea;
  color: var(--success);
}

.status-pill.deal-status-analysis {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.deal-status-balance {
  background: #ede9fe;
  color: #6d28d9;
}

.status-pill.deal-status-pending {
  background: #ffedd5;
  color: #c2410c;
}

.status-pill.deal-status-averbacao {
  background: #ede9fe;
  color: #6d28d9;
}

.status-pill.deal-status-payment {
  background: #fef9c3;
  color: #854d0e;
}

.status-pill.deal-status-paid {
  background: #dcfce7;
  color: #15803d;
}

.status-pill.deal-status-commission {
  background: #e2e8f0;
  color: #334155;
}

.status-pill.deal-status-done {
  background: #bbf7d0;
  color: #14532d;
}

.status-pill.deal-status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.deal-status-canceled {
  background: #e5e7eb;
  color: #111827;
}

.deal-row-overdue {
  background: #fff7f7;
  box-shadow: inset 3px 0 0 #ef4444;
}

.worked-row {
  background: #f8fbf9;
  opacity: 0.72;
}

.insurance-new-lead-row {
  background: transparent;
}

.insurance-new-lead-row td:first-child {
  border-left: 4px solid var(--success);
}

.mini-separator {
  border: 0;
  border-top: 1px solid #dbe5ea;
  margin: 8px 0;
}

.small-button {
  background: var(--brand);
  color: #fff;
  border-radius: 7px;
  padding: 7px 10px;
  margin-right: 6px;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.ui-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.ui-icon svg {
  width: 100%;
  height: 100%;
}

.ghost-small-button {
  background: var(--surface-2);
  color: var(--brand);
  border: 1px solid var(--line);
}

.danger-button {
  background: var(--danger);
}

.primary-button {
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 700;
}

.compact-button {
  padding: 10px 12px;
  white-space: nowrap;
}

.link-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.row-check {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.alerts {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.alert-item {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
}

.alert-item strong {
  display: block;
  margin-bottom: 4px;
}

.import-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-import-grid {
  padding: 0;
  margin-top: 10px;
}

.settings-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 18px;
}

.settings-grid-single {
  grid-template-columns: minmax(280px, 520px);
}

.settings-grid-single-wide {
  grid-template-columns: minmax(320px, 920px);
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.settings-form-grid label {
  display: grid;
  gap: 6px;
}

.settings-form-grid label.wide {
  grid-column: 1 / -1;
}

.settings-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 18px 0;
  border-top: 1px solid var(--line);
}

.settings-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  background: #fbfcfe;
  font-weight: 700;
}

.settings-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
}

.settings-grid h3 {
  margin: 0 0 10px;
}

.settings-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.settings-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-readout {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.settings-readout span,
.settings-readout small {
  color: var(--muted);
}

.settings-readout strong {
  font-size: 20px;
}

.settings-table-wrap {
  max-height: none;
}

.setting-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
}

.setting-textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}

.settings-help {
  color: var(--muted);
  margin-bottom: 12px;
}

.calendar-days-table-wrap {
  margin-top: 14px;
}

.muted-row {
  opacity: 0.62;
}

.business-day-notice {
  min-height: 18px;
  padding: 8px 10px;
  border: 1px solid #ffe1ad;
  background: #fff8e8;
  color: #9a5b00;
  border-radius: 8px;
  font-size: 12px;
}

.business-day-notice:empty {
  display: none;
}

.file-card {
  border: 1px dashed #a8bac8;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 8px;
  background: #fbfcfe;
}

.file-card input {
  max-width: 100%;
}

.import-actions {
  padding: 0 18px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
}

.settings-import-actions {
  padding: 14px 0 0;
}

.import-log {
  padding: 0 18px 18px;
  color: var(--muted);
}

.margin-summary {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfe;
}

.insurance-lead-alert {
  padding: 14px 18px;
  border-bottom: 1px solid #b9e1ce;
  background: #f0fff7;
  color: #315544;
}

.insurance-lead-alert strong {
  color: var(--success);
}

.insurance-lead-alert.hidden {
  display: none;
}

.social-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.social-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.social-summary span,
.social-chip span {
  color: var(--muted);
  font-size: 13px;
}

.social-ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.social-op-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
  display: grid;
  gap: 6px;
  min-height: 118px;
}

.social-op-card.attention {
  border-color: #f0c0a4;
  background: #fff8f2;
}

.social-op-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.social-op-card strong {
  font-size: 26px;
  line-height: 1;
}

.social-op-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.social-today-card {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.social-today-content {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
}

.social-today-copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 12px;
}

.social-today-copy h3 {
  margin: 0;
  font-size: 22px;
}

.social-today-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-today-meta span {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-2);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

.social-today-copy label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.social-today-copy textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  resize: vertical;
  min-height: 170px;
  color: var(--text);
  background: #fff;
  line-height: 1.45;
}

.social-art-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101711;
  padding: 12px;
  display: grid;
  place-items: center;
  min-height: 420px;
}

.social-art-preview canvas,
.social-art-preview img {
  width: min(100%, 380px);
  aspect-ratio: 1 / 1;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(8, 14, 16, 0.28);
}

.social-art-preview img {
  object-fit: cover;
}

.social-today-empty {
  border: 1px dashed #a8bac8;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.social-today-empty strong {
  color: var(--text);
}

.social-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  padding: 16px 18px 18px;
}

.social-main {
  min-width: 0;
}

.social-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.social-calendar-head h3 {
  margin: 0;
}

.social-view-tabs {
  display: flex;
  gap: 6px;
}

.social-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.social-day {
  min-height: 112px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 4px;
  cursor: pointer;
}

.social-day.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(36, 106, 115, 0.14);
}

.social-day span,
.social-day small {
  color: var(--muted);
}

.social-day em {
  width: fit-content;
  min-width: 24px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  font-style: normal;
  font-weight: 800;
}

.social-table-wrap {
  max-height: 390px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.social-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.social-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  width: fit-content;
  padding: 0;
  font-weight: 800;
  cursor: pointer;
}

.whatsapp-tools {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(360px, 1fr);
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.whatsapp-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.whatsapp-tools select,
.whatsapp-tools textarea,
.inline-control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}

.whatsapp-template-box textarea {
  min-height: 86px;
  resize: vertical;
}

.inline-control {
  min-width: 150px;
  margin-bottom: 7px;
  font-size: 13px;
}

.whatsapp-note {
  min-width: 190px;
}

.whatsapp-inline-card {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.drawer-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

.drawer-section-title h3 {
  margin: 0;
}

.client-margin-panel .metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.client-margin-panel .metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.client-margin-panel .metric-grid small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.client-margin-panel .metric-grid strong {
  color: var(--ink);
}

.client-margin-panel .table-scroll {
  overflow-x: auto;
}

.client-margin-panel .compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.client-margin-panel .compact-table th,
.client-margin-panel .compact-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

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

.whatsapp-inline-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.whatsapp-inline-message {
  margin-top: 10px;
  min-height: 78px;
  resize: vertical;
}

.whatsapp-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.whatsapp-inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
}

.drawer.open {
  display: block;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 25, 0.35);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(1280px, calc(100% - 20px));
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px 30px;
  overflow: auto;
}

.drawer-panel > #closeDrawerBtn {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  margin: -10px -12px 8px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 18px rgba(15, 35, 45, 0.14);
}

.client-profile-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbfb);
  box-shadow: 0 12px 28px rgba(15, 35, 45, 0.08);
  margin-right: 36px;
}

.client-profile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.client-profile-main {
  display: flex;
  gap: 16px;
  min-width: 0;
}

.client-profile-avatar {
  width: 66px;
  height: 66px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dcf5e7;
  color: var(--brand);
  font-size: 24px;
  font-weight: 900;
  border: 1px solid #bee8cf;
}

.client-profile-main h2 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.15;
}

.client-profile-tags,
.client-profile-meta,
.client-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.client-profile-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-profile-meta span {
  padding-right: 8px;
  border-right: 1px solid var(--line);
}

.client-profile-meta span:last-child {
  border-right: 0;
}

.client-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.client-profile-metrics div {
  border-right: 1px solid var(--line);
  min-height: 48px;
}

.client-profile-metrics .client-metric-item {
  position: relative;
  padding-left: 34px;
}

.client-metric-item .ui-icon {
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e5f5ec;
  color: var(--brand);
}

.client-metric-item:nth-child(2) .ui-icon {
  background: #eef4ff;
  color: #2463d1;
}

.client-metric-item:nth-child(3) .ui-icon {
  background: #fff4da;
  color: #c17600;
}

.client-metric-item:nth-child(4) .ui-icon {
  background: #fff0e6;
  color: #e06a00;
}

.client-profile-metrics div:last-child {
  border-right: 0;
}

.client-profile-metrics span,
.client-profile-metrics small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.client-profile-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.client-profile-actions {
  gap: 10px;
}

.client-profile-tabs {
  flex: 1 1 100%;
}

.whatsapp-button {
  background: #0a8f57;
}

.muted-tag {
  background: #eef4f6;
  color: var(--muted);
}

.client-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-right: 42px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.client-header h2 {
  margin: 0 0 6px;
}

.promosys-phone-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.promosys-phone-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.promosys-phone-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
}

.drawer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  width: 100%;
  margin-top: 16px;
  padding: 0 0 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.drawer-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 16px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
}

.drawer-tab.active {
  background: transparent;
  color: var(--brand);
}

.drawer-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  transition: background 0.18s ease;
}

.drawer-tab:hover {
  color: var(--brand);
}

.drawer-tab.active::after {
  background: var(--brand);
}

.drawer-tab .ui-icon {
  width: 18px;
  height: 18px;
}

.drawer-tab .ui-icon svg {
  width: 18px;
  height: 18px;
}

.drawer-tab-panel {
  display: none;
}

.drawer-tab-panel.active {
  display: block;
}

.icon-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
}

.drawer-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section h3 {
  margin: 0 0 10px;
}

.drawer-placeholder-section {
  padding: 18px 0;
}

.placeholder-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--text);
  line-height: 1.7;
}

.table-link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.table-link-button:hover {
  text-decoration: underline;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.section-toolbar h3 {
  margin: 0;
}

.section-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 999px;
  background: #e7f0ff;
  color: #2463d1;
  font-size: 13px;
  font-weight: 900;
}

.promosys-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.opportunity-panel .section-toolbar {
  align-items: flex-start;
}

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

.opportunity-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

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

.opportunity-source {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.opportunity-card h4 {
  margin: 3px 0 0;
  font-size: 15px;
}

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

.opportunity-values div,
.compact-key-values div {
  min-width: 0;
}

.opportunity-values span,
.opportunity-meta span,
.compact-key-values span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.opportunity-values strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}

.opportunity-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.opportunity-meta strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.opportunity-details {
  margin-top: 12px;
}

.opportunity-details summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.compact-key-values {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.compact-key-values strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.client-opportunities-dashboard {
  display: grid;
  gap: 10px;
}

.client-opportunities-header,
.client-opportunity-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(11, 31, 68, .05);
}

.client-opportunities-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
}

.client-opportunities-header > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.client-opportunities-header h3 {
  margin: 0;
  color: #304cff;
  font-size: 18px;
}

.client-opportunities-header > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-opportunities-header > div > span,
.client-opportunities-refresh-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-opportunities-refresh-note {
  margin: -4px 4px 0;
}

.client-opportunity-benefit-group {
  display: grid;
  gap: 10px;
  border: 1px solid #dce6f4;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
}

.client-opportunity-benefit-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid #dce6f4;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.client-opportunity-benefit-header div {
  display: grid;
  gap: 2px;
}

.client-opportunity-benefit-header span,
.client-opportunity-benefit-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-opportunity-benefit-header strong {
  color: var(--ink);
  font-size: 16px;
}

.client-opportunity-benefit-header .positive strong {
  color: #07a957;
}

.client-opportunity-benefit-header .negative strong {
  color: #d92222;
}

.client-opportunity-section {
  padding: 12px;
}

.client-opportunity-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.client-opportunity-title span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #4f5bff;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.client-opportunity-title h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-opportunity-green .client-opportunity-title h3 { color: #07a957; }
.client-opportunity-blue .client-opportunity-title h3 { color: #245df5; }
.client-opportunity-orange .client-opportunity-title h3 { color: #f47712; }
.client-opportunity-purple .client-opportunity-title h3 { color: #7357e8; }
.client-opportunity-red .client-opportunity-title h3 { color: #d92222; }

.client-opportunity-kpis,
.client-opportunity-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.client-opportunity-kpis.fixed-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-opportunity-info,
.client-opportunity-mini-card,
.client-opportunity-note {
  border: 1px solid #dce6f4;
  border-radius: 8px;
  background: #fdfefe;
  padding: 11px;
}

.client-opportunity-info span,
.client-opportunity-mini-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-opportunity-info strong,
.client-opportunity-mini-card strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.client-opportunity-info small,
.client-opportunity-mini-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.client-opportunity-info.is-success {
  border-color: #c9efd9;
  background: #f4fcf7;
}

.client-opportunity-info.is-success strong { color: #07a957; }

.client-opportunity-info.is-alert {
  border-color: #ffd0d0;
  background: #fff7f7;
}

.client-opportunity-info.is-alert strong { color: #d92222; }

.client-opportunity-info.is-warning,
.client-opportunity-note.orange {
  border-color: #ffdcbf;
  background: #fff9f4;
}

.client-opportunity-info.is-warning strong { color: #f47712; }

.client-opportunity-info.is-neutral {
  border-color: #e4eaf3;
  background: #f8fafc;
}

.client-opportunity-info.is-neutral strong {
  color: #526071;
}

.client-opportunity-info.is-purple,
.client-opportunity-note.purple {
  border-color: #ddd4ff;
  background: #faf8ff;
}

.client-opportunity-summary-line {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin: -2px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.client-opportunity-summary-line strong {
  color: var(--ink);
}

.client-opportunities-two-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr);
  gap: 10px;
  align-items: start;
}

.client-opportunities-two-columns > div {
  display: grid;
  gap: 10px;
}

.client-opportunities-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

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

.client-opportunity-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  font-size: 11px;
}

.client-opportunity-table.reduction-table {
  min-width: 720px;
}

.client-opportunity-table th,
.client-opportunity-table td {
  border: 1px solid #e1e8f2;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.client-opportunity-table th {
  background: #f3f7fc;
  color: #16345f;
  font-weight: 900;
}

.client-opportunity-rate-list {
  display: grid;
  gap: 5px;
}

.client-opportunity-rate-list div {
  display: grid;
  grid-template-columns: 46px minmax(82px, 1fr) minmax(82px, auto);
  gap: 6px;
  align-items: center;
}

.client-opportunity-rate-list strong {
  color: #123266;
}

.client-opportunity-rate-list .negative-money,
.client-opportunity-table .negative-money {
  color: #d92222;
}

.portability-status {
  display: inline-flex;
  margin-bottom: 5px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
}

.portability-status.positive {
  background: #e8f9ef;
  color: #07934e;
}

.portability-status.negative {
  background: #fff0ed;
  color: #d92222;
}

.commission-badge {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2f7;
  color: #526071;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}

.client-opportunity-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
}

.client-opportunity-result.compact {
  display: inline-flex;
  margin: 0;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.client-opportunity-result span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.client-opportunity-result.positive {
  color: #07934e;
  background: #f4fcf7;
  border-color: #c9efd9;
}

.client-opportunity-result.negative {
  color: #d92222;
  background: #fff7f7;
  border-color: #ffd0d0;
}

.opportunity-convert-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.opportunity-convert-button {
  margin-top: 6px;
  align-self: flex-start;
}

.client-opportunity-table.portability-table th:nth-child(7),
.client-opportunity-table.portability-table td:nth-child(7) {
  min-width: 330px;
  width: 34%;
}

.client-opportunity-table.portability-table .client-opportunity-rate-list {
  gap: 4px;
}

.client-opportunity-table.portability-table .portability-rate-row {
  display: grid;
  grid-template-columns: 44px minmax(92px, 1fr) minmax(54px, auto) auto;
  gap: 6px;
  align-items: center;
  min-height: 26px;
  white-space: nowrap;
}

.client-opportunity-table.portability-table .portability-rate-value {
  color: #16345f;
  font-size: inherit;
  font-weight: inherit;
}

.client-opportunity-table.portability-table .portability-change-value {
  color: #123266;
  font-size: inherit;
  font-weight: inherit;
}

.client-opportunity-table.portability-table .commission-badge {
  min-width: 46px;
  padding: 2px 7px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.client-opportunity-table.portability-table .commission-badge.muted {
  background: #f1f5f9;
  color: #64748b;
}

.client-opportunity-table.portability-table .opportunity-convert-button {
  margin-top: 0;
  align-self: center;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.client-opportunity-table.portability-table .portability-convert-placeholder {
  width: 1px;
  min-width: 1px;
}

.compact-contract-list {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.compact-contract-list span {
  border: 1px solid #e5ddff;
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  color: #4b3da8;
  font-size: 12px;
  font-weight: 700;
}

.commission-badge.high {
  background: #e8f9ef;
  color: #07934e;
}

.commission-badge.medium {
  background: #edf3ff;
  color: #245df5;
}

.commission-badge.low {
  background: #fff3e8;
  color: #d96a00;
}

@media (max-width: 980px) {
  .client-opportunities-header,
  .client-opportunity-summary-line,
  .client-opportunity-benefit-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-opportunities-two-columns {
    grid-template-columns: 1fr;
  }

  .client-opportunities-bottom-grid {
    grid-template-columns: 1fr;
  }

  .client-opportunity-kpis.fixed-three {
    grid-template-columns: 1fr;
  }
}

.opportunity-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #f4c9c9;
  border-radius: 8px;
  background: #fff3f3;
  color: #9f1d1d;
  font-weight: 700;
}

.client-detail-bottom-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.client-next-card,
.client-history-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}

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

.next-activity-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.next-activity-grid strong {
  display: block;
  margin-top: 4px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 94px 18px 1fr;
  gap: 8px;
  align-items: start;
}

.timeline-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 3px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px #e0f3ea;
}

.timeline-item strong {
  display: block;
  font-size: 13px;
}

.timeline-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-full {
  margin-top: 12px;
}

.history-full summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.key-values {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 12px;
}

.compact-values {
  grid-template-columns: repeat(4, max-content minmax(110px, 1fr));
  align-items: baseline;
}

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

.raw-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.insurance-details {
  border: 1px solid #cfe5df;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf8;
}

.insurance-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--teal);
}

.insurance-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.insurance-form-grid .wide {
  grid-column: span 2;
}

.insurance-main-fields {
  margin-bottom: 12px;
}

.insurance-policy-card {
  border: 1px solid #d7e5e2;
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px;
  background: #fbfefd;
}

.insurance-policy-card legend {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}

.insurance-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.insurance-policy-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.insurance-policy-history h4 {
  margin: 0;
  font-size: 14px;
}

.raw-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-form label {
  display: grid;
  gap: 6px;
}

.edit-form label span {
  color: var(--muted);
  font-size: 12px;
}

.edit-form > .full > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.edit-form input,
.edit-form textarea,
.edit-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  resize: vertical;
}

.edit-form .full,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.deal-drawer .drawer-section-title {
  align-items: flex-start;
}

.deal-form {
  margin-top: 10px;
}

.deal-form .readonly-field {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.deal-form .readonly-field span,
.deal-form .readonly-field small {
  color: var(--muted);
  font-size: 12px;
}

.deal-form .readonly-field strong {
  font-size: 15px;
}

.deal-cycle-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.deal-cycle-details summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--primary);
}

.compact-timeline {
  margin-top: 4px;
}

.save-status {
  color: var(--success);
  font-weight: 700;
}

.note-box {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.debug-box {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #b8d7df;
  border-radius: 8px;
  background: #eef8fa;
  color: #23464f;
  font-size: 12px;
  line-height: 1.5;
}

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

.simulation-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
}

.simulation-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

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

.positive-margin-box div {
  border: 1px solid #cfe5d8;
  border-radius: 8px;
  padding: 12px;
  background: #f1faf5;
}

.positive-margin-box span,
.positive-margin-box small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.positive-margin-box strong {
  display: block;
  margin: 4px 0;
  color: var(--success);
  font-size: 18px;
}

.promosys-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.promosys-summary.inactive-benefit {
  opacity: 0.72;
  border-style: dashed;
}

.promosys-summary.inactive-benefit .summary-row:not(.summary-head) {
  background: #fafafa;
}

.benefit-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  background: #fff;
}

.benefit-block h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.inactive-benefit-block {
  opacity: 0.75;
  background: #fbfbfb;
  border-style: dashed;
}

.summary-row {
  display: grid;
  grid-template-columns: 0.9fr 2fr 1.2fr 1.4fr 1.2fr 0.9fr;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}

.summary-row-7 {
  grid-template-columns: 1.25fr 1.45fr 0.8fr 1.15fr 0.9fr 0.65fr 0.95fr;
}

.summary-row:last-child {
  border-bottom: 0;
}

.summary-head {
  background: var(--surface-2);
  color: #33485a;
  font-weight: 700;
  font-size: 12px;
}

.summary-row strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.25;
}

.benefit-values-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

.benefit-values-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.benefit-values-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.benefit-values-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  color: var(--brand-2);
}

.ok-text {
  color: var(--success);
}

.danger-text {
  color: var(--danger);
}

.positive-margin-box .negative-card {
  border-color: #efd0d0;
  background: #fff6f6;
}

.positive-margin-box .negative-card strong {
  color: var(--danger);
}

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

.mini-table {
  min-width: 520px;
}

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

.card-contracts-table {
  min-width: 620px;
}

.subtable-block {
  margin-top: 14px;
}

.subtable-block h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.wide-drawer-section .key-values {
  grid-template-columns: 120px minmax(140px, 1fr) 120px minmax(140px, 1fr);
}

.mini-table th,
.mini-table td {
  padding: 8px 10px;
  font-size: 13px;
}

.number-cell {
  text-align: right;
  white-space: nowrap;
}

.center-cell {
  text-align: center;
  white-space: nowrap;
}

.positive-row td:last-child {
  color: var(--success);
}

.rate-alert {
  color: var(--danger);
  font-weight: 800;
}

.rate-detail {
  font-weight: 800;
}

.rate-warning {
  color: #a15c00;
  font-weight: 700;
  white-space: nowrap;
}

.activity-preview {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.activity-preview:last-child {
  border-bottom: 0;
}

.activity-preview p {
  margin: 0 0 8px;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-inline input {
  width: auto;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 170px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfe;
  margin-top: 8px;
}

.checkbox-grid.collapsed {
  display: none;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 13px;
}

.check-option input {
  width: auto;
}

.check-option span {
  color: var(--text);
}

.orgao-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e4eef2;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

.ghost-light-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-2);
  padding: 8px 10px;
  cursor: pointer;
}

.orgao-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.orgao-options.collapsed {
  display: none;
}

.orgao-chip {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 34px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.orgao-chip::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 1px solid #b7c8d1;
  border-radius: 999px;
  background: #fff;
}

.orgao-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.orgao-chip:has(input:checked) {
  border-color: rgba(25, 112, 119, 0.35);
  background: #eaf7f1;
  color: var(--brand-2);
  box-shadow: 0 6px 18px rgba(25, 112, 119, 0.08);
}

.orgao-chip:has(input:checked)::before {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--success);
  background: var(--success);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.raw-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

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

.raw-field span {
  color: var(--muted);
  font-size: 11px;
}

.raw-field input {
  min-width: 0;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .metrics-grid,
  .content-grid,
  .cockpit-metrics,
  .cockpit-grid.two-columns,
  .import-grid,
  .deal-summary-grid,
  .deals-filter-grid,
  .calendar-strip,
  .social-summary,
  .social-ops-grid,
  .social-today-content,
  .social-layout,
  .social-calendar {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .main {
    padding: 16px;
  }

  .drawer-panel {
    width: 100%;
    padding: 18px;
  }

  .cockpit-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cockpit-production-panel-header {
    align-items: stretch;
  }

  .cockpit-period-tools {
    justify-items: stretch;
    width: 100%;
    margin-left: 0;
  }

  .cockpit-period-segment {
    display: grid;
    grid-template-columns: repeat(5, minmax(max-content, 1fr));
  }

  .cockpit-period-segment button {
    width: 100%;
  }

  .cockpit-custom-period {
    justify-content: flex-start;
  }

  .cockpit-funnel-row {
    grid-template-columns: 1fr;
  }

  .cockpit-mini-grid {
    grid-template-columns: 1fr;
  }

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

  .client-profile-card {
    margin-right: 0;
  }

  .client-profile-top,
  .client-profile-main,
  .drawer-section-title,
  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-profile-metrics,
  .client-detail-bottom-grid,
  .opportunity-values,
  .opportunity-meta,
  .compact-key-values,
  .whatsapp-inline-grid,
  .compact-client-form,
  .insurance-form-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 76px 16px 1fr;
  }
}

.central-readonly-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 10px 18px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 700;
  text-align: center;
}

.central-readonly-mode .readonly-disabled,
.central-readonly-mode button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Fase 6 — Clientes Mobile isolado. Desktop continua usando a tabela original. */
.mobile-clients-shell,
.mobile-filter-overlay {
  display: none;
}

/* Fase 7C — Atividades Mobile isolada. A tabela e o calendário desktop permanecem intactos. */
.mobile-activities-shell,
.mobile-activity-overlay { display: none; }
.mobile-activity-overlay[hidden] { display: none !important; }

@media (max-width: 920px) {
  .responsive-base-enabled body[data-current-view="activities"] .topbar { display: none; margin-bottom: 0; }
  .responsive-base-enabled #activitiesView > :not(.mobile-activities-shell) { display: none !important; }
  .mobile-activities-shell { display: block; min-width: 0; min-height: 65vh; padding-bottom: calc(88px + env(safe-area-inset-bottom)); background: #f8fafc; }
  .mobile-activities-header { position: sticky; top: 50px; z-index: 32; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); backdrop-filter: blur(8px); }
  .mobile-activities-header h2,.mobile-activities-header p { margin: 0; }
  .mobile-activities-header h2 { font-size: 21px; }
  .mobile-activity-new { min-height: 44px; border: 0; border-radius: 12px; padding: 0 14px; background: var(--brand); color: #fff; font-weight: 850; }
  .mobile-activity-chips { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding: 12px; background: #fff; scrollbar-width: none; }
  .mobile-activity-chips::-webkit-scrollbar,.mobile-activity-days::-webkit-scrollbar { display: none; }
  .mobile-activity-chips button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 999px; padding: 0 13px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 850; }
  .mobile-activity-chips button.active { border-color: var(--brand); background: var(--brand); color: #fff; }
  .mobile-activity-chips b { display: inline-grid; place-items: center; min-width: 21px; height: 21px; border-radius: 999px; background: rgba(15,23,42,.1); font-size: 10px; }
  .mobile-activity-chips button.active b { background: rgba(255,255,255,.2); }
  .mobile-activity-days { display: flex; gap: 8px; min-height: 83px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; padding: 0 12px 12px; background: #fff; scrollbar-width: none; }
  .mobile-activity-days.loading { align-items: center; min-height: 68px; color: var(--muted); font-size: 13px; }
  .mobile-activity-days button { position: relative; display: grid; flex: 0 0 66px; place-items: center; gap: 2px; min-height: 70px; border: 1px solid var(--line); border-radius: 13px; padding: 7px 4px; background: #fff; color: var(--text); }
  .mobile-activity-days button.active { border-color: #2563eb; background: #eff6ff; color: #1e40af; box-shadow: 0 0 0 2px #bfdbfe inset; }
  .mobile-activity-days span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
  .mobile-activity-days strong { font-size: 13px; }
  .mobile-activity-days em { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--surface-2); color: var(--brand); font-size: 10px; font-style: normal; font-weight: 900; }
  .mobile-activity-list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 12px 7px; }
  .mobile-activity-list-toolbar > div { display: grid; gap: 2px; min-width: 0; }
  .mobile-activity-list-toolbar strong { overflow-wrap: anywhere; font-size: 16px; }
  .mobile-activity-list-toolbar span { color: var(--muted); font-size: 12px; }
  .mobile-activity-list-toolbar > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; color: var(--brand); font-weight: 850; }
  .mobile-activity-list-toolbar b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 10px; }
  .mobile-activity-list { display: grid; gap: 12px; padding: 8px 12px; }
  .mobile-activity-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.06); }
  .mobile-activity-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .mobile-activity-card > header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
  .mobile-activity-card time { color: var(--muted); font-size: 12px; font-weight: 750; }
  .mobile-activity-badge,.mobile-activity-status { border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
  .mobile-activity-badge.overdue { background: #fee2e2; color: #b91c1c; }
  .mobile-activity-badge.today { background: #dbeafe; color: #1d4ed8; }
  .mobile-activity-badge.upcoming { background: #dcfce7; color: #166534; }
  .mobile-activity-badge.done { background: #e2e8f0; color: #334155; }
  .mobile-activity-badge.rescheduled { background: #fef3c7; color: #92400e; }
  .mobile-activity-badge.no-date { background: #f3e8ff; color: #7e22ce; }
  .mobile-activity-status { flex: 0 0 auto; background: var(--surface-2); color: var(--muted); }
  .mobile-activity-card h3 { margin: 13px 0 3px; overflow-wrap: anywhere; font-size: 17px; line-height: 1.25; }
  .mobile-activity-orgao { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
  .mobile-activity-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; margin: 0; }
  .mobile-activity-card dl div:first-child,.mobile-activity-card dl div:last-child:nth-child(odd) { grid-column: 1/-1; }
  .mobile-activity-card dt { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-activity-card dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 720; }
  .mobile-activity-note { display: -webkit-box; overflow: hidden; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
  .mobile-activity-card > footer { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
  .mobile-activity-card > footer button { min-width: 0; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 850; }
  .mobile-activity-card > footer .primary-button { border-color: var(--brand); background: var(--brand); color: #fff; }
  .mobile-activity-card > footer span { grid-column: 1/-1; color: var(--muted); font-size: 11px; }
  .mobile-activity-error,.mobile-activity-notice { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 12px; border-radius: 12px; padding: 11px 12px; font-size: 12px; line-height: 1.4; }
  .mobile-activity-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
  .mobile-activity-notice { border: 1px solid #bbf7d0; background: #f0fdf4; color: #166534; }
  .mobile-activity-error button { flex: 0 0 auto; min-height: 38px; border: 0; border-radius: 9px; padding: 0 10px; background: #991b1b; color: #fff; font-weight: 800; }
  .mobile-activity-empty { display: grid; gap: 5px; padding: 34px 18px; border: 1px dashed var(--line); border-radius: 15px; background: #fff; color: var(--muted); text-align: center; }
  .mobile-activity-empty strong { color: var(--text); }
  .mobile-activity-load-more { display: block; min-height: 46px; margin: 13px auto; border: 1px solid var(--brand); border-radius: 12px; padding: 0 24px; background: #fff; color: var(--brand); font-weight: 850; }
  .mobile-activity-load-more:disabled { opacity: .55; }

  .mobile-activity-overlay { position: fixed; inset: 0; z-index: 7200; display: grid; align-items: end; background: rgba(15,23,42,.58); }
  .mobile-activity-sheet { max-height: min(90dvh,760px); overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -18px 50px rgba(15,23,42,.24); }
  .mobile-activity-sheet > header { position: sticky; top: -18px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -18px -16px 14px; padding: 16px; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-activity-sheet h2 { margin: 0; font-size: 20px; }
  .mobile-activity-sheet > header button { width: 42px; height: 42px; border: 0; border-radius: 11px; background: var(--surface-2); font-size: 25px; }
  .mobile-activity-sheet form { display: grid; gap: 12px; }
  .mobile-activity-sheet label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 850; }
  .mobile-activity-sheet input,.mobile-activity-sheet select,.mobile-activity-sheet textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--text); font: inherit; font-size: 16px; }
  .mobile-activity-sheet textarea { min-height: 92px; resize: vertical; }
  .mobile-activity-period { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .mobile-activity-sheet-actions { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px -16px calc(-18px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
  .mobile-activity-sheet-actions button,.mobile-activity-sheet form > button { min-height: 46px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--brand); font-weight: 850; }
  .mobile-activity-sheet .primary-button { border-color: var(--brand); background: var(--brand); color: #fff; }
  .mobile-activity-identity { display: grid; gap: 4px; margin-bottom: 14px; border-radius: 12px; padding: 12px; background: #eff6ff; color: #1e3a8a; }
  .mobile-activity-identity span { overflow-wrap: anywhere; font-size: 12px; }
  .mobile-activity-confirm,.mobile-activity-no-date { display: flex !important; grid-template-columns: 22px minmax(0,1fr); align-items: center; gap: 9px !important; min-height: 44px; color: var(--text) !important; }
  .mobile-activity-confirm input,.mobile-activity-no-date input { flex: 0 0 auto; width: 22px; min-height: 22px; }
  .mobile-activity-form-error { min-height: 18px; color: #b91c1c; font-size: 12px; font-weight: 750; }
  .mobile-activity-client-search { position: relative; display: grid; gap: 6px; }
  .mobile-activity-client-search > strong:empty { display: none; }
  .mobile-activity-client-search > strong { border-radius: 9px; padding: 10px; background: #eff6ff; color: #1e3a8a; }
  #mobileActivityClientResults { display: grid; max-height: 220px; overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,.12); }
  #mobileActivityClientResults > button { display: grid; gap: 2px; min-height: 48px; border: 0; border-bottom: 1px solid var(--line); padding: 9px 11px; background: #fff; color: var(--text); text-align: left; }
  #mobileActivityClientResults span { padding: 10px; color: var(--muted); font-size: 12px; }
}

@media (min-width: 768px) and (max-width: 920px) {
  .mobile-activity-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mobile-activity-sheet { width: min(620px,100%); margin-inline: auto; border-radius: 22px 22px 0 0; }
}

.mobile-filter-overlay[hidden] { display: none !important; }

@media (max-width: 920px) {
  .responsive-base-enabled body[data-current-view="clients"] .topbar { display: none; margin-bottom: 0; }
  .clients-desktop-panel { display: none !important; }
  .mobile-clients-shell { display: block; min-height: 60vh; padding: 0 0 24px; }
  .mobile-clients-toolbar { position: sticky; top: 50px; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(8px); }
  .mobile-clients-search { position: relative; min-width: 0; }
  .mobile-clients-search input { width: 100%; min-height: 44px; padding: 10px 42px 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; background: #fff; }
  .mobile-clients-search button { position: absolute; right: 3px; top: 3px; width: 38px; height: 38px; border: 0; background: transparent; color: var(--muted); font-size: 24px; }
  .mobile-filter-button { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; color: var(--brand); font-weight: 800; }
  .mobile-filter-button span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; }
  .mobile-clients-status { min-height: 38px; padding: 10px 14px 4px; color: var(--muted); font-size: 13px; }
  .mobile-clients-status button { border: 0; background: transparent; color: var(--brand); font-weight: 800; text-decoration: underline; }
  .mobile-loading-dot { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: mobile-client-spin .8s linear infinite; }
  @keyframes mobile-client-spin { to { transform: rotate(360deg); } }
  .mobile-client-list { display: grid; gap: 12px; padding: 8px 12px; }
  .mobile-client-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.06); }
  .mobile-client-card-head { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 10px; align-items: center; }
  .mobile-client-card-head h3 { margin: 0 0 5px; overflow-wrap: anywhere; font-size: 17px; line-height: 1.2; }
  .mobile-client-tags { display: flex; gap: 6px; overflow: hidden; }
  .mobile-client-tags span { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 999px; padding: 4px 8px; background: var(--surface-2); color: var(--brand); font-size: 11px; font-weight: 800; }
  .mobile-client-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 12px; margin: 0; }
  .mobile-client-card dl div:first-child { grid-column: 1/-1; }
  .mobile-client-card dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .mobile-client-card dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
  .mobile-client-next { margin: 0; padding: 9px 10px; border-radius: 10px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
  .mobile-client-next.empty { background: #fff7ed; color: #9a3412; }
  .mobile-client-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .mobile-client-actions button { min-width: 0; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 3px; background: #fff; color: var(--brand); font-size: 11px; font-weight: 800; }
  .mobile-client-actions .primary-button { border-color: var(--brand); background: var(--brand); color: #fff; }
  .mobile-load-more { display: block; min-height: 44px; margin: 12px auto; border: 1px solid var(--brand); border-radius: 12px; padding: 0 22px; background: #fff; color: var(--brand); font-weight: 800; }
  .mobile-load-more[hidden] { display: none; }

  .mobile-filter-overlay { position: fixed; inset: 0; z-index: 7000; display: grid; align-items: end; background: rgba(15,23,42,.52); }
  .mobile-filter-sheet { max-height: min(88vh, 680px); overflow: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; box-shadow: 0 -18px 50px rgba(15,23,42,.2); }
  .mobile-filter-sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
  .mobile-filter-sheet h2 { margin: 0; font-size: 20px; }
  .mobile-filter-sheet header button { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--surface-2); font-size: 24px; }
  .mobile-filter-sheet label { display: grid; gap: 5px; margin: 12px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
  .mobile-filter-sheet input,.mobile-filter-sheet select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; color: var(--text); font-size: 16px; }
  .mobile-filter-actions { position: sticky; bottom: -18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px -16px -18px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }

  .drawer-panel { inset: 0; width: 100%; max-width: none; height: 100dvh; padding: 0; border-radius: 0; }
  .drawer-panel > .icon-button { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 7100; }
  .mobile-client-panel { min-height: 100dvh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); background: #f8fafc; }
  .mobile-client-panel-header { position: sticky; top: 0; z-index: 25; display: grid; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 56px 12px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); }
  .mobile-client-panel-header h2 { margin: 2px 0 5px; overflow-wrap: anywhere; font-size: 20px; }
  .mobile-client-panel-header p { margin: 3px 0; color: var(--muted); font-size: 12px; }
  .mobile-client-panel-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
  .mobile-client-panel-actions button,.mobile-section-title button { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; padding: 5px; background: #fff; color: var(--brand); font-size: 10px; font-weight: 800; }
  .mobile-client-tabs { position: sticky; top: 156px; z-index: 24; display: flex; gap: 6px; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scroll-padding-inline: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fff; scrollbar-width: none; }
  .mobile-client-tabs::-webkit-scrollbar { display: none; }
  .mobile-client-tabs button { flex: 0 0 auto; min-width: max-content; min-height: 44px; border: 0; border-radius: 999px; padding: 0 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; }
  .mobile-client-tabs button.active { background: var(--brand); color: #fff; }
  .mobile-client-section { display: none; padding: 14px 12px; }
  .mobile-client-section.active { display: block; }
  .mobile-client-section > h3,.mobile-section-title h3 { margin: 4px 0 12px; font-size: 17px; }
  .mobile-client-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 18px; }
  .mobile-client-summary-grid article { display: grid; gap: 4px; min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .mobile-client-summary-grid span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .mobile-client-summary-grid strong { overflow-wrap: anywhere; font-size: 13px; }
  .mobile-client-activity-summary small { margin-top: 3px; font-size: 11px; font-weight: 850; line-height: 1.3; }
  .mobile-client-activity-summary.overdue { border-color: #fca5a5; background: linear-gradient(135deg,#fef2f2,#fff); box-shadow: 0 0 0 1px rgba(220,38,38,.05); }
  .mobile-client-activity-summary.overdue span,.mobile-client-activity-summary.overdue small { color: #b91c1c; }
  .mobile-client-activity-summary.overdue strong { color: #7f1d1d; font-size: 14px; }
  .mobile-client-activity-summary.upcoming { border-color: #bfdbfe; background: #eff6ff; }
  .mobile-client-activity-summary.upcoming span { color: #1d4ed8; }
  .mobile-client-activity-summary.empty { background: #f8fafc; }
  .mobile-promosys-summary-link { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; align-items: center; width: calc(100% - 24px); min-height: 58px; margin: 14px 12px 0; border: 1px solid #bfdbfe; border-radius: 12px; padding: 10px 12px; background: #eff6ff; color: #1e3a8a; text-align: left; }
  .mobile-promosys-summary-link span { grid-column: 1; color: #2563eb; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-promosys-summary-link strong { grid-column: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
  .mobile-promosys-summary-link b { grid-column: 2; grid-row: 1/3; font-size: 24px; }
  .mobile-promosys,.mobile-promosys-empty { min-width: 0; }
  .mobile-promosys-header { display: grid; gap: 7px; padding: 15px; border: 1px solid #bfdbfe; border-radius: 14px; background: linear-gradient(135deg,#eff6ff,#fff); }
  .mobile-promosys-header > small { color: #2563eb; font-size: 10px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
  .mobile-promosys-header h3 { margin: 0; overflow-wrap: anywhere; color: #172554; font-size: 16px; line-height: 1.35; }
  .mobile-promosys-header > div { display: flex; flex-wrap: wrap; gap: 7px; }
  .mobile-promosys-header > div span { border-radius: 999px; padding: 5px 9px; background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 850; }
  .mobile-promosys-history-note { margin: 10px 0; padding: 11px 12px; border: 1px solid #fed7aa; border-radius: 11px; background: #fff7ed; color: #9a3412; font-size: 12px; line-height: 1.45; }
  .mobile-promosys-benefits,.mobile-promosys-contracts { display: grid; gap: 12px; margin-top: 12px; }
  .mobile-promosys-benefit { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(15,23,42,.05); }
  .mobile-promosys-benefit.blocked { border-color: #fdba74; }
  .mobile-promosys-benefit > summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; min-height: 64px; padding: 12px; cursor: pointer; list-style: none; }
  .mobile-promosys-benefit > summary::-webkit-details-marker { display: none; }
  .mobile-promosys-benefit > summary > div:first-child { display: grid; min-width: 0; gap: 3px; }
  .mobile-promosys-benefit > summary small { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
  .mobile-promosys-benefit > summary strong,.mobile-promosys-benefit > summary span { overflow-wrap: anywhere; }
  .mobile-promosys-benefit > summary > div:first-child > span { color: var(--muted); font-size: 11px; }
  .mobile-promosys-benefit-state { display: grid; justify-items: end; gap: 4px; }
  .mobile-promosys-benefit-state b { transition: transform .2s ease; color: var(--muted); font-size: 20px; }
  .mobile-promosys-benefit[open] .mobile-promosys-benefit-state b { transform: rotate(180deg); }
  .mobile-promosys-blocked { border-radius: 999px; padding: 4px 7px; background: #ffedd5; color: #9a3412; font-size: 10px; font-weight: 900; }
  .mobile-promosys-benefit-body { min-width: 0; padding: 0 12px 12px; border-top: 1px solid var(--line); }
  .mobile-promosys-data-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .mobile-promosys-benefit-grid { padding-top: 12px; }
  .mobile-promosys-data-grid > div { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 9px; border-radius: 10px; background: #f8fafc; }
  .mobile-promosys-data-grid > div.danger { background: #fff7ed; }
  .mobile-promosys-data-grid span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
  .mobile-promosys-data-grid strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35; }
  .mobile-promosys-contract { min-width: 0; overflow: hidden; border: 1px solid #dbeafe; border-radius: 13px; padding: 12px; background: #fff; }
  .mobile-promosys-contract header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .mobile-promosys-contract header > div { display: grid; min-width: 0; gap: 2px; }
  .mobile-promosys-contract header small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .mobile-promosys-contract header strong { overflow-wrap: anywhere; font-size: 13px; }
  .mobile-promosys-type { flex: 0 0 auto; border-radius: 999px; padding: 5px 8px; background: #dbeafe; color: #1e40af; font-size: 10px; font-weight: 900; }
  .mobile-promosys-contract-id { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; padding: 8px 9px; border-radius: 9px; background: #f1f5f9; }
  .mobile-promosys-contract-id span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .mobile-promosys-contract-id strong { overflow-wrap: anywhere; font-size: 12px; }
  .mobile-promosys-empty { padding: 18px 14px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #fff; text-align: center; }
  .mobile-promosys-empty h3 { margin: 0 0 12px; }
  .mobile-promosys-empty p { color: var(--muted); line-height: 1.45; }
  .mobile-promosys-empty button { min-height: 44px; max-width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #f1f5f9; color: var(--muted); font-weight: 800; }
  .mobile-detail-card,.mobile-summary-line { display: grid; gap: 4px; margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
  .mobile-detail-card span,.mobile-detail-card small { color: var(--muted); font-size: 12px; }
  .mobile-detail-card button { justify-self: start; margin-top: 5px; }
  .mobile-detail-empty { padding: 18px 10px; color: var(--muted); text-align: center; }
  .mobile-client-activity-group { margin: 14px 0 20px; }
  .mobile-client-activity-group:first-of-type { margin-top: 4px; }
  .mobile-client-activity-group > h4 { display: flex; align-items: center; gap: 5px; margin: 0 0 9px; color: var(--text); font-size: 15px; }
  .mobile-client-activity-group > h4 span { color: var(--muted); font-size: 12px; }
  .mobile-client-activity-group > div { display: grid; gap: 10px; }
  .mobile-client-activity-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-left-width: 4px; border-radius: 13px; padding: 12px; background: #fff; box-shadow: 0 4px 13px rgba(15,23,42,.05); }
  .mobile-client-activity-card.overdue { border-left-color: #dc2626; background: linear-gradient(90deg,#fef2f2 0,#fff 28%); }
  .mobile-client-activity-card.today { border-left-color: #2563eb; }
  .mobile-client-activity-card.upcoming { border-left-color: #16a34a; }
  .mobile-client-activity-card.no-date { border-left-color: #9333ea; }
  .mobile-client-activity-card.done,.mobile-client-activity-card.closed { border-left-color: #64748b; }
  .mobile-client-activity-card.rescheduled { border-left-color: #d97706; background: linear-gradient(90deg,#fffbeb 0,#fff 28%); }
  .mobile-client-activity-card.cancelled { border-left-color: #475569; background: #f8fafc; }
  .mobile-client-activity-card > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px; }
  .mobile-client-activity-card time { color: var(--muted); font-size: 12px; font-weight: 800; }
  .mobile-client-activity-badge { border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; text-transform: uppercase; }
  .mobile-client-activity-badge.overdue { background: #fee2e2; color: #b91c1c; }
  .mobile-client-activity-badge.today { background: #dbeafe; color: #1d4ed8; }
  .mobile-client-activity-badge.upcoming { background: #dcfce7; color: #166534; }
  .mobile-client-activity-badge.no-date { background: #f3e8ff; color: #7e22ce; }
  .mobile-client-activity-badge.done,.mobile-client-activity-badge.closed { background: #e2e8f0; color: #334155; }
  .mobile-client-activity-badge.rescheduled { background: #fef3c7; color: #92400e; }
  .mobile-client-activity-badge.cancelled { background: #e2e8f0; color: #475569; }
  .mobile-client-activity-card h4 { margin: 10px 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.3; }
  .mobile-client-activity-card dl { display: grid; gap: 8px; margin: 0; }
  .mobile-client-activity-card dl div { min-width: 0; }
  .mobile-client-activity-card dt { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .mobile-client-activity-card dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; }
  .mobile-client-activity-relation { margin: 10px 0 0; border-radius: 9px; padding: 8px 9px; background: #eff6ff; color: #1e40af; font-size: 11px; font-weight: 850; line-height: 1.35; }
  .mobile-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mobile-external-note { padding: 10px; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 12px; font-weight: 800; }
  .mobile-client-edit { min-height: 100dvh; padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); background: #fff; }
  .mobile-client-edit h2 { margin: 4px 0 18px; }
  .mobile-client-edit form { display: grid; gap: 13px; }
  .mobile-client-edit label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 800; }
  .mobile-client-edit input,.mobile-client-edit select,.mobile-client-edit textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; background: #fff; color: var(--text); font-size: 16px; }
}

@media (min-width: 921px) {
  .clients-desktop-panel { display: block; }
}


/* Shell responsivo Mobile. Breakpoints espelham app.js: 767px / 920px. */
.mobile-header,
.mobile-bottom-nav,
.mobile-leads-menu,
.mobile-more-menu {
  display: none;
}

.mobile-leads-menu[hidden],
.mobile-more-menu[hidden],
[data-mobile-view][hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  body.auth-loading .mobile-header,
  body.auth-loading .mobile-bottom-nav,
  body.auth-login-required .mobile-header,
  body.auth-login-required .mobile-bottom-nav {
    display: none !important;
  }

  .responsive-base-enabled body {
    --environment-banner-height: 0px;
    --mobile-header-height: 58px;
    --mobile-nav-height: 66px;
  }

  .responsive-base-enabled body.mobile-overlay-open,
  .responsive-base-enabled body.mobile-drawer-open {
    overflow: hidden;
  }

  .responsive-base-enabled .app-shell {
    display: block;
    min-height: calc(100dvh - var(--environment-banner-height));
  }

  .responsive-base-enabled .sidebar {
    display: none;
  }

  .responsive-base-enabled .mobile-header {
    position: sticky;
    top: var(--environment-banner-height);
    z-index: 900;
    min-height: var(--mobile-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 6px 20px rgba(15, 35, 45, .07);
    backdrop-filter: blur(10px);
  }

  .mobile-header-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-header-copy span {
    color: #701a75;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
  }

  .mobile-header-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-profile-button,
  .mobile-menu-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid #e7d7ea;
    border-radius: 14px;
    background: #faf5ff;
    color: #701a75;
    cursor: pointer;
  }

  .mobile-profile-button svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
  }

  .responsive-base-enabled .main {
    min-width: 0;
    padding: 14px 12px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 20px);
    overflow: visible;
  }

  .responsive-base-enabled .topbar {
    display: block;
    margin-bottom: 14px;
  }

  .responsive-base-enabled .topbar > div:first-child,
  .responsive-base-enabled .auth-user-bar {
    display: none;
  }

  .responsive-base-enabled .search-box {
    width: 100%;
  }

  .responsive-base-enabled .search-box input,
  .responsive-base-enabled input,
  .responsive-base-enabled select,
  .responsive-base-enabled textarea {
    min-height: 44px;
    max-width: 100%;
  }

  .responsive-base-enabled button,
  .responsive-base-enabled a[role="button"] {
    touch-action: manipulation;
  }

  .responsive-base-enabled .table-wrap,
  .responsive-base-enabled .settings-table-wrap,
  .responsive-base-enabled .calendar-days-table-wrap,
  .responsive-base-enabled .social-table-wrap,
  .responsive-base-enabled .client-opportunity-table-wrap,
  .responsive-base-enabled .mini-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .responsive-base-enabled .panel,
  .responsive-base-enabled .metric,
  .responsive-base-enabled .cockpit-panel,
  .responsive-base-enabled .settings-card {
    max-width: 100%;
  }

  .responsive-base-enabled .settings-form-grid,
  .responsive-base-enabled .client-profile-grid,
  .responsive-base-enabled .client-profile-metrics,
  .responsive-base-enabled .deal-form-grid,
  .responsive-base-enabled .deal-fields-grid,
  .responsive-base-enabled .raw-fields-grid,
  .responsive-base-enabled .insurance-policy-grid,
  .responsive-base-enabled .insurance-lead-grid,
  .responsive-base-enabled .clt-lead-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .responsive-base-enabled .drawer {
    z-index: 5200;
  }

  .responsive-base-enabled .drawer-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    padding: 16px 14px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    overscroll-behavior: contain;
  }

  .responsive-base-enabled .drawer-panel > #closeDrawerBtn {
    min-width: 44px;
    min-height: 44px;
    margin: -4px -2px 8px 12px;
  }

  .responsive-base-enabled .mobile-bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 5px max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 -8px 26px rgba(15, 35, 45, .10);
    backdrop-filter: blur(12px);
  }

  .mobile-nav-item {
    position: relative;
    min-width: 0;
    min-height: 56px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
  }

  .mobile-nav-item svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .mobile-nav-item span {
    overflow: hidden;
    max-width: 100%;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-item.active {
    background: #faf5ff;
    color: #701a75;
  }

  .mobile-nav-item.active::before {
    content: "";
    position: absolute;
    top: -5px;
    width: 30px;
    height: 3px;
    border-radius: 999px;
    background: #701a75;
  }

  .responsive-base-enabled .mobile-leads-menu,
  .responsive-base-enabled .mobile-more-menu {
    position: fixed;
    inset: 0;
    z-index: 5100;
    background: rgba(15, 23, 42, .48);
  }

  .responsive-base-enabled .mobile-leads-menu {
    display: flex;
    align-items: flex-end;
  }

  .mobile-leads-menu-panel {
    width: 100%;
    display: grid;
    gap: 10px;
    padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -18px 48px rgba(15, 23, 42, .2);
  }

  .mobile-sheet-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 4px;
    border-radius: 999px;
    background: #cbd5e1;
  }

  .mobile-lead-option,
  .mobile-sheet-cancel,
  .mobile-more-links button,
  .mobile-logout-button {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
  }

  .mobile-lead-option {
    display: grid;
    gap: 3px;
    padding: 10px 14px;
    text-align: left;
  }

  .mobile-lead-option span,
  .mobile-more-links button {
    font-weight: 800;
  }

  .mobile-lead-option small {
    color: var(--muted);
  }

  .mobile-sheet-cancel {
    color: #701a75;
    font-weight: 800;
  }

  .responsive-base-enabled .mobile-more-menu {
    display: flex;
    justify-content: flex-end;
  }

  .mobile-more-panel {
    width: min(390px, 92vw);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: max(18px, env(safe-area-inset-top, 0px)) 16px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    background: #fff;
    box-shadow: -18px 0 48px rgba(15, 23, 42, .22);
  }

  .mobile-more-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-more-panel > header > div,
  .mobile-user-card {
    display: grid;
    gap: 3px;
  }

  .mobile-more-panel > header span,
  .mobile-user-card span,
  .mobile-menu-footer small {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-menu-close {
    font-size: 26px;
    line-height: 1;
  }

  .mobile-user-card {
    padding: 14px;
    border: 1px solid #eadcf0;
    border-radius: 14px;
    background: #faf5ff;
  }

  .mobile-desktop-notice {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
  }

  .mobile-more-links {
    display: grid;
    gap: 8px;
  }

  .mobile-more-links button {
    padding: 10px 13px;
    text-align: left;
  }

  .mobile-menu-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .mobile-logout-button {
    color: #991b1b;
    font-weight: 900;
  }
}

@media (min-width: 768px) and (max-width: 920px) {
  .responsive-base-enabled .main {
    padding-right: 24px;
    padding-left: 24px;
  }

  .responsive-base-enabled .mobile-bottom-nav {
    right: 50%;
    left: auto;
    width: min(660px, 100%);
    transform: translateX(50%);
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
  }

  .responsive-base-enabled .cockpit-metrics,
  .responsive-base-enabled .metrics-grid,
  .responsive-base-enabled .cockpit-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .responsive-base-enabled *,
  .responsive-base-enabled *::before,
  .responsive-base-enabled *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Fase 4: renderizador unificado de Leads, isolado das tabelas desktop. */
.mobile-leads-page {
  width: min(760px, 100%);
  margin: 0 auto;
}

.mobile-leads-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.mobile-leads-page-header h2,
.mobile-leads-page-header p {
  margin: 0;
}

.mobile-leads-page-header > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.mobile-leads-total {
  min-width: 44px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #701a75;
  color: #fff;
  font-weight: 900;
}

.mobile-leads-filters {
  display: flex;
  gap: 8px;
  margin: 0 -12px 12px;
  padding: 2px 12px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.mobile-leads-filters::-webkit-scrollbar {
  display: none;
}

.mobile-leads-filters button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.mobile-leads-filters button.active {
  border-color: #701a75;
  background: #faf5ff;
  color: #701a75;
}

.mobile-leads-update-status {
  min-height: 34px;
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #eef6f7;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

.mobile-leads-update-status.received {
  background: #ecfdf5;
  color: #166534;
}

.mobile-leads-update-status.error {
  background: #fff7ed;
  color: #9a3412;
}

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

.mobile-lead-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 35, 45, .08);
}

.mobile-lead-card.is-new {
  border-color: #d8b4fe;
  box-shadow: 0 12px 30px rgba(112, 26, 117, .13);
}

.mobile-lead-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
}

.mobile-lead-identity {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mobile-lead-identity h3 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-lead-kind,
.mobile-lead-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e6f3f5;
  color: #155e75;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.mobile-lead-kind.clt {
  background: #eef2ff;
  color: #4338ca;
}

.mobile-lead-status {
  flex: 0 0 auto;
  background: #f1f5f9;
  color: #475569;
}

.mobile-lead-status.new {
  background: #fdf2f8;
  color: #9d174d;
}

.mobile-lead-status.attended {
  background: #ecfdf5;
  color: #166534;
}

.mobile-lead-phone {
  color: var(--muted);
  font-size: 12px;
}

.mobile-lead-waiting {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-block: 1px solid #f1f5f9;
  background: #fafafa;
}

.mobile-lead-waiting strong {
  color: #9d174d;
  font-size: 16px;
}

.mobile-lead-waiting span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.mobile-lead-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 0;
  padding: 12px 14px;
}

.mobile-lead-meta div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-lead-meta dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-lead-meta dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.mobile-lead-meta .unscheduled dd {
  color: #b45309;
}

.mobile-lead-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 0 14px 14px;
}

.mobile-lead-actions button {
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  padding: 8px 6px;
  font-size: 11px;
}

.mobile-leads-load-more {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid #d8b4fe;
  border-radius: 12px;
  background: #faf5ff;
  color: #701a75;
  font-weight: 900;
  cursor: pointer;
}

.mobile-leads-empty {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.mobile-leads-empty strong {
  color: var(--text);
}

.mobile-nav-badge {
  position: absolute;
  top: 1px;
  left: calc(50% + 7px);
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.mobile-nav-badge[hidden] {
  display: none;
}

.mobile-lead-drawer-context {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 54px 12px 0;
  padding: 10px 12px;
  border: 1px solid #eadcf0;
  border-radius: 12px;
  background: #faf5ff;
}

.mobile-lead-drawer-context > div {
  min-width: 0;
  display: grid;
  gap: 2px;
  margin-right: auto;
}

.mobile-lead-drawer-context > div strong,
.mobile-lead-drawer-context > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-lead-drawer-context > div span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 480px) {
  .mobile-lead-meta {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .mobile-lead-drawer-context {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

.mobile-leads-filters button:focus-visible,
.mobile-lead-actions button:focus-visible,
.mobile-leads-load-more:focus-visible {
  outline: 3px solid rgba(112, 26, 117, .28);
  outline-offset: 2px;
}

/* Client panel: portrait keeps the approved layout; short landscape gets its own
   content scroller so the header and tabs cannot cover the active section. */
.mobile-client-panel-scroll {
  min-width: 0;
}

.mobile-opportunity-benefit {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.mobile-opportunity-benefit > header {
  display: grid;
  gap: 3px;
  padding: 0 2px;
}

.mobile-opportunity-benefit > header small {
  color: var(--muted);
}

.mobile-opportunity-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.mobile-opportunity-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.mobile-opportunity-group > summary::-webkit-details-marker {
  display: none;
}

.mobile-opportunity-group > summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  transition: transform .15s ease;
}

.mobile-opportunity-group:not([open]) > summary::after {
  transform: rotate(-90deg);
}

.mobile-opportunity-group > summary span {
  min-width: 0;
  font-size: 13px;
  font-weight: 900;
}

.mobile-opportunity-group > summary strong {
  margin-left: auto;
  color: var(--brand);
  font-size: 11px;
  text-align: right;
}

.mobile-opportunity-values,
.mobile-opportunity-list {
  display: grid;
  gap: 9px;
  padding: 0 10px 10px;
}

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

.mobile-opportunity-value,
.mobile-opportunity-contract {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8fafc;
}

.mobile-opportunity-value {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
}

.mobile-opportunity-value span,
.mobile-opportunity-value small {
  color: var(--muted);
  font-size: 10px;
}

.mobile-opportunity-value strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mobile-opportunity-value.positive strong {
  color: #087c47;
}

.mobile-opportunity-value.negative strong {
  color: #b42318;
}

.mobile-opportunity-contract {
  overflow: hidden;
}

.mobile-opportunity-contract > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.mobile-opportunity-contract > header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mobile-opportunity-contract > header strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mobile-opportunity-contract > header small {
  color: var(--muted);
  font-size: 10px;
}

.mobile-opportunity-contract > header > span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 7px;
  background: #e8f6ef;
  color: #087c47;
  font-size: 9px;
  font-weight: 900;
}

.mobile-opportunity-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
}

.mobile-opportunity-facts > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-opportunity-facts dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-opportunity-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 850;
}

.mobile-opportunity-simulations {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px;
}

.mobile-opportunity-simulations > article {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 9px;
  border: 1px solid #bfdbfe;
  border-radius: 9px;
  background: #eff6ff;
}

.mobile-opportunity-simulations > article > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-opportunity-simulations span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.mobile-opportunity-simulations strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.mobile-opportunity-simulations .highlight strong {
  color: #087c47;
}

@media (max-width: 480px) {
  .mobile-opportunity-values {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 920px) and (max-height: 520px) and (orientation: landscape) {
  .responsive-base-enabled .drawer-panel:has(.mobile-client-panel) {
    overflow: hidden;
    padding: 0;
  }

  .responsive-base-enabled .mobile-client-panel {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
  }

  .responsive-base-enabled .mobile-client-panel-header {
    position: relative;
    top: auto;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
    align-items: center;
    gap: 10px;
    padding: calc(7px + env(safe-area-inset-top)) 58px 7px 12px;
  }

  .responsive-base-enabled .mobile-client-panel-header h2 {
    margin: 0 0 2px;
    font-size: 16px;
    line-height: 1.15;
  }

  .responsive-base-enabled .mobile-client-panel-header p {
    display: inline;
    margin: 0 8px 0 0;
    font-size: 11px;
  }

  .responsive-base-enabled .mobile-client-panel-actions button {
    min-height: 36px;
  }

  .responsive-base-enabled .mobile-client-tabs {
    position: relative;
    top: auto;
    padding: 5px 12px;
  }

  .responsive-base-enabled .mobile-client-tabs button {
    min-height: 40px;
  }

  .responsive-base-enabled .mobile-client-panel-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .responsive-base-enabled .mobile-client-section {
    padding-top: 10px;
  }
}
