:root {
  --bg-top: #eef2fb;
  --bg-mid: #dde5f3;
  --bg-bottom: #d6deef;
  --page-text: #33415c;
  --frame-bg: #f6f7fb;
  --panel-bg: #ffffff;
  --panel-border: #e9edf5;
  --panel-shadow: 0 10px 30px rgba(160, 175, 210, 0.14);
  --muted: #7d879b;
  --muted-strong: #57627d;
  --line: #edf0f6;
  --brand-blue: #4f8df7;
  --brand-blue-soft: #dce9ff;
  --brand-green: #46b28b;
  --brand-green-soft: #d7f3e8;
  --brand-orange: #f1ae45;
  --brand-orange-soft: #f9e7c2;
  --brand-purple: #8f6ae8;
  --brand-purple-soft: #e9ddfb;
  --brand-red: #e46a6a;
  --brand-red-soft: #f8d5d5;
  --radius-xl: 18px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --transition-fast: 140ms ease;
  --transition-medium: 220ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
  color: var(--page-text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

input {
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.page {
  width: min(1512px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 16px;
}

.app {
  position: relative;
  width: min(1338px, 100%);
  min-height: 900px;
  margin: 0 auto;
  background: var(--frame-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 25px 80px rgba(127, 142, 180, 0.25);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 95px;
  background: #f7f7fa;
  border-bottom: 1px solid #e7ebf3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px 0 40px;
}

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

.brand-logo-wrap {
  min-width: 220px;
}

.brand-logo {
  width: 255px;
  max-width: 100%;
  object-fit: contain;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search {
  width: 320px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #e4e7ef;
  background: #f4f5f8;
  display: flex;
  align-items: center;
  color: #9da6b9;
  font-size: 15px;
  padding: 0 15px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.search input {
  width: 100%;
  color: #51607d;
}

.search input::placeholder,
.mini-search input::placeholder {
  color: #97a1b7;
}

.search svg,
.mini-search svg,
.search-icon-inline {
  margin-right: 10px;
  opacity: 0.72;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #8f98aa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f8;
  border: 1px solid #e4e7ef;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.icon-btn:hover,
.icon-btn:focus-visible,
.avatar-button:hover,
.avatar-button:focus-visible,
.menu-item:hover,
.menu-item:focus-visible,
.bottom-settings:hover,
.bottom-settings:focus-visible,
.tab:hover,
.tab:focus-visible,
.stat-card:hover,
.stat-card:focus-visible,
.ghost-btn:hover,
.ghost-btn:focus-visible,
.chip-btn:hover,
.chip-btn:focus-visible,
.price-pill:hover,
.price-pill:focus-visible,
.donut-legend-item:hover,
.donut-legend-item:focus-visible,
.drawer-item:hover,
.drawer-item:focus-visible,
.focus-item:hover,
.focus-item:focus-visible,
.invoice-link:hover,
.invoice-link:focus-visible {
  transform: translateY(-1px);
}

.icon-btn:hover,
.icon-btn:focus-visible {
  border-color: #d7dfef;
  box-shadow: 0 10px 18px rgba(127, 142, 180, 0.12);
}

.badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef6b6c;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 107, 108, 0.3);
}

.badge.alt {
  background: var(--brand-blue);
  box-shadow: 0 2px 6px rgba(79, 141, 247, 0.3);
}

.badge.inline {
  position: static;
  margin-left: 10px;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #79675d, #f0e7e0);
  color: white;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.avatar-button {
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr) 320px;
  min-height: calc(900px - 95px);
}

.sidebar {
  background: linear-gradient(180deg, #f3f4f8 0%, #f0f2f7 100%);
  border-right: 1px solid #e8ebf4;
  position: relative;
  display: flex;
  flex-direction: column;
}

.sidebar-label {
  padding: 30px 0 14px 36px;
  font-size: 12px;
  color: #d5dae6;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.menu-item,
.bottom-settings {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 23px;
  color: #6f7890;
  font-size: 16px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}

.menu-item .menu-icon,
.bottom-settings .menu-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c869e;
}

.menu-item.active,
.bottom-settings.active {
  background: #e7effb;
  border-left-color: var(--brand-blue);
  color: #3f79d9;
}

.menu-item.active .menu-icon,
.bottom-settings.active .menu-icon {
  color: var(--brand-blue);
}

.bottom-settings-wrap {
  margin-top: auto;
}

.bottom-settings {
  min-height: 78px;
  border-top: 1px solid #e7ebf3;
  padding-left: 28px;
}

.main {
  background: #f7f8fc;
  padding: 18px 24px 22px 24px;
}

.rightbar {
  background: #f7f8fb;
  border-left: 1px solid #e8ebf4;
  padding: 12px;
}

.scrollable-rightbar {
  max-height: calc(100vh - 159px);
  overflow-y: auto;
}

.tabs {
  min-height: 38px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
  border-bottom: 1px solid #e8ebf4;
  margin-bottom: 20px;
  color: #6f7890;
  font-size: 16px;
  font-weight: 500;
  overflow-x: auto;
}

.tab {
  position: relative;
  padding: 0 0 14px;
  white-space: nowrap;
}

.tab.active {
  color: #2f3a57;
  font-weight: 700;
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-blue);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  height: 104px;
  width: 100%;
  text-align: left;
  background: white;
  border: 1px solid #eceef5;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(163, 175, 205, 0.12);
  padding: 14px 18px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.stat-card.active {
  border-color: #d7e5ff;
  box-shadow: 0 12px 30px rgba(94, 122, 190, 0.16);
}

.stat-title {
  font-size: 16px;
  font-weight: 500;
  color: #46506a;
  margin-bottom: 12px;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
}

.stat-meta {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-bubble {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.stat-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: #f4f6fb;
}

.stat-fill {
  height: 100%;
  border-radius: 0 999px 999px 0;
}

.panel,
.side-card,
.create-card,
.report-metric-card,
.report-chart-card,
.integration-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--panel-shadow);
}

.panel {
  overflow: hidden;
}

.leads-panel {
  min-height: 430px;
  margin-bottom: 12px;
}

.invoice-panel {
  min-height: 295px;
}

.panel-head,
.report-card-head,
.drawer-head,
.modal-head {
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
}

.panel-title,
.drawer-title,
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #33415c;
}

.panel-title-small {
  font-size: 18px;
}

.panel-subtitle,
.drawer-subtitle,
.page-subtitle,
.report-card-subtitle {
  font-size: 13px;
  color: #73809b;
  margin-top: 4px;
}

.mini-search {
  width: 280px;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid #e6e9f1;
  background: #f8f9fc;
  display: flex;
  align-items: center;
  color: #77829a;
  font-size: 14px;
  padding: 0 14px;
}

.mini-search input {
  width: 100%;
}

.table-head,
.table-row,
.invoice-head,
.invoice-row,
.source-row,
.modal-table-row {
  display: grid;
  align-items: center;
}

.leads-head,
.leads-row {
  grid-template-columns: 38px 1.35fr 1fr 0.9fr 1.1fr 1fr 0.95fr;
}

.leads-head {
  min-height: 44px;
  color: #76819b;
  font-size: 14px;
  font-weight: 500;
  padding: 0 18px;
}

.leads-row {
  width: 100%;
  min-height: 54px;
  color: #5c6884;
  font-size: 15px;
  padding: 0 18px;
  text-align: left;
  border-top: 1px solid #f0f2f7;
  position: relative;
  background: transparent;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.leads-row:hover {
  background: rgba(231, 239, 251, 0.55);
}

.leads-row.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #6fa3ff;
}

.name-cell,
.strong,
.invoice-link {
  color: #37435f;
  font-weight: 700;
}

.invoice-link {
  text-align: left;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.subtle {
  background: #eef1f7;
  color: #627089;
}

.invoice-head-wrap {
  padding-top: 6px;
  padding-bottom: 6px;
}

.invoice-wrap.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
}

.invoice-grid,
.invoice-row {
  grid-template-columns: 38px 1.2fr 0.85fr 0.95fr 0.75fr 0.9fr 0.8fr;
}

.invoice-head {
  min-height: 44px;
  color: #76819b;
  font-size: 14px;
  font-weight: 500;
  padding: 0 18px;
}

.invoice-row {
  min-height: 48px;
  padding: 0 18px;
  border-top: 1px solid #f0f2f7;
  font-size: 14px;
  color: #5c6884;
  gap: 8px;
}

.invoice-actions-cell {
  display: flex;
  justify-content: flex-end;
}

.checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #ccd4e3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  background: white;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.checkbox.checked {
  background: #68c4a1;
  border-color: #68c4a1;
  color: white;
}

.chart-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px 12px;
}

.chart-side {
  border-left: 1px solid #eef2f7;
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.95), rgba(246, 248, 251, 0.7));
}

.interactive-donut {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.donut-visual {
  width: 190px;
  height: 190px;
}

.donut-svg {
  width: 100%;
  height: 100%;
}

.donut-segment {
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.donut-segment:hover path,
.donut-segment.active path {
  filter: brightness(1.03);
}

.donut-segment-label {
  fill: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.donut-center-title {
  fill: #7a889f;
  font-size: 13px;
  font-weight: 600;
}

.donut-center-value {
  fill: #33415c;
  font-size: 16px;
  font-weight: 800;
}

.donut-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donut-legend-item {
  width: 100%;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e6ebf5;
  background: #fff;
}

.donut-legend-item.active {
  border-color: #dce7fb;
  background: #f8fbff;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.legend-swatch.neutral {
  background: #ced7e9;
}

.donut-empty,
.invoice-empty,
.empty-state,
.empty-mini-card {
  padding: 32px 18px;
  text-align: center;
  color: #73809b;
}

.donut-empty-title,
.empty-state h3,
.invoice-empty h3 {
  margin: 0 0 8px;
  color: #37435f;
}

.invoice-footer-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 16px;
  border-top: 1px solid #edf0f6;
  font-size: 13px;
  color: #66758d;
}

.invoice-footer-stats strong {
  color: #34415d;
}

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

.ghost-btn,
.chip-btn,
.chip-label,
.tiny-action,
.report-range-btn,
.feature-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e1e5ee;
  border-radius: 10px;
  background: #f6f7fb;
  color: #6b7893;
  font-size: 13px;
  font-weight: 600;
  min-height: 34px;
  padding: 0 12px;
}

.ghost-btn.wide {
  min-width: 120px;
}

.tiny-action {
  min-height: 30px;
  font-size: 12px;
  padding: 0 10px;
}

.chip-label {
  background: white;
  min-width: 130px;
}

.report-range-btn.active,
.price-pill.active,
.ghost-btn.active,
.chip-btn.active {
  background: #d9f1e7;
  border-color: #d9f1e7;
  color: #4a9d7f;
}

.side-card {
  overflow: hidden;
}

.contact-top {
  padding: 16px 18px 14px 18px;
  border-bottom: 1px solid #edf0f6;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.contact-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #5c96fb 0%, #52bf99 100%);
}

.contact-name {
  font-size: 18px;
  font-weight: 600;
  color: #34415d;
  margin-bottom: 8px;
}

.contact-phone {
  font-size: 16px;
  font-weight: 700;
  color: #34415d;
}

.contact-meta {
  font-size: 14px;
  color: #64708a;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropdown-caret {
  color: #8b94a8;
  font-size: 18px;
}

.side-section,
.report-aside-section,
.activity-section {
  padding: 14px 18px;
  border-bottom: 1px solid #edf0f6;
}

.state-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 500;
  color: #496656;
  margin-bottom: 14px;
}

.state-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #58c19a;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.price-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.price-pill {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #d6ddea;
  background: #f8fafd;
  color: #57627d;
}

.update-title {
  font-size: 15px;
  font-weight: 500;
  color: #4a536b;
  margin-bottom: 12px;
}

.action-row {
  display: flex;
  gap: 10px;
}

.btn {
  flex: 1;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid #e1e5ee;
  background: #f6f7fb;
  color: #8b93a8;
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.btn.primary,
.create-btn {
  background: #52bf99;
  border-color: #52bf99;
  color: white;
  box-shadow: 0 6px 16px rgba(82, 191, 153, 0.25);
}

.btn:hover,
.btn:focus-visible,
.create-btn:hover,
.create-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(82, 191, 153, 0.28);
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #394662;
  margin-bottom: 14px;
}

.billing-list,
.focus-list,
.timeline-list,
.notes-list,
.check-list,
.insight-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.billing-item,
.check-list-item,
.insight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-item.active {
  padding: 10px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #e2ebfc;
}

.billing-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tiny-box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 9px;
  font-weight: 700;
}

.tiny-box.green {
  background: var(--brand-green);
}

.billing-price {
  font-weight: 700;
  color: #394662;
}

.total-row {
  padding: 13px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: #4c5874;
}

.total-row strong {
  color: #394662;
  font-size: 15px;
}

.create-card {
  margin-top: 12px;
  padding: 18px;
}

.create-title {
  font-size: 18px;
  font-weight: 600;
  color: #3f4c69;
  margin-bottom: 28px;
}

.create-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  color: #6a748c;
  font-size: 16px;
}

.create-total strong {
  color: #37435f;
  font-size: 17px;
}

.create-btn {
  width: 100%;
  min-height: 46px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5c96fb 0%, #4b86ec 100%);
  box-shadow: 0 10px 25px rgba(81, 138, 242, 0.3);
  font-size: 18px;
  font-weight: 600;
}

.create-footnote,
.muted-small,
.timeline-time,
.note-time,
.package-mix-value {
  font-size: 12px;
  color: #8a95aa;
}

.activity-card,
.notes-card {
  margin-top: 12px;
}

.timeline-item.compact,
.note-item.compact,
.focus-item {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #edf2f8;
}

.timeline-item.compact {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5c96fb 0%, #52bf99 100%);
  margin-top: 6px;
}

.timeline-title,
.note-author,
.focus-name {
  font-weight: 700;
  color: #34415d;
  margin-bottom: 4px;
}

.timeline-desc,
.note-text,
.focus-meta,
.integration-description {
  font-size: 13px;
  line-height: 1.5;
  color: #627089;
}

.note-item.compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.focus-item {
  width: 100%;
  text-align: left;
}

.focus-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.focus-value {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #34415d;
}

.floating-drawer {
  position: absolute;
  top: 110px;
  right: 18px;
  width: 360px;
  max-width: calc(100% - 36px);
  max-height: calc(100% - 132px);
  overflow: hidden;
  background: white;
  border: 1px solid #e6eaf4;
  border-radius: 18px;
  box-shadow: 0 25px 65px rgba(68, 84, 120, 0.18);
  z-index: 20;
}

.drawer-list {
  max-height: 540px;
  overflow-y: auto;
}

.drawer-item {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f8;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.drawer-item:hover {
  background: #f8fbff;
}

.drawer-item.unread {
  background: linear-gradient(90deg, rgba(79, 141, 247, 0.06), rgba(79, 141, 247, 0.015));
}

.drawer-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #33415c;
  margin-bottom: 8px;
}

.drawer-item-body {
  font-size: 13px;
  color: #627089;
  line-height: 1.5;
  margin-bottom: 8px;
}

.drawer-item-time {
  font-size: 12px;
  color: #8b94a8;
}

.unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--brand-blue);
  display: inline-block;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 24;
  background: rgba(26, 37, 59, 0.34);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: min(720px, 100%);
  background: #fff;
  border: 1px solid #e7ebf4;
  border-radius: 20px;
  box-shadow: 0 32px 70px rgba(54, 67, 98, 0.28);
  overflow: hidden;
}

.modal-table {
  padding: 10px 18px 18px;
}

.modal-table-row {
  grid-template-columns: 1fr 1fr 1fr 100px;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid #eef2f8;
}

.profile-modal-body {
  padding: 18px;
  color: #627089;
  line-height: 1.6;
}

.reports-main,
.integrations-main {
  overflow-y: auto;
}

.reports-header,
.integrations-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.reports-range-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.report-metric-card {
  padding: 18px;
}

.report-metric-title {
  color: #627089;
  font-size: 14px;
  margin-bottom: 12px;
}

.report-metric-value {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.report-metric-detail {
  font-size: 13px;
  color: #7a889f;
}

.reports-grid-two {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.reports-grid-two.bottom {
  margin-bottom: 0;
}

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

.report-chart-card.large .chart-scroll-wrap {
  padding: 12px 12px 0;
}

.report-line-chart {
  width: 100%;
  height: 260px;
}

.grid-line {
  stroke: #edf2f8;
  stroke-width: 1;
}

.axis-label {
  font-size: 12px;
  fill: #7f8aa0;
}

.line-created,
.line-won,
.line-invoiced {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-created,
.dot-created {
  stroke: var(--brand-blue);
  fill: var(--brand-blue);
}

.line-won,
.dot-won {
  stroke: var(--brand-green);
  fill: var(--brand-green);
}

.line-invoiced,
.dot-invoiced {
  stroke: var(--brand-purple);
  fill: var(--brand-purple);
}

.report-inline-legend,
.chart-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 10px 18px 16px;
  color: #627089;
  font-size: 13px;
}

.legend-pill {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
}

.legend-pill.created {
  background: var(--brand-blue);
}

.legend-pill.won {
  background: var(--brand-green);
}

.legend-pill.invoiced {
  background: var(--brand-purple);
}

.progress-list,
.package-mix-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.progress-item,
.package-mix-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-label-row,
.package-mix-head,
.integration-head,
.integration-meta-grid,
.integration-actions-row,
.source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
}

.source-table {
  padding: 0 18px 18px;
}

.source-row {
  display: grid;
  grid-template-columns: 1.2fr 0.5fr 0.5fr 0.5fr 0.8fr;
  min-height: 48px;
  padding: 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 14px;
  color: #5c6884;
}

.source-row.head {
  color: #76819b;
  font-size: 13px;
  font-weight: 600;
}

.report-aside-card {
  margin-bottom: 12px;
}

.insight-item {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}

.insight-item strong {
  min-width: 88px;
  color: #33415c;
}

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

.integration-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.integration-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.integration-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: linear-gradient(135deg, #5c96fb 0%, #52bf99 100%);
  color: white;
}

.integration-name {
  font-size: 18px;
  font-weight: 700;
  color: #34415d;
}

.integration-category {
  font-size: 13px;
  color: #8a95aa;
}

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

.integration-meta-grid span,
.integration-meta-grid strong {
  display: block;
}

.integration-meta-grid strong {
  color: #34415d;
  margin-top: 6px;
}

.integration-feature-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.feature-pill {
  min-height: 30px;
  padding-inline: 10px;
  background: #f9fbff;
}

.integration-actions-row {
  margin-top: auto;
}

.check-list-item {
  justify-content: flex-start;
}

.muted {
  color: #7d879b;
}

strong {
  font-weight: 700;
}

@media (max-width: 1320px) {
  .layout {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .rightbar {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid #e8ebf4;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .create-card,
  .activity-card,
  .notes-card,
  .report-aside-card {
    margin-top: 0;
  }
}

@media (max-width: 1120px) {
  .topbar {
    height: auto;
    padding: 18px;
    flex-wrap: wrap;
    gap: 18px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .search {
    width: min(100%, 420px);
  }

  .stats,
  .report-metric-grid,
  .integrations-grid,
  .reports-grid-two,
  .rightbar {
    grid-template-columns: 1fr;
  }

  .invoice-wrap.work-grid {
    grid-template-columns: 1fr;
  }

  .chart-side {
    border-left: 0;
    border-top: 1px solid #eef2f7;
  }
}

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

  .sidebar {
    display: none;
  }

  .page {
    padding: 16px 8px;
  }

  .main,
  .rightbar {
    padding: 16px;
  }

  .leads-head,
  .leads-row,
  .invoice-head,
  .invoice-row,
  .source-row,
  .modal-table-row {
    min-width: 880px;
  }

  .leads-panel,
  .invoice-panel,
  .source-table,
  .modal-table {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .brand-logo {
    width: 210px;
  }

  .floating-drawer {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .toolbar-inline {
    justify-content: flex-start;
  }

  .page-title {
    font-size: 24px;
  }

  .tabs {
    gap: 18px;
  }
}

.app-loading-state {
  min-height: 760px;
}

.app-loader-wrap {
  min-height: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  text-align: center;
  padding: 24px;
}

.app-loader {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 4px solid rgba(79, 141, 247, 0.14);
  border-top-color: var(--brand-blue);
  animation: sfcrm-spin 0.8s linear infinite;
}

.app-loader-title {
  font-size: 22px;
  font-weight: 700;
  color: #34415d;
}

.app-error-wrap {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
}

.app-error-wrap p {
  margin: 0;
  color: #667085;
}

.app.is-saving::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(246, 247, 251, 0.42);
  pointer-events: none;
}

.create-btn.disabled,
.btn.disabled,
.ghost-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.sfcrm-login-page {
  min-height: 100vh;
  padding: 32px 16px;
  background: radial-gradient(circle at top, var(--bg-top) 0%, var(--bg-mid) 45%, var(--bg-bottom) 100%);
  color: var(--page-text);
}

.sfcrm-login-shell {
  width: min(1240px, 100%);
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  background: rgba(246, 247, 251, 0.88);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 25px 80px rgba(127, 142, 180, 0.24);
  display: grid;
  grid-template-columns: 1.1fr minmax(340px, 420px);
  overflow: hidden;
}

.sfcrm-login-branding {
  padding: 56px 64px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72) 0%, rgba(241, 245, 255, 0.98) 100%);
  position: relative;
}

.sfcrm-login-branding::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 141, 247, 0.24) 0%, rgba(79, 141, 247, 0) 68%);
}

.sfcrm-login-logo {
  width: 280px;
  max-width: 100%;
  margin-bottom: 40px;
}

.sfcrm-login-kicker {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #e9efff;
  color: #456ec6;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}

.sfcrm-login-branding h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: #34415d;
}

.sfcrm-login-branding p {
  max-width: 620px;
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
  color: #5f6c88;
}

.sfcrm-login-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.sfcrm-login-pills span {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 229, 243, 0.95);
  color: #4c5874;
  font-weight: 600;
}

.sfcrm-login-card-wrap {
  padding: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f7f8fc 0%, #f3f5fb 100%);
}

.sfcrm-login-card {
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e8ebf4;
  box-shadow: 0 18px 42px rgba(160, 175, 210, 0.18);
  padding: 28px;
}

.sfcrm-login-card-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #34415d;
}

.sfcrm-login-card-head p {
  margin: 0 0 22px;
  color: #667085;
  line-height: 1.6;
}

.sfcrm-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sfcrm-login-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #475467;
  font-weight: 600;
}

.sfcrm-login-form input[type='email'],
.sfcrm-login-form input[type='password'] {
  height: 50px;
  border-radius: 14px;
  border: 1px solid #d9e1f0;
  background: #f8fafd;
  padding: 0 16px;
  color: #34415d;
}

.sfcrm-login-form input[type='email']:focus,
.sfcrm-login-form input[type='password']:focus {
  border-color: #4f8df7;
  box-shadow: 0 0 0 4px rgba(79, 141, 247, 0.12);
}

.sfcrm-login-checkbox {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  font-weight: 500 !important;
}

.sfcrm-login-button {
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #5c96fb 0%, #4b86ec 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(81, 138, 242, 0.3);
}

.sfcrm-login-notice {
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

.sfcrm-login-notice--error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.sfcrm-login-notice--success {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid #abefc6;
}

@keyframes sfcrm-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 980px) {
  .sfcrm-login-shell {
    grid-template-columns: 1fr;
  }

  .sfcrm-login-branding,
  .sfcrm-login-card-wrap {
    padding: 28px;
  }
}


.page-loading-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 16px;
}

.app-loading-card-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(100vh - 64px, 900px);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.app-loader-card {
  width: min(100%, 368px);
  min-height: 156px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: 0 28px 80px rgba(127, 142, 180, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 28px;
  text-align: center;
}

.app-loader-card-error {
  gap: 14px;
}

.app-loader-card .ghost-btn {
  margin-top: 8px;
}

.sfcrm-boot-error {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== Sajtfabriken CRM v5.1 polish overrides ===== */
:root {
  --bg-top: #eef2f6;
  --bg-mid: #eef2f6;
  --bg-bottom: #eef2f6;
  --page-text: #243247;
  --frame-bg: #f8fafc;
  --panel-bg: #ffffff;
  --panel-border: rgba(15, 23, 42, 0.06);
  --panel-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px rgba(15, 23, 42, 0.04);
  --muted: #7d879b;
  --muted-strong: #57627d;
  --line: rgba(15, 23, 42, 0.06);
  --brand-blue: #4a78e3;
  --brand-blue-soft: #e3ecff;
  --brand-green: #53a483;
  --brand-green-soft: #ddf1e8;
  --brand-orange: #c7923a;
  --brand-orange-soft: #f8edd6;
  --brand-purple: #8270db;
  --brand-purple-soft: #ece7ff;
  --brand-red: #d66b6b;
  --brand-red-soft: #f7dede;
  --radius-xl: 20px;
  --radius-lg: 18px;
  --radius-md: 16px;
  --radius-sm: 14px;
  --radius-xs: 12px;
}

html,
body {
  height: 100%;
}

body.sfcrm-portal-body,
body.sfcrm-login-body,
body.sfcrm-portal-page,
body.sfcrm-login-page-body {
  background: #eef2f6;
  color: #243247;
}

.page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

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

.app {
  width: 100%;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #f8fafc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 88px;
  background: rgba(248, 250, 252, 0.92);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
  padding: 0 28px 0 32px;
}

.brand-logo {
  width: 238px;
}

.top-actions {
  gap: 12px;
}

.search {
  width: 360px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #8a94a8;
  box-shadow: none;
}

.search svg,
.mini-search svg,
.search-icon-inline svg {
  margin-right: 10px;
  opacity: 0.72;
}

.search-icon-inline {
  display: inline-flex;
  align-items: center;
  color: #8a94a8;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #7d879b;
  box-shadow: none;
}

.icon-btn:hover,
.icon-btn:focus-visible,
.avatar-button:hover,
.avatar-button:focus-visible {
  transform: none;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.avatar {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.layout {
  grid-template-columns: 284px minmax(0, 1fr) 360px;
  min-height: calc(100vh - 88px);
}

.sidebar {
  background: #f7f9fc;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  padding: 22px 18px 20px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 18px;
}

.sidebar-brand-meta {
  padding: 0 14px 4px;
}

.sidebar-kicker,
.sidebar-section-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.sidebar-kicker {
  color: #7c879b;
  margin-bottom: 10px;
}

.sidebar-helper {
  max-width: 208px;
  font-size: 13px;
  line-height: 1.55;
  color: #667388;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-title {
  padding: 0 14px;
  color: #9aa3b5;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item,
.bottom-settings {
  position: relative;
  min-height: 50px;
  gap: 12px;
  padding: 12px 16px 12px 18px;
  border-left: 0;
  border-radius: 14px;
  background: transparent;
  color: #617084;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.menu-item::after,
.bottom-settings::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -2px;
  height: 1px;
  background: rgba(15, 23, 42, 0.05);
}

.sidebar-nav .menu-item:last-child::after,
.sidebar-section:last-of-type .bottom-settings::after {
  display: none;
}

.menu-item:hover,
.menu-item:focus-visible,
.bottom-settings:hover,
.bottom-settings:focus-visible {
  transform: none;
  background: rgba(92, 108, 138, 0.055);
  color: #33415d;
}

.menu-item .menu-icon,
.bottom-settings .menu-icon {
  width: 18px;
  height: 18px;
  color: #8a94a8;
}

.menu-item .menu-icon svg,
.bottom-settings .menu-icon svg {
  width: 18px;
  height: 18px;
}

.menu-label-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.menu-item.active,
.bottom-settings.active {
  background: rgba(74, 120, 227, 0.11);
  color: #3567d0;
  font-weight: 700;
}

.menu-item.active::before,
.bottom-settings.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: #4a78e3;
}

.menu-item.active::after,
.bottom-settings.active::after {
  opacity: 0;
}

.menu-item.active .menu-icon,
.bottom-settings.active .menu-icon {
  color: #3e72dd;
}

.sidebar-footer-card {
  margin-top: auto;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.sidebar-footer-role {
  font-size: 12px;
  font-weight: 600;
  color: #8a94a8;
  margin-bottom: 6px;
}

.sidebar-footer-name {
  font-size: 15px;
  font-weight: 700;
  color: #30415f;
  margin-bottom: 4px;
}

.sidebar-footer-meta {
  font-size: 13px;
  color: #667388;
}

.main {
  background: #fbfcfe;
  padding: 20px 24px 26px;
}

.rightbar {
  background: #fbfcfe;
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  padding: 20px 20px 24px;
}

.scrollable-rightbar {
  max-height: calc(100vh - 128px);
}

.tabs {
  min-height: auto;
  width: fit-content;
  max-width: 100%;
  gap: 6px;
  padding: 6px;
  margin-bottom: 20px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: #f7f9fc;
  overflow-x: auto;
}

.tab {
  padding: 10px 14px;
  border-radius: 10px;
  color: #65748a;
  font-size: 14px;
  font-weight: 600;
}

.tab:hover,
.tab:focus-visible {
  transform: none;
  background: rgba(92, 108, 138, 0.055);
}

.tab.active {
  color: #2e4263;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.tab.active::after {
  display: none;
}

.stats {
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  height: 112px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 24px rgba(15, 23, 42, 0.04);
}

.stat-card:hover,
.stat-card:focus-visible {
  transform: none;
}

.stat-card.active {
  border-color: rgba(74, 120, 227, 0.16);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 30px rgba(74, 120, 227, 0.08);
}

.stat-title {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #55627a;
}

.stat-value {
  font-size: 24px;
}

.stat-meta {
  font-size: 12px;
}

.mini-bubble {
  min-width: 24px;
  height: 24px;
}

.stat-bar {
  height: 10px;
  background: rgba(15, 23, 42, 0.04);
}

.stat-fill {
  border-radius: 0 999px 999px 0;
}

.panel,
.side-card,
.create-card,
.report-metric-card,
.report-chart-card,
.integration-card {
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 28px rgba(15, 23, 42, 0.04);
}

.panel-head,
.report-card-head,
.drawer-head,
.modal-head {
  min-height: 62px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.panel-title,
.drawer-title,
.page-title {
  font-size: 19px;
  letter-spacing: -0.02em;
  color: #30415f;
}

.panel-title-small {
  font-size: 17px;
}

.panel-subtitle,
.drawer-subtitle,
.page-subtitle,
.report-card-subtitle {
  color: #728099;
}

.mini-search {
  width: 290px;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #74829b;
}

.leads-head,
.invoice-head,
.source-row.head {
  color: #7a8598;
  font-size: 13px;
  font-weight: 600;
}

.leads-head {
  min-height: 46px;
  padding: 0 20px;
}

.leads-row {
  min-height: 58px;
  padding: 0 20px;
  border-top-color: rgba(15, 23, 42, 0.04);
}

.leads-row:hover {
  background: rgba(92, 108, 138, 0.05);
}

.leads-row.selected {
  background: rgba(74, 120, 227, 0.08);
}

.leads-row.selected::before {
  width: 3px;
  background: #4a78e3;
}

.leads-row.selected:hover {
  background: rgba(74, 120, 227, 0.1);
}

.name-cell,
.strong,
.invoice-link {
  color: #30415f;
}

.status-pill {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.invoice-head {
  min-height: 46px;
  padding: 0 20px;
}

.invoice-row {
  min-height: 50px;
  padding: 0 20px;
  border-top-color: rgba(15, 23, 42, 0.04);
}

.chart-side {
  border-left: 1px solid rgba(15, 23, 42, 0.06);
  background: linear-gradient(180deg, rgba(251, 252, 254, 0.98), rgba(247, 249, 252, 0.92));
}

.donut-legend-item {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: none;
}

.donut-legend-item.active {
  border-color: rgba(74, 120, 227, 0.12);
  background: rgba(74, 120, 227, 0.04);
}

.ghost-btn,
.chip-btn,
.chip-label,
.tiny-action,
.report-range-btn,
.feature-pill {
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #647287;
}

.ghost-btn:hover,
.ghost-btn:focus-visible,
.chip-btn:hover,
.chip-btn:focus-visible,
.price-pill:hover,
.price-pill:focus-visible,
.donut-legend-item:hover,
.donut-legend-item:focus-visible,
.drawer-item:hover,
.drawer-item:focus-visible,
.focus-item:hover,
.focus-item:focus-visible,
.invoice-link:hover,
.invoice-link:focus-visible {
  transform: none;
}

.report-range-btn.active,
.price-pill.active,
.ghost-btn.active,
.chip-btn.active {
  background: rgba(74, 120, 227, 0.1);
  border-color: rgba(74, 120, 227, 0.14);
  color: #3263cc;
}

.contact-top,
.side-section,
.report-aside-section,
.activity-section {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

.contact-name,
.contact-phone,
.create-title,
.integration-name,
.report-metric-value,
.state-line,
.section-title-row,
.total-row strong {
  color: #30415f;
}

.contact-avatar,
.integration-logo {
  background: linear-gradient(135deg, #4f7de6 0%, #53a483 100%);
}

.price-pill {
  border-radius: 10px;
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  color: #57657d;
}

.update-title,
.contact-meta,
.timeline-desc,
.note-text,
.focus-meta,
.integration-description,
.create-total,
.total-row,
.billing-list,
.billing-item,
.report-metric-detail {
  color: #65748a;
}

.btn {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: #6f7d92;
  font-weight: 700;
}

.btn.primary {
  background: #53a483;
  border-color: #53a483;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(83, 164, 131, 0.2);
}

.btn:hover,
.btn:focus-visible {
  transform: none;
}

.create-card {
  margin-top: 14px;
  padding: 20px;
}

.create-btn {
  min-height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #4f7de6 0%, #3f6fd3 100%);
  box-shadow: 0 10px 22px rgba(74, 120, 227, 0.22);
  font-weight: 700;
}

.create-btn:hover,
.create-btn:focus-visible {
  transform: none;
  box-shadow: 0 12px 24px rgba(74, 120, 227, 0.24);
}

.timeline-item.compact,
.note-item.compact,
.focus-item,
.donut-legend-item,
.timeline-item.compact,
.billing-item.active {
  border-radius: 14px;
}

.timeline-item.compact,
.note-item.compact,
.focus-item {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.billing-item.active {
  background: rgba(74, 120, 227, 0.04);
  border: 1px solid rgba(74, 120, 227, 0.12);
}

.floating-drawer {
  top: 102px;
  right: 20px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
}

.drawer-item {
  border-bottom-color: rgba(15, 23, 42, 0.05);
}

.drawer-item:hover {
  background: rgba(92, 108, 138, 0.05);
}

.drawer-item.unread {
  background: linear-gradient(90deg, rgba(74, 120, 227, 0.07), rgba(74, 120, 227, 0.02));
}

.modal-overlay {
  background: rgba(20, 28, 45, 0.32);
}

.modal-card {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
}

.app-loading-state {
  min-height: 100vh;
}

.page-loading-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
  background: #eef2f6;
}

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

.app-loader-card {
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.app-loader-title {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.sfcrm-login-page {
  min-height: 100vh;
  padding: 0;
  background: #eef2f6;
}

.sfcrm-login-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  background: #f8fafc;
  grid-template-columns: minmax(0, 1.08fr) 460px;
}

.sfcrm-login-branding {
  padding: 72px 72px 64px;
  background: linear-gradient(145deg, #f9fbfd 0%, #f2f6fb 100%);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
}

.sfcrm-login-branding::after {
  right: -90px;
  bottom: -90px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(74, 120, 227, 0.16) 0%, rgba(74, 120, 227, 0) 68%);
}

.sfcrm-login-branding-inner {
  max-width: 620px;
}

.sfcrm-login-logo {
  width: 290px;
  margin-bottom: 48px;
}

.sfcrm-login-kicker {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(74, 120, 227, 0.1);
  color: #3667d0;
  border: 1px solid rgba(74, 120, 227, 0.12);
  margin-bottom: 18px;
}

.sfcrm-login-branding h1 {
  font-size: clamp(40px, 5vw, 58px);
  line-height: 0.98;
  color: #2f4263;
}

.sfcrm-login-branding p {
  max-width: 560px;
  font-size: 18px;
  line-height: 1.65;
  color: #627089;
}

.sfcrm-login-pills {
  margin-top: 30px;
}

.sfcrm-login-pills span {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: #4f5d74;
}

.sfcrm-login-card-wrap {
  padding: 32px;
  background: #fbfcfe;
}

.sfcrm-login-card-shell {
  width: 100%;
  max-width: 420px;
}

.sfcrm-login-card {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 18px 40px rgba(15, 23, 42, 0.06);
  padding: 32px;
}

.sfcrm-login-card-head h2 {
  font-size: 30px;
  letter-spacing: -0.03em;
  color: #30415f;
}

.sfcrm-login-card-head p {
  color: #667388;
}

.sfcrm-login-form {
  gap: 18px;
}

.sfcrm-login-form label {
  gap: 9px;
  color: #46566f;
}

.sfcrm-login-form input[type='email'],
.sfcrm-login-form input[type='password'] {
  height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  padding: 0 16px;
  color: #30415f;
}

.sfcrm-login-form input[type='email']:focus,
.sfcrm-login-form input[type='password']:focus {
  border-color: rgba(74, 120, 227, 0.7);
  box-shadow: 0 0 0 4px rgba(74, 120, 227, 0.12);
}

.sfcrm-login-button {
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(180deg, #4f7de6 0%, #3f6fd3 100%);
  box-shadow: 0 12px 24px rgba(74, 120, 227, 0.22);
}

.sfcrm-login-notice {
  border-radius: 14px;
}

@media (max-width: 1320px) {
  .layout {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .rightbar {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 1120px) {
  .topbar {
    height: auto;
    padding: 16px 18px;
    gap: 14px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .search {
    width: min(100%, 480px);
  }

  .sfcrm-login-shell {
    grid-template-columns: 1fr;
  }

  .sfcrm-login-branding,
  .sfcrm-login-card-wrap {
    padding: 28px;
  }
}

@media (max-width: 960px) {
  .page {
    min-height: 100vh;
  }

  .app {
    min-height: 100vh;
  }

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

  .sidebar {
    display: none;
  }

  .main,
  .rightbar {
    padding: 16px;
  }

  .tabs {
    width: 100%;
  }
}

/* 5.1.1 design refinements */
.layout {
  grid-template-columns: 304px minmax(0, 1fr) 360px;
}

.topbar {
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.brand-logo-wrap {
  min-width: 250px;
}

.brand-logo,
.sfcrm-login-logo,
.integration-logo img {
  image-rendering: -webkit-optimize-contrast;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.brand-logo {
  height: 38px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.sidebar {
  background: #f8fafc;
  border-right: 1px solid rgba(15, 23, 42, 0.055);
  padding: 24px 16px 20px;
}

.sidebar-brand-meta {
  padding: 4px 12px 10px;
}

.sidebar-helper {
  max-width: 220px;
}

.sidebar-nav {
  gap: 2px;
}

.menu-item,
.bottom-settings {
  min-height: 52px;
  padding: 13px 18px 13px 18px;
  border-radius: 14px;
}

.menu-item::after,
.bottom-settings::after {
  left: 20px;
  right: 20px;
  bottom: -1px;
  background: rgba(15, 23, 42, 0.045);
}

.menu-item .menu-icon,
.bottom-settings .menu-icon {
  width: 20px;
  height: 20px;
}

.menu-item .menu-icon svg,
.bottom-settings .menu-icon svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.9;
}

.menu-item.active,
.bottom-settings.active {
  font-weight: 700;
}

.menu-item.active::before,
.bottom-settings.active::before {
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
}

.menu-item.active[data-tone='blue'],
.bottom-settings.active[data-tone='blue'] {
  background: #e8efff;
  color: #2f61c9;
}

.menu-item.active[data-tone='blue']::before,
.bottom-settings.active[data-tone='blue']::before {
  background: #4a78e3;
}

.menu-item.active[data-tone='blue'] .menu-icon,
.bottom-settings.active[data-tone='blue'] .menu-icon {
  color: #4a78e3;
}

.menu-item.active[data-tone='gold'],
.bottom-settings.active[data-tone='gold'] {
  background: #f9efdc;
  color: #9a6b22;
}

.menu-item.active[data-tone='gold']::before,
.bottom-settings.active[data-tone='gold']::before {
  background: #c7923a;
}

.menu-item.active[data-tone='gold'] .menu-icon,
.bottom-settings.active[data-tone='gold'] .menu-icon {
  color: #c7923a;
}

.menu-item.active[data-tone='purple'],
.bottom-settings.active[data-tone='purple'] {
  background: #efe9ff;
  color: #624eb5;
}

.menu-item.active[data-tone='purple']::before,
.bottom-settings.active[data-tone='purple']::before {
  background: #8270db;
}

.menu-item.active[data-tone='purple'] .menu-icon,
.bottom-settings.active[data-tone='purple'] .menu-icon {
  color: #8270db;
}

.menu-item.active[data-tone='green'],
.bottom-settings.active[data-tone='green'] {
  background: #e7f5ee;
  color: #3f7f65;
}

.menu-item.active[data-tone='green']::before,
.bottom-settings.active[data-tone='green']::before {
  background: #53a483;
}

.menu-item.active[data-tone='green'] .menu-icon,
.bottom-settings.active[data-tone='green'] .menu-icon {
  color: #53a483;
}

.menu-item.active[data-tone='red'],
.bottom-settings.active[data-tone='red'] {
  background: #fbeaea;
  color: #aa5b5b;
}

.menu-item.active[data-tone='red']::before,
.bottom-settings.active[data-tone='red']::before {
  background: #d66b6b;
}

.menu-item.active[data-tone='red'] .menu-icon,
.bottom-settings.active[data-tone='red'] .menu-icon {
  color: #d66b6b;
}

.sidebar-footer-card,
.panel,
.side-card,
.create-card,
.integration-card {
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.tabs {
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: #f5f8fc;
}

.tab {
  padding: 11px 14px;
  border-radius: 12px;
}

.tab.active {
  box-shadow: none;
}

.tab.active[data-tone='blue'] {
  background: #e8efff;
  color: #2f61c9;
}

.tab.active[data-tone='gold'] {
  background: #f9efdc;
  color: #9a6b22;
}

.tab.active[data-tone='purple'] {
  background: #efe9ff;
  color: #624eb5;
}

.tab.active[data-tone='green'] {
  background: #e7f5ee;
  color: #3f7f65;
}

.tab.active[data-tone='red'] {
  background: #fbeaea;
  color: #aa5b5b;
}

.stat-card.tone-card {
  height: 116px;
  background: linear-gradient(180deg, var(--stat-surface-strong) 0%, var(--stat-surface) 100%);
  border-color: var(--stat-outline);
  box-shadow: none;
}

.stat-card.tone-card:hover,
.stat-card.tone-card:focus-visible {
  transform: none;
}

.stat-card.tone-card.active {
  background: linear-gradient(180deg, var(--stat-soft) 0%, var(--stat-surface-strong) 100%);
  border-color: var(--stat-solid);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.stat-card.tone-card .stat-title,
.stat-card.tone-card .stat-value,
.stat-card.tone-card .stat-meta {
  color: var(--stat-text);
}

.stat-card.tone-card .stat-value {
  color: var(--stat-solid);
}

.stat-card.tone-card .mini-bubble {
  background: rgba(255, 255, 255, 0.82);
  color: var(--stat-solid);
}

.stat-card.tone-card .stat-bar {
  background: rgba(255, 255, 255, 0.48);
  height: 10px;
  border-radius: 999px;
  left: 18px;
  right: 18px;
  bottom: 16px;
}

.stat-card.tone-card .stat-fill {
  background: linear-gradient(90deg, var(--stat-gradient-start) 0%, var(--stat-gradient-end) 100%);
  border-radius: 999px;
}

.panel,
.side-card,
.create-card {
  border-radius: 18px;
}

.integration-card {
  padding: 20px;
  gap: 16px;
  border-radius: 18px;
  background: #ffffff;
}

.integrations-grid {
  gap: 16px;
}

.integration-logo {
  width: 48px;
  height: 48px;
  padding: 8px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #2f61c9;
}

.integration-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.integration-logo--wide {
  width: 78px;
  padding: 8px 10px;
}

.integration-logo--round {
  width: 48px;
}

.feature-pill {
  background: #f6f8fc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.sfcrm-login-logo {
  width: auto;
  height: 64px;
  max-width: min(100%, 320px);
  margin-bottom: 44px;
  object-fit: contain;
}

@media (max-width: 1320px) {
  .layout {
    grid-template-columns: 284px minmax(0, 1fr);
  }
}


/* 5.1.2 design corrections */
.brand-logo-wrap {
  min-width: 220px;
}

.brand-logo {
  width: 238px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  image-rendering: auto;
  backface-visibility: visible;
  transform: none;
}

.stat-card.tone-card {
  height: 112px;
  padding: 18px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 24px rgba(15, 23, 42, 0.04);
}

.stat-card.tone-card:hover,
.stat-card.tone-card:focus-visible {
  transform: none;
}

.stat-card.tone-card.active {
  background: #ffffff;
  border-color: rgba(74, 120, 227, 0.16);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 30px rgba(74, 120, 227, 0.08);
}

.stat-card.tone-card .stat-title {
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: #55627a;
}

.stat-card.tone-card .stat-value {
  color: var(--stat-solid);
  font-size: 24px;
}

.stat-card.tone-card .stat-meta {
  color: var(--stat-solid);
  font-size: 12px;
}

.stat-card.tone-card .mini-bubble {
  min-width: 24px;
  height: 24px;
  background: var(--stat-soft);
  color: var(--stat-solid);
}

.stat-card.tone-card .stat-bar {
  left: 18px;
  right: 18px;
  bottom: 14px;
  height: 10px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 999px;
}

.stat-card.tone-card .stat-fill {
  width: 100% !important;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--stat-gradient-start) 0%, var(--stat-gradient-end) 100%);
}

.integrations-main--wide {
  grid-column: 2 / 4;
}

.integrations-grid--wide {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
}

@media (max-width: 1320px) {
  .integrations-main--wide {
    grid-column: 2 / 3;
  }
}

@media (max-width: 720px) {
  .brand-logo {
    width: 210px;
  }

  .integrations-grid--wide {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 960px) {
  .integrations-main--wide {
    grid-column: auto;
  }
}


/* 5.1.4 login and access refinements */
.sfcrm-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: #f4f6fa;
}

.sfcrm-login-centered-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.sfcrm-login-card-shell {
  width: 100%;
}

.sfcrm-login-logo {
  width: auto;
  height: 88px;
  max-width: min(100%, 330px);
  margin: 0;
  object-fit: contain;
}

.sfcrm-login-card {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  padding: 28px 28px 30px;
}

.sfcrm-login-card-head {
  margin-bottom: 18px;
}

.sfcrm-login-card-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #24385b;
}

.sfcrm-login-card-head p {
  margin: 0;
  color: #6b7890;
  font-size: 16px;
  line-height: 1.6;
}

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

.sfcrm-login-form label {
  display: grid;
  gap: 9px;
  color: #42526a;
  font-size: 15px;
  font-weight: 600;
}

.sfcrm-login-form input[type='email'],
.sfcrm-login-form input[type='password'] {
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  padding: 0 15px;
  font-size: 16px;
  color: #2d3f5f;
}

.sfcrm-login-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
}

.sfcrm-login-checkbox input {
  width: 16px;
  height: 16px;
}

.sfcrm-login-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #4f7de6 0%, #3f6fd3 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(74, 120, 227, 0.2);
}

.integration-actions-row--readonly {
  justify-content: flex-start;
}

.integration-readonly-note {
  font-size: 14px;
  line-height: 1.5;
  color: #6c7890;
}

@media (max-width: 640px) {
  .sfcrm-login-page {
    padding: 24px 16px;
  }

  .sfcrm-login-logo {
    height: 74px;
  }

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


/* 5.1.3 login + messaging polish */
.sfcrm-login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: #f3f5f8;
}

.sfcrm-login-centered-shell {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.sfcrm-login-page .sfcrm-login-logo {
  display: block;
  width: min(100%, 300px);
  height: auto;
  max-width: 86vw;
  margin: 0 auto;
  object-fit: contain;
  image-rendering: auto;
  backface-visibility: visible;
  transform: none;
}

.sfcrm-login-card-shell {
  width: 100%;
  max-width: 370px;
}

.sfcrm-login-page .sfcrm-login-card {
  width: 100%;
  padding: 28px 28px 30px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.sfcrm-login-page .sfcrm-login-card-head {
  margin-bottom: 18px;
}

.sfcrm-login-page .sfcrm-login-card-head h2 {
  font-size: 26px;
  letter-spacing: -0.03em;
  color: #30415f;
}

.sfcrm-login-page .sfcrm-login-card-head p {
  color: #667388;
  margin-top: 8px;
}

.sfcrm-login-page .sfcrm-login-form {
  gap: 16px;
}

.sfcrm-login-page .sfcrm-login-form label {
  gap: 8px;
}

.sfcrm-login-page .sfcrm-login-form input[type='email'],
.sfcrm-login-page .sfcrm-login-form input[type='password'] {
  height: 48px;
  border-radius: 14px;
}

.sfcrm-login-page .sfcrm-login-checkbox {
  margin-top: -2px;
}

.sfcrm-login-page .sfcrm-login-button {
  min-height: 48px;
  border-radius: 14px;
}

.integration-readonly-note,
.integration-muted-note {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  color: #6d7890;
  font-size: 13px;
  font-weight: 600;
}

.drawer-item-frame {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.drawer-item-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eef2fb;
  color: #3f6fd3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.drawer-item-avatar.has-image {
  background: #ffffff;
}

.drawer-item-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.drawer-item-content {
  min-width: 0;
}

@media (max-width: 720px) {
  .sfcrm-login-page {
    padding: 20px 16px;
  }

  .sfcrm-login-centered-shell {
    max-width: 100%;
    gap: 18px;
  }

  .sfcrm-login-page .sfcrm-login-logo {
    width: min(100%, 280px);
  }
}


/* 5.1.4 messaging polish */
.drawer-item-shell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
}

.drawer-item-content {
  min-width: 0;
}

.drawer-media {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #edf2fb;
  color: #456fd4;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
}

.drawer-media--avatar {
  background: #f3f6fb;
}

.drawer-media--avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-media--message {
  background: #eef3ff;
  color: #456fd4;
}

.drawer-media--lead {
  background: #eef7f2;
  color: #3f8d68;
}

.messages-drawer {
  width: 420px;
}

.compose-drawer .compose-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.compose-field {
  display: grid;
  gap: 8px;
  color: #42536d;
  font-size: 14px;
  font-weight: 600;
}

.compose-field select,
.compose-field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  padding: 12px 14px;
  color: #2c3f5f;
  font: inherit;
}

.compose-field select {
  height: 48px;
  appearance: none;
}

.compose-field textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.6;
}

.compose-field select:focus,
.compose-field textarea:focus {
  outline: none;
  border-color: rgba(74, 120, 227, 0.68);
  box-shadow: 0 0 0 4px rgba(74, 120, 227, 0.12);
}

.compose-context {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f5f8fd;
  color: #40526d;
  font-size: 14px;
  line-height: 1.55;
}

.compose-context--muted {
  color: #6c7890;
}

.compose-send-btn {
  width: 100%;
}


/* 5.1.5 access and login refinements */
.report-metric-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.source-row--simple {
  grid-template-columns: 1.6fr 0.8fr 0.8fr 0.8fr;
}

.sfcrm-login-partner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.sfcrm-login-partner-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #1f3241;
}

.sfcrm-login-partner-logo {
  display: block;
  width: auto;
  max-width: 150px;
  height: 32px;
  object-fit: contain;
}

.sidebar-footer-meta {
  word-break: break-word;
}

@media (max-width: 720px) {
  .report-metric-grid--compact {
    grid-template-columns: 1fr;
  }

  .sfcrm-login-partner-logo {
    height: 28px;
  }
}


/* 5.1.6 polish: stat meta text, avatar crop, logout/login refinements */
.stat-card.tone-card .stat-meta {
  gap: 8px;
}

.stat-card.tone-card .stat-meta-value,
.stat-card.tone-card .mini-bubble {
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--stat-solid);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.avatar,
.avatar-button,
.profile-avatar {
  overflow: hidden;
}

.avatar-button--image {
  padding: 0;
  background: #eef3f8;
  color: transparent;
}

.avatar img,
.avatar-button img,
.profile-avatar-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 26%;
  transform: scale(1.14);
}

.logout-form {
  margin: 0;
}

.sfcrm-login-partner-logo {
  max-width: 210px;
  height: 42px;
}

@media (max-width: 720px) {
  .sfcrm-login-partner-logo {
    max-width: 180px;
    height: 36px;
  }
}

/* 5.1.7 profile, login spacing, and copy cleanup */
.sidebar-kicker {
  letter-spacing: 0.14em;
}

.modal-card--profile {
  width: min(380px, calc(100% - 24px));
  border-radius: 18px;
}

.modal-card--profile .modal-head {
  padding: 18px 20px 12px;
}

.modal-card--profile .profile-modal-body {
  padding: 0 20px 18px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #eef3f8;
  overflow: hidden;
}

.modal-card--profile .profile-avatar-image {
  object-position: center 22%;
  transform: scale(1.08);
}

.profile-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #30415f;
  font-size: 24px;
  font-weight: 800;
}

.profile-name {
  color: #30415f;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.profile-email {
  margin-top: 4px;
  color: #667388;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.logout-form {
  margin-top: 16px;
  display: flex;
  justify-content: flex-start;
}

.logout-form .ghost-btn {
  min-width: 110px;
}

.sfcrm-login-centered-shell {
  gap: 16px;
}

.sfcrm-login-partner {
  gap: 4px;
  margin-top: -2px;
}

.sfcrm-login-partner-label {
  margin: 0;
}

.sfcrm-login-partner-logo {
  max-width: 220px;
  height: 48px;
}

@media (max-width: 720px) {
  .modal-card--profile {
    width: min(360px, calc(100% - 18px));
  }

  .sfcrm-login-partner-logo {
    max-width: 190px;
    height: 40px;
  }
}


.checkbox-disabled {
  opacity: 0.42;
  pointer-events: none;
  color: #7c8798;
  background: #f6f8fc;
}

.lead-quick-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}

.quick-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #dde5f1;
  background: #f7f9fc;
  color: #425372;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.quick-link-btn:hover {
  background: #eef3fb;
  border-color: #cfdcf0;
  color: #2f4364;
}

.action-row--lead {
  margin-top: 6px;
}

.response-follow-up {
  margin-top: -6px;
  margin-bottom: 2px;
}

.lead-brief-section {
  background: linear-gradient(180deg, #fbfcff 0%, #f8fafe 100%);
}

.lead-brief-list {
  display: grid;
  gap: 14px;
}

.lead-brief-row {
  display: grid;
  gap: 6px;
}

.lead-brief-label {
  color: #7a8699;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead-brief-row strong {
  color: #223556;
  font-size: 15px;
  font-weight: 700;
}

.lead-brief-row p {
  margin: 0;
  color: #485a77;
  font-size: 14px;
  line-height: 1.65;
}

.integration-actions-row--readonly .integration-readonly-note {
  color: #7a8699;
  font-size: 14px;
  line-height: 1.5;
}

/* --- 5.3.0 portal polish overrides --- */
.search-wrap {
  position: relative;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border: 1px solid #e5eaf4;
  border-radius: 18px;
  box-shadow: 0 22px 48px rgba(31, 50, 65, 0.12);
  padding: 10px;
}

.global-search-item,
.global-search-empty {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 12px 14px;
}

.global-search-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.global-search-item:hover {
  background: #f4f7fd;
  transform: translateY(-1px);
}

.global-search-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #243655;
}

.global-search-item-head strong {
  font-size: 14px;
  font-weight: 700;
}

.global-search-status,
.global-search-item-meta,
.global-search-empty {
  color: #6e7b93;
  font-size: 12px;
}

.sidebar-icon-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.stat-meta-plain {
  font-size: 13px;
  font-weight: 700;
  color: inherit;
}

.ghost-btn--refresh {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ghost-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leads-panel {
  display: flex;
  flex-direction: column;
}

.leads-table-scroll {
  flex: 1 1 auto;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.leads-table-scroll::-webkit-scrollbar,
.scrollable-rightbar::-webkit-scrollbar,
.reports-main::-webkit-scrollbar,
.integrations-main::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.leads-table-scroll::-webkit-scrollbar-thumb,
.scrollable-rightbar::-webkit-scrollbar-thumb,
.reports-main::-webkit-scrollbar-thumb,
.integrations-main::-webkit-scrollbar-thumb {
  background: #d8dfec;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.price-editor-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.price-input-label {
  color: #5e6c86;
  font-size: 13px;
  font-weight: 600;
}

.price-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.price-input-shell {
  flex: 1;
  min-height: 46px;
  border: 1px solid #dde5f1;
  border-radius: 12px;
  background: #fbfcfe;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.price-input {
  width: 100%;
  min-width: 0;
  font-size: 16px;
  color: #243655;
}

.price-input::placeholder {
  color: #9ba5b9;
}

.price-input-suffix {
  color: #6f7c93;
  font-size: 13px;
  font-weight: 700;
}

.save-price-btn {
  white-space: nowrap;
}

.drawer-priority-block {
  margin-bottom: 14px;
  padding: 10px;
  border-radius: 18px;
  background: #fff5f5;
  border: 1px solid #f0d6d6;
}

.drawer-priority-title {
  padding: 4px 6px 10px;
  color: #b24f4f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.drawer-item--urgent {
  background: #fff7f7;
  border: 1px solid #f2d4d4;
}

.drawer-item--urgent .drawer-item-avatar {
  background: #f7dede;
  color: #b44d4d;
}

.drawer-label-pill--urgent {
  background: #f7dede;
  color: #b44d4d;
}

.drawer-label-pill--message {
  background: #e5ecff;
  color: #3556a8;
}

.drawer-label-pill--lead {
  background: #eef3fb;
  color: #50607c;
}

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

.reports-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.report-chart-card--hero {
  min-height: 488px;
}

.chart-scroll-wrap--premium {
  padding: 16px 18px 0;
}

.report-line-chart--advanced {
  width: 100%;
  min-width: 760px;
  height: auto;
}

.chart-area {
  pointer-events: none;
}

.chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line--created {
  stroke: #4a78e3;
}

.chart-line--won {
  stroke: #53a483;
}

.chart-line--invoiced {
  stroke: #8270db;
}

.chart-point-group .chart-point-core {
  stroke: #ffffff;
  stroke-width: 3;
}

.chart-point-group.created .chart-point-core {
  fill: #4a78e3;
}

.chart-point-group.won .chart-point-core {
  fill: #53a483;
}

.chart-point-group.invoiced .chart-point-core {
  fill: #8270db;
}

.chart-point-hit {
  fill: transparent;
}

.report-inline-legend--premium {
  padding-top: 14px;
}

.report-note-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-note-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafd;
}

.report-note-item strong {
  color: #223758;
  font-size: 16px;
}

.report-note-item span {
  color: #6d7992;
  font-size: 13px;
}

@media (max-width: 1280px) {
  .reports-grid,
  .report-metric-grid,
  .reports-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1080px) {
  .reports-grid,
  .reports-grid-two {
    grid-template-columns: 1fr;
  }

  .reports-metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .price-input-row {
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .global-search-dropdown {
    left: auto;
    right: 0;
    width: min(92vw, 360px);
  }

  .reports-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* 5.4.0 mobile + smooth icon transitions */
.topbar-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  flex: 0 0 auto;
}

.sidebar-overlay {
  display: none;
}

.menu-icon {
  position: relative;
}

.menu-icon-swap {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-icon-image,
.sidebar-icon-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
}

.menu-icon-image {
  position: absolute;
  inset: 0;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
  transform-origin: center center;
}

.menu-icon-image--default {
  opacity: 1;
  transform: scale(1);
}

.menu-icon-image--active {
  opacity: 0;
  transform: scale(0.94);
}

.menu-item.active .menu-icon-image--default,
.menu-icon-swap.is-active .menu-icon-image--default {
  opacity: 0;
  transform: scale(1.04);
}

.menu-item.active .menu-icon-image--active,
.menu-icon-swap.is-active .menu-icon-image--active {
  opacity: 1;
  transform: scale(1);
}

.menu-item .menu-icon,
.menu-item .menu-label-text,
.menu-item::before,
.menu-item::after {
  transition: color 180ms ease, opacity 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

@media (max-width: 1180px) {
  .page {
    width: 100%;
    padding: 16px 12px;
  }

  .app {
    width: 100%;
    min-height: calc(100vh - 32px);
  }

  .brand-logo-wrap {
    min-width: 0;
  }

  .brand-logo {
    width: min(255px, 100%);
  }

  .topbar {
    padding: 18px 20px;
    gap: 14px;
  }

  .top-actions {
    width: 100%;
    gap: 10px;
    justify-content: flex-end;
  }

  .global-search-wrap {
    flex: 1 1 100%;
    min-width: 0;
    order: 10;
  }

  .search {
    width: 100%;
  }
}

@media (max-width: 960px) {
  body {
    background: #edf2fa;
  }

  .page {
    padding: 0;
  }

  .app {
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .topbar {
    padding: 14px 14px 12px;
    gap: 12px;
  }

  .topbar-brand-row {
    width: 100%;
    justify-content: flex-start;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
  }

  .global-search-wrap {
    grid-column: 1 / -1;
    order: 4;
  }

  .global-search-dropdown {
    left: 0;
    right: 0;
    width: auto;
    top: calc(100% + 8px);
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 84px);
  }

  .sidebar {
    display: block;
    position: fixed;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: min(320px, calc(100vw - 54px));
    z-index: 40;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.18);
    transform: translateX(calc(-100% - 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 220ms ease;
    overflow: auto;
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .sidebar-overlay.is-visible,
  .app.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .main,
  .rightbar {
    padding: 14px;
  }

  .rightbar {
    border-left: 0;
    border-top: 1px solid #e8ebf4;
    background: #f7f8fb;
  }

  .stats,
  .report-metric-grid,
  .integrations-grid,
  .reports-grid-two,
  .rightbar {
    grid-template-columns: 1fr;
  }

  .tabs {
    gap: 12px;
    margin: 0 -2px 18px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .panel,
  .side-card,
  .create-card,
  .report-chart-card,
  .integration-card {
    border-radius: 18px;
  }

  .floating-drawer {
    left: 10px;
    right: 10px;
    top: 84px;
    width: auto;
    max-height: calc(100vh - 96px);
  }

  .notifications-drawer,
  .messages-drawer {
    max-width: none;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-card,
  .modal-card--profile {
    width: min(100%, 520px);
  }

  .integrations-main--wide,
  .reports-header,
  .report-chart-card.large {
    min-width: 0;
  }

  .report-line-chart--advanced {
    height: 280px;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 12px 12px 10px;
  }

  .brand-logo {
    width: min(210px, 62vw);
  }

  .icon-btn,
  .avatar-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    height: auto;
    min-height: 102px;
  }

  .panel-head--with-tools,
  .panel-tools,
  .invoice-head-wrap,
  .toolbar-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-tools .mini-search,
  .panel-tools .ghost-btn,
  .toolbar-inline .chip-label,
  .toolbar-inline .chip-btn,
  .toolbar-inline .ghost-btn {
    width: 100%;
  }

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

  .table-head.leads-head {
    display: none;
  }

  .leads-table-body {
    max-height: 50vh;
    padding: 6px 0 4px;
  }

  .leads-row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas:
      'dot name status'
      'dot phone phone'
      'dot source price'
      'dot created created';
    align-items: start;
    gap: 6px 10px;
    min-width: 0;
    height: auto;
    margin: 0 0 10px;
    padding: 14px 14px 13px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  }

  .leads-row > :nth-child(1) { grid-area: dot; }
  .leads-row > :nth-child(2) { grid-area: name; }
  .leads-row > :nth-child(3) { grid-area: phone; color: #5d6c84; }
  .leads-row > :nth-child(4) { grid-area: source; color: #6f7c92; font-size: 13px; }
  .leads-row > :nth-child(5) { grid-area: status; justify-self: end; }
  .leads-row > :nth-child(6) { grid-area: price; justify-self: start; font-weight: 700; color: #2f4364; }
  .leads-row > :nth-child(7) { grid-area: created; color: #8090a7; font-size: 13px; }

  .leads-row.selected {
    border-color: rgba(79, 141, 247, 0.18);
    box-shadow: 0 10px 28px rgba(79, 141, 247, 0.08);
  }

  .rightbar {
    padding: 12px;
  }

  .lead-detail-rightbar .side-card {
    border-radius: 18px;
  }

  .contact-top,
  .side-section {
    padding-inline: 14px;
  }

  .contact-name {
    font-size: 18px;
  }

  .contact-phone {
    font-size: 15px;
  }

  .contact-meta {
    gap: 6px;
    font-size: 13px;
  }

  .lead-quick-actions,
  .action-row,
  .integration-actions-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .lead-quick-actions {
    gap: 8px;
  }

  .quick-link-btn,
  .btn,
  .ghost-btn,
  .create-btn,
  .compose-send-btn,
  .lead-save-price-btn {
    width: 100%;
  }

  .invoice-wrap.work-grid {
    grid-template-columns: 1fr;
  }

  .invoice-head.invoice-grid {
    display: none;
  }

  .invoice-row {
    min-width: 0;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #ffffff;
  }

  .invoice-actions-cell {
    grid-column: 1 / -1;
  }

  .chart-box.chart-side {
    padding: 8px 0 0;
  }

  .interactive-donut {
    gap: 16px;
  }

  .donut-legend {
    width: 100%;
  }

  .report-metric-grid {
    grid-template-columns: 1fr;
  }

  .report-line-chart--advanced {
    height: 240px;
  }

  .source-row,
  .modal-table-row {
    min-width: 0;
  }

  .source-table,
  .modal-table {
    overflow: visible;
  }

  .source-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 14px;
    height: auto;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  }

  .source-row.head {
    display: none;
  }

  .integration-meta-grid {
    grid-template-columns: 1fr;
  }

  .global-search-item {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .sfcrm-login-page {
    padding: 18px 14px 24px;
  }

  .sfcrm-login-card-shell,
  .sfcrm-login-page .sfcrm-login-card {
    width: 100%;
  }

  .sfcrm-login-partner {
    gap: 3px;
  }

  .sfcrm-login-partner-logo {
    max-width: 210px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    width: min(182px, 58vw);
  }

  .top-actions {
    grid-template-columns: repeat(3, auto);
  }

  .global-search-wrap {
    grid-column: 1 / -1;
  }

  .panel-title,
  .page-title {
    font-size: 22px;
  }

  .panel-subtitle,
  .page-subtitle {
    font-size: 13px;
  }

  .report-line-chart--advanced {
    height: 220px;
  }

  .floating-drawer {
    top: 74px;
    max-height: calc(100vh - 84px);
  }
}

/* 5.5.0 overlay detail flow + responsive shell */
.page.page-app-shell {
  width: 100%;
  max-width: none;
  padding: clamp(0px, 1.2vw, 16px);
}

.app {
  width: 100%;
}

.layout {
  grid-template-columns: 220px minmax(0, 1fr);
  align-items: start;
}

.main,
.main--dashboard-full,
.integrations-main--wide,
.reports-main,
.dashboard-shell {
  min-width: 0;
}

.dashboard-shell {
  position: relative;
}

.panel-head--with-tools {
  gap: 16px;
}

.panel-tools-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  min-width: min(360px, 46vw);
}

.search-wrap .search {
  width: 100%;
}

.asset-preload-strip {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.menu-icon-swap {
  width: 18px;
  height: 18px;
  overflow: hidden;
  isolation: isolate;
}

.menu-icon-image {
  width: 18px;
  height: 18px;
  object-fit: contain;
  object-position: center;
  position: absolute;
  inset: 0;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: none !important;
  will-change: opacity;
  backface-visibility: hidden;
}

.menu-icon-image--default {
  opacity: 1;
}

.menu-icon-image--active {
  opacity: 0;
}

.menu-item.active .menu-icon-image--default,
.menu-icon-swap.is-active .menu-icon-image--default {
  opacity: 0;
}

.menu-item.active .menu-icon-image--active,
.menu-icon-swap.is-active .menu-icon-image--active {
  opacity: 1;
}

.leads-panel {
  position: relative;
}

.leads-table-scroll {
  max-height: clamp(360px, 62vh, 780px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.leads-row {
  position: relative;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.leads-row::after {
  content: '›';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca7bb;
  font-size: 22px;
  line-height: 1;
  opacity: 0;
  transition: opacity 180ms ease, color 180ms ease;
}

.leads-row:hover::after,
.leads-row.selected::after {
  opacity: 1;
}

.leads-row.selected {
  background: linear-gradient(90deg, rgba(79, 141, 247, 0.12), rgba(79, 141, 247, 0.04));
  box-shadow: inset 0 0 0 1px rgba(79, 141, 247, 0.12);
}

.lead-overlay-shell {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 12px 18px 20px;
  pointer-events: none;
  z-index: 12;
}

.lead-overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: linear-gradient(90deg, rgba(247, 248, 252, 0) 18%, rgba(236, 240, 249, 0.28) 54%, rgba(214, 221, 239, 0.48) 100%);
  opacity: 1;
  pointer-events: none;
}

.lead-overlay-panel {
  position: relative;
  pointer-events: auto;
  width: min(520px, 100%);
  max-height: calc(100% - 6px);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(223, 230, 244, 0.92);
  box-shadow: 0 26px 60px rgba(31, 41, 55, 0.16);
  backdrop-filter: blur(22px);
  overflow: hidden;
  animation: sfcrmLeadOverlayIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-overlay-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(226, 232, 243, 0.95);
}

.lead-overlay-head-copy {
  min-width: 0;
}

.lead-overlay-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b95a8;
  margin-bottom: 8px;
}

.lead-overlay-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lead-overlay-title-row h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #24324a;
}

.lead-overlay-subtitle {
  margin-top: 10px;
  color: #66758e;
  font-size: 14px;
}

.lead-overlay-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #f5f7fb;
  border: 1px solid #e2e7f0;
  color: #6e7b93;
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.lead-overlay-close:hover,
.lead-overlay-close:focus-visible {
  background: #eef4ff;
  border-color: #d6e2ff;
  color: #3f79d9;
  transform: translateY(-1px);
}

.lead-overlay-panel-body {
  max-height: calc(100% - 116px);
  overflow: auto;
  padding: 22px;
}

.lead-overlay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
  gap: 16px;
}

.lead-overlay-card {
  background: linear-gradient(180deg, rgba(248, 250, 253, 0.98), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(227, 233, 244, 0.95);
  border-radius: 20px;
  padding: 20px;
  min-width: 0;
}

.lead-overlay-card .contact-top,
.lead-overlay-card .side-section,
.lead-overlay-card .lead-brief-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.lead-overlay-card .contact-top {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(226, 232, 243, 0.95);
}

.lead-overlay-card .lead-brief-section {
  margin-top: 0;
}

.lead-overlay-card .price-editor-card {
  margin-bottom: 16px;
}

.lead-overlay-card .state-line {
  margin-bottom: 14px;
}

.lead-overlay-card .lead-quick-actions,
.lead-overlay-card .action-row {
  margin-top: 14px;
}

.lead-overlay-card .response-follow-up {
  margin-top: 8px;
}

@keyframes sfcrmLeadOverlayIn {
  from {
    opacity: 0;
    transform: translate3d(20px, 0, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes sfcrmLeadSheetIn {
  from {
    opacity: 0;
    transform: translate3d(0, 26px, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1280px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-overlay-panel {
    width: min(500px, 100%);
  }
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 204px minmax(0, 1fr);
  }

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

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

  .main--dashboard-full,
  .main {
    padding-right: 14px;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  .lead-overlay-shell {
    position: fixed;
    inset: 0;
    padding: 8px;
    justify-content: stretch;
    align-items: stretch;
    pointer-events: auto;
    z-index: 46;
  }

  .lead-overlay-backdrop {
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(6px);
    pointer-events: auto;
  }

  .lead-overlay-panel {
    width: 100%;
    max-height: calc(100vh - 16px);
    margin-top: auto;
    animation: sfcrmLeadSheetIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .lead-overlay-panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .lead-overlay-panel-body {
    max-height: calc(100vh - 148px);
  }

  .panel-head--with-tools,
  .panel-tools-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-tools-inline > * {
    width: 100%;
  }

  .leads-table-scroll {
    max-height: none;
  }
}

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

  .lead-overlay-panel {
    border-radius: 24px;
  }

  .lead-overlay-panel-head,
  .lead-overlay-panel-body {
    padding-inline: 16px;
  }

  .lead-overlay-title-row h2 {
    font-size: 24px;
  }

  .lead-overlay-card {
    padding: 16px;
    border-radius: 18px;
  }

  .leads-row::after {
    right: 14px;
  }
}

/* 5.5.2 lead overlay refinement + smooth dismiss */
.dashboard-shell {
  isolation: isolate;
}

.lead-overlay-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 28px);
  pointer-events: auto;
  z-index: 34;
}

.lead-overlay-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(19, 30, 48, 0.18);
  backdrop-filter: blur(10px);
  opacity: 1;
  pointer-events: auto;
  transition: opacity 240ms ease;
}

.lead-overlay-panel {
  position: relative;
  width: min(1120px, calc(100% - 8px));
  min-height: min(680px, calc(100% - 8px));
  max-height: calc(100% - 8px);
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98) 0%, rgba(255, 255, 255, 0.99) 100%);
  border: 1px solid rgba(221, 229, 243, 0.98);
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center top;
  will-change: transform, opacity;
  animation: sfcrmLeadOverlayPanelIn 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-overlay-panel-head {
  align-items: flex-start;
  gap: 18px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(226, 232, 243, 0.98);
  background: linear-gradient(180deg, rgba(248, 250, 255, 0.98) 0%, rgba(255, 255, 255, 0.92) 100%);
}

.lead-overlay-head-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lead-overlay-kicker {
  margin-bottom: 10px;
}

.lead-overlay-title-row {
  gap: 12px;
}

.lead-overlay-title-row h2 {
  font-size: clamp(32px, 3vw, 42px);
  line-height: 1;
}

.lead-overlay-subtitle {
  margin-top: 12px;
  font-size: 16px;
}

.lead-overlay-close {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  font-size: 30px;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.lead-overlay-close span {
  display: inline-block;
  transform: translateY(-2px);
}

.lead-overlay-close:hover,
.lead-overlay-close:focus-visible {
  box-shadow: 0 10px 24px rgba(79, 141, 247, 0.14);
}

.lead-overlay-panel-body {
  flex: 1;
  max-height: none;
  overflow: auto;
  padding: 0 32px 32px;
}

.lead-overlay-grid {
  grid-template-columns: minmax(0, 1.14fr) minmax(360px, 0.86fr);
  gap: 20px;
  align-items: start;
}

.lead-overlay-card {
  border-radius: 24px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(249, 251, 255, 0.98), rgba(255, 255, 255, 0.99));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.lead-overlay-card--summary,
.lead-overlay-card--workflow {
  min-height: 100%;
}

.lead-overlay-card .contact-top {
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.lead-overlay-card .lead-brief-row strong,
.lead-overlay-card .lead-brief-row p {
  font-size: 15px;
}

.lead-overlay-card .action-row {
  gap: 12px;
}

.lead-overlay-card .btn,
.lead-overlay-card .ghost-btn {
  min-height: 46px;
}

.lead-overlay-shell.is-closing .lead-overlay-backdrop {
  opacity: 0;
}

.lead-overlay-shell.is-closing .lead-overlay-panel {
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.985);
}

.modal-overlay {
  transition: opacity 220ms ease;
}

.modal-card {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.modal-overlay.is-closing {
  opacity: 0;
}

.modal-overlay.is-closing .modal-card {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
}

@keyframes sfcrmLeadOverlayPanelIn {
  from {
    opacity: 0;
    transform: translate3d(0, 34px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1320px) {
  .lead-overlay-panel {
    width: min(1060px, calc(100% - 8px));
  }
}

@media (max-width: 1180px) {
  .lead-overlay-panel {
    width: min(980px, calc(100% - 8px));
    min-height: min(640px, calc(100% - 8px));
  }

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

@media (max-width: 960px) {
  .lead-overlay-shell {
    position: fixed;
    inset: 0;
    padding: 10px;
  }

  .lead-overlay-panel {
    width: 100%;
    height: calc(100dvh - 20px);
    min-height: 0;
    max-height: calc(100dvh - 20px);
    border-radius: 26px;
  }

  .lead-overlay-panel-head {
    padding: 22px 18px 16px;
  }

  .lead-overlay-panel-body {
    padding: 0 18px 18px;
  }
}

@media (max-width: 640px) {
  .lead-overlay-shell {
    padding: 6px;
  }

  .lead-overlay-panel {
    height: calc(100dvh - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 22px;
  }

  .lead-overlay-panel-head {
    padding: 18px 14px 14px;
  }

  .lead-overlay-panel-body {
    padding: 0 14px 14px;
  }

  .lead-overlay-close {
    width: 44px;
    height: 44px;
    border-radius: 16px;
  }

  .lead-overlay-card {
    padding: 18px;
    border-radius: 20px;
  }
}
.modal-card--profile {
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.modal-overlay.is-closing .modal-card--profile {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
}


/* 5.5.3 responsive centered lead overlay + click-origin motion */
.dashboard-shell {
  position: relative;
}

.lead-overlay-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 2.8vw, 34px);
  z-index: 90;
  --lead-origin-x: 50%;
  --lead-origin-y: 50%;
  --lead-enter-x: 0px;
  --lead-enter-y: 24px;
}

.lead-overlay-backdrop {
  background: rgba(14, 22, 37, 0.22);
  backdrop-filter: blur(12px);
}

.lead-overlay-panel {
  width: min(1320px, calc(100vw - clamp(28px, 4vw, 84px)));
  min-height: min(780px, calc(100dvh - clamp(28px, 4vh, 72px)));
  max-height: calc(100dvh - clamp(28px, 4vh, 72px));
  border-radius: clamp(24px, 2.2vw, 32px);
  border: 1px solid rgba(221, 229, 243, 0.96);
  box-shadow: 0 38px 100px rgba(15, 23, 42, 0.2);
  transform-origin: var(--lead-origin-x) var(--lead-origin-y);
  animation: sfcrmLeadOverlayPanelIn553 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-overlay-panel-head {
  padding: clamp(24px, 2.4vw, 32px) clamp(24px, 2.6vw, 34px) 20px;
}

.lead-overlay-panel-body {
  padding: 0 clamp(20px, 2.6vw, 34px) clamp(20px, 2.8vw, 32px);
}

.lead-overlay-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: clamp(16px, 2vw, 24px);
}

.lead-overlay-card {
  border-radius: clamp(20px, 2vw, 24px);
}

.lead-overlay-shell.is-closing .lead-overlay-panel {
  opacity: 0;
  transform: translate3d(calc(var(--lead-enter-x) * 0.14), calc(var(--lead-enter-y) * 0.14), 0) scale(0.972);
}

@keyframes sfcrmLeadOverlayPanelIn553 {
  from {
    opacity: 0;
    transform: translate3d(var(--lead-enter-x), var(--lead-enter-y), 0) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1480px) {
  .lead-overlay-panel {
    width: min(1240px, calc(100vw - 34px));
  }
}

@media (max-width: 1200px) {
  .lead-overlay-panel {
    width: min(1120px, calc(100vw - 26px));
    min-height: min(760px, calc(100dvh - 26px));
    max-height: calc(100dvh - 26px);
  }
}

@media (max-width: 1040px) {
  .lead-overlay-shell {
    padding: 12px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 24px);
    min-height: min(720px, calc(100dvh - 24px));
    max-height: calc(100dvh - 24px);
  }

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

@media (max-width: 820px) {
  .lead-overlay-shell {
    align-items: stretch;
    padding: 8px;
  }

  .lead-overlay-panel {
    width: 100%;
    min-height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 24px;
  }

  .lead-overlay-panel-head {
    padding: 20px 18px 16px;
  }

  .lead-overlay-panel-body {
    padding: 0 18px 18px;
  }
}

@media (max-width: 640px) {
  .lead-overlay-shell {
    padding: 0;
  }

  .lead-overlay-backdrop {
    backdrop-filter: blur(8px);
  }

  .lead-overlay-panel {
    width: 100vw;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: none;
  }

  .lead-overlay-panel-head {
    padding: 18px 16px 14px;
  }

  .lead-overlay-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .lead-overlay-title-row h2 {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.02;
  }

  .lead-overlay-subtitle {
    font-size: 14px;
    line-height: 1.5;
  }

  .lead-overlay-panel-body {
    padding: 0 16px 16px;
  }

  .lead-overlay-card {
    padding: 16px;
    border-radius: 18px;
  }
}

@media (max-width: 1100px) {
  .panel-head--with-tools {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .panel-tools-inline {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .mini-search {
    flex: 1 1 280px;
    min-width: min(100%, 320px);
  }
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tabs {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }
}

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

  .panel-tools-inline {
    align-items: stretch;
  }

  .panel-tools-inline > * {
    width: 100%;
  }

  .ghost-btn--refresh {
    justify-content: center;
  }

  .mini-search {
    width: 100%;
  }
}

/* 5.5.5 centered lead sheet below topbar */
.lead-overlay-shell {
  position: fixed;
  inset: 88px 0 0;
  display: grid;
  place-items: center;
  padding: 18px 20px 22px;
  overflow: auto;
  z-index: 28;
  --lead-origin-x: 50%;
  --lead-origin-y: 50%;
  --lead-enter-x: 0px;
  --lead-enter-y: 18px;
}

.lead-overlay-backdrop {
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
}

.lead-overlay-panel {
  width: min(980px, calc(100vw - 72px));
  min-height: 0;
  max-height: calc(100dvh - 122px);
  border-radius: 26px;
  border: 1px solid rgba(221, 229, 243, 0.94);
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.985) 0%, rgba(255, 255, 255, 0.99) 100%);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
  transform-origin: center center;
  animation: sfcrmLeadOverlayPanelIn555 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-overlay-panel-head {
  padding: 22px 24px 16px;
}

.lead-overlay-head-copy {
  min-width: 0;
}

.lead-overlay-kicker {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.lead-overlay-title-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-overlay-title-row h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.02;
}

.lead-overlay-subtitle {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.45;
}

.lead-overlay-close {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-size: 28px;
}

.lead-overlay-panel-body {
  padding: 0 24px 24px;
  overflow: auto;
}

.lead-overlay-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
}

.lead-overlay-card {
  padding: 20px;
  border-radius: 20px;
}

.lead-overlay-card .contact-top {
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.lead-overlay-card .contact-name {
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.04;
  margin-bottom: 10px;
}

.lead-overlay-card .contact-phone {
  font-size: 17px;
}

.lead-overlay-card .contact-meta {
  gap: 10px;
  font-size: 13px;
}

.lead-overlay-card .dropdown-caret {
  font-size: 16px;
}

.lead-overlay-card .section-title-row {
  margin-bottom: 12px;
}

.lead-overlay-card .lead-brief-row strong,
.lead-overlay-card .lead-brief-row p {
  font-size: 14px;
  line-height: 1.55;
}

.lead-overlay-card .price-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.lead-overlay-card .save-price-btn {
  min-width: 132px;
}

.lead-overlay-card .update-title {
  margin: 16px 0 8px;
  font-size: 15px;
}

.lead-overlay-card .lead-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lead-overlay-card .lead-quick-actions .quick-link-btn {
  flex: 0 1 auto;
  min-width: 96px;
}

.lead-overlay-card .action-row--lead {
  margin-top: 16px;
}

.lead-overlay-card .action-row--lead.action-row--danger {
  margin-top: 12px;
}

.lead-overlay-shell.is-closing .lead-overlay-panel {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.986);
}

@keyframes sfcrmLeadOverlayPanelIn555 {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.986);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1180px) {
  .lead-overlay-panel {
    width: min(920px, calc(100vw - 48px));
  }

  .lead-overlay-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  }
}

@media (max-width: 980px) {
  .lead-overlay-shell {
    padding: 14px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 116px);
    border-radius: 24px;
  }

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

@media (max-width: 720px) {
  .lead-overlay-shell {
    inset: 78px 0 0;
    padding: 10px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 90px);
    border-radius: 22px;
  }

  .lead-overlay-panel-head {
    padding: 18px 16px 14px;
  }

  .lead-overlay-panel-body {
    padding: 0 16px 16px;
  }

  .lead-overlay-card {
    padding: 16px;
    border-radius: 18px;
  }

  .lead-overlay-card .price-input-row {
    grid-template-columns: 1fr;
  }

  .lead-overlay-card .save-price-btn {
    width: 100%;
  }

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

@media (max-width: 560px) {
  .lead-overlay-shell {
    inset: 72px 0 0;
    padding: 8px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 80px);
    border-radius: 20px;
  }

  .lead-overlay-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .lead-overlay-title-row h2 {
    font-size: clamp(24px, 8vw, 30px);
  }

  .lead-overlay-subtitle {
    font-size: 14px;
  }

  .lead-overlay-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .lead-overlay-card .lead-quick-actions,
  .lead-overlay-card .action-row--lead {
    grid-template-columns: 1fr;
  }
}


/* 5.5.6 centered compact lead overlay, full-screen blur, no desktop scroll */
.lead-overlay-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 2.2vw, 28px);
  overflow: hidden;
  z-index: 120;
}

.lead-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.20);
  backdrop-filter: blur(10px);
}

.lead-overlay-panel {
  position: relative;
  width: min(1120px, calc(100vw - 56px));
  max-height: min(740px, calc(100dvh - 44px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(221, 229, 243, 0.94);
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.99) 0%, rgba(255, 255, 255, 0.995) 100%);
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.18);
  transform-origin: center center;
  animation: sfcrmLeadOverlayPanelIn556 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-overlay-panel-head {
  flex: 0 0 auto;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(222, 230, 242, 0.88);
}

.lead-overlay-kicker {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.lead-overlay-title-row {
  gap: 10px;
}

.lead-overlay-title-row h2 {
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.02;
}

.lead-overlay-subtitle {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.lead-overlay-close {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  font-size: 28px;
}

.lead-overlay-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 22px 22px;
  overflow: hidden;
}

.lead-overlay-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 400px);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}

.lead-overlay-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 18px;
  border-radius: 20px;
}

.lead-overlay-card .contact-top {
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.lead-overlay-card .contact-name {
  margin-bottom: 8px;
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1.04;
}

.lead-overlay-card .contact-phone {
  font-size: 16px;
}

.lead-overlay-card .contact-meta {
  gap: 9px;
  font-size: 12px;
}

.lead-overlay-card .lead-brief-list {
  display: grid;
  gap: 14px;
}

.lead-overlay-card .lead-brief-row strong,
.lead-overlay-card .lead-brief-row p {
  font-size: 14px;
  line-height: 1.45;
}

.lead-overlay-card .lead-brief-row--stacked p {
  max-height: 8.5em;
  overflow: auto;
  padding-right: 4px;
}

.lead-overlay-card .price-editor-card {
  margin-bottom: 12px;
}

.lead-overlay-card .price-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.lead-overlay-card .save-price-btn {
  min-width: 126px;
}

.lead-overlay-card .update-title {
  margin: 14px 0 6px;
  font-size: 14px;
}

.lead-overlay-card .response-follow-up,
.lead-overlay-card .muted-small {
  font-size: 12px;
  line-height: 1.5;
}

.lead-overlay-card .lead-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lead-overlay-card .lead-quick-actions .quick-link-btn {
  min-width: 0;
  width: 100%;
  justify-content: center;
}

.lead-overlay-card .action-row--lead {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.lead-overlay-card .action-row--lead.action-row--danger {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

.lead-overlay-card .btn,
.lead-overlay-card .ghost-btn,
.lead-overlay-card .quick-link-btn {
  min-height: 52px;
}

.lead-overlay-shell.is-closing .lead-overlay-backdrop {
  opacity: 0;
  transition: opacity 180ms ease;
}

.lead-overlay-shell.is-closing .lead-overlay-panel {
  opacity: 0;
  transform: translate3d(0, 16px, 0) scale(0.986);
}

@keyframes sfcrmLeadOverlayPanelIn556 {
  from {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.986);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 1180px) {
  .lead-overlay-panel {
    width: min(1020px, calc(100vw - 40px));
  }

  .lead-overlay-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  }
}

@media (max-height: 840px) and (min-width: 981px) {
  .lead-overlay-panel {
    max-height: calc(100dvh - 28px);
  }

  .lead-overlay-panel-body {
    overflow: auto;
  }
}

@media (max-width: 980px) {
  .lead-overlay-shell {
    padding: 14px;
    overflow: auto;
    align-items: flex-start;
  }

  .lead-overlay-panel {
    width: calc(100vw - 28px);
    max-height: none;
    min-height: 0;
    margin: auto 0;
    border-radius: 22px;
  }

  .lead-overlay-panel-body {
    overflow: auto;
    padding: 14px 16px 16px;
  }

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

@media (max-width: 720px) {
  .lead-overlay-shell {
    padding: 10px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 20px);
    border-radius: 20px;
  }

  .lead-overlay-panel-head {
    padding: 16px 16px 12px;
  }

  .lead-overlay-card {
    padding: 15px 16px;
    border-radius: 18px;
  }

  .lead-overlay-card .price-input-row {
    grid-template-columns: 1fr;
  }

  .lead-overlay-card .save-price-btn,
  .lead-overlay-card .lead-quick-actions,
  .lead-overlay-card .action-row--lead {
    width: 100%;
  }

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

@media (max-width: 560px) {
  .lead-overlay-shell {
    padding: 8px;
  }

  .lead-overlay-panel {
    width: calc(100vw - 16px);
    border-radius: 18px;
  }

  .lead-overlay-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .lead-overlay-title-row h2 {
    font-size: clamp(24px, 8vw, 30px);
  }

  .lead-overlay-subtitle {
    font-size: 13px;
  }

  .lead-overlay-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .lead-overlay-card .lead-quick-actions,
  .lead-overlay-card .action-row--lead {
    grid-template-columns: 1fr;
  }
}

/* 5.6.0 final responsiveness, mobile scroll, admin-safe polish */
html,
body {
  overflow-x: hidden;
  overflow-y: auto;
}

.page-app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

.page-app-shell .app {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}

.brand-logo-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transform: none !important;
}

.brand-logo-stack {
  position: relative;
  display: block;
  width: 255px;
  max-width: 100%;
  height: 54px;
}

.brand-logo-stack .brand-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 240ms ease, transform 240ms ease, filter 240ms ease;
  will-change: opacity;
}

.brand-logo--default {
  opacity: 1;
}

.brand-logo--hover {
  opacity: 0;
}

.brand-logo-button:hover .brand-logo--default,
.brand-logo-button:focus-visible .brand-logo--default {
  opacity: 0;
}

.brand-logo-button:hover .brand-logo--hover,
.brand-logo-button:focus-visible .brand-logo--hover {
  opacity: 1;
}

.brand-logo-button:hover .brand-logo-stack,
.brand-logo-button:focus-visible .brand-logo-stack {
  cursor: pointer;
}

.notification-button.is-urgent {
  background: #fff1f1;
  border-color: #f0b8b8;
  color: #b94242;
  box-shadow: 0 12px 28px rgba(218, 75, 75, 0.16);
}

.notification-button.is-urgent .badge {
  background: #d94f4f;
  box-shadow: 0 4px 12px rgba(217, 79, 79, 0.32);
}

.lead-row-status-cell {
  min-width: 0;
  display: flex;
  align-items: center;
}

.leads-row .status-pill,
.focus-head .status-pill {
  width: fit-content;
  min-width: 78px;
  max-width: 118px;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline: 10px;
}

.reports-grid--no-pipeline {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.reports-main {
  grid-column: 2 / -1;
}

@media (max-width: 1120px) {
  .reports-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .page,
  .page-app-shell,
  .page-app-shell .app,
  .layout,
  .main,
  .main--dashboard-full,
  .reports-main {
    min-height: 0;
    height: auto;
    overflow: visible !important;
  }

  .topbar {
    height: auto;
    min-height: 70px;
    padding: 9px 12px 8px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-rows: 48px auto;
    gap: 6px 8px;
    align-items: center;
  }

  .topbar-brand-row {
    display: contents;
  }

  .mobile-menu-btn {
    display: inline-flex;
    grid-column: 1;
    grid-row: 1;
    width: 38px;
    height: 38px;
    justify-self: start;
  }

  .brand-logo-wrap {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    min-width: 0;
    width: clamp(158px, 44vw, 214px);
  }

  .brand-logo-stack {
    width: 100%;
    height: 42px;
  }

  .top-actions {
    display: contents;
  }

  .top-actions .avatar-button {
    grid-column: 3;
    grid-row: 1;
    width: 38px;
    height: 38px;
    justify-self: end;
  }

  .top-actions .notification-button,
  .top-actions .icon-btn[data-action="toggle-messages-drawer"] {
    grid-row: 1;
    width: 34px;
    height: 34px;
  }

  .top-actions .notification-button {
    grid-column: 3;
    justify-self: start;
    transform: translateX(-76px) !important;
  }

  .top-actions .icon-btn[data-action="toggle-messages-drawer"] {
    grid-column: 3;
    justify-self: start;
    transform: translateX(-38px) !important;
  }

  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .search.search-real {
    width: 100%;
    height: 34px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .search.search-real input {
    font-size: 14px;
  }

  .global-search-dropdown {
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(304px, 86vw);
    max-height: 100dvh;
    overflow-y: auto;
    transform: translateX(-104%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay.is-visible {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(4px);
    display: block;
  }

  .main,
  .main--dashboard-full,
  .reports-main {
    padding: 12px;
  }

  .tabs {
    margin-bottom: 10px;
  }

  .stats {
    gap: 10px;
  }

  .leads-panel {
    overflow: visible;
  }

  .leads-table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  .leads-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 8px 10px;
    min-height: 86px;
    height: auto;
    padding: 14px;
  }

  .leads-row > div:nth-child(3),
  .leads-row > div:nth-child(4),
  .leads-row > div:nth-child(6),
  .leads-row > div:nth-child(7) {
    grid-column: 2 / 4;
    font-size: 13px;
  }

  .leads-row .name-cell {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .leads-row .lead-row-status-cell {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .leads-row .status-pill {
    min-width: 80px;
    max-width: 96px;
    height: 28px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .reports-grid--no-pipeline,
  .reports-grid--top,
  .reports-grid--bottom,
  .reports-metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 5.6.1 fixes: real smooth logo crossfade + hide retired pipeline section if cached markup exists */
.brand-logo-button .brand-logo-stack {
  isolation: isolate;
  overflow: visible;
}
.brand-logo-button .brand-logo-stack .brand-logo {
  opacity: 1;
  transition-property: opacity, filter;
  transition-duration: 520ms;
  transition-timing-function: cubic-bezier(.22, .61, .36, 1);
  transform: none !important;
  will-change: opacity;
}
.brand-logo-button .brand-logo-stack .brand-logo--default {
  opacity: 1 !important;
  z-index: 1;
}
.brand-logo-button .brand-logo-stack .brand-logo--hover {
  opacity: 0 !important;
  z-index: 2;
}
.brand-logo-button:hover .brand-logo-stack .brand-logo--default,
.brand-logo-button:focus-visible .brand-logo-stack .brand-logo--default {
  opacity: 0 !important;
}
.brand-logo-button:hover .brand-logo-stack .brand-logo--hover,
.brand-logo-button:focus-visible .brand-logo-stack .brand-logo--hover {
  opacity: 1 !important;
}
.report-chart-card--hero,
.report-line-chart--advanced {
  display: none !important;
}

/* 5.6.2 fixes: make logo hover an actual preloaded crossfade, not an apparent image swap */
.topbar .brand-logo-button,
.topbar .brand-logo-button:hover,
.topbar .brand-logo-button:focus-visible {
  cursor: pointer;
}

.topbar .brand-logo-stack {
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
}

.topbar .brand-logo-stack .brand-logo {
  display: block;
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  opacity: 1;
  transform: translateZ(0);
  transition-property: opacity;
  transition-duration: 520ms;
  transition-timing-function: cubic-bezier(.22,.72,.22,1);
  will-change: opacity;
  pointer-events: none;
}

.topbar .brand-logo-stack .brand-logo--hover {
  opacity: 0;
}

.topbar .brand-logo-button:hover .brand-logo--default,
.topbar .brand-logo-button:focus-visible .brand-logo--default {
  opacity: 0;
}

.topbar .brand-logo-button:hover .brand-logo--hover,
.topbar .brand-logo-button:focus-visible .brand-logo--hover {
  opacity: 1;
}

/* 5.7.0 admin 2FA + safer login polish */
.sfcrm-2fa-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 12%, rgba(71, 118, 232, .10), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}
.sfcrm-2fa-shell {
  gap: 22px;
}
.sfcrm-2fa-card {
  position: relative;
  width: min(420px, calc(100vw - 34px));
  padding: 30px 30px 28px;
  overflow: hidden;
  border: 1px solid rgba(217, 225, 239, .92);
  box-shadow: 0 26px 80px rgba(31, 50, 65, .16), 0 3px 12px rgba(31, 50, 65, .05);
}
.sfcrm-2fa-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #4776e8, #8c6de8, #5fc2a1);
}
.sfcrm-2fa-orb {
  width: 58px;
  height: 58px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: linear-gradient(145deg, rgba(71, 118, 232, .14), rgba(140, 109, 232, .12));
  border: 1px solid rgba(71, 118, 232, .16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.sfcrm-2fa-orb span {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #4776e8;
  position: relative;
  box-shadow: 0 9px 22px rgba(71,118,232,.32);
}
.sfcrm-2fa-orb span::before,
.sfcrm-2fa-orb span::after {
  content: "";
  position: absolute;
  background: #fff;
  left: 50%;
  transform: translateX(-50%);
}
.sfcrm-2fa-orb span::before {
  width: 12px;
  height: 8px;
  top: 5px;
  border: 2px solid #fff;
  border-bottom: 0;
  background: transparent;
  border-radius: 8px 8px 0 0;
}
.sfcrm-2fa-orb span::after {
  width: 11px;
  height: 8px;
  bottom: 5px;
  border-radius: 2px;
}
.sfcrm-2fa-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  color: #4776e8;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sfcrm-2fa-head h2 {
  font-size: 25px;
  letter-spacing: -.035em;
}
.sfcrm-2fa-head p {
  max-width: 330px;
}
.sfcrm-2fa-form {
  margin-top: 20px;
}
.sfcrm-2fa-code-wrap span {
  font-weight: 800;
  color: #1f3241;
}
.sfcrm-2fa-input {
  height: 62px !important;
  font-size: 28px !important;
  letter-spacing: .34em;
  font-weight: 800;
  text-align: center;
  color: #1f3241;
  background: linear-gradient(180deg, #fff 0%, #f9fbff 100%);
  border-color: #dbe4f2 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 9px 24px rgba(31,50,65,.06);
}
.sfcrm-2fa-input:focus {
  border-color: #4776e8 !important;
  box-shadow: 0 0 0 5px rgba(71,118,232,.12), 0 12px 26px rgba(31,50,65,.08);
}
.sfcrm-2fa-submit {
  margin-top: 4px;
  height: 54px;
  border-radius: 15px;
  background: linear-gradient(135deg, #4776e8 0%, #3867d9 100%);
  box-shadow: 0 16px 32px rgba(71, 118, 232, .26);
}
.sfcrm-login-button-link {
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #fff !important;
}
.sfcrm-2fa-footnote {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef2f7;
  color: #7a879b;
  font-size: 13px;
  line-height: 1.5;
}
@media (max-width: 520px) {
  .sfcrm-2fa-card {
    padding: 26px 22px 24px;
    border-radius: 24px;
  }
  .sfcrm-2fa-input {
    font-size: 24px !important;
    letter-spacing: .24em;
  }
}

/* v5.8 admin/history/GDPR polish */
.admin-tool-main {
  width: 100%;
  min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  overflow: auto;
}
.tool-hero {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 24px;
  padding: clamp(20px, 3vw, 30px);
  background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
  border: 1px solid rgba(226, 232, 244, .9);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(31, 50, 65, .07);
  margin-bottom: 18px;
}
.tool-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #4776e8;
  margin-bottom: 8px;
}
.tool-hero h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: .95;
  color: #1f3241;
  letter-spacing: -.055em;
}
.tool-hero p {
  max-width: 640px;
  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
  margin: 14px 0 0;
}
.tool-search,
.gdpr-password-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #75859a;
  min-width: min(340px, 100%);
}
.tool-search input,
.gdpr-password-label input,
.gdpr-search-row input,
.gdpr-action-card input,
.gdpr-action-card textarea,
.admin-user-form input,
.admin-user-form select {
  width: 100%;
  height: 48px;
  border: 1px solid #e2e8f4;
  background: #fff;
  border-radius: 14px;
  padding: 0 14px;
  color: #1f3241;
  outline: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.tool-search input:focus,
.gdpr-search-row input:focus,
.gdpr-action-card input:focus,
.gdpr-action-card textarea:focus,
.admin-user-form input:focus,
.admin-user-form select:focus {
  border-color: #a9c2ff;
  box-shadow: 0 0 0 4px rgba(71, 118, 232, .10);
}
.history-timeline-panel,
.gdpr-card,
.admin-users-list,
.admin-user-form {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(226, 232, 244, .9);
  border-radius: 24px;
  box-shadow: 0 22px 65px rgba(31,50,65,.06);
}
.history-timeline-panel {
  padding: clamp(16px, 2.6vw, 30px);
}
.history-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.history-timeline::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, rgba(71,118,232,.18), rgba(137,109,218,.12));
}
.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 14px;
}
.history-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  border: 6px solid var(--history-tone, #4776e8);
  box-shadow: 0 0 0 6px rgba(71,118,232,.08);
  z-index: 1;
}
.history-card {
  border: 1px solid #e6ebf5;
  border-radius: 18px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}
.history-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.history-kicker {
  color: #7b8aa2;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.history-card h3 {
  margin: 4px 0 0;
  color: #1f3241;
  font-size: 17px;
}
.history-card time,
.history-muted {
  color: #8492a7;
  font-size: 13px;
  white-space: nowrap;
}
.history-card p {
  margin: 10px 0;
  color: #56657b;
  line-height: 1.55;
}
.history-meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.history-lead-link {
  border: 0;
  background: #eef4ff;
  color: #4776e8;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 800;
  cursor: pointer;
}
.gdpr-grid,
.admin-users-grid {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.1fr);
  gap: 18px;
}
.gdpr-card,
.admin-user-form {
  padding: clamp(18px, 2.5vw, 26px);
}
.tool-card-head h2 {
  margin: 0;
  color: #1f3241;
  letter-spacing: -.03em;
}
.tool-card-head p {
  margin: 6px 0 18px;
  color: #64748b;
  line-height: 1.5;
}
.gdpr-retention-card {
  min-width: min(390px, 100%);
  padding: 16px;
  border: 1px solid #e4eaf5;
  border-radius: 20px;
  background: rgba(255,255,255,.82);
}
.gdpr-retention-title {
  font-weight: 800;
  color: #1f3241;
  margin-bottom: 10px;
}
.gdpr-toggle-row,
.gdpr-search-row,
.admin-form-actions {
  display: flex;
  gap: 10px;
}
.gdpr-toggle {
  flex: 1;
  height: 40px;
  border: 1px solid #e0e7f2;
  border-radius: 13px;
  background: #f7f9fd;
  font-weight: 800;
  color: #607086;
  cursor: pointer;
}
.gdpr-toggle.active {
  background: #eaf5ef;
  border-color: #b9dfcc;
  color: #377a61;
}
.gdpr-toggle.active.danger {
  background: #fff0f0;
  border-color: #f1b9b9;
  color: #b64b4b;
}
.gdpr-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.gdpr-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #e5ebf5;
  border-radius: 17px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.gdpr-result-card:hover,
.gdpr-result-card.selected {
  transform: translateY(-1px);
  border-color: #bcd0ff;
  box-shadow: 0 14px 30px rgba(71, 118, 232, .10);
}
.gdpr-result-card strong,
.gdpr-result-card span {
  display: block;
}
.gdpr-result-card strong {
  color: #1f3241;
}
.gdpr-result-card div > span {
  color: #6f7e93;
  margin-top: 4px;
  font-size: 13px;
}
.gdpr-selected-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  padding: 15px;
  background: #f7faff;
  border: 1px solid #e4ebf8;
  border-radius: 18px;
  margin-bottom: 16px;
}
.gdpr-selected-box strong,
.gdpr-selected-box span {
  display: block;
  color: #1f3241;
}
.gdpr-selected-box span {
  color: #64748b;
  margin-top: 4px;
}
.gdpr-tool-section {
  border-top: 1px solid #edf1f7;
  padding-top: 16px;
  margin-top: 16px;
}
.gdpr-tool-section h3 {
  margin: 0 0 10px;
  color: #1f3241;
}
.gdpr-checkbox-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.gdpr-checkbox-grid label,
.gdpr-small-check,
.admin-active-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #526179;
  font-weight: 700;
}
.gdpr-action-card textarea {
  min-height: 92px;
  padding: 14px;
  resize: vertical;
}
.gdpr-danger-zone {
  background: linear-gradient(180deg, rgba(255,247,247,.9), rgba(255,255,255,0));
  border-radius: 18px;
  padding: 16px;
  border: 1px solid #f5d7d7;
}
.gdpr-empty {
  color: #7b8aa2;
  padding: 16px;
  border: 1px dashed #d8e1ef;
  border-radius: 16px;
  text-align: center;
}
.gdpr-empty-large {
  min-height: 280px;
  display: grid;
  place-items: center;
}
.admin-users-grid {
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, .8fr);
}
.admin-users-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-user-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 18px;
}
.admin-user-card.is-disabled {
  opacity: .62;
}
.admin-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #eef4ff;
  color: #4776e8;
  font-weight: 900;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.admin-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.admin-user-top {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-user-top strong {
  color: #1f3241;
}
.admin-role-chip {
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2f7;
  color: #607086;
  font-size: 12px;
  font-weight: 800;
}
.admin-role-chip.admin {
  background: #eef4ff;
  color: #4776e8;
}
.admin-user-email,
.admin-user-meta {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}
.admin-user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tiny-action.danger,
.btn.danger {
  color: #b84b4b;
  border-color: #f0c9c9;
  background: #fff7f7;
}
.admin-user-form {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-user-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 800;
  color: #516177;
  font-size: 13px;
}
.admin-active-check {
  flex-direction: row !important;
}
.btn[disabled],
.tiny-action[disabled] {
  opacity: .42;
  cursor: not-allowed;
}
@media (max-width: 980px) {
  .tool-hero,
  .gdpr-grid,
  .admin-users-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .gdpr-selected-box,
  .admin-user-card {
    grid-template-columns: 1fr;
  }
  .admin-user-actions {
    justify-content: flex-start;
  }
}
@media (max-width: 640px) {
  .admin-tool-main {
    padding: 14px;
  }
  .tool-hero {
    padding: 18px;
    border-radius: 20px;
  }
  .tool-hero h1 {
    font-size: 34px;
  }
  .gdpr-toggle-row,
  .gdpr-search-row,
  .admin-form-actions {
    flex-direction: column;
  }
  .history-card-top {
    flex-direction: column;
    gap: 6px;
  }
  .history-timeline::before {
    left: 10px;
  }
  .history-item {
    grid-template-columns: 24px 1fr;
    gap: 10px;
  }
  .history-dot {
    width: 22px;
    height: 22px;
    border-width: 5px;
  }
}

/* 5.8.1 cleanup: cleaner 2FA, tools, focus, PDF/GDPR, and robust logo */
.topbar .brand-logo-stack,
.brand-logo-stack {
  position: relative !important;
  display: block !important;
  width: 255px !important;
  height: 54px !important;
  isolation: isolate;
  overflow: visible;
}
.topbar .brand-logo-stack .brand-logo,
.brand-logo-stack .brand-logo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;
  transition: opacity 560ms cubic-bezier(.22,.72,.22,1), filter 560ms cubic-bezier(.22,.72,.22,1) !important;
  transform: translateZ(0) !important;
  will-change: opacity;
  pointer-events: none;
}
.topbar .brand-logo--default,
.brand-logo--default { opacity: 1 !important; z-index: 1; }
.topbar .brand-logo--hover,
.brand-logo--hover { opacity: 0 !important; z-index: 2; }
.topbar .brand-logo-button:hover .brand-logo--default,
.topbar .brand-logo-button:focus-visible .brand-logo--default { opacity: 0 !important; }
.topbar .brand-logo-button:hover .brand-logo--hover,
.topbar .brand-logo-button:focus-visible .brand-logo--hover { opacity: 1 !important; }

.sfcrm-2fa-page {
  background: #f5f7fb !important;
}
.sfcrm-2fa-card {
  text-align: center;
  padding: 34px 32px 30px !important;
  border-radius: 24px !important;
  background: #fff !important;
}
.sfcrm-2fa-card::before {
  height: 5px !important;
  background: #4776e8 !important;
}
.sfcrm-2fa-orb { display: none !important; }
.sfcrm-2fa-kicker {
  color: #4776e8 !important;
  margin-bottom: 10px !important;
}
.sfcrm-2fa-head,
.sfcrm-2fa-head p {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}
.sfcrm-2fa-head p strong {
  color: #1f3241;
  font-weight: 800;
}
.sfcrm-2fa-input {
  background: #fff !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.sfcrm-2fa-submit,
.sfcrm-login-button {
  background: #4776e8 !important;
  background-image: none !important;
}

.admin-tool-main {
  background: #f7f8fb;
}
.tool-hero,
.history-timeline-panel,
.gdpr-card,
.admin-users-list,
.admin-user-form,
.history-card {
  background: #fff !important;
  background-image: none !important;
  box-shadow: 0 12px 34px rgba(31,50,65,.055) !important;
  border-color: #e5ebf5 !important;
}
.tool-hero {
  align-items: center;
  border-radius: 22px !important;
}
.tool-kicker {
  color: #4776e8 !important;
}
.tool-search {
  position: relative;
  min-width: min(420px, 100%);
}
.tool-search span {
  color: #64748b;
}
.tool-search input,
.gdpr-search-row input {
  height: 50px !important;
  border-radius: 16px !important;
  padding-left: 44px !important;
  font-size: 15px;
  background: #fbfcff !important;
}
.tool-search::before,
.gdpr-search-row::before {
  content: "⌕";
  position: absolute;
  left: 16px;
  bottom: 13px;
  color: #8a98ad;
  font-weight: 800;
  pointer-events: none;
}
.gdpr-search-row {
  position: relative;
  align-items: stretch;
}
.gdpr-search-row .btn,
.gdpr-search-row button {
  min-width: 86px;
  height: 50px;
  border-radius: 15px;
}
.gdpr-retention-card {
  background: #fff !important;
  box-shadow: none !important;
}
.gdpr-toggle {
  background: #f8fafc !important;
  background-image: none !important;
  white-space: nowrap;
}
.gdpr-toggle.active,
.gdpr-toggle.active.danger {
  background: #eef4ff !important;
  border-color: #cddcff !important;
  color: #4776e8 !important;
}
.gdpr-danger-zone {
  background: #fff !important;
  background-image: none !important;
  border: 1px solid #f0d3d3 !important;
  border-radius: 18px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gdpr-delete-button,
.btn.danger {
  background: #fff7f7 !important;
  background-image: none !important;
  border: 1px solid #f0c9c9 !important;
  border-radius: 14px !important;
  color: #b84b4b !important;
  min-height: 46px;
}
.gdpr-export-zone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.gdpr-pdf-button,
.gdpr-export-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 48px;
  padding: 0 22px !important;
  border-radius: 15px !important;
  text-decoration: none !important;
  font-weight: 800 !important;
}
.history-timeline-panel {
  max-width: 1180px;
}
.history-card {
  border-radius: 16px !important;
}
.modal-overlay,
.floating-drawer {
  z-index: 1000 !important;
}
.modal-head .ghost-btn,
.drawer-head .ghost-btn,
button[data-action="close-modal"],
button[data-action="close-drawers"] {
  cursor: pointer !important;
  pointer-events: auto !important;
}

@media (max-width: 900px) {
  .tool-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .tool-search,
  .gdpr-retention-card {
    min-width: 0;
    width: 100%;
  }
  .gdpr-grid,
  .admin-users-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 640px) {
  .topbar .brand-logo-stack,
  .brand-logo-stack {
    width: min(204px, 50vw) !important;
    height: 44px !important;
  }
  .admin-tool-main {
    padding: 12px !important;
  }
  .tool-hero,
  .history-timeline-panel,
  .gdpr-card,
  .admin-users-list,
  .admin-user-form {
    border-radius: 18px !important;
    padding: 16px !important;
  }
  .tool-hero h1 {
    font-size: 32px !important;
    line-height: 1.05 !important;
  }
  .gdpr-selected-box,
  .admin-user-card {
    grid-template-columns: 1fr !important;
  }
  .gdpr-result-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .gdpr-toggle-row,
  .gdpr-search-row,
  .admin-form-actions {
    flex-direction: column;
  }
  .gdpr-search-row::before { bottom: auto; top: 43px; }
  .admin-user-actions {
    justify-content: stretch !important;
  }
  .admin-user-actions .tiny-action {
    flex: 1;
  }
  .history-card-top {
    flex-direction: column;
  }
  .sfcrm-2fa-card {
    width: min(390px, calc(100vw - 28px));
    padding: 28px 22px 24px !important;
  }
}

/* 5.8.2 latest-only polish: history search, real mobile header spacing, search focus, and lead cards */
.tool-search--history span,
.history-hero .tool-search span { display: none !important; }
.tool-search--history::before,
.history-hero .tool-search::before { content: none !important; display: none !important; }
.tool-search--history input,
.history-hero .tool-search input { padding-left: 18px !important; }
.topbar .brand-logo-stack,
.brand-logo-stack { width: 286px !important; height: 60px !important; }
.topbar .brand-logo-wrap { min-width: 286px !important; }
@media (max-width: 760px) {
  .topbar { grid-template-columns: 44px minmax(0,1fr) 38px 38px 44px !important; grid-template-rows: 54px 36px !important; gap: 7px 9px !important; padding: 9px 12px 8px !important; }
  .mobile-menu-btn { grid-column: 1 !important; grid-row: 1 !important; justify-self: start !important; align-self: center !important; }
  .brand-logo-wrap { grid-column: 2 / 5 !important; grid-row: 1 !important; justify-self: center !important; align-self: center !important; width: clamp(220px, 58vw, 262px) !important; min-width: 0 !important; }
  .topbar .brand-logo-stack, .brand-logo-stack { width: 100% !important; height: 50px !important; }
  .top-actions .avatar-button { grid-column: 5 !important; grid-row: 1 !important; justify-self: end !important; align-self: center !important; width: 40px !important; height: 40px !important; }
  .search-wrap { grid-column: 1 / 4 !important; grid-row: 2 !important; width: 100% !important; align-self: center !important; margin: 0 !important; padding: 0 !important; }
  .top-actions .notification-button,
  .top-actions .icon-btn[data-action="toggle-messages-drawer"] { grid-row: 2 !important; transform: none !important; justify-self: center !important; align-self: center !important; width: 34px !important; height: 34px !important; }
  .top-actions .notification-button { grid-column: 4 !important; }
  .top-actions .icon-btn[data-action="toggle-messages-drawer"] { grid-column: 5 !important; }
  .search.search-real { width: 100% !important; height: 32px !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  .search.search-real svg { flex: 0 0 auto !important; margin-right: 6px !important; }
  .search.search-real input { min-width: 0 !important; font-size: 14px !important; padding: 0 !important; }
  .panel-tools-inline { gap: 8px !important; align-items: center !important; }
  .panel-tools-inline .mini-search { height: 32px !important; flex: 1 1 170px !important; min-width: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
  .panel-tools-inline .mini-search input { min-width: 0 !important; font-size: 14px !important; }
  .panel-head--with-tools { gap: 10px !important; }
  .leads-row { grid-template-columns: 14px minmax(0, 1fr) auto !important; grid-template-areas: "dot name status" ". phone phone" ". source price" ". created created" !important; column-gap: 10px !important; row-gap: 7px !important; min-height: 94px !important; padding: 14px 13px !important; overflow: hidden !important; }
  .leads-row > div:nth-child(1) { grid-area: dot !important; }
  .leads-row > div:nth-child(2) { grid-area: name !important; }
  .leads-row > div:nth-child(3) { grid-area: phone !important; grid-column: auto !important; }
  .leads-row > div:nth-child(4) { grid-area: source !important; grid-column: auto !important; }
  .leads-row > div:nth-child(5) { grid-area: status !important; grid-column: auto !important; }
  .leads-row > div:nth-child(6) { grid-area: price !important; grid-column: auto !important; }
  .leads-row > div:nth-child(7) { grid-area: created !important; grid-column: auto !important; }
  .leads-row > div:nth-child(4), .leads-row > div:nth-child(6) { min-width: 0 !important; display: flex !important; align-items: center !important; gap: 6px !important; font-size: 12px !important; color: #607086 !important; }
  .leads-row > div:nth-child(4)::before { content: "Källa"; color: #9aa6b8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .leads-row > div:nth-child(6)::before { content: "Pris"; color: #9aa6b8; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
  .leads-row .lead-row-status-cell { justify-self: end !important; align-self: start !important; min-width: 74px !important; max-width: 92px !important; overflow: visible !important; }
  .leads-row .status-pill { width: auto !important; min-width: 74px !important; max-width: 92px !important; height: 28px !important; padding-inline: 8px !important; font-size: 11px !important; flex: 0 0 auto !important; transform: none !important; }
  .global-search-dropdown { top: calc(100% + 7px) !important; border-radius: 16px !important; }
}
@media (max-width: 420px) {
  .topbar { grid-template-columns: 40px minmax(0,1fr) 34px 34px 40px !important; gap: 6px 7px !important; }
  .brand-logo-wrap { width: clamp(204px, 62vw, 238px) !important; }
  .topbar .brand-logo-stack, .brand-logo-stack { height: 47px !important; }
  .top-actions .notification-button, .top-actions .icon-btn[data-action="toggle-messages-drawer"] { width: 32px !important; height: 32px !important; }
}

/* 5.8.3: restore the full-size CRM header logo without changing the rest of the layout. */
.topbar .brand-logo-wrap {
  min-width: 300px !important;
}
.topbar .brand-logo-stack,
.brand-logo-stack {
  width: 300px !important;
  height: 74px !important;
}
.topbar .brand-logo-stack .brand-logo,
.brand-logo-stack .brand-logo {
  object-fit: contain !important;
}
@media (max-width: 760px) {
  .brand-logo-wrap {
    width: clamp(240px, 64vw, 284px) !important;
    min-width: 0 !important;
  }
  .topbar .brand-logo-stack,
  .brand-logo-stack {
    width: 100% !important;
    height: clamp(58px, 16vw, 70px) !important;
  }
}
@media (max-width: 420px) {
  .brand-logo-wrap {
    width: clamp(228px, 68vw, 266px) !important;
  }
  .topbar .brand-logo-stack,
  .brand-logo-stack {
    height: 60px !important;
  }
}

/* 5.8.4 mobile lead list fix: prevent pre-open lead details from overlapping */
@media (max-width: 760px) {
  .leads-table-body {
    display: grid;
    gap: 10px;
    padding: 6px 0 10px;
  }

  .leads-row {
    display: grid !important;
    grid-template-columns: 12px minmax(0, 1fr) max-content !important;
    grid-template-areas:
      "dot name status"
      "dot phone phone"
      "dot source source"
      "dot price price"
      "dot created created" !important;
    align-items: start !important;
    column-gap: 10px !important;
    row-gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 14px 14px 13px !important;
    overflow: hidden !important;
  }

  .leads-row::after {
    display: none !important;
  }

  .leads-row > * {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    line-height: 1.35 !important;
  }

  .leads-row > :nth-child(1) {
    grid-area: dot !important;
    grid-column: auto !important;
    grid-row: auto !important;
    padding-top: 4px;
  }

  .leads-row > :nth-child(2) {
    grid-area: name !important;
    grid-column: auto !important;
    grid-row: auto !important;
    padding-right: 4px;
  }

  .leads-row > :nth-child(3) {
    grid-area: phone !important;
    grid-column: auto !important;
    grid-row: auto !important;
    color: #5d6c84;
  }

  .leads-row > :nth-child(4) {
    grid-area: source !important;
    grid-column: auto !important;
    grid-row: auto !important;
    color: #6f7c92;
    font-size: 13px;
  }

  .leads-row > :nth-child(5),
  .leads-row .lead-row-status-cell {
    grid-area: status !important;
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: end !important;
    align-self: start !important;
    min-width: 0 !important;
    max-width: 104px !important;
  }

  .leads-row > :nth-child(6) {
    grid-area: price !important;
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: start !important;
    font-weight: 700;
    color: #2f4364;
  }

  .leads-row > :nth-child(7) {
    grid-area: created !important;
    grid-column: auto !important;
    grid-row: auto !important;
    color: #8090a7;
    font-size: 13px;
  }

  .leads-row .status-pill {
    display: inline-flex !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 104px !important;
    height: 26px !important;
    padding: 0 9px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .global-search-item,
  .global-search-item-head,
  .global-search-item-meta {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .global-search-item-meta {
    display: block !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.35 !important;
  }

  .contact-meta {
    min-width: 0 !important;
  }

  .contact-meta > div {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.45 !important;
  }
}

/* 5.8.6 polish: phone-only logo size, smoother preloaded logo crossfade, and mobile lead close */
.topbar .brand-logo-button,
.topbar .brand-logo-button * {
  -webkit-tap-highlight-color: transparent;
}

.topbar .brand-logo-button {
  cursor: pointer !important;
}

.topbar .brand-logo-stack.brand-logo-stack--crossfade,
.topbar .brand-logo-stack {
  contain: paint;
  transform: translate3d(0,0,0) !important;
  backface-visibility: hidden;
}

.topbar .brand-logo-stack .brand-logo {
  opacity: 0;
  transform: translate3d(0,0,0) scale(1) !important;
  filter: none !important;
  backface-visibility: hidden;
  transform-origin: 50% 50%;
  transition:
    opacity 860ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 860ms step-end !important;
  will-change: opacity;
}

.topbar .brand-logo-stack .brand-logo--default {
  opacity: 1 !important;
  visibility: visible !important;
}

.topbar .brand-logo-stack .brand-logo--hover {
  opacity: 0 !important;
  visibility: hidden !important;
}

.topbar .brand-logo-button:hover .brand-logo-stack .brand-logo--default,
.topbar .brand-logo-button:focus-visible .brand-logo-stack .brand-logo--default {
  opacity: 0 !important;
  visibility: hidden !important;
  transition:
    opacity 860ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 860ms step-end !important;
}

.topbar .brand-logo-button:hover .brand-logo-stack .brand-logo--hover,
.topbar .brand-logo-button:focus-visible .brand-logo-stack .brand-logo--hover {
  opacity: 1 !important;
  visibility: visible !important;
  transition:
    opacity 860ms cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0ms step-start !important;
}

@media (prefers-reduced-motion: reduce) {
  .topbar .brand-logo-stack .brand-logo,
  .topbar .brand-logo-button:hover .brand-logo-stack .brand-logo--default,
  .topbar .brand-logo-button:focus-visible .brand-logo-stack .brand-logo--default,
  .topbar .brand-logo-button:hover .brand-logo-stack .brand-logo--hover,
  .topbar .brand-logo-button:focus-visible .brand-logo-stack .brand-logo--hover {
    transition-duration: 1ms !important;
  }
}

@media (max-width: 760px) {
  .topbar .brand-logo-wrap,
  .brand-logo-wrap {
    width: clamp(202px, 55vw, 242px) !important;
    min-width: 0 !important;
    justify-self: center !important;
  }

  .topbar .brand-logo-stack,
  .brand-logo-stack {
    width: 100% !important;
    height: clamp(48px, 13vw, 58px) !important;
  }

  .topbar .brand-logo-stack .brand-logo,
  .brand-logo-stack .brand-logo {
    object-fit: contain !important;
    object-position: center center !important;
  }

  .lead-overlay-shell {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
  }

  .lead-overlay-panel {
    width: min(96vw, 560px) !important;
    max-height: calc(100dvh - 24px) !important;
    border-radius: 24px !important;
  }

  .lead-overlay-panel-head {
    position: sticky !important;
    top: 0 !important;
    z-index: 6 !important;
    padding: 15px 64px 12px 16px !important;
    background: rgba(255,255,255,.96) !important;
    backdrop-filter: blur(14px) !important;
  }

  .lead-overlay-close {
    position: absolute !important;
    top: 10px !important;
    right: 12px !important;
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(210, 219, 233, 0.95) !important;
    background: rgba(255,255,255,.98) !important;
    color: #5f6e84 !important;
    box-shadow: 0 10px 24px rgba(31, 50, 65, .10) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 8 !important;
    opacity: 1 !important;
    transform: none !important;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease !important;
  }

  .lead-overlay-close:hover,
  .lead-overlay-close:focus-visible {
    background: #f6f8fc !important;
    color: #1f3241 !important;
    box-shadow: 0 14px 30px rgba(31, 50, 65, .13) !important;
  }

  .lead-overlay-close:active {
    transform: scale(.96) !important;
  }

  .lead-overlay-close span {
    display: block !important;
    font-size: 30px !important;
    line-height: 1 !important;
    margin-top: -2px !important;
  }
}

@media (max-width: 420px) {
  .topbar .brand-logo-wrap,
  .brand-logo-wrap {
    width: clamp(190px, 53vw, 224px) !important;
  }

  .topbar .brand-logo-stack,
  .brand-logo-stack {
    height: clamp(44px, 12vw, 54px) !important;
  }
}

/* 5.8.7: GDPR person search has no decorative icon. */
.gdpr-search-row::before {
  content: none !important;
  display: none !important;
}
.gdpr-search-row input {
  padding-left: 16px !important;
}

/* ===== v6.0.0 additions ===== */
.lead-extras { margin-top: 18px; }
.lead-extras-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid #e3e7f0; margin-bottom: 14px; }
.lead-extras-tab { background: transparent; border: 0; padding: 10px 14px; font-weight: 600; color: #586079; cursor: pointer; border-bottom: 2px solid transparent; min-height: 44px; }
.lead-extras-tab.active { color: #3a6ae8; border-bottom-color: #3a6ae8; }
.lead-extras-pane { padding: 4px 0; }
.lead-extras-empty { color: #8a93a8; padding: 16px; text-align: center; font-size: 14px; }
.lead-extras-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #f6f8fd; border-radius: 12px; margin-top: 12px; }
.lead-extras-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #3b4254; }
.lead-extras-form input, .lead-extras-form select, .lead-extras-form textarea { padding: 9px 12px; border: 1px solid #d8dde9; border-radius: 8px; font-family: inherit; font-size: 14px; }
.lead-extras-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .lead-extras-form-grid { grid-template-columns: 1fr; } }

.agreements-list, .notes-list { display: flex; flex-direction: column; gap: 10px; }
.agreement-row, .note-row, .schedule-row { display: flex; gap: 12px; padding: 12px; background: #fff; border: 1px solid #e6eaf2; border-radius: 10px; align-items: flex-start; justify-content: space-between; }
.agreement-row-main, .schedule-row-main { flex: 1; min-width: 0; }
.agreement-title { font-weight: 600; color: #1a1f2e; margin-bottom: 4px; }
.agreement-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 6px; background: #eef2fa; color: #3a6ae8; }
.agreement-status--signed { background: #e8f6ec; color: #1f6a3a; }
.agreement-status--draft { background: #fff5e0; color: #8a6210; }
.agreement-status--archived { background: #ebedf2; color: #586079; }
.agreement-meta, .note-meta, .schedule-row-meta { font-size: 12px; color: #8a93a8; }
.agreement-link { display: inline-block; margin-top: 6px; color: #3a6ae8; text-decoration: none; font-size: 13px; }
.agreement-notes, .note-text, .schedule-row-desc { margin-top: 6px; font-size: 14px; color: #3b4254; }

.withdrawal-summary { padding: 16px; border-radius: 12px; background: #f6f8fd; }
.withdrawal-summary--green { background: #e8f6ec; }
.withdrawal-summary--gold { background: #fff5e0; }
.withdrawal-summary--red { background: #fdecec; }
.withdrawal-row { padding: 4px 0; font-size: 14px; color: #3b4254; }
.withdrawal-flag { color: #a02323; font-weight: 600; }
.withdrawal-handled { color: #1f6a3a; font-weight: 600; }

.autogiro-summary { padding: 14px; background: #f6f8fd; border-radius: 12px; }
.autogiro-row { padding: 4px 0; font-size: 14px; color: #3b4254; word-break: break-word; }
.autogiro-link a { color: #3a6ae8; word-break: break-all; }

.schedule-form { padding: 16px; background: #f6f8fd; border-radius: 12px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.schedule-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.schedule-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: #3b4254; }
.schedule-form input, .schedule-form select, .schedule-form textarea { padding: 9px 12px; border: 1px solid #d8dde9; border-radius: 8px; font-family: inherit; font-size: 14px; }
.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-row-title { font-weight: 600; color: #1a1f2e; }
.schedule-empty { padding: 32px; text-align: center; color: #8a93a8; }
.ghost-btn--danger { color: #a02323; border-color: #f3b9b9; }

/* ===== Responsive pass ===== */
@media (max-width: 900px) {
  .lead-overlay-panel { width: 100% !important; max-width: 100% !important; border-radius: 0 !important; }
  .lead-overlay-grid { grid-template-columns: 1fr !important; }
  .stats { grid-template-columns: repeat(2, 1fr) !important; }
  .leads-head, .leads-row { grid-template-columns: 30px 1.4fr 1fr 1fr !important; }
  .leads-head > div:nth-child(n+5), .leads-row > div:nth-child(n+5) { display: none !important; }
  .panel-head--with-tools { flex-direction: column; align-items: stretch; gap: 10px; }
  .panel-tools-inline { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr !important; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab { white-space: nowrap; min-height: 44px; }
  .ghost-btn, .icon-btn, button { min-height: 44px; }
  .lead-overlay-panel-body { padding: 16px !important; }
  .panel { padding: 14px !important; }
}

/* === v6.1 UI/UX polish layer (non-breaking) === */
:root { --sfcrm-ease: cubic-bezier(.4,0,.2,1); --sfcrm-radius: 12px; }

html { -webkit-text-size-adjust: 100%; }
* { -webkit-tap-highlight-color: transparent; }

button, .ghost-btn, .icon-btn, .tab, a.btn, .primary-btn {
  transition: background-color .18s var(--sfcrm-ease), color .18s var(--sfcrm-ease),
              border-color .18s var(--sfcrm-ease), box-shadow .18s var(--sfcrm-ease),
              transform .12s var(--sfcrm-ease);
}
button:not(:disabled):hover, .ghost-btn:not(:disabled):hover, .icon-btn:not(:disabled):hover {
  filter: brightness(1.05);
}
button:not(:disabled):active, .ghost-btn:not(:disabled):active, .icon-btn:not(:disabled):active {
  transform: translateY(1px);
}
button:focus-visible, .ghost-btn:focus-visible, .icon-btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible, .tab:focus-visible {
  outline: 2px solid #2f80ed;
  outline-offset: 2px;
  border-radius: 8px;
}

input, select, textarea {
  transition: border-color .18s var(--sfcrm-ease), box-shadow .18s var(--sfcrm-ease);
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(47,128,237,.18);
}

/* Smoother scrollbars on desktop */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 8px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.28); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* Card / panel softening */
.panel, .card, .lead-card, .stats > * {
  border-radius: var(--sfcrm-radius);
}

/* Scrollable horizontal tabs everywhere */
.tabs, .lead-extras-tabs, .schedule-tabs {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tabs::-webkit-scrollbar { height: 4px; }

/* Modal / overlay viewport fit */
.lead-overlay, .modal, .sfcrm-modal, .overlay {
  max-height: 100vh;
  max-height: 100dvh;
}
.lead-overlay-panel, .modal-panel, .sfcrm-modal-panel {
  max-height: 100dvh;
  overflow: auto;
}

/* Mobile polish */
@media (max-width: 760px) {
  .lead-overlay, .modal, .sfcrm-modal {
    inset: 0 !important;
    border-radius: 0 !important;
  }
  .lead-overlay-panel, .modal-panel, .sfcrm-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }
  table { font-size: 14px; }
  .table-wrap, .leads-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  input, select, textarea { font-size: 16px; } /* prevent iOS zoom */
  .ghost-btn, .icon-btn, button, .tab, a.btn { min-height: 44px; }
  .lead-extras-form-grid, .schedule-grid { gap: 12px; }
}

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .panel { padding: 12px !important; }
  .stats { gap: 10px; }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Lead overlay v2 — richer hero + metrics + cards
   Additive layer; preserves existing functions and handlers.
   ============================================================ */
.lead-overlay-shell--v2 .lead-overlay-panel--v2 {
  background: #f7f9fd;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px -22px rgba(20, 30, 60, 0.28), 0 6px 18px -8px rgba(20, 30, 60, 0.14);
  border: 1px solid #e6ebf5;
}
.lead-overlay-hero {
  position: relative;
  padding: 16px 20px 14px;
  color: #1f2a44;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid #e6ebf5;
}
.lead-overlay-hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background: #ffffff;
}
.lead-overlay-hero-inner {
  display: flex; gap: 14px; align-items: center;
}
.lead-overlay-avatar {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--lead-tone-soft, #e3ecff);
  border: 1px solid var(--lead-tone-outline, #d6e2ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; letter-spacing: 0.4px;
  color: var(--lead-tone-text-dark, #3152a0);
}
.lead-overlay-hero-copy { flex: 1; min-width: 0; }
.lead-overlay-hero .lead-overlay-kicker {
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 10px; color: #6d7b92; opacity: 1; margin-bottom: 3px; font-weight: 700;
}
.lead-overlay-hero .lead-overlay-title-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.lead-overlay-hero h2 {
  margin: 0; font-size: 18px; font-weight: 700; color: #1f2a44;
  word-break: break-word; line-height: 1.15;
}
.lead-overlay-hero .lead-overlay-subtitle {
  margin-top: 3px; color: #6d7b92; font-size: 12px;
}
.lead-overlay-close--hero {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 10px;
  background: #f3f5fa; border: 1px solid #e3e7f0;
  color: #5f6e84; font-size: 18px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 160ms ease, transform 160ms ease;
}
.lead-overlay-close--hero:hover { background: #e8ecf4; transform: scale(1.05); }
.lead-overlay-quick-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
}
.lead-quick-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; min-height: 30px;
  border-radius: 999px;
  background: #f3f5fa;
  border: 1px solid #e3e7f0;
  color: #3b4254; font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.lead-quick-chip:hover { background: #e8ecf4; transform: translateY(-1px); }
.lead-quick-chip--primary {
  background: var(--lead-tone-solid, #4a78e3); color: #fff;
  border-color: var(--lead-tone-solid, #4a78e3);
}
.lead-quick-chip--primary:hover { background: var(--lead-tone-text-dark, #3152a0); }

.lead-overlay-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 12px;
  padding: 8px;
  background: #f6f8fd;
  border: 1px solid #e6ebf5;
  border-radius: 12px;
}
.lead-overlay-metric {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 8px;
  min-width: 0;
}
.lead-overlay-metric + .lead-overlay-metric {
  border-left: 1px solid #e3e7f0;
}
.lead-overlay-metric-label {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #8a93a8; font-weight: 600;
}
.lead-overlay-metric-value {
  font-size: 12px; font-weight: 700; color: #1f2a44;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.lead-overlay-panel-body--v2 {
  padding: 14px 18px 18px;
  background: #f7f9fd;
}
.lead-overlay-grid--v2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.lead-overlay-grid--v2 > .lead-overlay-card {
  background: #fff;
  border: 1px solid #e6ebf5;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px -4px rgba(20,30,60,0.06);
}
.lead-overlay-card-head {
  margin-bottom: 10px;
}
.lead-overlay-card-eyebrow {
  display: block;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--lead-tone-text-dark, #6d7b92);
  font-weight: 700; margin-bottom: 2px;
}
.lead-overlay-card-head h3 {
  margin: 0; font-size: 14px; font-weight: 700; color: #1f2a44;
}
.lead-overlay-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e6ebf5;
}
.lead-overlay-contact-cell {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.lead-overlay-contact-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #6d7b92; font-weight: 600;
}
.lead-overlay-contact-value {
  font-size: 13px; font-weight: 600; color: #1f2a44;
  word-break: break-word;
}

/* Tabs container in extras gets a softer card on v2 */
.lead-overlay-shell--v2 .lead-extras {
  background: #fff;
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px -4px rgba(20,30,60,0.08);
}
.lead-overlay-shell--v2 .lead-extras-tabs {
  gap: 6px;
  border-bottom: 1px solid #eef2f9;
  padding-bottom: 10px;
  margin-bottom: 14px;
  overflow-x: auto;
}
.lead-overlay-shell--v2 .lead-extras-tab {
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  background: transparent;
  color: #6d7b92;
}
.lead-overlay-shell--v2 .lead-extras-tab.active {
  background: var(--lead-tone-soft, #e3ecff);
  color: var(--lead-tone-text-dark, #3152a0);
}

/* Mobile */
@media (max-width: 720px) {
  .lead-overlay-shell--v2 .lead-overlay-panel--v2 {
    border-radius: 0;
  }
  .lead-overlay-hero { padding: 18px 18px 16px; }
  .lead-overlay-hero h2 { font-size: 20px; }
  .lead-overlay-avatar { width: 52px; height: 52px; font-size: 18px; border-radius: 14px; }
  .lead-overlay-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .lead-overlay-metric:nth-child(odd) { border-left: none; }
  .lead-overlay-metric:nth-child(3) { border-top: 1px solid rgba(255,255,255,0.22); }
  .lead-overlay-metric:nth-child(4) { border-top: 1px solid rgba(255,255,255,0.22); }
  .lead-overlay-grid--v2 { grid-template-columns: 1fr; }
  .lead-overlay-contact-grid { grid-template-columns: 1fr; }
  .lead-overlay-panel-body--v2 { padding: 16px; }
}

/* Client-facing lead list: no price column, no internal billing labels. */
.leads-head--client,
.leads-row--client {
  grid-template-columns: 38px 1.35fr 1fr 0.9fr 1.1fr 0.95fr !important;
}

.leads-row--client .lead-row-created-cell {
  color: #8090a7;
  font-size: 13px;
  font-weight: 400;
}

@media (max-width: 900px) {
  .leads-head--client,
  .leads-row--client {
    grid-template-columns: 30px 1.4fr 1fr 1fr !important;
  }

  .leads-head--client > div:nth-child(n+5),
  .leads-row--client > div:nth-child(n+5) {
    display: block !important;
  }

  .leads-row--client .lead-row-status-cell {
    display: flex !important;
  }
}

@media (max-width: 720px) {
  .leads-row--client {
    grid-template-columns: 14px minmax(0, 1fr) auto !important;
    grid-template-areas:
      "dot name status"
      "dot phone phone"
      "dot source source"
      "dot created created" !important;
  }

  .leads-row--client > :nth-child(1) { grid-area: dot !important; }
  .leads-row--client > :nth-child(2) { grid-area: name !important; }
  .leads-row--client > :nth-child(3) { grid-area: phone !important; }
  .leads-row--client > :nth-child(4) { grid-area: source !important; }
  .leads-row--client > :nth-child(5) { grid-area: status !important; }
  .leads-row--client > :nth-child(6) {
    grid-area: created !important;
    justify-self: start !important;
    font-weight: 400 !important;
    color: #8090a7 !important;
    font-size: 13px !important;
  }

  .leads-row--client > div:nth-child(6)::before {
    content: "Skapad" !important;
    color: #9aa6b8;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
}

/* v6.2.7 client/status polish: Klar, admin preview and rich notes */
.menu-item.active[data-tone='deepgreen'],
.bottom-settings.active[data-tone='deepgreen'] {
  background: #dff3e9;
  color: #25664b;
}

.menu-item.active[data-tone='deepgreen']::before,
.bottom-settings.active[data-tone='deepgreen']::before {
  background: #2f8f66;
}

.menu-item.active[data-tone='deepgreen'] .menu-icon,
.bottom-settings.active[data-tone='deepgreen'] .menu-icon {
  color: #2f8f66;
}

.tab.active[data-tone='deepgreen'] {
  background: #dff3e9;
  color: #25664b;
}

.client-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d8e5f2;
  background: #ffffff;
  color: #30415f;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  white-space: nowrap;
}

.client-preview-toggle:hover,
.client-preview-toggle:focus-visible {
  border-color: #b9d5c9;
  background: #f4fbf7;
}

.client-preview-toggle.active {
  border-color: #9dceb9;
  background: #e5f6ee;
  color: #25664b;
}

.client-preview-toggle-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #95a3b8;
  box-shadow: 0 0 0 4px rgba(149,163,184,.15);
}

.client-preview-toggle.active .client-preview-toggle-dot {
  background: #2f8f66;
  box-shadow: 0 0 0 4px rgba(47,143,102,.14);
}

.client-preview-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.client-preview-toggle-copy strong {
  font-size: 12px;
  font-weight: 800;
}

.client-preview-toggle-copy small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #6f7d92;
}

.client-preview-toggle.active .client-preview-toggle-copy small {
  color: #3c7b5f;
}

.client-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 24px 14px;
  padding: 12px 14px 12px 16px;
  border: 1px solid #b9dfcc;
  border-radius: 16px;
  background: linear-gradient(135deg, #edf8f2 0%, #f8fcfa 100%);
  color: #25664b;
  box-shadow: 0 10px 24px rgba(47,143,102,.08);
}

.client-preview-banner strong {
  display: block;
  font-size: 13px;
  font-weight: 850;
}

.client-preview-banner span {
  display: block;
  margin-top: 2px;
  color: #4d6d5e;
  font-size: 12px;
  line-height: 1.35;
}

.client-preview-banner-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: #2f8f66;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.client-preview-active .lead-extras,
.client-preview-active .invoice-panel,
.client-preview-active .billing-panel {
  display: none !important;
}

.lead-note-form {
  gap: 14px;
}

.note-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: start;
}

.note-upload-box {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px dashed #cbd8ea;
  border-radius: 14px;
  background: #f8fbff;
  color: #46566f;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.note-upload-box:hover,
.note-upload-box:focus-within {
  border-color: #4a78e3;
  background: #f2f6ff;
}

.note-upload-box input[type='file'] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.note-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #e8efff;
  color: #2f61c9;
  font-size: 22px;
  font-weight: 700;
  flex: 0 0 auto;
}

.note-upload-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note-upload-copy strong {
  font-size: 13px;
  color: #30415f;
}

.note-upload-copy small {
  font-size: 12px;
  color: #7c8aa2;
  line-height: 1.35;
}

.note-form-actions {
  display: flex;
  justify-content: flex-end;
}

.note-save-btn {
  min-width: 158px;
}

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

.note-row--rich {
  padding: 13px;
  border: 1px solid #e6ebf5;
  border-radius: 14px;
  background: #fff;
}

.note-row--rich .note-text {
  margin-top: 7px;
  white-space: pre-wrap;
}

.note-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.note-image-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e0e7f1;
  border-radius: 12px;
  background: #f8fafc;
  color: #30415f;
  text-decoration: none;
}

.note-image-card:hover,
.note-image-card:focus-visible {
  border-color: #b8c9e3;
  box-shadow: 0 8px 20px rgba(16,24,40,.08);
}

.note-image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eef2f7;
}

.note-image-card span {
  display: block;
  overflow: hidden;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .client-preview-toggle-copy small {
    display: none;
  }

  .client-preview-toggle {
    padding-inline: 10px;
  }
}

@media (max-width: 760px) {
  .client-preview-banner {
    align-items: stretch;
    flex-direction: column;
    margin: 0 12px 10px;
    gap: 10px;
  }

  .client-preview-banner-btn {
    width: 100%;
  }

  .client-preview-toggle {
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .client-preview-toggle-copy {
    display: none;
  }

  .note-form-grid {
    grid-template-columns: 1fr;
  }

  .note-form-actions {
    justify-content: stretch;
  }

  .note-save-btn {
    width: 100%;
  }

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

/* ===== v6.2.7.2 Hojer fix: cleaner drawer, notes-first UX, compact agreements ===== */
.lead-overlay-shell.lead-overlay-shell--v2 {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  overflow: hidden !important;
  z-index: 160 !important;
}

.lead-overlay-shell--v2 .lead-overlay-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.22) !important;
  backdrop-filter: blur(8px) !important;
}

.lead-overlay-shell--v2 .lead-overlay-panel--v2 {
  position: relative !important;
  width: min(860px, 100vw) !important;
  max-width: 100vw !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 26px 0 0 26px !important;
  border: 0 !important;
  border-left: 1px solid rgba(221, 229, 243, .95) !important;
  background: #f6f8fc !important;
  box-shadow: -24px 0 70px rgba(15, 23, 42, .18) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: sfcrmLeadDrawerIn6272 220ms cubic-bezier(.22,1,.36,1) !important;
}

@keyframes sfcrmLeadDrawerIn6272 {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

.lead-overlay-shell--v2.is-closing .lead-overlay-panel--v2 {
  animation: sfcrmLeadDrawerOut6272 180ms ease forwards !important;
}

@keyframes sfcrmLeadDrawerOut6272 {
  to { opacity: 0; transform: translateX(26px); }
}

.lead-overlay-shell--v2 .lead-overlay-hero {
  flex: 0 0 auto !important;
  padding: 16px 20px 14px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #e6ebf5 !important;
}

.lead-overlay-shell--v2 .lead-overlay-hero-inner {
  padding-right: 42px !important;
}

.lead-overlay-shell--v2 .lead-overlay-close--hero {
  top: 14px !important;
  right: 14px !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 14px !important;
  background: #f6f8fc !important;
  border: 1px solid #dfe6f1 !important;
  color: #54647c !important;
  box-shadow: 0 8px 22px rgba(16,24,40,.08) !important;
}

.lead-overlay-shell--v2 .lead-overlay-close--hero:hover,
.lead-overlay-shell--v2 .lead-overlay-close--hero:focus-visible {
  background: #edf2f8 !important;
  color: #1f3241 !important;
  transform: translateY(-1px) !important;
}

.lead-overlay-shell--v2 .lead-overlay-metrics {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
  margin-top: 12px !important;
}

.lead-overlay-shell--v2 .lead-overlay-metric + .lead-overlay-metric {
  border-left: 0 !important;
}

.lead-overlay-shell--v2 .lead-overlay-panel-body--v2 {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 14px 16px 22px !important;
  background: #f6f8fc !important;
}

.lead-overlay-shell--v2 .lead-overlay-grid--v2 {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin-bottom: 12px !important;
}

.lead-overlay-shell--v2 .lead-overlay-grid--v2 > .lead-overlay-card,
.lead-overlay-shell--v2 .lead-extras {
  border-radius: 18px !important;
  border: 1px solid #e3eaf4 !important;
  background: #ffffff !important;
  box-shadow: 0 10px 28px rgba(16, 24, 40, .05) !important;
}

.lead-overlay-shell--v2 .lead-overlay-grid--v2 > .lead-overlay-card {
  padding: 16px !important;
}

.lead-overlay-shell--v2 .lead-overlay-card--workflow .side-section {
  gap: 12px !important;
}

.lead-overlay-shell--v2 .lead-extras {
  margin-top: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.lead-overlay-shell--v2 .lead-extras-tabs {
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  display: flex !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid #edf1f7 !important;
  background: rgba(255,255,255,.96) !important;
  backdrop-filter: blur(10px) !important;
}

.lead-overlay-shell--v2 .lead-extras-tab {
  flex: 0 0 auto !important;
  min-height: 38px !important;
  padding: 8px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  color: #6b7890 !important;
  background: transparent !important;
}

.lead-overlay-shell--v2 .lead-extras-tab:hover,
.lead-overlay-shell--v2 .lead-extras-tab:focus-visible {
  background: #f4f7fb !important;
  color: #29364a !important;
}

.lead-overlay-shell--v2 .lead-extras-tab.active {
  color: #2f61c9 !important;
  background: #ecf3ff !important;
  border-color: #d7e4ff !important;
  box-shadow: inset 0 0 0 1px rgba(47, 97, 201, .04) !important;
}

.lead-overlay-shell--v2 .lead-extras-pane {
  padding: 14px !important;
}

.lead-create-details {
  margin-top: 12px !important;
  border: 1px solid #e1e8f2 !important;
  border-radius: 16px !important;
  background: #f9fbfe !important;
  overflow: hidden !important;
}

.lead-create-details > summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-height: 48px !important;
  padding: 12px 14px !important;
  cursor: pointer !important;
  list-style: none !important;
  color: #30415f !important;
}

.lead-create-details > summary::-webkit-details-marker { display: none !important; }

.lead-create-summary-main {
  font-size: 13px !important;
  font-weight: 850 !important;
}

.lead-create-summary-sub {
  color: #7b8ba3 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  text-align: right !important;
}

.lead-create-details[open] > summary {
  border-bottom: 1px solid #e7edf6 !important;
  background: #ffffff !important;
}

.lead-extras-empty--card {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  padding: 18px !important;
  border: 1px dashed #d9e2ee !important;
  border-radius: 16px !important;
  background: #fbfdff !important;
  color: #6f7d92 !important;
  text-align: center !important;
}

.lead-extras-empty--card strong {
  color: #30415f !important;
  font-size: 14px !important;
}

.lead-extras-empty--card span {
  font-size: 13px !important;
}

.lead-extras-form--compact,
.note-composer {
  margin-top: 0 !important;
  padding: 14px !important;
  border-radius: 0 !important;
  background: #ffffff !important;
}

.lead-extras-form-actions {
  display: flex !important;
  justify-content: flex-end !important;
}

.note-composer {
  gap: 12px !important;
  margin-bottom: 12px !important;
  border: 1px solid #dbe6f4 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .04) !important;
}

.note-composer-head {
  display: flex !important;
  justify-content: space-between !important;
  gap: 12px !important;
  color: #30415f !important;
}

.note-composer-head strong {
  display: block !important;
  font-size: 15px !important;
  font-weight: 850 !important;
}

.note-composer-head span {
  display: block !important;
  margin-top: 2px !important;
  color: #7b8ba3 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

.note-textarea-label textarea {
  min-height: 112px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.note-composer-bottom {
  display: grid !important;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.note-type-select,
.note-upload-box {
  margin: 0 !important;
}

.note-upload-box {
  min-height: 52px !important;
  padding: 10px 12px !important;
  background: #f6f9ff !important;
  border-radius: 14px !important;
}

.note-upload-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
}

.note-save-btn {
  align-self: stretch !important;
  min-width: 150px !important;
  background: #315fd1 !important;
  color: #ffffff !important;
  border-color: #315fd1 !important;
  box-shadow: 0 10px 20px rgba(49, 95, 209, .16) !important;
}

.note-save-btn:hover,
.note-save-btn:focus-visible {
  background: #244eb8 !important;
  border-color: #244eb8 !important;
}

.notes-list--rich {
  gap: 10px !important;
}

.note-row--rich {
  display: block !important;
  padding: 14px !important;
  border-radius: 16px !important;
  border-color: #e3eaf4 !important;
}

.note-meta {
  font-weight: 750 !important;
}

.client-preview-toggle {
  border-color: #cfe0ef !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .06) !important;
}

.client-preview-toggle.active {
  box-shadow: 0 10px 24px rgba(47,143,102,.14) !important;
}

@media (max-width: 980px) {
  .lead-overlay-shell--v2 .lead-overlay-panel--v2 {
    width: min(780px, 100vw) !important;
  }

  .note-composer-bottom {
    grid-template-columns: 1fr !important;
  }

  .note-save-btn {
    width: 100% !important;
  }
}

@media (max-width: 720px) {
  .lead-overlay-shell.lead-overlay-shell--v2 {
    align-items: stretch !important;
    justify-content: center !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-panel--v2 {
    width: 100vw !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 0 !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-hero {
    padding: max(12px, env(safe-area-inset-top)) 14px 12px !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-hero-inner {
    align-items: flex-start !important;
    padding-right: 46px !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-title-row h2,
  .lead-overlay-shell--v2 .lead-overlay-hero h2 {
    font-size: 20px !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-panel-body--v2 {
    padding: 12px 12px max(16px, env(safe-area-inset-bottom)) !important;
  }

  .lead-overlay-shell--v2 .lead-extras-tabs {
    padding: 10px 12px !important;
  }

  .lead-overlay-shell--v2 .lead-extras-pane {
    padding: 12px !important;
  }

  .lead-create-details > summary {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .lead-create-summary-sub {
    text-align: left !important;
  }
}

/* ===== v6.2.7.4 Hojer/Douglas polish: tighter drawer, notes-first flow, fixed prognosis labels ===== */
.lead-overlay-shell.lead-overlay-shell--v2 {
  justify-content: flex-end !important;
}

.lead-overlay-shell--v2 .lead-overlay-backdrop {
  background: rgba(15, 23, 42, 0.12) !important;
  backdrop-filter: blur(2px) !important;
}

.lead-overlay-shell--v2 .lead-overlay-panel--v2 {
  width: min(760px, 100vw) !important;
  border-radius: 22px 0 0 22px !important;
  background: #f7f9fc !important;
  box-shadow: -18px 0 54px rgba(15, 23, 42, .16) !important;
}

.lead-overlay-shell--v2 .lead-overlay-hero {
  padding: 14px 18px 12px !important;
}

.lead-overlay-shell--v2 .lead-overlay-avatar {
  width: 48px !important;
  height: 48px !important;
  font-size: 16px !important;
}

.lead-overlay-shell--v2 .lead-overlay-title-row h2,
.lead-overlay-shell--v2 .lead-overlay-hero h2 {
  font-size: 24px !important;
  line-height: 1.12 !important;
}

.lead-overlay-shell--v2 .lead-overlay-subtitle {
  font-size: 13px !important;
}

.lead-overlay-shell--v2 .lead-overlay-quick-toolbar {
  margin-top: 10px !important;
  gap: 8px !important;
}

.lead-overlay-shell--v2 .lead-overlay-metrics {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.lead-overlay-shell--v2 .lead-overlay-metric {
  padding: 10px 12px !important;
  border-radius: 14px !important;
  background: #f8fafc !important;
  border: 1px solid #eef2f7 !important;
}

.lead-overlay-shell--v2 .lead-overlay-panel-body--v2 {
  padding: 12px 14px 18px !important;
}

.lead-overlay-shell--v2 .lead-extras {
  margin-bottom: 12px !important;
}

.lead-overlay-shell--v2 .lead-overlay-grid--support {
  margin-top: 0 !important;
}

.lead-overlay-shell--v2 .lead-extras-tabs {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}

.lead-overlay-shell--v2 .lead-extras-tabs::-webkit-scrollbar {
  display: none !important;
}

.lead-overlay-shell--v2 .lead-extras-tab:first-child {
  color: #1f4fb8 !important;
  background: #f6f9ff !important;
}

.lead-overlay-shell--v2 .lead-extras-tab:first-child.active {
  color: #ffffff !important;
  background: #315fd1 !important;
  border-color: #315fd1 !important;
}

.lead-overlay-shell--v2 .note-composer {
  border-radius: 16px !important;
  box-shadow: none !important;
}

.lead-overlay-shell--v2 .note-composer-bottom {
  grid-template-columns: 150px minmax(0, 1fr) 142px !important;
}

.package-mix-formula {
  margin-top: 3px;
  color: #8a96aa;
  font-size: 12px;
  font-weight: 650;
}

@media (max-width: 860px) {
  .lead-overlay-shell--v2 .lead-overlay-panel--v2 {
    width: 100vw !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 720px) {
  .lead-overlay-shell--v2 .lead-overlay-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .lead-overlay-shell--v2 .lead-overlay-quick-toolbar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .lead-overlay-shell--v2 .lead-quick-chip {
    justify-content: center !important;
  }

  .lead-overlay-shell--v2 .note-composer-bottom {
    grid-template-columns: 1fr !important;
  }
}


/* ===== v6.2.7.5 Douglas 2FA deliverability + resend UX ===== */
.sfcrm-2fa-resend-form {
  margin: 12px 0 0;
  display: flex;
  justify-content: center;
}
.sfcrm-2fa-resend-button {
  appearance: none;
  border: 1px solid rgba(71, 118, 232, .24);
  background: #f6f9ff;
  color: #315bca;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.sfcrm-2fa-resend-button:hover,
.sfcrm-2fa-resend-button:focus-visible {
  background: #edf4ff;
  box-shadow: 0 10px 24px rgba(71, 118, 232, .14);
  transform: translateY(-1px);
  outline: none;
}
.sfcrm-2fa-footnote strong {
  color: #315bca;
}
@media (max-width: 560px) {
  .sfcrm-2fa-resend-button {
    width: 100%;
  }
}

/* === v6.3.1 Gyms page =================================================== */
.gyms-main { padding: 24px; }
.gyms-page { max-width: 1600px; margin: 0 auto; }
.gyms-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.gyms-hero h1 { margin: 4px 0; }
.gyms-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .gyms-three-col { grid-template-columns: 1fr; } }
.gyms-col {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 14px;
  max-height: 78vh;
  overflow: auto;
}
.gyms-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.gyms-col-head h2 { font-size: 15px; margin: 0; }
.gyms-col-head span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f3f4f6; }
.gyms-activity-list, .gyms-lead-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gyms-activity-item { padding: 10px 12px; border-radius: 10px; background: #fafafa; border: 1px solid #f0f0f0; font-size: 13px; }
.gyms-activity-time { color: #888; font-size: 11px; }
.gyms-activity-msg { color: #555; margin-top: 4px; }
.gyms-activity-actor { color: #999; font-size: 11px; margin-top: 4px; }
.gyms-lead-row { padding: 10px 12px; border-radius: 10px; background: #fafafa; border: 1px solid #f0f0f0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.gyms-lead-row:hover { background: #f3f4f6; }
.gyms-lead-top { display: flex; justify-content: space-between; align-items: center; }
.gyms-lead-gym { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: #111; color: #fff; text-transform: uppercase; letter-spacing: .04em; }
.gyms-lead-meta { color: #666; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.gyms-lead-foot { display: flex; justify-content: space-between; font-size: 11px; color: #888; }
.gyms-lead-status { text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.gyms-gym-group { margin-bottom: 14px; }
.gyms-gym-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.gyms-gym-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #444; }
.gyms-gym-count { font-size: 11px; padding: 2px 7px; background: #eee; border-radius: 999px; }
.gyms-empty { color: #999; font-size: 12px; padding: 10px; text-align: center; }
.gyms-loading, .gyms-error { padding: 30px; text-align: center; color: #666; }
.gyms-error { color: #c00; }
.gyms-admin-panel { margin-top: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px 18px; }
.gyms-admin-panel summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.gyms-admin-section { margin-top: 14px; }
.gyms-admin-section h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #555; }
.gyms-admin-list { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gyms-admin-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fafafa; border-radius: 8px; font-size: 13px; }
.gyms-admin-list li code { font-size: 11px; background: #eee; padding: 1px 6px; border-radius: 4px; }
.gyms-admin-list li small { color: #888; margin-left: auto; }
.gyms-admin-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; padding: 10px; background: #f9fafb; border-radius: 10px; }
.gyms-admin-form input, .gyms-admin-form select { padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.gyms-admin-form button { grid-column: span 1; }

/* ============================================================
 * Visual schedule grid (added v6.3.3)
 * Scoped under .sf-sched-panel and .calendar (theme-onechai / -cantagalo / -impact)
 * ============================================================ */
.sf-sched-panel .sf-sched-block { margin-top: 24px; }
.sf-sched-panel .calendar { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; }
.sf-sched-panel .cal-header { text-align: center; margin-bottom: 16px; }
.sf-sched-panel .cal-header h2 { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.sf-sched-panel .cal-header p { color: #666; margin: 4px 0 0; }

.sf-sched-panel .calendar .week {
  display: grid; gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
@media (max-width: 1100px) { .sf-sched-panel .calendar .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .sf-sched-panel .calendar .week { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .sf-sched-panel .calendar .week { grid-template-columns: 1fr; } }

.sf-sched-panel .calendar .day { display: flex; flex-direction: column; gap: 6px; }
.sf-sched-panel .calendar .day h4 {
  background: #111; color: #fff; font-size: 0.92rem; font-weight: 800;
  text-align: center; padding: 10px 6px; margin: 0; border-radius: 4px;
}
.sf-sched-panel .calendar .classes { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.sf-sched-panel .calendar .class {
  position: relative; border-radius: 2px; padding: 10px 6px; color: #111;
  font-size: 0.78rem; font-weight: 700; text-align: center;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  line-height: 1.2; min-height: 74px; cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.sf-sched-panel .calendar .class > span { display: block; }
.sf-sched-panel .calendar .class:not(.empty-box):not(.closed):hover { transform: translateY(-1px); filter: brightness(1.06); }
.sf-sched-panel .calendar .class small { font-weight: 500; opacity: 0.85; font-size: 0.68rem; }
.sf-sched-panel .calendar .class .booking-count {
  position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 0.65rem; font-weight: 800;
}

.sf-sched-panel .calendar .empty-box { background: #bdbdbd; cursor: default; min-height: 74px; }
.sf-sched-panel .calendar .closed { background: #ececec; color: #888; font-style: italic; cursor: not-allowed; }

/* Category colors (matching reference) */
.sf-sched-panel .calendar .junior-13-15  { background: #b6dcef; color: #0e2230; }
.sf-sched-panel .calendar .sparring-nyb  { background: #f59345; color: #1a1a1a; }
.sf-sched-panel .calendar .bootcamp      { background: #c66fce; color: #fff; }
.sf-sched-panel .calendar .forts-2       { background: #111; color: #fff; }
.sf-sched-panel .calendar .bjj           { background: #1a1a1a; color: #ffd84a; }
.sf-sched-panel .calendar .nyb-1         { background: #6fcf6a; color: #0e2210; }
.sf-sched-panel .calendar .sparring-forts{ background: #d8392a; color: #fff; }
.sf-sched-panel .calendar .open-gym      { background: #fff; color: #111; border: 1px solid #e5e5e5; }

/* Black-metal Tävlings Grupp Thai */
.sf-sched-panel .calendar .class.tavlings-grupp-thai {
  position: relative; isolation: isolate; color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.75);
  background: linear-gradient(135deg, #050505 0%, #1a1a1a 18%, #3a3a3a 38%, #0f0f0f 58%, #4a4a4a 74%, #070707 100%);
  border: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -12px 20px rgba(0,0,0,0.65), 0 6px 14px rgba(0,0,0,0.16);
}
.sf-sched-panel .calendar .class.tavlings-grupp-thai::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(to bottom, rgba(255,255,255,0.40) 0%, rgba(255,255,255,0.12) 22%, rgba(255,255,255,0) 55%, rgba(0,0,0,0.40) 100%);
  mix-blend-mode: overlay; pointer-events: none; z-index: 0;
}
.sf-sched-panel .calendar .class.tavlings-grupp-thai::after {
  content: ""; position: absolute; inset: -70% -90%; border-radius: inherit;
  background: radial-gradient(circle at 28% 26%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 58%);
  transform: rotate(-12deg); opacity: 0.75; pointer-events: none; z-index: 0;
}
.sf-sched-panel .calendar .class.tavlings-grupp-thai > span { position: relative; z-index: 1; }

/* Impact variant switch */
.sf-sched-panel .impact-switch {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 16px;
  background: #f1f1f1; padding: 6px; border-radius: 999px; width: fit-content;
  margin-left: auto; margin-right: auto;
}
.sf-sched-panel .impact-switch button {
  background: transparent; border: none; padding: 8px 22px; border-radius: 999px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center;
  line-height: 1.1; color: #555;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.sf-sched-panel .impact-switch button.active { background: #111; color: #fff; transform: scale(1.03); }
.sf-sched-panel .impact-switch .big { font-weight: 800; font-size: 0.95rem; }
.sf-sched-panel .impact-switch .small { font-size: 0.7rem; opacity: 0.8; }

/* Booking overlay panel */
.sf-sched-overlay { position: fixed; inset: 0; z-index: 99999; }
.sf-sched-overlay-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.45); }
.sf-sched-overlay-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 100%; max-width: 420px;
  background: #fff; box-shadow: -8px 0 24px rgba(0,0,0,0.18);
  display: flex; flex-direction: column; overflow-y: auto; padding: 20px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}
.sf-sched-overlay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sf-sched-overlay-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; }
.sf-sched-overlay-sub { font-size: 0.85rem; color: #666; margin: 0; }
.sf-sched-overlay-close {
  background: transparent; border: none; font-size: 1.6rem; line-height: 1;
  cursor: pointer; padding: 4px 8px; color: #444;
}
.sf-sched-overlay-form { display: grid; gap: 10px; margin-top: 18px; }
.sf-sched-overlay-form label { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: #333; }
.sf-sched-overlay-form input,
.sf-sched-overlay-form textarea {
  font: inherit; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
  background: #fff; color: #111;
}
.sf-sched-overlay-form button[type="submit"] { justify-self: start; }
.sf-sched-overlay-msg { font-size: 0.8rem; color: #2a7a2a; min-height: 1em; }
.sf-sched-overlay-list { margin-top: 22px; }
.sf-sched-overlay-list h4 { font-size: 0.85rem; font-weight: 700; margin: 0 0 8px; }
.sf-sched-overlay-bookings { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sf-sched-overlay-bookings li { border: 1px solid #eee; border-radius: 6px; padding: 8px 10px; font-size: 0.82rem; }
.sf-sched-overlay-bk-name { font-weight: 700; }
.sf-sched-overlay-bk-meta { color: #666; font-size: 0.74rem; margin-top: 2px; }
.sf-sched-overlay-bk-note { margin-top: 4px; font-size: 0.78rem; }
.sf-sched-overlay-empty { color: #888; font-size: 0.82rem; }

/* ============================================================
   v6.3.12 — Admin status popover above rows, with inline price entry
   ============================================================ */
.status-pill-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  isolation: isolate;
  z-index: 2;
}
.status-pill-wrap .status-pill { cursor: pointer; }
.status-pill-wrap::before {
   content: '';
   position: absolute;
   left: -18px;
   right: -18px;
   top: 100%;
   height: 14px;
 }
 .status-pill-wrap .status-pop {
   position: absolute;
   top: calc(100% + 8px);
   left: 50%;
   transform: translate(-50%, -8px) scale(0.96);
   transform-origin: top center;
  min-width: 178px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.28),
              0 4px 10px -4px rgba(15, 23, 42, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, transform 160ms ease, visibility 0s linear 160ms;
  z-index: 9999;
}
.status-pill-wrap:hover .status-pop,
.status-pill-wrap:focus-within .status-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
  transition: opacity 140ms ease, transform 160ms ease, visibility 0s linear 0s;
}
.status-pop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  text-align: left;
  transition: background 120ms ease;
}
.status-pop-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, #94a3b8);
  flex: 0 0 auto;
}
.status-pop-item:hover,
.status-pop-item:focus {
  background: rgba(15, 23, 42, 0.06);
  outline: none;
}
.status-pop-price-row {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
}
.status-pop-price-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 4px;
  transform: translateY(-4px);
  transition: max-height 180ms ease, opacity 150ms ease, padding 180ms ease, transform 180ms ease;
}
.status-pop-price-row.is-open .status-pop-price-panel,
.status-pop-price-row:focus-within .status-pop-price-panel {
  max-height: 42px;
  opacity: 1;
  padding: 2px 4px 6px;
  transform: translateY(0);
}
.status-pop-price-input {
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 0 8px;
  color: #0f172a;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  outline: none;
}
.status-pop-price-input:focus {
  border-color: rgba(69, 110, 232, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(69, 110, 232, 0.14);
}
.status-pop-price-input.is-invalid {
  border-color: rgba(225, 87, 87, 0.8);
  box-shadow: 0 0 0 3px rgba(225, 87, 87, 0.14);
}
.status-pop-price-save {
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #456ee8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.status-pop-price-save:hover,
.status-pop-price-save:focus {
  background: #335ad0;
  outline: none;
}
/* keep popover above row click targets and neighboring rows */
.leads-row .status-pill-wrap { pointer-events: auto; }
.leads-row:hover,
.leads-row:focus-within { z-index: 80; }

/* v6.3.11 — make sure status popover isn't clipped or stacked behind row/cell */
.leads-row { overflow: visible !important; }
.leads-row .lead-row-status-cell { overflow: visible !important; position: relative; z-index: 3; }

/* v6.3.18 — lead overlay must own the stack only while it is open */
.app:has(.lead-overlay-shell.is-open) {
  isolation: isolate;
}
.app:has(.lead-overlay-shell.is-open) .layout,
.dashboard-shell:has(.lead-overlay-shell.is-open) {
  position: relative;
  z-index: 2147482000 !important;
}
.lead-overlay-shell.is-open,
.lead-overlay-shell.lead-overlay-shell--v2 {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
}
body:has(.lead-overlay-shell.is-open) .topbar,
.app:has(.lead-overlay-shell.is-open) .topbar {
  filter: blur(8px) saturate(0.95);
  pointer-events: none;
  z-index: 0 !important;
  transition: filter 220ms ease;
}

/* v6.3.20 — when mobile menu is open, navbar must sit blurred below the menu stack only then */
.app.sidebar-open .layout {
  position: relative;
  z-index: 2147482400 !important;
}
.app.sidebar-open .sidebar,
.app.sidebar-open .sidebar-overlay {
  position: fixed !important;
}
.app.sidebar-open .sidebar {
  z-index: 2147482600 !important;
}
.app.sidebar-open .sidebar-overlay {
  z-index: 2147482500 !important;
}
.app.sidebar-open .topbar {
  filter: blur(8px) saturate(0.95);
  pointer-events: none;
  z-index: 0 !important;
  transition: filter 220ms ease;
}

/* ============ v6.3.19: schedule week navigation ============ */
.panel.sf-sched-panel .panel-head { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.sf-week-nav { display:inline-flex; align-items:center; gap:8px; }
.sf-week-nav .sf-week-label { display:flex; flex-direction:column; align-items:center; min-width:140px; line-height:1.2; }
.sf-week-nav .sf-week-label strong { font-size:13px; letter-spacing:.04em; text-transform:uppercase; opacity:.9; }
.sf-week-nav .sf-week-label span { font-size:12px; opacity:.7; margin-top:2px; }
.sf-week-nav .ghost-btn { min-width:38px; padding:6px 10px; }
