:root {
  color-scheme: light;
  --ink: #101b2f;
  --muted: #38465a;
  --line: #d9e6f2;
  --surface: #ffffff;
  --soft: #eef6f8;
  --accent: #c6a75b;
  --accent-strong: #9c7c33;
  --brand-blue: #0b2b57;
  --brand-blue-strong: #071d3b;
  --sky-soft: #eef7ff;
  --mint-soft: #effaf4;
  --gold-soft: #fff8e6;
  --rose-soft: #fff3f5;
  --warning: #9c7c33;
  --error-bg: #fff1f2;
  --error-text: #be123c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--soft);
  color: var(--ink);
  font-size: 14px;
  font-family:
    "Plus Jakarta Sans", "Aptos", "Inter", ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

.workspace {
  min-height: 100vh;
  padding-left: 288px;
  transition: padding-left 0.2s ease;
}

.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 18px;
  width: 288px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 10px 0 24px rgba(11, 43, 87, 0.05);
  transition: width 0.2s ease, padding 0.2s ease;
}

.brand-area {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.brand-logo {
  width: 236px;
  height: auto;
  margin-bottom: 8px;
  transition: opacity 0.2s ease, width 0.2s ease;
}

.side-menu-toggle {
  flex: 0 0 auto;
}

.tool-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
}

.tool-tab {
  align-items: center;
  border: 1px solid #d7e2ef;
  border-radius: 10px;
  background: #ffffff;
  color: var(--brand-blue);
  cursor: pointer;
  display: flex;
  gap: 10px;
  font-weight: 900;
  justify-content: flex-start;
  padding: 11px 14px;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tool-tab:hover {
  border-color: #8fb5dc;
  background: #f4f9ff;
  transform: translateX(2px);
}

.tool-tab.active {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: #ffffff;
}

.tool-tab .button-icon,
.logout-button .button-icon {
  align-items: center;
  border-radius: 7px;
  display: inline-flex;
  flex: 0 0 22px;
  height: 22px;
  justify-content: center;
  min-width: 22px;
}

.tool-tab .button-icon i,
.logout-button .button-icon i {
  font-size: 1rem;
  line-height: 1;
}

.tool-tab.btn,
.logout-button.btn {
  --bs-btn-active-bg: var(--brand-blue);
  --bs-btn-active-border-color: var(--brand-blue);
  --bs-btn-active-color: #ffffff;
}

.logout-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--error-text);
  cursor: pointer;
  display: flex;
  gap: 10px;
  font-weight: 900;
  justify-content: flex-start;
  padding: 10px 14px;
  text-align: left;
}

.logout-button:hover {
  border-color: var(--error-text);
  background: #fff1f2;
}

body.side-menu-collapsed .workspace {
  padding-left: 82px;
}

body.side-menu-collapsed .topbar {
  width: 82px;
  padding: 18px 10px;
}

body.side-menu-collapsed .brand-logo {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

body.side-menu-collapsed .tool-tab,
body.side-menu-collapsed .logout-button {
  justify-content: center;
  padding: 11px;
}

body.side-menu-collapsed .tool-tab,
body.side-menu-collapsed .logout-button {
  font-size: 0;
}

body.side-menu-collapsed .tool-tab .button-icon,
body.side-menu-collapsed .logout-button .button-icon {
  font-size: 17px;
  margin: 0;
}

.danger-button {
  border-color: var(--error-text) !important;
  color: var(--error-text) !important;
}

.danger-button:hover:not(:disabled) {
  background: var(--error-bg) !important;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(11, 43, 87, 0.95), rgba(21, 34, 58, 0.9)),
    var(--soft);
}

.login-shell {
  width: min(100%, 520px);
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 22px;
  border: 1px solid rgba(198, 167, 91, 0.45);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(7, 29, 59, 0.28);
  padding: 28px;
}

.login-logo {
  width: min(340px, 100%);
  height: auto;
}

.login-card h1 {
  color: var(--brand-blue);
  font-size: 28px;
  line-height: 1.14;
}

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

.underwriting-alerts {
  margin-top: 12px;
  border: 1px solid #f4c542;
  border-left: 4px solid #d99a00;
  border-radius: 8px;
  background: #fff8db;
  color: #7a4f00;
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.35;
}

.underwriting-alerts p {
  margin: 0;
}

.underwriting-alerts p + p {
  margin-top: 6px;
}

body.tool-proposal .review-only,
body.tool-proposal .review-only-simulation-fields,
body.tool-proposal .view-switcher,
body.tool-proposal .proposal-hidden-field,
body.tool-proposal [data-tool-scope="review"] {
  display: none !important;
}

body.tool-review .proposal-only,
body.tool-review .proposal-only-field,
body.tool-review .proposal-client-action,
body.tool-review .review-hidden-field {
  display: none !important;
}

body.tool-review.review-from-crm .proposal-intelligence-panel {
  display: grid !important;
}

body.tool-review.review-from-crm .proposal-title-field {
  display: grid !important;
}

body.tool-proposal.proposal-client-locked #simulation-view .simulation-panel {
  display: none;
}

body:not(.tool-crm):not(.tool-portfolio) .crm-only {
  display: none !important;
}

body.hub-screen-active .client-workspace,
body.hub-screen-active .crm-workspace,
body.hub-screen-active .view-switcher,
body.hub-screen-active .view-panel,
body.hub-screen-active #insured-top-summary,
body.hub-screen-active #portfolio-workspace {
  display: none !important;
}

body.app-booting .client-workspace,
body.app-booting .crm-workspace,
body.app-booting .view-switcher,
body.app-booting .view-panel,
body.app-booting #insured-top-summary,
body.app-booting #portfolio-workspace,
body.app-booting #review-import-panel,
body.app-booting #review-import-slot-top,
body.app-booting #review-import-slot-current,
body.app-booting .review-only,
body.app-booting .proposal-only {
  display: none !important;
}

body.tool-crm .client-workspace,
body.tool-portfolio .client-workspace,
body.tool-crm .view-switcher,
body.tool-portfolio .view-switcher,
body.tool-crm .view-panel,
body.tool-portfolio .view-panel,
body.tool-crm #insured-top-summary {
  display: none !important;
}

body.tool-portfolio #insured-top-summary,
body.tool-portfolio #portfolio-workspace {
  display: none !important;
}

body.tool-crm.crm-proposal-embedded #crm-proposal-workspace #simulation-view {
  display: grid !important;
}

body.tool-portfolio.crm-proposal-embedded #crm-proposal-workspace #simulation-view {
  display: grid !important;
}

body.tool-crm.crm-ran-embedded #crm-ran-workspace .client-workspace,
body.tool-portfolio.crm-ran-embedded #crm-ran-workspace .client-workspace,
body.crm-ran-embedded #crm-ran-workspace .client-workspace {
  display: grid !important;
}

body.crm-ran-embedded #crm-ran-workspace .view-switcher {
  display: flex !important;
}

body.crm-ran-embedded #crm-ran-workspace .view-panel {
  display: none !important;
}

body.crm-ran-embedded #crm-ran-workspace .view-panel.active-view {
  display: block !important;
}

body.crm-ran-embedded #crm-ran-workspace #family-view,
body.crm-ran-embedded #crm-ran-workspace .view-tab[data-target="family-view"] {
  display: none !important;
}

body.crm-ran-embedded #crm-ran-workspace #proposal-intelligence-panel {
  display: grid !important;
}

body.crm-ran-embedded #crm-ran-workspace .panel-head .export-actions,
body.crm-ran-embedded #crm-ran-workspace .client-grid {
  display: none !important;
}

.crm-ran-inline-target {
  margin-top: 14px;
}

.crm-ran-inline-target:empty {
  display: none;
}

body.crm-ran-embedded .crm-ran-inline-target .client-workspace {
  display: grid !important;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

body.crm-ran-embedded .crm-ran-inline-target .view-switcher {
  display: flex !important;
}

body.crm-ran-embedded .crm-ran-inline-target .view-panel {
  display: none !important;
}

body.crm-ran-embedded .crm-ran-inline-target .view-panel.active-view {
  display: block !important;
}

body.crm-ran-embedded .crm-ran-inline-target .panel-head,
body.crm-ran-embedded .crm-ran-inline-target .client-grid,
body.crm-ran-embedded .crm-ran-inline-target #review-import-slot-top,
body.crm-ran-embedded .crm-ran-inline-target #review-import-slot-current,
body.crm-ran-embedded .crm-ran-inline-target #family-view,
body.crm-ran-embedded .crm-ran-inline-target .view-tab[data-target="family-view"],
body.crm-ran-embedded .crm-ran-inline-target .proposal-only,
body.crm-ran-embedded .crm-ran-inline-target .proposal-only-field,
body.crm-ran-embedded .crm-ran-inline-target #prudential-proposal-import-panel {
  display: none !important;
}

body.crm-ran-embedded .crm-ran-inline-target #proposal-intelligence-panel {
  display: grid !important;
}

body.crm-ran-embedded .crm-ran-inline-target #current-view,
body.crm-ran-embedded .crm-ran-inline-target #simulation-view,
body.crm-ran-embedded .crm-ran-inline-target #demonstration-view {
  min-height: auto;
}

body.crm-ran-embedded .crm-ran-inline-target #current-policy-content:not(.hidden) {
  display: block !important;
}

body.crm-ran-embedded #crm-ran-workspace.crm-ran-workspace.hidden {
  display: none !important;
}

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

.business-opportunities-screen {
  padding-bottom: 18px;
}

.business-opportunities-screen .business-opportunity-selector {
  margin: 0 22px 16px;
}

.business-opportunities-screen .crm-opportunity-grid {
  padding: 0 22px 22px;
}

.user-settings-form {
  align-items: end;
}

.users-table td,
.users-table th {
  vertical-align: middle;
}

.users-table .table-actions {
  white-space: nowrap;
}

.crm-opportunity-card {
  border: 1px solid #d7e5f3;
  border-radius: 12px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(11, 43, 87, 0.06);
}

.crm-opportunity-card h3 {
  margin: 0 0 8px;
  color: var(--navy);
}

.crm-opportunity-card ul {
  margin: 0;
  padding-left: 18px;
}

.crm-opportunity-card li {
  margin: 5px 0;
  color: var(--muted);
}

.crm-opportunity-table {
  min-width: 0;
  table-layout: fixed;
}

.crm-opportunity-table th,
.crm-opportunity-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-opportunity-table th:nth-child(1),
.crm-opportunity-table td:nth-child(1) {
  width: 28%;
}

.crm-opportunity-table th:nth-child(2),
.crm-opportunity-table td:nth-child(2) {
  width: 24%;
}

.crm-opportunity-table th:nth-child(4),
.crm-opportunity-table td:nth-child(4) {
  width: 130px;
  text-align: right;
}

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

.crm-attachment-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.proposal-locked-message h3 {
  margin: 4px 0 6px;
}

body.tool-review.review-client-unselected .client-grid .field:not(:first-child) {
  display: none;
}

body.tool-review .client-grid .field:not(:first-child),
body.tool-review.review-client-new #delete-client,
body.tool-review.review-client-new .view-switcher,
body.tool-review.review-client-new #current-view,
body.tool-review.review-client-new #simulation-view,
body.tool-review.review-client-new #demonstration-view,
body.tool-review.review-client-new #family-view,
body.tool-review.review-client-new #insured-top-summary {
  display: none;
}

body.tool-review.review-without-import #family-view,
body.tool-review.review-without-import #simulation-view,
body.tool-review.review-without-import #demonstration-view {
  display: none;
}

body.tool-review.review-without-import .view-tab[data-target="family-view"],
body.tool-review.review-without-import .view-tab[data-target="simulation-view"],
body.tool-review.review-without-import .view-tab[data-target="demonstration-view"] {
  cursor: not-allowed;
  opacity: 0.45;
}

body.tool-review.review-client-new #current-view #review-import-slot-current {
  display: none;
}

body.tool-review:not(.review-client-new) #review-import-slot-top {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 26px;
}

h3 {
  margin-bottom: 18px;
  font-size: 18px;
}

.intro {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(320px, 1.25fr);
  align-items: end;
  gap: 18px;
}

.import-panel h2 {
  margin-bottom: 0;
}

.client-workspace {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

body.tool-review.review-client-new .client-workspace {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  align-items: start;
}

body.tool-review.review-client-new .client-workspace > .guidance-message,
body.tool-review.review-client-new .client-workspace > .panel-head,
body.tool-review.review-client-new .client-workspace > #client-success,
body.tool-review.review-client-new .client-workspace > .quick-indicators,
body.tool-review.review-client-new .client-workspace > .history-actions,
body.tool-review.review-client-new .client-workspace > .client-history-grid {
  grid-column: 1 / -1;
}

body.tool-review.review-client-new .client-workspace > .client-grid {
  grid-column: 1;
}

body.tool-review.review-client-new .client-workspace > #review-import-slot-top {
  grid-column: 2;
}

body.tool-review.review-client-new #review-import-slot-top .import-panel,
body.tool-review.review-client-new #review-import-slot-top .upload-form {
  grid-template-columns: 1fr;
}

.success-message {
  border: 1px solid #86efac;
  border-radius: 8px;
  background: #ecfdf3;
  color: #047857;
  font-size: 13px;
  font-weight: 900;
  padding: 10px 12px;
}

.success-message.error-message {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--error-text);
}

.crm-workspace {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.crm-lead-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.crm-lead-form .crm-notes-field {
  grid-column: 1 / -2;
}

.crm-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

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

.crm-kanban-mode .crm-stage-list {
  display: none;
}

.crm-filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 0.75fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.crm-stage-list,
.crm-leads-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.crm-stage-list {
  overflow: hidden;
}

.crm-stage-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.crm-stage-list-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.crm-stage-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 6px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  padding: 9px 8px;
  text-align: left;
}

.crm-stage-button:last-child {
  border-bottom: 0;
}

.crm-stage-button:hover,
.crm-stage-button.active {
  background: #f1f5f9;
}

.crm-stage-button span {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-stage-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-stage-label.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #0b4f91;
}

.crm-stage-label.dark {
  border-color: #d1d5db;
  background: #f3f4f6;
  color: #1f2937;
}

.crm-stage-label.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.crm-stage-label.gold {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.crm-stage-label.purple {
  border-color: #e9d5ff;
  background: #faf5ff;
  color: #6b21a8;
}

.crm-stage-label.pink {
  border-color: #fbcfe8;
  background: #fdf2f8;
  color: #be185d;
}

.crm-stage-label.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.crm-stage-label.orange {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.crm-stage-label.teal {
  border-color: #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
}

.crm-stage-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 6px;
  color: currentColor;
  font-style: normal;
  font-weight: 900;
}

.crm-stage-icon.blue { color: #0b78d1; }
.crm-stage-icon.dark { color: #20242b; }
.crm-stage-icon.green { color: #12a53a; }
.crm-stage-icon.gold { color: #c6a300; }
.crm-stage-icon.purple { color: #7c2cff; }
.crm-stage-icon.pink { color: #ec1680; }
.crm-stage-icon.red { color: #d71920; }
.crm-stage-icon.orange { color: #de7b00; }
.crm-stage-icon.teal { color: #11bfb4; }

.crm-stage-button strong {
  min-width: 24px;
  border-radius: 999px;
  background: #e5e7eb;
  color: var(--muted);
  font-size: 11px;
  padding: 2px 6px;
  text-align: center;
}

.crm-leads-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.compact-head {
  margin-bottom: 0;
}

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

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

.crm-dashboard-card,
.crm-insight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(11, 43, 87, 0.04);
}

.crm-dashboard-title {
  grid-column: 1 / -1;
}

.crm-dashboard-title strong {
  color: var(--brand-blue);
  display: block;
  font-size: 1.05rem;
}

.crm-dashboard-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.crm-dashboard-card {
  border-top: 3px solid var(--accent);
  padding: 12px;
}

.crm-dashboard-card span,
.crm-insight-head span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-dashboard-card strong {
  color: var(--brand-blue);
  display: block;
  font-size: 1.15rem;
  margin-top: 5px;
}

.crm-insight-panel {
  margin: 10px 0;
  padding: 12px;
}

.crm-insight-head {
  margin-bottom: 8px;
}

.crm-insight-head strong {
  color: var(--brand-blue);
  display: block;
  font-size: 1rem;
}

.crm-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-insight-chip {
  border: 1px solid #f1c7cd;
  border-radius: 999px;
  background: #fff7f8;
  color: #8f1230;
  cursor: pointer;
  font-weight: 800;
  padding: 7px 10px;
}

.crm-mini-table th,
.crm-mini-table td {
  font-size: 12px;
  padding: 7px 8px;
}

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

.crm-lead-table,
.portfolio-table {
  min-width: 1060px;
  font-size: 12px;
}

.crm-lead-table th,
.crm-lead-table td,
.portfolio-table th,
.portfolio-table td {
  padding: 8px 10px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-col {
  width: 42px;
  text-align: center;
}

.business-opportunity-selector {
  margin: 12px 0;
  max-width: 420px;
}

.portfolio-detail-modal {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
}

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

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

.portfolio-detail-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.portfolio-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.portfolio-detail-grid strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  margin-top: 4px;
}

.portfolio-detail-sections {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.portfolio-detail-sections section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}

.portfolio-detail-sections h3 {
  margin: 0 0 10px;
  color: var(--ink);
}

.portfolio-detail-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.portfolio-detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding: 6px 0;
}

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

.snapshot-detail-grid article {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.snapshot-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-detail-grid pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.snapshot-detail-sections {
  display: grid;
  gap: 14px;
}

.snapshot-detail-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.snapshot-detail-section h3 {
  margin: 0;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: var(--ink);
  font-size: 15px;
  padding: 12px 14px;
}

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

.snapshot-field {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfdff;
  padding: 10px;
  min-height: 62px;
}

.snapshot-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.snapshot-field strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  margin-top: 5px;
  white-space: pre-wrap;
}

.snapshot-table {
  padding: 0 14px 14px;
}

.snapshot-table table {
  min-width: 720px;
}

.crm-policy-detail-backdrop .portfolio-detail-modal input,
.crm-policy-detail-backdrop .portfolio-detail-modal select,
.crm-policy-detail-backdrop .portfolio-detail-modal textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  min-height: 34px;
  padding: 7px 8px;
}

.crm-lead-table {
  table-layout: fixed;
  min-width: 1040px;
}

.crm-lead-table .lead-name-col {
  width: 220px;
}

.crm-lead-table .score-col {
  width: 58px;
  max-width: 58px;
  text-align: center;
}

.crm-lead-table th:not(.lead-name-col),
.crm-lead-table td:not(.lead-name-col) {
  max-width: 135px;
}

.crm-lead-table th button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  overflow: hidden;
  padding: 0;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-pill {
  display: inline-grid;
  min-width: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 950;
  padding: 3px 7px;
}

.score-low {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.score-mid {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.score-good {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.score-high {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.icon-only-button {
  min-width: 34px;
  padding-inline: 8px;
}

.crm-progress-box {
  min-width: 150px;
}

.crm-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.crm-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-blue);
}

.crm-progress-box small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.contact-shortcut-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 14px 0;
}

.crm-lead-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.contact-message-field textarea {
  min-height: 58px;
}

.crm-view-toggle {
  display: flex;
  gap: 8px;
}

.crm-view-toggle .active {
  border-color: var(--brand-blue);
  background: #eef6ff;
  color: var(--brand-blue);
}

.crm-table-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.crm-lead-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(240px, 1fr) minmax(220px, 0.8fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.crm-lead-card strong,
.crm-lead-card span {
  display: block;
}

.crm-lead-card span,
.crm-lead-card dd {
  color: var(--muted);
}

.crm-lead-card dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}

.crm-lead-card dt {
  color: var(--accent-strong);
  font-weight: 900;
}

.crm-lead-card dd {
  margin: 0;
}

.crm-lead-actions {
  display: grid;
  gap: 10px;
}

.crm-empty {
  margin: 0;
}

.crm-lead-modal-card {
  display: grid;
  width: min(1120px, 96vw);
  max-height: 92vh;
  gap: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 18px;
}

.crm-proposal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1280px, 98vw);
  height: min(94vh, 980px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8fb;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 18px;
}

.crm-proposal-card .modal-head {
  top: -18px;
  background: #f5f8fb;
}

.crm-proposal-embed-target {
  min-height: 0;
  overflow: auto;
  padding: 2px 2px 18px;
}

.crm-proposal-embed-target #simulation-view {
  gap: 14px;
}

.crm-proposal-embed-target .view-heading {
  border-left-color: #0f766e;
}

.proposal-intelligence-panel {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 18px;
}

.proposal-intelligence-card {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  display: grid;
  gap: 14px;
  border: 1px solid #c7d2fe;
  border-left: 4px solid #4f46e5;
  border-radius: 12px;
  background: #f8f9ff;
  padding: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.proposal-intelligence-output {
  display: grid;
  gap: 12px;
}

.proposal-intelligence-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.proposal-intelligence-summary article,
.proposal-intelligence-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.proposal-intelligence-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.proposal-intelligence-summary strong {
  color: var(--brand-blue);
}

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

.proposal-intelligence-list h5 {
  margin: 0 0 6px;
}

.proposal-intelligence-list p,
.proposal-intelligence-list small {
  display: block;
  margin: 6px 0 0;
  line-height: 1.35;
}

.proposal-intelligence-memory {
  border: 1px dashed #c7d2fe;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
}

.proposal-intelligence-memory-note {
  border: 1px solid #facc15;
  border-radius: 8px;
  background: #fef9c3;
  color: #713f12;
  padding: 10px 12px;
}

.proposal-intelligence-memory-note strong {
  display: block;
  margin-bottom: 6px;
}

.proposal-intelligence-memory-note ul {
  margin: 0;
  padding-left: 18px;
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-head {
  position: sticky;
  top: -18px;
  z-index: 2;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  padding: 2px 0 14px;
}

.modal-head h2 {
  margin: 3px 0 0;
}

.modal-actions {
  position: sticky;
  bottom: -18px;
  z-index: 2;
  border-top: 1px solid var(--line);
  background: #ffffff;
  padding: 14px 0 0;
}

.crm-modal-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.crm-modal-tabs button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  padding: 9px 11px;
}

.crm-modal-tabs button.active {
  border-color: var(--brand-blue);
  background: #eef6ff;
  color: var(--brand-blue);
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

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

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

.form-section summary {
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 950;
  padding: 12px 14px;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary::after {
  content: "+";
  float: right;
  color: var(--brand-blue);
}

.form-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f6f8fb;
}

.form-section[open] summary::after {
  content: "−";
}

.form-grid,
.inline-form-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.form-section .secondary-button,
.embedded-form-card .secondary-button,
.relationship-editor-card .secondary-button {
  min-height: 34px;
  padding: 8px 10px;
}

#add-crm-contact,
#add-crm-meeting {
  justify-self: start;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
}

.form-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.inline-form-grid {
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
  align-items: end;
}

.relationship-inline-form,
.referral-inline-form,
.finance-inline-form,
.insurance-inline-form {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.finance-subsections {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.section-command-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 14px 0;
}

.embedded-form-card,
.relationship-editor-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.relationship-editor-card {
  margin: 0 14px 14px;
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.relationship-editor-card .inline-form-grid {
  padding: 0;
}

.relationship-editor-card input,
.relationship-editor-card select,
.crm-relationship-modal-card input,
.crm-relationship-modal-card select,
.crm-relationship-modal-card textarea {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  min-height: 38px;
}

.crm-relationship-modal-card {
  display: grid;
  gap: 14px;
  width: min(1080px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  padding: 20px;
}

.crm-relationship-modal-card .form-section {
  margin-top: 4px;
}

.crm-relationship-modal-card .form-grid {
  padding: 18px;
}

.mini-list-item span {
  white-space: normal;
}

.embedded-form-card h4 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  padding: 12px 14px 0;
}

.finance-inline-form,
.insurance-inline-form,
.referral-inline-form {
  align-items: end;
  border-top: 1px solid #eef2f7;
  background: #fbfcfe;
}

.finance-inline-form input,
.finance-inline-form select,
.insurance-inline-form input,
.insurance-inline-form select,
.referral-inline-form input,
.referral-inline-form select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  min-height: 38px;
}

.wide-field {
  grid-column: span 2;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

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

.mini-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
}

.mini-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  justify-self: end;
}

.icon-link {
  font-size: 15px;
  line-height: 1;
  padding: 3px 5px;
}

.crm-kanban-board {
  display: grid;
  grid-auto-columns: minmax(230px, 260px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.crm-kanban-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.crm-kanban-column.blue,
.crm-kanban-card.blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.crm-kanban-column.green,
.crm-kanban-card.green {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.crm-kanban-column.gold,
.crm-kanban-card.gold {
  background: #fffbeb;
  border-color: #fde68a;
}

.crm-kanban-column.purple,
.crm-kanban-card.purple {
  background: #faf5ff;
  border-color: #e9d5ff;
}

.crm-kanban-column.pink,
.crm-kanban-card.pink {
  background: #fdf2f8;
  border-color: #fbcfe8;
}

.crm-kanban-column.red,
.crm-kanban-card.red {
  background: #fef2f2;
  border-color: #fecaca;
}

.crm-kanban-column.orange,
.crm-kanban-card.orange {
  background: #fff7ed;
  border-color: #fed7aa;
}

.crm-kanban-column.teal,
.crm-kanban-card.teal {
  background: #f0fdfa;
  border-color: #99f6e4;
}

.crm-kanban-column.drag-over,
.crm-stage-button.drag-over {
  border-color: var(--brand-blue);
  background: #eef6ff;
}

.crm-kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.crm-kanban-cards {
  display: grid;
  gap: 8px;
}

.crm-kanban-card {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: grab;
  padding: 10px;
}

.crm-kanban-card strong,
.crm-kanban-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-modal {
  width: min(560px, 94vw);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.score-check-list {
  display: grid;
  gap: 10px;
  padding: 22px 24px 24px;
}

.score-check-list div {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
  padding: 11px 12px;
}

.score-check-list div.met {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.danger-text,
.danger-button,
.danger-button .button-icon,
.link-button.danger-text,
.link-button.danger-text .button-icon {
  color: #b91c1c;
  border-color: #fecaca;
}

.education-plan-panel {
  display: grid;
  gap: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px;
}

.education-plan-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.education-plan-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.education-plan-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) repeat(3, minmax(90px, 0.7fr)) minmax(130px, 0.8fr) minmax(130px, 0.8fr);
  gap: 10px;
  align-items: end;
  border-top: 1px solid #cbd5e1;
  padding-top: 10px;
}

.education-plan-row small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 3px;
}

.education-plan-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 2px solid var(--brand-blue);
  padding-top: 12px;
  font-weight: 950;
}

.education-plan-total strong {
  color: var(--brand-blue);
}

.mini-list-item span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 950;
  padding: 2px 4px;
}

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

.guidance-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #854d0e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  padding: 10px 12px;
}

.guidance-message strong {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 14px;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.compact-button {
  min-height: 38px;
  padding-inline: 14px;
}

.quick-indicators {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-command-panel,
.relationship-command-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.family-command-panel .primary-button,
.family-command-panel .secondary-button,
.relationship-command-panel .primary-button,
.relationship-command-panel .secondary-button {
  align-self: end;
}

.add-member-grid {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.relationship-option-title {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.relationship-option-title:not(:first-child) {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.family-grid,
.relationship-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
}

.family-notes-field {
  grid-column: span 2;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.icon-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-blue);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
}

.icon-toggle:hover {
  border-color: var(--accent);
  background: #fbf7ea;
}

.indicator-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.indicator-pill.aumentou {
  border-color: #86efac;
  color: #047857;
}

.indicator-pill.reduziu {
  border-color: #fecdd3;
  color: #be123c;
}

.indicator-pill.neutro {
  border-color: #d9e1e8;
  color: var(--brand-blue);
}

.client-history-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 14px;
}

.client-history-grid article {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.client-history-grid h3 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 14px;
}

.history-box,
.timeline {
  color: var(--muted);
  font-size: 13px;
}

.mini-table {
  min-width: 0;
  font-size: 12px;
}

.mini-table th,
.mini-table td {
  padding: 7px 6px;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.timeline-item strong {
  color: var(--brand-blue);
}

.timeline-item span {
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.premium-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
}

.field textarea {
  min-height: 70px;
  resize: vertical;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
  width: 100%;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 8px;
}

.password-toggle:hover {
  color: var(--accent-strong);
}

.premium-input {
  min-height: 30px;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 800;
  padding: 4px 0;
  border: 0;
}

.premium-input[readonly] {
  background: transparent;
}

.premium-input.manual-premium {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 6px 8px;
}

.premium-input.missing-factor-premium {
  border-color: #be123c;
  background: #fff1f2;
  color: #be123c;
}

.invalid-field {
  border-color: #be123c !important;
  background: #fff1f2 !important;
}

.field select option {
  color: var(--ink);
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-blue);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button:hover {
  background: var(--brand-blue-strong);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  margin-right: 6px;
  font-weight: 900;
  line-height: 1;
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--brand-blue);
  border-radius: 8px;
  background: white;
  color: var(--brand-blue);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.secondary-button:hover {
  border-color: var(--accent);
  background: #fbf7ea;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.danger-button:hover {
  border-color: var(--error-text);
  background: #fff1f2;
}

.success-button {
  border-color: #16a34a;
  color: #15803d;
}

.success-button:hover {
  border-color: #15803d;
  background: #f0fdf4;
}

.pdf-button {
  border-color: var(--error-text);
  color: var(--error-text);
}

.pdf-button:hover {
  border-color: var(--error-text);
  background: #fff1f2;
}

.pdf-icon {
  width: 18px;
  height: 18px;
  background: url("/static/pdf.png") center / contain no-repeat;
}

.icon-button {
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-blue);
  cursor: pointer;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--accent);
  background: #fbf7ea;
}

.content {
  padding: 32px;
  overflow-x: hidden;
}

.empty-state,
.loading {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 64px);
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

.compact-empty {
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
}

.hidden {
  display: none !important;
}

.results {
  display: grid;
  gap: 18px;
}

.batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.batch-bar strong {
  display: block;
  font-size: 18px;
}

.view-switcher {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e9edf2;
  padding: 6px;
}

.view-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--brand-blue);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  padding: 10px 16px;
}

.view-tab:hover {
  background: #ffffff;
}

.view-tab.active {
  background: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(7, 29, 59, 0.16);
}

.view-panel {
  display: grid;
  gap: 18px;
}

.view-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #ffffff;
}

.view-heading h2 {
  margin-bottom: 0;
}

.pdf-options {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.pdf-options h3 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 16px;
}

.pdf-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px;
}

.pdf-options-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 10px;
}

.pdf-options-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-blue);
}

.simulation-heading {
  border-left-color: var(--accent);
}

.policy-select-band {
  display: grid;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.policy-select-band h3 {
  margin-bottom: 0;
}

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

.policy-card {
  display: grid;
  gap: 6px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 14px;
  text-align: left;
}

.policy-card.policy-card-active {
  border-color: #16a34a;
}

.policy-card.policy-card-inactive {
  border-color: #dc2626;
}

.policy-card.policy-card-reduction {
  border-color: #eab308;
}

.policy-card.policy-card-cancellation {
  border-color: #dc2626;
}

.policy-card.policy-card-active.active,
.policy-card.policy-card-active:hover {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.policy-card.policy-card-reduction.active,
.policy-card.policy-card-reduction:hover {
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.2);
}

.policy-card.policy-card-cancellation.active,
.policy-card.policy-card-cancellation:hover {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.policy-card.policy-card-inactive.active,
.policy-card.policy-card-inactive:hover {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

.policy-card.policy-card-active span {
  background: #dcfce7;
  color: #166534;
}

.policy-card.policy-card-inactive span {
  background: #fee2e2;
  color: #991b1b;
}

.policy-card.policy-card-reduction span {
  background: #fef3c7;
  color: #92400e;
}

.policy-card.policy-card-cancellation span {
  background: #fee2e2;
  color: #991b1b;
}

.policy-card:hover,
.policy-card.active {
  box-shadow: 0 0 0 3px rgba(198, 167, 91, 0.2);
}

.policy-card span {
  width: fit-content;
  border-radius: 999px;
  background: #f4ead1;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
  text-transform: uppercase;
}

.policy-card strong {
  color: var(--brand-blue);
  font-size: 18px;
}

.policy-card small {
  color: var(--muted);
  font-weight: 750;
}

.policy-card.policy-card-active.active { background: #f0fdf4; }
.policy-card.policy-card-reduction.active { background: #fffbeb; }
.policy-card.policy-card-cancellation.active,
.policy-card.policy-card-inactive.active { background: #fef2f2; }

.grid {
  display: grid;
  gap: 18px;
}

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

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.insured-top-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  align-items: start;
  gap: 18px;
}

.insured-top-summary h3 {
  margin-bottom: 0;
}

.insured-top-summary dl {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px 14px;
}

.insured-top-summary dt {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.insured-top-summary dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.panel-head h3 {
  margin-bottom: 0;
}

.aggregate-panel {
  display: grid;
  gap: 18px;
}

.simulation-panel {
  display: grid;
  gap: 18px;
}

.simulation-form,
.coverage-builder,
.optional-coverages,
.client-demonstration,
.saved-simulations,
.simulation-output {
  display: grid;
  gap: 16px;
}

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

.coverage-builder {
  padding-top: 4px;
}

.coverage-builder h4 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 15px;
}

.builder-head,
.simulation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.current-policy-section-heading,
.proposal-section-heading {
  border-radius: 8px;
  padding: 10px 12px;
}

.current-policy-section-heading {
  background: #eaf2fb;
  border-left: 4px solid var(--brand-blue);
}

.proposal-section-heading {
  background: #fff8e1;
  border-left: 4px solid var(--accent);
}

.current-policy-section-heading h4,
.proposal-section-heading h4 {
  margin: 0;
  font-size: 16px;
}

.coverage-row {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.85fr) minmax(230px, 1.35fr) minmax(140px, 0.65fr)
    minmax(150px, 0.75fr) repeat(3, minmax(118px, 0.55fr)) auto;
  align-items: end;
  gap: 12px;
}

.basic-row {
  grid-template-columns:
    minmax(160px, 0.85fr) minmax(230px, 1.35fr) minmax(140px, 0.65fr)
    minmax(150px, 0.75fr) repeat(3, minmax(118px, 0.55fr));
}

.optional-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.coverage-justification-field {
  margin-top: 10px;
}

.module-exclusion-field {
  max-width: 360px;
  margin-top: 12px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.premium-preview {
  display: grid;
  gap: 6px;
  min-height: 44px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.premium-preview span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.premium-preview strong {
  color: var(--brand-blue);
  font-size: 14px;
  white-space: nowrap;
}

.simulation-premium-grid {
  grid-template-columns: repeat(4, minmax(92px, 132px));
  gap: 8px;
  justify-content: start;
}

.simulation-premium-grid .kpi {
  min-height: 58px;
  gap: 3px;
  border-top-width: 2px;
  padding: 7px 9px;
}

.simulation-premium-grid .kpi span {
  font-size: 9px;
}

.simulation-premium-grid .kpi strong {
  font-size: 13px;
}

.policy-edit-summary,
.policy-adjustment-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
}

.policy-edit-summary span,
.policy-adjustment-summary span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.policy-edit-summary small,
.policy-adjustment-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.policy-edit-summary strong,
.policy-adjustment-summary strong {
  color: var(--brand-blue);
  font-size: 15px;
}

.simulation-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.simulation-live-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.add-optional-button {
  justify-self: start;
}

.saved-simulations {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.client-demonstration {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

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

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

.consolidated-comparison-card {
  background: #ffffff;
}

.comparison-card h5 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 14px;
  line-height: 1.35;
}

.comparison-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.comparison-totals span {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 10px;
  text-transform: uppercase;
}

.comparison-totals strong {
  color: var(--brand-blue);
  font-size: 16px;
  text-transform: none;
}

.comparison-card .table-wrap.compact table {
  min-width: 980px;
  table-layout: fixed;
}

.comparison-card table {
  width: 100%;
  font-size: 13px;
}

.comparison-card th,
.comparison-card td {
  padding: 9px 6px;
}

.comparison-card th:first-child,
.comparison-card td:first-child {
  width: 24%;
  overflow-wrap: anywhere;
}

.comparison-card th:nth-child(2),
.comparison-card td:nth-child(2) {
  width: 13%;
}

.comparison-card th:nth-child(3),
.comparison-card td:nth-child(3) {
  width: 13%;
}

.comparison-card th:nth-child(4),
.comparison-card td:nth-child(4),
.comparison-card th:nth-child(5),
.comparison-card td:nth-child(5),
.comparison-card th:nth-child(6),
.comparison-card td:nth-child(6),
.comparison-card th:nth-child(7),
.comparison-card td:nth-child(7) {
  width: 12.5%;
}

.comparison-card td:nth-child(n + 2) {
  color: var(--brand-blue);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.comparison-card th:nth-child(n + 2) {
  text-align: right;
}

.comparison-card tr.subgroup-row td:first-child {
  padding-left: 30px;
  font-weight: 500;
}

.comparison-card tr.group-row td:first-child {
  font-weight: 900;
}

.comparison-card tr.subgroup-row td:first-child::before {
  content: "-> ";
  color: var(--accent-strong);
  font-weight: 900;
}

.comparison-card tr.subgroup-row td:nth-child(2),
.comparison-card tr.subgroup-row td:nth-child(n + 2) {
  font-weight: 500;
}

.comparison-card tr.comparison-improved td {
  background: #ecfdf3;
}

.comparison-card tr.comparison-improved td:first-child,
.comparison-card tr.comparison-improved td:nth-child(2),
.comparison-card tr.comparison-improved td:nth-child(3),
.comparison-card tr.comparison-improved td:nth-child(4) {
  color: #047857;
}

.comparison-card tr.comparison-reduced td {
  background: #fff7ed;
}

.comparison-card tr.comparison-reduced td:first-child,
.comparison-card tr.comparison-reduced td:nth-child(2),
.comparison-card tr.comparison-reduced td:nth-child(3),
.comparison-card tr.comparison-reduced td:nth-child(4) {
  color: #854d0e;
}

.comparison-card tr.comparison-zeroed td {
  background: #fff;
  color: var(--error-text);
  text-decoration: line-through;
}

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

.duplicate-proposal-box {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 12px;
}

.duplicate-proposal-box h4 {
  margin: 0 0 4px;
}

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

.saved-simulation-open {
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.saved-simulation-open:hover strong {
  color: var(--accent-strong);
}

.saved-simulation-open span,
.saved-simulation-open small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.saved-simulation-open strong {
  color: var(--brand-blue);
  font-size: 15px;
}

.saved-simulation-delete {
  justify-self: start;
}

.saved-simulation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.whatsapp-button {
  border-color: #25d366;
  color: #128c4a;
}

.whatsapp-button svg {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 6px;
  fill: currentColor;
}

.commission-opportunity {
  color: #854d0e;
  font-weight: 800;
}

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

.modal-backdrop.hub-screen {
  inset: 0 0 0 288px;
  z-index: 900;
  display: block;
  overflow: auto;
  padding: 34px;
  width: auto;
  max-width: calc(100vw - 288px);
  background: var(--soft);
}

body.side-menu-collapsed .modal-backdrop.hub-screen {
  left: 82px;
  max-width: calc(100vw - 82px);
}

.modal-backdrop.hub-screen .ptc-modal {
  width: 100%;
  max-width: 1180px;
  max-height: none;
  margin: 0 auto;
  box-shadow: none;
  overflow-x: hidden;
}

.modal-backdrop.hub-screen .ptc-settings-modal {
  width: min(920px, 100%);
}

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

.home-dashboard-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.home-dashboard-cards article {
  border: 1px solid #cfe0f1;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
  padding: 16px;
}

.home-dashboard-cards span {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.home-dashboard-cards strong {
  color: var(--brand-blue);
  font-size: 2rem;
  line-height: 1;
}

.home-dashboard-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 14px 34px rgba(11, 43, 87, 0.06);
}

.home-dashboard-table {
  min-width: 0;
  table-layout: fixed;
}

.home-dashboard-table th,
.home-dashboard-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-modal {
  width: min(1480px, 98vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.commission-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #b8bec8;
}

.commission-modal-head h2 {
  margin: 0;
  color: #101828;
  font-size: 26px;
}

.commission-modal-head .icon-button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #101828;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
}

.commission-modal-meta {
  display: none;
}

.commission-modal-meta strong {
  font-weight: 900;
}

.commission-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  padding: 0 16px 20px;
}

.commission-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

.commission-table th,
.commission-table td {
  border-left: 1px solid #aab0bb;
  border-bottom: 1px solid #aab0bb;
  padding: 8px 7px;
}

.commission-table th:first-child,
.commission-table td:first-child {
  border-left: 0;
}

.commission-table th {
  color: #101828;
  font-size: 13px;
  font-weight: 900;
}

.commission-table-group-row th {
  text-align: center;
  font-size: 14px;
}

.commission-table tbody tr:nth-child(odd) {
  background: #eaf2fb;
}

.commission-product-col {
  width: 47%;
}

.commission-value-col {
  width: 8.833%;
}

.commission-table td:nth-child(n + 2),
.commission-table th:nth-child(n + 2) {
  text-align: right;
  white-space: nowrap;
}

.commission-table td:nth-child(1),
.commission-table th:nth-child(1) {
  text-align: left;
  width: 47%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.commission-table tfoot td {
  background: #f8fafc;
  font-weight: 900;
}

.ptc-modal {
  width: min(1120px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  color: #101828;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.ptc-settings-modal {
  width: min(860px, 94vw);
}

.ptc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 18px 20px 22px;
}

.ptc-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.ptc-panel h3 {
  margin: 0 0 12px;
  color: var(--brand-blue);
}

.ptc-warning {
  margin-bottom: 12px;
  border: 1px solid #f4c542;
  border-left: 4px solid #d99a00;
  border-radius: 8px;
  background: #fff8db;
  color: #7a4f00;
  padding: 10px 12px;
  font-weight: 800;
  line-height: 1.35;
}

.ptc-result-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.ptc-result-list div {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(150px, auto) minmax(260px, 1.4fr);
  align-items: baseline;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.ptc-result-list span {
  color: var(--muted);
  font-weight: 800;
}

.ptc-result-list strong {
  color: var(--brand-blue);
  font-size: 18px;
}

.ptc-result-list small {
  color: #475569;
  line-height: 1.35;
}

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

.ptc-table th,
.ptc-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}

.ptc-table td {
  text-align: right;
  font-weight: 800;
}

.ptc-opportunities {
  display: grid;
  gap: 8px;
}

.ptc-opportunities article {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.ptc-opportunities strong {
  color: var(--brand-blue);
}

.ptc-opportunities p {
  margin: 4px 0 0;
  color: #475569;
  line-height: 1.4;
}

.ptc-rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.commission-modal-suggestions {
  display: grid;
  gap: 8px;
  padding: 0 24px 24px;
}

.commission-modal-suggestions strong {
  color: var(--brand-blue);
}

.commission-modal-suggestions ul {
  margin: 0;
  padding-left: 18px;
  color: #854d0e;
  font-weight: 700;
}

.simulation-table th:nth-child(4),
.simulation-table th:nth-child(6),
.simulation-table th:nth-child(7),
.simulation-table th:nth-child(8),
.simulation-table th:nth-child(5),
.simulation-table td:nth-child(4),
.simulation-table td:nth-child(6),
.simulation-table td:nth-child(7),
.simulation-table td:nth-child(8),
.simulation-table td:nth-child(5) {
  text-align: right;
  white-space: nowrap;
}

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

.kpi {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.kpi span {
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  font-size: 22px;
}

.badge {
  border-radius: 999px;
  background: #f4ead1;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

dl {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 10px 16px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.table-wrap.compact table {
  min-width: 720px;
}

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

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

th {
  color: var(--brand-blue);
  font-size: 12px;
  text-transform: uppercase;
}

.group-presentation {
  display: block;
}

.coverage-detail-table th:nth-child(5),
.coverage-detail-table th:nth-child(6),
.coverage-detail-table th:nth-child(7),
.coverage-detail-table th:nth-child(8),
.coverage-detail-table th:nth-child(11),
.coverage-detail-table td:nth-child(5),
.coverage-detail-table td:nth-child(6),
.coverage-detail-table td:nth-child(7),
.coverage-detail-table td:nth-child(8),
.coverage-detail-table td:nth-child(11) {
  text-align: right;
  white-space: nowrap;
}

.coverage-edit-capital {
  width: 140px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  text-align: right;
}

.coverage-edit-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.coverage-edit-premium {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.coverage-edit-error {
  display: block;
  margin-top: 4px;
  color: var(--error-text);
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
}

.coverage-excluded td,
.coverage-excluded input,
.coverage-excluded small,
.coverage-excluded label,
.coverage-excluded button {
  color: var(--error-text);
  text-decoration: line-through;
}

.coverage-reduced td,
.coverage-reduced input,
.coverage-reduced small,
.coverage-reduced label,
.coverage-reduced button {
  color: #854d0e;
}

.coverage-adjustments {
  display: grid;
  gap: 10px;
}

.coverage-adjustments table {
  min-width: 760px;
  font-size: 13px;
}

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

.policy-adjustment-card h5 {
  margin: 0;
  color: var(--brand-blue);
  font-size: 14px;
}

.coverage-adjustments .coverage-excluded td {
  background: #fff;
  color: var(--error-text);
  text-decoration: line-through;
}

.coverage-adjustments .coverage-reduced td {
  background: #fff;
  color: #854d0e;
}

.policy-adjustment-card.policy-status-cancellation {
  border-color: #fecaca;
}

.policy-adjustment-card.policy-status-cancellation h5 {
  color: var(--error-text);
}

.policy-adjustment-card.policy-status-reduction {
  border-color: #fde68a;
}

.policy-adjustment-card.policy-status-reduction h5 {
  color: #854d0e;
}

.group-table-panel table {
  font-size: 13px;
  table-layout: fixed;
}

.group-table-panel th:nth-child(1),
.group-table-panel td:nth-child(1) {
  width: 34%;
}

.group-table-panel th:nth-child(2),
.group-table-panel td:nth-child(2) {
  width: 18%;
}

.group-table-panel td:nth-child(2),
.group-table-panel td:nth-child(3),
.group-table-panel td:nth-child(4),
.group-table-panel td:nth-child(5),
.group-table-panel th:nth-child(2),
.group-table-panel th:nth-child(3),
.group-table-panel th:nth-child(4),
.group-table-panel th:nth-child(5) {
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
  color: var(--brand-blue);
}

.group-table-panel tr.group-row td {
  font-weight: 900;
}

.group-name-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.group-icon-badge {
  display: inline-flex;
  min-width: 42px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand-blue);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.group-icon-img {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  object-fit: contain;
}

.group-table-panel tr.subgroup-row td:first-child {
  padding-left: 30px;
  font-weight: 500;
}

.group-table-panel tr.subgroup-row .group-icon-badge {
  background: #eef2f7;
  color: var(--brand-blue);
}

.group-table-panel tr.subgroup-row td:nth-child(2),
.group-table-panel tr.subgroup-row td:nth-child(3),
.group-table-panel tr.subgroup-row td:nth-child(4),
.group-table-panel tr.subgroup-row td:nth-child(5) {
  font-weight: 500;
}

.group-table-panel tr.subgroup-row td:first-child::before {
  content: "-> ";
  color: var(--accent-strong);
  font-weight: 900;
}


.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.person:last-child {
  border-bottom: 0;
}

.person-info {
  display: grid;
  gap: 4px;
}

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

.beneficiary-edit-table input,
.beneficiary-edit-table select {
  width: 100%;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  font: inherit;
}

.beneficiary-edit-table .compact-button {
  padding: 7px 10px;
  white-space: nowrap;
}

.beneficiary-validation {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.beneficiary-validation:empty {
  display: none;
}

.beneficiary-validation.error {
  color: var(--error-text);
}

.beneficiary-excluded td,
.beneficiary-excluded input,
.beneficiary-excluded select {
  color: var(--error-text);
  text-decoration: line-through;
}

.beneficiary-excluded input,
.beneficiary-excluded select {
  border-color: #fecaca;
  background: #fff;
}

.beneficiary-added td,
.beneficiary-added input,
.beneficiary-added select {
  color: #047857;
}

.beneficiary-percentage-changed td,
.beneficiary-percentage-changed input,
.beneficiary-percentage-changed select {
  color: #854d0e;
}

.beneficiaries-demo {
  margin-top: 14px;
}

.beneficiaries-demo h6 {
  margin: 0 0 8px;
  color: var(--brand-blue);
  font-size: 13px;
  text-transform: uppercase;
}

.designation-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(198, 167, 91, 0.55);
  border-radius: 999px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.person strong,
.person span,
.person-info {
  overflow-wrap: anywhere;
}

.notes {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--error-text);
  line-height: 1.55;
}

.coverage-alerts {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--error-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.coverage-alerts:empty {
  display: none;
}

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

summary {
  cursor: pointer;
  font-weight: 800;
}

pre {
  max-height: 460px;
  overflow: auto;
  margin: 16px 0 0;
  border-radius: 8px;
  background: #0b1220;
  color: #d1e7dd;
  padding: 18px;
  font-size: 12px;
  line-height: 1.5;
}

.alert {
  margin-bottom: 18px;
  border: 1px solid #fecdd3;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error-text);
  padding: 14px 16px;
  font-weight: 700;
}

.rescue-import-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 280px) auto;
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

.rescue-import-panel strong,
.rescue-import-panel span {
  display: block;
}

.rescue-import-panel span,
.rescue-import-panel .hint {
  color: var(--muted);
  font-size: 12px;
}

.rescue-import-panel .hint {
  grid-column: 1 / -1;
  margin: 0;
}

.rescue-import-preview {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.rescue-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rescue-preview-table-wrap {
  max-height: 320px;
  overflow: auto;
}

.rescue-table-preview-details summary,
.rescue-observations-preview summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.rescue-preview-table {
  min-width: 760px;
  font-size: 12px;
}

.rescue-preview-table th:nth-child(n+3),
.rescue-preview-table td:nth-child(n+3) {
  text-align: right;
  white-space: nowrap;
}

.rescue-preview-table th:last-child,
.rescue-preview-table td:last-child {
  text-align: left;
}

.rescue-observations-preview p {
  margin: 8px 0 0;
  max-height: 180px;
  overflow: auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.compact-file-input {
  min-height: auto;
}

.error-text {
  color: var(--error-text) !important;
  font-weight: 700;
}

.charge-history-details summary {
  align-items: center;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  font-weight: 800;
  justify-content: space-between;
}

.charge-history-details summary::after {
  content: "Mostrar";
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 9px;
}

.charge-history-details[open] summary::after {
  content: "Recolher";
}

.charge-history-table th:nth-child(1),
.charge-history-table td:nth-child(1) {
  width: 18%;
}

.charge-history-table th:nth-child(2),
.charge-history-table td:nth-child(2),
.charge-history-table th:nth-child(3),
.charge-history-table td:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

.charge-history-note {
  margin-top: 10px;
}

.policy-history-import {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.policy-history-import input[type="file"] {
  display: none;
}

.policy-history-import .hint {
  max-width: 720px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .tool-menu {
    justify-content: stretch;
    width: 100%;
  }

  .tool-tab {
    flex: 1 1 220px;
  }

  .logout-button {
    flex: 1 1 120px;
  }

  .workspace,
  .grid.two,
  .group-presentation {
    grid-template-columns: 1fr;
  }

  .import-panel,
  .upload-form,
  .rescue-import-panel,
  .insured-top-summary,
  .simulation-grid,
  .comparison-grid,
  .coverage-row,
  .basic-row,
  .crm-layout,
  .crm-filter-panel,
  .form-grid,
  .inline-form-grid,
  .contact-shortcut-row,
  .crm-lead-card,
  .client-grid,
  .family-grid,
  .relationship-grid,
  .pdf-options-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: auto;
  }

  .crm-lead-modal-card {
    width: 100%;
    max-height: 94vh;
  }

  .family-notes-field {
    grid-column: auto;
  }

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

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

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

  .builder-head,
  .simulation-actions,
  .view-switcher {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switcher {
    width: 100%;
  }

  h1 {
    font-size: 28px;
  }

  .empty-state,
  .loading {
    min-height: 260px;
  }
}

@media (max-width: 700px) {
  body {
    background: #ffffff;
  }

  .brand-logo {
    width: min(280px, 100%);
    margin-bottom: 0;
  }

  .content {
    padding: 14px;
  }

  .panel,
  .compact-empty,
  .batch-bar,
  .family-command-panel,
  .relationship-command-panel,
  .client-history-grid article {
    border-radius: 7px;
    padding: 14px;
  }

  .panel-head,
  .builder-head,
  .simulation-output-head,
  .policy-select-band,
  .history-actions,
  .export-actions,
  .policy-history-import {
    align-items: stretch;
    flex-direction: column;
  }

  .export-actions button,
  .simulation-actions button,
  .tool-tab,
  .logout-button,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .tool-menu,
  .view-switcher,
  .simulation-actions {
    gap: 6px;
  }

  .tool-tab,
  .view-tab,
  .logout-button {
    min-height: 42px;
    padding: 9px 10px;
  }

  h1,
  .login-card h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 21px;
  }

  h3 {
    font-size: 17px;
  }

  .client-grid,
  .family-grid,
  .relationship-grid,
  .add-member-grid,
  body.tool-review.review-client-new .client-workspace,
  .client-history-grid,
  .insured-top-summary,
  .insured-top-summary dl,
  dl {
    grid-template-columns: 1fr;
  }

  body.tool-review.review-client-new .client-workspace > .client-grid,
  body.tool-review.review-client-new .client-workspace > #review-import-slot-top {
    grid-column: 1;
  }

  .import-panel {
    gap: 12px;
  }

  .crm-lead-form,
  .crm-layout,
  .crm-lead-card {
    grid-template-columns: 1fr;
  }

  .crm-lead-form .crm-notes-field {
    grid-column: 1;
  }

  .kpi-grid,
  .simulation-live-totals,
  .simulation-premium-grid,
  .comparison-totals {
    grid-template-columns: 1fr 1fr;
  }

  .kpi {
    min-height: 74px;
    padding: 10px;
  }

  .kpi strong {
    font-size: 17px;
  }

  .policy-cards,
  .saved-simulations-grid {
    grid-template-columns: 1fr;
  }

  .policy-card {
    min-height: auto;
    padding: 12px;
  }

  .coverage-row,
  .basic-row {
    gap: 10px;
  }

  .premium-preview {
    min-width: 0;
  }

  .field input,
  .field select,
  .field textarea,
  .premium-input {
    min-height: 42px;
    font-size: 16px;
  }

  .table-wrap {
    margin-inline: -14px;
    padding-inline: 14px;
    scrollbar-width: thin;
  }

  table {
    min-width: 820px;
    font-size: 12px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .coverage-detail-table,
  .simulation-table,
  .beneficiary-edit-table,
  .charge-history-table {
    min-width: 980px;
  }

  .comparison-card table {
    min-width: 980px;
  }

  .login-shell {
    padding: 16px;
  }

  .login-card {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .content {
    padding: 10px;
  }

  .topbar {
    padding: 14px 12px;
  }

  .kpi-grid,
  .simulation-live-totals,
  .simulation-premium-grid,
  .comparison-totals {
    grid-template-columns: 1fr;
  }

  .panel,
  .compact-empty,
  .batch-bar {
    padding: 12px;
  }
}

/* Visual refresh: cleaner CRM surface with darker text and lighter color accents. */
.content {
  background:
    linear-gradient(180deg, rgba(238, 247, 255, 0.72), rgba(239, 250, 244, 0.42) 38%, rgba(255, 248, 230, 0.36));
}

.panel,
.modal-card,
.crm-lead-modal-card,
.crm-relationship-modal-card,
.ptc-panel,
.embedded-form-card,
.form-section,
.mini-list-item,
.crm-opportunity-card {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.panel,
.crm-lead-modal-card,
.crm-relationship-modal-card,
.ptc-modal {
  box-shadow: 0 14px 36px rgba(11, 43, 87, 0.07);
}

.eyebrow,
.field span,
.client-grid label,
.form-section summary,
.table-wrap th,
table th {
  color: #15223a;
}

.hint,
.mini-list-item span,
.ptc-result-list span,
.ptc-rules ul,
.client-grid input::placeholder,
.field input::placeholder {
  color: #435268;
}

.crm-modal-tabs,
.view-switcher {
  border-color: #cfe0ef;
  background: #f2f8fc;
}

.crm-modal-tabs button,
.view-tab,
.tool-tab {
  font-size: 13px;
}

.crm-modal-tabs button {
  border-color: #d9e6f2;
  background: #ffffff;
  color: #13213a;
}

.crm-modal-tabs button.active,
.crm-modal-tabs button:hover {
  border-color: var(--brand-blue);
  background: var(--sky-soft);
  color: var(--brand-blue);
}

.form-section {
  border-left: 3px solid #d7b86a;
}

.form-section[open] summary {
  background: linear-gradient(90deg, var(--sky-soft), #ffffff);
}

.field input,
.field select,
.field textarea,
.client-grid input,
.client-grid select,
.inline-form-grid input,
.inline-form-grid select {
  min-height: 40px;
  border-color: #cbd9e7;
  color: var(--ink);
  font-size: 14px;
}

.field textarea {
  min-height: 78px;
}

.crm-table th,
.crm-table td,
.crm-opportunity-table th,
.crm-opportunity-table td,
.table-wrap th,
.table-wrap td {
  font-size: 13px;
}

.crm-stage-list,
.crm-lead-table-wrap,
.crm-kanban-column,
.crm-kanban-card {
  background: rgba(255, 255, 255, 0.86);
}

.crm-stage-button:hover,
.crm-stage-button.active {
  background: var(--sky-soft);
}

.crm-stage-button strong {
  background: #e7eef6;
  color: #1b2b44;
}

.mini-list-item {
  border-left: 3px solid #cfe0ef;
  box-shadow: 0 6px 16px rgba(11, 43, 87, 0.04);
}

.mini-list-item:hover {
  border-left-color: var(--accent);
  background: #fffdf7;
}

.primary-button,
.secondary-button,
.compact-button {
  font-size: 14px;
}

.kpi,
.premium-preview,
.crm-progress-box {
  border-color: #d9e6f2;
  background: #ffffff;
}

.crm-opportunity-card:nth-child(5n + 1) {
  border-left: 4px solid #0b78d1;
}

.crm-opportunity-card:nth-child(5n + 2) {
  border-left: 4px solid #12a53a;
}

.crm-opportunity-card:nth-child(5n + 3) {
  border-left: 4px solid #c6a300;
}

.crm-opportunity-card:nth-child(5n + 4) {
  border-left: 4px solid #7c2cff;
}

.crm-opportunity-card:nth-child(5n + 5) {
  border-left: 4px solid #de7b00;
}

.crm-policies-group-summary {
  margin: 14px 0 18px;
}

.crm-summary-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.crm-summary-header strong {
  color: var(--navy);
  display: block;
  font-size: 1rem;
}

.crm-summary-header span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
  margin-top: 2px;
}

.crm-group-summary-table th:nth-child(2),
.crm-group-summary-table th:nth-child(3),
.crm-group-summary-table td:nth-child(2),
.crm-group-summary-table td:nth-child(3) {
  text-align: right;
  white-space: nowrap;
}

.crm-group-summary-table tr.group-row td:first-child {
  color: var(--navy);
  font-weight: 800;
}

.crm-group-summary-table tr.subgroup-row td:first-child {
  color: var(--muted);
  padding-left: 28px;
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  .workspace,
  body.side-menu-collapsed .workspace {
    padding-left: 0;
    padding-bottom: 74px;
  }

  .topbar,
  body.side-menu-collapsed .topbar {
    inset: auto 0 0 0;
    z-index: 1100;
    width: auto;
    min-height: 66px;
    padding: 8px;
    border-right: 0;
    border-top: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
  }

  .brand-area {
    display: none;
  }

  .tool-menu {
    flex-direction: row;
    width: max-content;
  }

  .modal-backdrop.hub-screen,
  body.side-menu-collapsed .modal-backdrop.hub-screen {
    inset: 0 0 calc(74px + env(safe-area-inset-bottom, 0px)) 0;
    left: 0;
    width: 100vw;
    max-width: none;
    padding: 14px;
  }

  .modal-backdrop.hub-screen .ptc-modal {
    width: 100%;
    max-width: none;
    border-radius: 12px;
  }

  .modal-backdrop.hub-screen .commission-modal-head {
    align-items: flex-start;
    gap: 12px;
  }

  .modal-backdrop.hub-screen .commission-modal-head h2 {
    font-size: 24px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .modal-backdrop.hub-screen .ptc-layout {
    padding: 14px;
  }

  .home-dashboard-cards {
    grid-template-columns: 1fr;
  }

  .business-opportunities-screen .business-opportunity-selector,
  .business-opportunities-screen .crm-opportunity-grid {
    margin-left: 0;
    margin-right: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  .business-opportunities-screen .table-wrap,
  .home-dashboard-section .table-wrap,
  .ptc-panel .table-wrap {
    overflow-x: auto;
  }

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

  .crm-modal-tabs button,
  .view-tab,
  .tool-tab {
    font-size: 12px;
  }
}
