@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f1f3f8;
  --surface-strong: #e8ebf2;
  --line: #dfe3eb;
  --line-strong: #cfd5df;
  --text: #323338;
  --muted: #676879;
  --accent: #00a86b;
  --accent-soft: #e8f7ef;
  --warn: #8a5a00;
  --good: #2f7d52;
  --bad: #b42318;
  --shadow: 0 18px 44px rgba(35, 44, 68, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, Inter, Segoe UI, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--surface-soft);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

button[type="submit"],
.button-link {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button[type="submit"]:hover,
.button-link:hover {
  background: #008f5d;
}

button.secondary,
.segmented button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.16);
  border-color: var(--accent);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
}

input[type="checkbox"]:focus {
  outline: 2px solid rgba(15, 118, 110, 0.16);
  outline-offset: 2px;
}

input.italic-placeholder::placeholder {
  font-style: italic;
}

input.readonly-field,
input:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

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

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

h1 {
  font-size: 20px;
  font-weight: 700;
}

h2 {
  font-size: 30px;
  font-weight: 750;
}

h3 {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}

.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

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

.login-card {
  width: min(100%, 380px);
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.login-card p {
  margin-top: 6px;
  color: var(--muted);
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand img {
  width: 48px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
}

.brand h1 {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

.topbar-actions {
  position: relative;
  display: grid;
  grid-template-columns: minmax(100px, auto) auto auto;
  gap: 6px;
  align-items: center;
}

.current-user {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.icon-only {
  width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.icon-only svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-menu {
  position: relative;
}

.settings-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 10;
  min-width: 170px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.settings-panel button {
  min-height: 32px;
  justify-content: start;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.settings-panel button:hover {
  background: var(--surface-soft);
}

.profile-page {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(47, 52, 55, 0.26);
}

.profile-card {
  width: min(100%, 460px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding-bottom: 4px;
}

.profile-card-header h2 {
  margin-top: 4px;
  font-size: 24px;
}

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

.managed-profile-note {
  color: var(--muted);
  font-size: 13px;
}

.profile-actions .button-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  min-height: 38px;
  padding: 0 12px;
  text-decoration: none;
}

.availability-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.availability-card h3 {
  margin-bottom: 4px;
}

.availability-time-grid,
.duration-control,
.meeting-schedule-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.availability-days,
.quick-slot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: end;
}

.availability-days button,
.quick-slot-buttons button {
  min-height: 34px;
  border-color: var(--line);
  color: var(--muted);
  background: #ffffff;
}

.availability-days button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.quick-slot-buttons button {
  padding: 0 12px;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  min-height: calc(100vh - 82px);
  align-items: start;
  padding: 18px;
  background: var(--bg);
}

.workspace.detail-open {
  grid-template-columns: minmax(390px, 42vw) minmax(0, 1fr);
}

.lead-board {
  min-width: 0;
  display: grid;
  align-content: start;
}

.detail {
  min-width: 0;
  background: transparent;
  border-left: 0;
}

.workspace:not(.detail-open) .detail {
  display: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: none;
}

.lead-table-panel {
  min-width: 0;
  min-height: calc(100vh - 118px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  background: #ffffff;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding-bottom: 12px;
}

.database-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-menu {
  position: relative;
}

.database-icon-button {
  width: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 2px;
  border-color: var(--line);
  background: #ffffff;
}

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

.database-icon {
  display: inline-block;
  flex: 0 0 auto;
}

.database-icon {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 7px / 11px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 13px / 11px 1px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 8px 19px / 11px 1px no-repeat,
  var(--surface-soft);
  border: 1px solid var(--line);
}

.view-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 12;
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.view-panel button {
  justify-content: start;
  border: 0;
  background: transparent;
  text-align: left;
}

.view-panel button:hover,
.view-panel button.active {
  background: var(--surface-soft);
  color: var(--text);
}

.property-name {
  display: inline-block;
}

.wide-input {
  max-width: 420px;
  margin: 0 0 14px;
  border-color: transparent;
  background: var(--surface-soft);
}

.wide-input:hover,
.wide-input:focus {
  border-color: var(--line);
}

.lead-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.stage-filter {
  width: min(220px, 42vw);
  min-height: 32px;
  background: #ffffff;
}

.sort-field {
  width: min(170px, 34vw);
  min-height: 32px;
  background: #ffffff;
}

.sort-filter-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.sort-direction {
  min-height: 32px;
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mobile-sort-control {
  display: none;
}

.segmented {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 12px;
  color: var(--muted);
}

.segmented button.active {
  border-color: var(--surface);
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

#new-lead-toggle {
  min-height: 32px;
  color: var(--text);
  border-color: var(--line);
  background: #ffffff;
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(47, 52, 55, 0.26);
}

.lead-modal-card {
  position: relative;
  width: min(100%, 480px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.lead-modal-header {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-right: 48px;
}

.lead-list {
  max-height: calc(100vh - 190px);
  overflow: auto;
  border-top: 1px solid var(--line);
}

.events-view {
  display: grid;
}

.events-list {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.event-day {
  display: grid;
  gap: 8px;
}

.event-day h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.event-day-list {
  display: grid;
  gap: 8px;
}

.event-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  text-align: left;
}

.event-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.event-time {
  color: var(--text);
  font-weight: 750;
}

.event-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.event-open {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.event-open:hover {
  background: transparent;
  color: var(--accent);
}

.event-main strong,
.event-main span,
.event-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-main small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.event-type {
  justify-self: end;
}

.event-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.event-call-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 750;
  text-decoration: none;
}

.event-call-button:hover {
  background: #136761;
  color: #ffffff;
}

.event-icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
}

.event-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.event-icon-button.danger {
  border-color: rgba(181, 75, 75, 0.32);
  color: var(--bad);
}

.lead-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.lead-table col:nth-child(1) {
  width: 20%;
}

.lead-table col:nth-child(2) {
  width: 25%;
}

.lead-table col:nth-child(3) {
  width: 12%;
}

.lead-table col:nth-child(4) {
  width: 10%;
}

.lead-table col:nth-child(5) {
  width: 16%;
}

.lead-table col:nth-child(6) {
  width: 12%;
}

.lead-table col:nth-child(7) {
  width: 5%;
}

.lead-table th,
.lead-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.lead-table th:last-child,
.lead-table td:last-child {
  border-right: 0;
}

.lead-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.sort-header {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-size: inherit;
  font-weight: 650;
}

.sort-header .property-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-header:hover {
  background: transparent;
  color: var(--text);
}

.sort-header.active {
  color: var(--text);
}

.sort-indicator {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.sort-header.active .sort-indicator {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.source-select {
  width: 100%;
  min-width: 116px;
  min-height: 32px;
  padding: 5px 28px 5px 9px;
  border-color: var(--line);
  border-radius: 999px;
  background-color: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.source-select:focus {
  border-color: var(--accent);
}

.source-select:disabled {
  opacity: 0.7;
}

.lead-row {
  cursor: pointer;
}

.lead-row:hover,
.lead-row.active {
  background: var(--surface-soft);
}

.lead-title-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lead-title-cell strong {
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-row.unread {
  font-weight: 400;
}

.lead-row:not(.unread) {
  color: #3f4447;
  font-weight: 400;
}

.lead-row:not(.unread) strong {
  font-weight: 400;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: max-content;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
}

.stage-badge {
  max-width: 100%;
  min-width: 0;
}

.stage-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-count-chip {
  min-width: 21px;
  min-height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0 5px;
  border: 1px solid rgba(47, 52, 55, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.badge.new {
  color: #0b7a35;
  background: #dff7e9;
}

.badge.flag {
  color: #c21e1e;
  background: #fde2e2;
}

.badge.stage {
  color: var(--muted);
  background: var(--surface-strong);
}

.badge.contacted {
  color: #4f5963;
  background: #eef1f3;
}

.badge.connected {
  color: #087053;
  background: #dff7ef;
}

.badge.follow-up {
  color: #315f9c;
  background: #e9eef7;
}

.badge.re-engage {
  color: #7a2e75;
  background: #f6e7f5;
}

.badge.disqualified {
  color: var(--bad);
  background: #f7ecec;
}

.badge.invalid-phone {
  color: var(--bad);
  background: #f7ecec;
}

.badge.not-ready {
  color: #6f4e00;
  background: #fff4d6;
}

.badge.meeting {
  color: #4f5963;
  background: #eef1f3;
}

.badge.proposal {
  color: #1d4ed8;
  background: #e4efff;
}

.badge.under-contract {
  color: #1d4ed8;
  background: #e4efff;
}

.badge.closed {
  color: var(--good);
  background: #eaf5ef;
}

.stacked-form {
  display: grid;
  gap: 10px;
}

.duration-control label:last-child {
  max-width: 160px;
}

.meeting-invite-fields {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.hidden {
  display: none !important;
}

.empty-state {
  min-height: calc(100vh - 118px);
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

#lead-detail {
  min-height: calc(100vh - 118px);
  display: grid;
  align-content: start;
  gap: 14px;
  background: transparent;
}

.detail-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding: 28px 76px 18px 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.detail-header h2 {
  margin: 4px 0;
  font-size: 28px;
}

.lead-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0;
}

.lead-title-line h2 {
  margin: 0;
}

.lead-header-stage {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.lead-stage-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.stage-trigger {
  border: 0;
  background: transparent;
  min-height: 24px;
  padding: 0;
}

.stage-trigger:hover {
  background: transparent;
}

.stage-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 14;
  width: max-content;
  min-width: 230px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.stage-menu button {
  min-height: 34px;
  justify-content: start;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.stage-menu button:hover,
.stage-menu button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.kicker {
  color: var(--muted);
  font-weight: 650;
  text-transform: none;
  font-size: 12px;
}

#lead-subtitle {
  color: var(--muted);
}

.detail-tools {
  display: flex;
  align-items: start;
  gap: 10px;
}

#close-detail.close-detail-button,
#new-lead-close.close-detail-button,
#profile-close.close-detail-button {
  position: absolute;
  top: 18px;
  right: 24px;
  border: 1px solid var(--accent) !important;
  border-radius: 999px;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

#close-detail.close-detail-button:hover,
#new-lead-close.close-detail-button:hover,
#profile-close.close-detail-button:hover {
  border-color: var(--accent);
  background: #d7ebe7 !important;
  color: var(--accent);
}

#new-lead-close.close-detail-button,
#profile-close.close-detail-button {
  top: 16px;
  right: 16px;
}

.profile-card {
  position: relative;
}

.status-editor {
  min-width: 190px;
}

.icon-button {
  min-width: 68px;
}

#lead-detail > .panel,
.actions-section {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 18px 32px;
}

#lead-detail > .panel {
  border-bottom: 1px solid var(--line);
}

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

.detail-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.detail-card h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.detail-card-header {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 10px;
}

.detail-card-header h4 {
  margin: 0;
}

.inline-edit-button {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  min-height: 28px;
  padding: 0 10px;
}

.submitted-form-editor-block {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
}

.submitted-form-editor-block h4 {
  font-size: 14px;
  margin: 0;
}

.submitted-form-editor {
  display: grid;
  gap: 10px;
}

.source-data {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.source-data dt,
.source-data dd {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.source-data dt {
  color: var(--muted);
  font-weight: 600;
}

.source-data dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.map-link {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-right: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
}

.map-link:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.property-map-embed {
  width: 100%;
  max-width: 520px;
  height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.property-map-embed iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.source-data dt:nth-last-child(2),
.source-data dd:last-child {
  border-bottom: 0;
}

.actions-section {
  border-bottom: 1px solid var(--line);
}

.action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.action-tabs button {
  min-height: 30px;
  border-color: var(--line);
  color: var(--muted);
}

.action-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.email-meta-line {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.email-meta-line a {
  color: var(--accent);
  text-decoration: none;
}

.email-meta-line a:hover {
  text-decoration: underline;
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.template-tabs button {
  min-height: 28px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.template-tabs button.active {
  border-color: var(--surface);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.inline-check input {
  flex: 0 0 auto;
}

.email-attachment-option {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.action-empty-state {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.action-panel-grid {
  margin-top: 12px;
}

.action-panel {
  animation: action-panel-in 120ms ease-out;
}

@keyframes action-panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.detail-grid .panel,
.activity-grid .panel {
  border-radius: 10px;
  padding: 14px;
}

.button-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 650;
}

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

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

.activity-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: grid;
  gap: 4px;
}

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

.activity-item p {
  white-space: pre-wrap;
}

.email-activity-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.email-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.email-status.sent {
  background: #e4efff;
  color: #1d4ed8;
}

.email-status.draft {
  background: var(--surface-strong);
  color: var(--muted);
}

.activity-item time,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.checkbox-row input {
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  background: #2f3437;
  color: #ffffff;
  padding: 12px 14px;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .workspace,
  .workspace.detail-open,
  .detail-grid,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .detail {
    border-left: 0;
    border-top: 0;
  }

  .lead-table-panel {
    padding: 20px 14px 0;
  }

  .lead-list {
    max-height: 420px;
  }

  .panel-heading,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

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

  .topbar-actions {
    grid-template-columns: 1fr auto auto;
  }

  .brand {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .brand img {
    width: 48px;
    height: 42px;
  }

  .brand h1 {
    padding-left: 0;
    border-left: 0;
  }

  .lead-bar-actions,
  .segmented {
    justify-content: start;
    flex-wrap: wrap;
  }

  .detail-tools {
    flex-direction: column;
  }

  .source-data {
    grid-template-columns: 1fr;
  }

  .source-data dt {
    min-height: 24px;
    border-bottom: 0;
  }

  .source-data dd {
    min-height: 30px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .topbar {
    min-height: auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand img {
    width: 42px;
    height: 38px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .brand {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .topbar-actions {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .current-user {
    text-align: left;
  }

  .lead-table-panel {
    min-height: auto;
    padding: 14px 10px 0;
  }

  .workspace.detail-open {
    display: block;
  }

  .workspace.detail-open .lead-board {
    display: none;
  }

  .workspace.detail-open .detail {
    display: block;
    min-height: calc(100dvh - 112px);
    border-top: 0;
  }

  .panel-heading {
    gap: 10px;
    padding-bottom: 10px;
  }

  .database-title h2 {
    font-size: 24px;
  }

  .lead-bar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .stage-filter {
    width: 100%;
  }

  .mobile-sort-control {
    display: inline-flex;
  }

  select.mobile-sort-control {
    display: block;
  }

  .sort-filter-label {
    align-self: center;
  }

  .sort-field {
    width: 100%;
  }

  .sort-direction {
    padding: 0 9px;
  }

  .stage-filter-label {
    grid-column: 1;
  }

  .stage-filter {
    grid-column: 2 / 4;
  }

  .sort-filter-label {
    grid-column: 1;
  }

  .sort-field {
    grid-column: 2;
  }

  .sort-direction {
    grid-column: 3;
  }

  #new-lead-toggle {
    grid-column: 1 / 4;
    grid-row: 3;
    justify-self: start;
  }

  #new-lead-toggle {
    padding: 0 9px;
    white-space: nowrap;
  }

  .wide-input {
    width: 100%;
    max-width: none;
  }

  .lead-bar-actions .toolbar-search {
    grid-column: 1 / 4;
    grid-row: 4;
    min-width: 0;
    max-width: none;
  }

  .lead-list {
    max-height: none;
    overflow: visible;
    border-top: 0;
  }

  .events-list {
    border-top: 0;
  }

  .event-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .event-type {
    justify-self: start;
  }

  .event-actions {
    justify-content: flex-start;
  }

  .event-main strong,
  .event-main span,
  .event-main small {
    white-space: normal;
  }

  .lead-table,
  .lead-table colgroup,
  .lead-table thead,
  .lead-table tbody,
  .lead-table tr,
  .lead-table td {
    display: block;
    width: 100%;
  }

  .lead-table thead,
  .lead-table colgroup {
    display: none;
  }

  .lead-row {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .lead-table td {
    min-height: 0;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 7px 0;
    overflow: visible;
  }

  .lead-table td:last-child {
    border-bottom: 0;
  }

  .lead-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }

  .lead-title-cell strong {
    white-space: normal;
  }

  .stage-badge,
  .badge {
    max-width: 100%;
  }

  .lead-table td[data-label="Stage"] {
    align-items: center;
  }

  .lead-table td[data-label="Stage"] .badge {
    justify-self: start;
    max-width: min(100%, max-content);
    width: fit-content;
  }

  .detail-header {
    padding: 58px 16px 16px;
  }

  #lead-detail {
    min-height: calc(100dvh - 112px);
  }

  #close-detail.close-detail-button {
    top: 14px;
    right: 16px;
  }

  .detail-header h2 {
    font-size: 24px;
  }

  .lead-title-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .status-editor {
    width: 100%;
    min-width: 0;
  }

  #lead-detail > .panel,
  .actions-section {
    padding: 14px 16px;
  }

  .activity-grid {
    padding: 0;
  }

  .detail-card,
  .detail-grid .panel,
  .activity-grid .panel {
    padding: 12px;
  }

  .action-tabs {
    gap: 5px;
  }

  .action-tabs button {
    flex: 1 1 92px;
  }

  .lead-modal,
  .profile-page {
    padding: 12px;
    align-items: start;
  }

  .lead-modal-card,
  .profile-card {
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .availability-time-grid,
  .duration-control,
  .meeting-schedule-row {
    grid-template-columns: 1fr;
  }

  .duration-control label:last-child {
    max-width: none;
  }

  .quick-slot-buttons {
    align-items: center;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* Modular Home PM visual alignment */
:root {
  color-scheme: light;
  --bg: var(--fs-bg, #f4f1eb);
  --surface: var(--fs-panel, #fffdf8);
  --surface-soft: var(--fs-panel-strong, #f8f5ee);
  --surface-strong: #e7e2d8;
  --line: var(--fs-line, #ddd8cf);
  --line-strong: #b8b0a4;
  --text: var(--fs-ink, #1f2424);
  --muted: var(--fs-muted, #6d746f);
  --accent: var(--fs-teal, #1b7f78);
  --accent-soft: var(--fs-teal-soft, #dff1ed);
  --warn: #74480f;
  --good: var(--fs-green, #347a3b);
  --bad: var(--fs-rose, #b54b4b);
  --gold: var(--fs-gold, #b9731f);
  --gold-soft: var(--fs-gold-soft, #f8e7c5);
  --rose-soft: var(--fs-rose-soft, #f5dddd);
  --green-soft: var(--fs-green-soft, #e0efdf);
  --shadow: var(--fs-shadow, 0 18px 45px rgba(45, 38, 29, 0.06));
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

button {
  min-height: 38px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

button[type="submit"],
.button-link {
  border-color: #232826;
  border-radius: 8px;
  background: #232826;
  color: #fffdf8;
}

button[type="submit"]:hover,
.button-link:hover {
  border-color: #313734;
  background: #313734;
}

input,
select,
textarea {
  min-height: 42px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(27, 127, 120, 0.16);
}

h1 {
  font-size: 20px;
  font-weight: 700;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.08;
}

h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.app-shell,
.workspace {
  background: var(--bg);
}

.login-screen {
  background: var(--bg);
}

.login-card,
.profile-card,
.lead-modal-card,
.panel,
.lead-table-panel,
.detail-header,
.empty-state,
#lead-detail > .panel,
.actions-section,
.activity-grid .panel,
.detail-grid .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card {
  gap: 14px;
  padding: 24px;
}

.login-card h1 {
  font-size: 30px;
  line-height: 1.05;
}

.topbar {
  min-height: 74px;
  border-bottom: 0;
  background: #232826;
  color: #fffdf8;
  padding: 10px 24px;
}

.brand img {
  width: 48px;
  height: 42px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  padding: 0;
}

.brand h1 {
  border-left-color: #49514d;
  color: #fffdf8;
}

.current-user {
  color: #c5c7be;
}

.topbar .icon-only {
  border-color: #49514d;
  background: #313734;
  color: #ece7dc;
}

.topbar .icon-only:hover {
  background: #3b433f;
  color: #ffffff;
}

.settings-panel,
.view-panel {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-panel button:hover,
.view-panel button:hover,
.view-panel button.active {
  background: var(--surface-soft);
}

.workspace {
  gap: 16px;
  min-height: calc(100vh - 74px);
  padding: 26px;
}

.workspace.detail-open {
  grid-template-columns: minmax(390px, 42vw) minmax(0, 1fr);
}

.lead-table-panel {
  min-height: calc(100vh - 126px);
  padding: 18px;
}

.panel-heading {
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.database-title h2 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.02;
}

.database-icon-button,
.icon-only {
  width: 38px;
  min-height: 38px;
  border-radius: 8px;
}

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

.database-icon {
  border-color: var(--line);
  background:
    linear-gradient(var(--accent), var(--accent)) 8px 7px / 11px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 13px / 11px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 8px 19px / 11px 1px no-repeat,
    var(--accent-soft);
}

.lead-bar-actions {
  gap: 10px;
}

.lead-bar-actions .toolbar-search {
  flex: 1 1 260px;
  min-width: 220px;
  max-width: 420px;
  margin: 0;
}

.stage-filter-label,
.sort-filter-label,
label,
.kicker,
.activity-item time,
.muted,
.email-meta-line,
.action-empty-state {
  color: var(--muted);
}

.stage-filter,
.sort-field,
.sort-direction,
#new-lead-toggle {
  min-height: 38px;
}

.sort-direction,
#new-lead-toggle {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.wide-input {
  max-width: 420px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.lead-bar-actions .wide-input {
  margin-bottom: 0;
}

.lead-list,
.events-list {
  border-top-color: var(--line);
}

.lead-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.lead-table th,
.lead-table td {
  border-bottom-color: var(--line);
  border-right-color: var(--line);
  padding: 11px 12px;
}

.lead-table th {
  background: #232826;
  color: #fffdf8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.sort-header {
  color: inherit;
  font-weight: 700;
}

.sort-header:hover,
.sort-header.active {
  color: #ffffff;
}

.sort-indicator {
  border-color: #49514d;
  background: #313734;
  color: #c5c7be;
}

.lead-row {
  background: var(--surface);
}

.lead-row:hover,
.lead-row.active {
  background: var(--surface-soft);
}

.lead-row.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.lead-title-cell strong {
  font-weight: 400;
}

.badge,
.email-status,
.lead-header-stage .badge {
  min-height: 24px;
  border-radius: 999px;
  font-weight: 700;
}

.badge.new,
.badge.connected,
.badge.closed,
.email-status.sent {
  background: var(--green-soft);
  color: var(--good);
}

.badge.follow-up {
  background: #e9eef7;
  color: #315f9c;
}

.badge.re-engage {
  background: #f6e7f5;
  color: #7a2e75;
}

.badge.flag,
.badge.disqualified,
.badge.invalid-phone {
  background: var(--rose-soft);
  color: var(--bad);
}

.badge.not-ready {
  background: var(--gold-soft);
  color: var(--warn);
}

.badge.stage,
.badge.contacted,
.badge.meeting,
.email-status.draft {
  background: var(--surface-strong);
  color: var(--muted);
}

.badge.proposal,
.badge.under-contract {
  background: var(--accent-soft);
  color: var(--accent);
}

.stage-count-chip {
  border-color: rgba(31, 36, 36, 0.12);
  background: rgba(255, 253, 248, 0.85);
}

.event-item,
.detail-card,
.meeting-invite-fields,
.availability-card,
.email-attachment-option {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.event-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.empty-state {
  min-height: calc(100vh - 126px);
}

.detail-header {
  padding: 28px 76px 20px 32px;
}

.detail-header h2 {
  font-size: 30px;
  font-weight: 700;
}

#lead-detail {
  min-height: calc(100vh - 126px);
  gap: 14px;
}

#lead-detail > .panel,
.actions-section {
  padding: 18px 32px;
}

#close-detail.close-detail-button,
#new-lead-close.close-detail-button,
#profile-close.close-detail-button {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}

.source-data dt,
.source-data dd,
.activity-item,
.lead-sections {
  border-color: var(--line);
}

.action-tabs,
.template-tabs,
.segmented {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.action-tabs button,
.template-tabs button,
.segmented button {
  border-radius: 8px;
}

.action-tabs button.active,
.template-tabs button.active,
.segmented button.active,
.availability-days button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

.map-link {
  border-color: var(--line);
  border-radius: 999px;
  color: var(--accent);
}

.property-map-embed {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.toast {
  border-radius: 8px;
  background: #232826;
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .workspace {
    padding: 18px;
  }

  .brand img {
    width: 48px;
    height: 42px;
  }

  .lead-table-panel {
    padding: 18px;
  }
}

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

  .brand img {
    width: 42px;
    height: 38px;
  }

  .workspace {
    padding: 14px;
  }

  .lead-table-panel {
    padding: 14px 10px;
  }

  .lead-row {
    border-color: var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .lead-table {
    border: 0;
    border-radius: 0;
  }

  .lead-table td {
    border-bottom-color: var(--line);
  }
}

/* Sidebar navigation and full-detail layout */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  background: #232826;
  color: #faf7ee;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  padding: 24px 18px;
}

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

.sidebar .brand img {
  height: 42px;
  object-fit: contain;
  width: 48px;
}

.sidebar .brand strong,
.sidebar .brand span {
  display: block;
}

.sidebar .brand strong {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar .brand span {
  color: #c5c7be;
  font-size: 12px;
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-button {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #ece7dc;
  display: flex;
  font-weight: 400;
  gap: 10px;
  justify-content: start;
  min-height: 42px;
  padding: 0 10px;
  position: relative;
  text-align: left;
  width: 100%;
}

.nav-button svg {
  fill: none;
  flex: 0 0 auto;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.nav-button span {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
}

.nav-counter {
  align-items: center;
  background: #dc2626;
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-height: 18px;
  min-width: 18px;
  padding: 2px 5px;
  pointer-events: none;
  position: absolute;
  right: 7px;
  top: 5px;
  z-index: 1;
}

.nav-button:hover,
.nav-button.active,
.sidebar-settings:has(.settings-panel:not(.hidden)) > .nav-button {
  background: #313734;
  border-color: #49514d;
  color: #ffffff;
}

.sidebar-settings {
  display: grid;
  gap: 7px;
  position: relative;
}

.sidebar .settings-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 0 0 0 32px;
  position: static;
}

.sidebar .settings-panel button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c5c7be;
  justify-content: start;
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
}

.sidebar .settings-panel button:hover {
  background: #313734;
  border-color: #49514d;
  color: #ffffff;
}

.sidebar-footer {
  align-items: center;
  color: #c5c7be;
  display: flex;
  gap: 8px;
  margin-top: auto;
  min-width: 0;
}

.sync-dot {
  background: #d49b31;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.sync-dot.online {
  background: #48b675;
}

.sidebar-footer .current-user {
  color: #ece7dc;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar {
  display: none;
}

.workspace {
  min-height: 100vh;
  padding: 26px;
}

.workspace.detail-open {
  grid-template-columns: 1fr;
}

.workspace.detail-open .lead-board {
  display: none;
}

.workspace.detail-open .detail {
  display: block;
}

.lead-table-panel,
.empty-state,
#lead-detail {
  min-height: calc(100vh - 52px);
}

.panel-heading {
  align-items: center;
}

.lead-bar-actions {
  align-items: center;
  display: flex;
}

.stage-filter-label {
  align-self: center;
  min-width: 42px;
  text-align: right;
}

.stage-filter {
  width: min(276px, 34vw);
}

.status-editor {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(220px, 240px);
  min-width: 0;
}

.status-editor label {
  align-self: center;
  display: block;
  margin: 0;
}

.status-editor select {
  width: 100%;
}

.detail-header {
  align-items: center;
}

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

  .sidebar {
    gap: 14px;
    height: 116px;
    min-height: auto;
    max-height: 116px;
    overflow: visible;
    padding: 16px;
    position: relative;
    z-index: 20;
  }

  .nav-list {
    align-items: start;
    grid-auto-rows: 42px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: 42px;
    position: relative;
  }

  .nav-button {
    height: 42px;
    justify-content: center;
    max-height: 42px;
    min-height: 42px;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar .settings-panel {
    background: #232826;
    border: 1px solid #49514d;
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(45, 38, 29, 0.16);
    min-width: 190px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
  }

  .sidebar-footer {
    display: none;
  }

  .workspace {
    align-content: start;
    align-items: start;
    min-height: auto;
    padding: 18px;
  }

  .workspace.events-active,
  .workspace.statistics-active {
    padding-top: 10px;
  }

  .lead-table-panel,
  .empty-state,
  #lead-detail {
    min-height: auto;
  }

  .workspace.events-active .lead-table-panel,
  .workspace.statistics-active .lead-table-panel {
    margin-top: 0;
  }

  .stage-filter {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .nav-button span {
    display: none;
  }

  .sidebar .brand span {
    display: none;
  }

  .sidebar .brand strong {
    font-size: 15px;
  }

  .workspace {
    padding: 14px;
  }

  .workspace.events-active,
  .workspace.statistics-active {
    padding-top: 10px;
  }

  .workspace.events-active .lead-table-panel,
  .workspace.statistics-active .lead-table-panel {
    margin-top: 0;
  }

  .lead-bar-actions {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .stage-filter-label {
    grid-column: 1;
    text-align: left;
  }

  .stage-filter {
    grid-column: 2;
  }

  .status-editor {
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }
}

/* Keep the lead detail controls on one aligned row. */
.detail-header {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 28px 32px 20px;
}

.detail-header > div:not(.detail-tools) {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.detail-header .detail-tools {
  align-items: center;
  grid-column: 2;
  grid-row: 1;
}

#close-detail.close-detail-button {
  grid-column: 3;
  grid-row: 1;
  position: static;
}

@media (max-width: 680px) {
  .detail-header {
    grid-template-columns: 1fr auto;
    padding: 18px 16px;
  }

  .detail-header > div:not(.detail-tools) {
    grid-column: 1 / -1;
  }

  .detail-header .detail-tools {
    grid-column: 1;
    grid-row: 2;
  }

  #close-detail.close-detail-button {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Modular PM dashboard structure for Lead Tracker. */
.lead-board {
  display: grid;
  gap: 16px;
}

.workspace-heading h2 {
  color: var(--text);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.02;
  margin-top: 3px;
}

.lead-dashboard-metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 0;
  padding: 14px;
}

.metric-action {
  display: block;
  width: 100%;
  text-align: left;
}

.metric-action:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(35, 44, 68, 0.12);
}

.metric-action:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(27, 127, 120, 0.18);
  outline-offset: 2px;
}

.metric-action.metric-danger .metric-icon {
  background: #feeceb;
  color: var(--bad);
}

.metric-action.metric-danger strong {
  color: var(--bad);
}

.metric-action-card,
.metric-data-card {
  height: 176px;
}

.metric-card-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--text) !important;
  font-size: 13px;
  font-weight: 750;
}

.metric-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 8px;
  color: var(--accent);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  margin-bottom: 0;
  width: 32px;
}

.metric-icon svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
}

.metric-card strong {
  color: var(--text);
  display: block;
  font-size: 26px;
  line-height: 1;
  margin: 6px 0;
}

.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}

.metric-value-row strong {
  margin: 0;
}

.metric-week-chart {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  height: 72px;
  margin-top: 8px;
}

.metric-week-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 4px;
  min-width: 0;
}

.metric-week-bar-area {
  display: flex;
  align-items: end;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.metric-week-bar {
  width: min(34px, 62%);
  min-height: 0;
  border-radius: 5px 5px 0 0;
  background: var(--accent);
}

.metric-week-count {
  position: absolute;
  top: 0;
  right: 3px;
  color: var(--text) !important;
  font-size: 11px;
  font-weight: 750;
}

.metric-week-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-distribution {
  display: grid;
  gap: 8px;
  max-height: 106px;
  margin-top: 10px;
  overflow: auto;
  padding-right: 3px;
}

.metric-distribution-section {
  display: grid;
  gap: 4px;
}

.metric-distribution-title {
  color: var(--text) !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-distribution-row {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(50px, 0.8fr) auto;
  gap: 7px;
  align-items: center;
  font-size: 11px;
}

.metric-distribution-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-distribution-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.metric-distribution-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.metric-distribution-row b {
  color: var(--text);
  font-size: 11px;
}

.metric-breakdown {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  max-height: 76px;
  overflow: auto;
}

.metric-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-breakdown-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-breakdown-row b {
  color: var(--text);
  font-size: 12px;
}

.connections-view {
  display: grid;
  gap: 14px;
}

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

.connections-checked {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.connections-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.connections-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.connections-table th,
.connections-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.connections-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-soft);
}

.connections-table tr:last-child td {
  border-bottom: 0;
}

.connection-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.connection-status-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.connection-status-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connection-row.ok .connection-status-icon,
.connection-status-pill.ok {
  border-color: rgba(14, 133, 81, 0.24);
  background: #e7f7ef;
  color: #0e8551;
}

.connection-row.warning .connection-status-icon,
.connection-status-pill.warning {
  border-color: rgba(142, 109, 34, 0.24);
  background: #fff5d8;
  color: #8e6d22;
}

.connection-row.error .connection-status-icon,
.connection-status-pill.error {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fdecec;
  color: #b42318;
}

.connection-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.connection-copy strong {
  color: var(--text);
  font-size: 14px;
}

.connection-copy span,
.connection-copy small {
  color: var(--muted);
  font-size: 12px;
}

.connection-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.connection-detail {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.lead-table-panel {
  min-height: auto;
  padding: 18px;
}

.lead-table-panel .panel-heading {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 0;
}

.database-title {
  display: block;
}

.database-title .kicker {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.database-title h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}

#new-lead-toggle {
  background: #232826;
  border-color: #232826;
  color: #fffdf8;
}

#new-lead-toggle:hover {
  background: #313734;
  border-color: #313734;
}

.statistics-view {
  display: grid;
  gap: 16px;
}

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

.metric-card.compact {
  min-height: 118px;
  padding: 18px;
}

.metric-card.compact strong {
  font-size: 28px;
  margin: 18px 0 6px;
}

.statistics-map-card,
.statistics-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.statistics-section-heading .kicker {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.statistics-section-heading h3 {
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 2px;
}

.statistics-map {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 560px;
  margin: 0 auto;
  max-width: 860px;
  overflow: hidden;
  position: relative;
  width: min(100%, 860px);
  z-index: 0;
}

.statistics-map .leaflet-container,
.leaflet-container {
  font-family: inherit;
}

.statistics-map-message {
  align-items: center;
  display: grid;
  height: 100%;
  justify-items: center;
  margin: 0;
  padding: 24px;
  text-align: center;
}

.statistics-breakdowns {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.statistics-bars {
  display: grid;
  gap: 12px;
}

.statistics-bar-row {
  display: grid;
  gap: 6px;
}

.statistics-bar-label {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.statistics-bar-label span {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-bar-label strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
}

.statistics-bar-track {
  background: #e7e3d8;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.statistics-bar-track span {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.statistics-bar-row small {
  color: var(--muted);
  font-size: 11px;
}

.statistics-map-fallback {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.statistics-map-fallback-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 0;
}

.statistics-map-fallback-row:last-child {
  border-bottom: 0;
}

.statistics-map-fallback-row strong,
.statistics-map-fallback-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wide-input {
  margin-bottom: 16px;
}

@media (max-width: 980px) {
  .lead-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .statistics-map {
    height: 420px;
  }
}

/* Modular PM handoff */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-home {
  width: 100%;
  min-height: 0;
  justify-content: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand-home:hover {
  background: transparent;
}

.sidebar-footer {
  justify-content: space-between;
}

.sidebar-logout {
  min-height: 30px;
  padding: 0 10px;
  border-color: #49514d;
  background: transparent;
  color: #ece7dc;
  font-size: 12px;
}

.sidebar-logout:hover {
  background: #313734;
  color: #ffffff;
}

.row-icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  justify-self: center;
}

.row-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.row-icon-button.danger {
  border-color: rgba(181, 75, 75, 0.28);
  color: var(--bad);
}

.action-tabs {
  align-items: center;
}

.action-tabs button {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  white-space: nowrap;
}

.stacked-form button[type="submit"],
.button-link {
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 24px 20px;
}

.detail-header > div:not(.detail-tools) {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

#close-detail.close-detail-button {
  grid-column: 2;
  grid-row: 1;
  position: static;
}

@media (max-width: 980px) {
  .sidebar {
    height: auto;
    max-height: none;
    overflow: hidden;
  }

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

  .sidebar-footer {
    display: flex;
  }

  .workspace.events-active,
  .workspace.statistics-active {
    padding-top: 18px;
  }

  .detail-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    padding: 24px 24px 20px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    gap: 16px;
    padding: 16px 14px 14px;
  }

  .sidebar .brand {
    gap: 12px;
  }

  .sidebar .brand img {
    width: 52px;
    height: 46px;
  }

  .sidebar .brand strong {
    font-size: 20px;
  }

  .sidebar .brand span,
  .nav-button span {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    height: auto;
  }

  .nav-button {
    min-height: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
  }

  .nav-button svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-footer {
    gap: 10px;
  }

  .sidebar-footer .current-user {
    font-size: 13px;
  }

  .workspace {
    max-width: 100vw;
    overflow-x: hidden;
    padding: 16px 12px 22px;
  }

  .workspace-heading h2 {
    font-size: clamp(32px, 14vw, 48px);
    line-height: 0.98;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .lead-board,
  .statistics-view,
  .events-view,
  .statistics-map-card,
  .statistics-card,
  .lead-table-panel {
    min-width: 0;
    max-width: 100%;
  }

  .lead-dashboard-metrics,
  .statistics-metrics,
  .statistics-breakdowns {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-card {
    min-height: auto;
  }

  .lead-table-panel {
    padding: 14px 12px;
    overflow: hidden;
  }

  .lead-table td {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .lead-table td[data-label="Actions"] {
    grid-template-columns: 76px auto;
    align-items: center;
  }

  .row-icon-button {
    justify-self: start;
  }

  .detail-header {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 18px 16px;
  }

  .lead-title-line {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .lead-title-line h2 {
    font-size: clamp(28px, 10vw, 40px);
    line-height: 1;
    min-width: 0;
  }

  .action-tabs button {
    flex: 0 0 auto;
  }

  .stacked-form button[type="submit"],
  .button-link {
    width: fit-content;
  }
}

/* Final layout polish for mobile header, dashboard controls, and lead detail actions. */
.lead-table-panel .database-title {
  display: none;
}

.lead-table-panel .panel-heading:has(.lead-bar-actions.hidden) {
  display: none;
}

.lead-table col:nth-child(1) {
  width: 21%;
}

.lead-table col:nth-child(2) {
  width: 28%;
}

.lead-table col:nth-child(3) {
  width: 13%;
}

.lead-table col:nth-child(4) {
  width: 11%;
}

.lead-table col:nth-child(5) {
  width: 15%;
}

.lead-table col:nth-child(6) {
  width: 12%;
}

.sort-direction,
#new-lead-toggle {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 0 14px;
  width: fit-content;
}

.detail-card-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.inline-icon-button {
  align-items: center;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
  width: 36px;
}

.inline-icon-button svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.inline-icon-button.danger {
  border-color: rgba(181, 75, 75, 0.28);
  color: var(--bad);
}

@media (max-width: 980px) {
  .sidebar {
    align-items: center;
    display: grid;
    gap: 14px 12px;
    grid-template-areas:
      "brand account"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding: 16px;
  }

  .sidebar .brand {
    grid-area: brand;
    min-width: 0;
  }

  .nav-list {
    grid-area: nav;
  }

  .sidebar-footer {
    align-items: center;
    display: flex;
    gap: 10px;
    grid-area: account;
    justify-self: end;
    margin-top: 0;
    min-width: 0;
  }

  .sidebar-footer .current-user {
    max-width: 120px;
    text-align: right;
  }

  .workspace.events-active,
  .workspace.statistics-active {
    padding-top: 14px;
  }
}

@media (max-width: 680px) {
  .sidebar {
    padding: 14px 14px 12px;
  }

  .sidebar .brand img {
    height: 42px;
    width: 48px;
  }

  .sidebar .brand strong {
    font-size: 18px;
  }

  .sidebar-footer {
    gap: 8px;
  }

  .sidebar-footer .current-user {
    max-width: 86px;
  }

  .sidebar-logout {
    min-height: 34px;
    padding: 0 10px;
  }

  .nav-list {
    gap: 8px;
  }

  .lead-table-panel {
    padding-top: 16px;
  }

  .lead-bar-actions {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: auto auto minmax(0, 1fr);
    width: 100%;
  }

  .stage-filter-label,
  .sort-filter-label {
    grid-column: 1 / -1;
    text-align: left;
  }

  .stage-filter,
  .sort-field {
    grid-column: 1 / -1;
    width: 100%;
  }

  .sort-direction {
    grid-column: 1;
    justify-self: start;
  }

  #new-lead-toggle {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }

  .workspace.events-active .workspace-heading h2 {
    font-size: clamp(36px, 13vw, 50px);
  }
}
.move-pm-panel {
  display: grid;
  gap: 12px;
}

.move-pm-locked {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
  background: #fff8e7;
  color: #74480f;
  font-weight: 650;
}

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

.move-pm-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.move-pm-form label:nth-last-child(2) {
  grid-column: 1 / -1;
}

.move-pm-form button {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (max-width: 680px) {
  .move-pm-form {
    grid-template-columns: 1fr;
  }

  .move-pm-form button {
    width: 100%;
  }
}

/* Keep the mobile header height identical across Dashboard, Events, and Statistics. */
@media (max-width: 980px) {
  .sidebar {
    align-content: start;
    align-items: center;
    box-sizing: border-box;
    display: grid;
    gap: 14px 12px;
    grid-template-areas:
      "brand account"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 48px 48px;
    height: 138px !important;
    min-height: 138px !important;
    max-height: 138px !important;
    overflow: visible;
    padding: 14px 16px;
  }

  .sidebar .brand {
    grid-area: brand;
    min-width: 0;
  }

  .sidebar-footer {
    align-items: center;
    display: flex;
    grid-area: account;
    justify-self: end;
    margin-top: 0;
    min-width: 0;
  }

  .nav-list {
    align-self: start;
    grid-area: nav;
    height: 48px !important;
    min-height: 48px;
    overflow: visible;
  }

  .nav-button {
    height: 48px;
    max-height: 48px;
    min-height: 48px;
  }
}

@media (max-width: 680px) {
  .sidebar {
    gap: 12px 10px;
    grid-template-rows: 44px 46px;
    height: 130px !important;
    min-height: 130px !important;
    max-height: 130px !important;
    padding: 12px 14px;
  }

  .nav-list {
    height: 46px !important;
    min-height: 46px;
  }

  .nav-button {
    height: 46px;
    max-height: 46px;
    min-height: 46px;
  }

  .stage-menu {
    position: fixed;
    left: var(--stage-menu-left, 12px);
    right: auto;
    top: var(--stage-menu-top, 160px);
    width: var(--stage-menu-width, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: var(--stage-menu-max-height, min(58vh, 520px));
    overflow-y: auto;
    z-index: 100;
  }

  .stage-menu button {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Keep page titles aligned the same way in every mobile view. */
@media (max-width: 980px) {
  .workspace,
  .workspace.events-active,
  .workspace.statistics-active {
    padding-top: 16px !important;
  }

  .workspace-heading {
    margin: 0;
  }

  .workspace-heading h2,
  .workspace.events-active .workspace-heading h2,
  .workspace.statistics-active .workspace-heading h2 {
    margin: 0;
  }
}

@media (max-width: 680px) {
  .workspace,
  .workspace.events-active,
  .workspace.statistics-active {
    padding: 16px 20px 22px !important;
  }

  .workspace-heading h2,
  .workspace.events-active .workspace-heading h2,
  .workspace.statistics-active .workspace-heading h2 {
    font-size: clamp(30px, 12vw, 44px);
    line-height: 0.98;
  }

  .workspace.events-active,
  .workspace.statistics-active {
    display: block !important;
  }

  .workspace.events-active .lead-board,
  .workspace.statistics-active .lead-board {
    display: block;
  }

  .workspace.events-active .workspace-heading,
  .workspace.statistics-active .workspace-heading {
    margin: 0 0 16px;
  }

  .workspace.events-active .lead-table-panel,
  .workspace.statistics-active .lead-table-panel {
    margin: 0;
  }

  .workspace.events-active {
    position: relative;
  }

  .workspace.events-active .workspace-heading {
    position: absolute;
    top: 16px;
    left: 20px;
    right: 20px;
    z-index: 1;
    margin: 0;
  }

  .workspace.events-active .workspace-heading h2 {
    max-width: 100%;
    overflow: visible;
    white-space: normal;
  }

  .workspace.events-active #lead-dashboard-metrics {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .workspace.events-active .lead-board {
    display: block !important;
    margin: 0 !important;
    padding-top: 72px !important;
  }
}

/* Dashboard toolbar and header filters. */
.lead-bar-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
}

.lead-control-right {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  justify-content: flex-end;
  margin-left: auto;
}

.lead-control-right .stage-filter-label {
  white-space: nowrap;
}

.lead-control-right .stage-filter {
  width: min(230px, 28vw);
}

.lead-bar-actions .toolbar-search {
  flex: 1 1 360px;
  margin: 0;
  max-width: 520px;
  min-width: 240px;
}

#new-lead-toggle {
  border-color: var(--accent);
  color: var(--accent);
  flex: 0 0 38px;
  height: 38px;
  min-height: 38px;
  width: 38px;
}

#new-lead-toggle svg {
  height: 18px;
  width: 18px;
}

.lead-table,
.lead-table th {
  overflow: visible;
}

.column-filter {
  position: relative;
}

.filter-header .sort-indicator {
  min-width: 44px;
  text-align: center;
}

.column-filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 18;
  width: min(280px, 80vw);
  max-height: 340px;
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.column-filter-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.column-filter-menu-head button {
  min-height: 28px;
  padding: 0 8px;
  border-color: transparent;
  background: var(--surface-soft);
  color: var(--accent);
}

.column-filter-options {
  display: grid;
  gap: 4px;
}

.column-filter-option {
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.column-filter-option:hover {
  background: var(--surface-soft);
}

@media (min-width: 981px) {
  #dashboard-controls .toolbar-search {
    flex: 1 1 520px;
    max-width: 560px;
  }

  #dashboard-controls .stage-filter {
    flex: 0 0 auto;
    width: 230px;
  }
}

@media (max-width: 680px) {
  .lead-bar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .lead-bar-actions .toolbar-search {
    grid-column: 1 / -1;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .lead-control-right {
    grid-column: 1 / -1;
    width: 100%;
  }

  .lead-control-right .stage-filter-label {
    margin-right: auto;
  }

  .lead-control-right .stage-filter {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }
}

/* Final mobile layout contract: all views start immediately under the header. */
@media (min-width: 981px) {
  #dashboard-controls {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
  }

  #dashboard-controls .stage-filter {
    flex: 0 0 280px;
    width: 280px;
  }

  #dashboard-controls .sort-direction,
  #dashboard-controls #new-lead-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #dashboard-controls .toolbar-search {
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 420px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    display: block !important;
    min-height: 0 !important;
  }
}

@media (max-width: 680px) {
  .workspace,
  .workspace.events-active,
  .workspace.statistics-active {
    display: block !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 16px 20px 22px !important;
  }

  .lead-board,
  .workspace.events-active .lead-board,
  .workspace.statistics-active .lead-board {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .workspace-heading,
  .workspace.events-active .workspace-heading,
  .workspace.statistics-active .workspace-heading {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .workspace-heading h2,
  .workspace.events-active .workspace-heading h2,
  .workspace.statistics-active .workspace-heading h2 {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 2px !important;
    overflow: visible !important;
    font-size: clamp(30px, 12vw, 44px) !important;
    line-height: 1.04 !important;
    white-space: normal !important;
  }

  #lead-dashboard-metrics.hidden,
  .workspace.events-active #lead-dashboard-metrics,
  .workspace.statistics-active #lead-dashboard-metrics {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .lead-table-panel,
  .workspace.events-active .lead-table-panel,
  .workspace.statistics-active .lead-table-panel {
    margin: 0 !important;
  }

  .workspace.detail-open .lead-board {
    display: none !important;
  }

  .workspace.detail-open .detail {
    display: block !important;
    min-height: 0 !important;
  }
}

/* Estimate builder */
.mobile-nav-toggle {
  display: none;
}

.estimate-view {
  display: grid;
  gap: 16px;
}

.estimate-search-card,
.estimate-prompt-card,
.estimate-output {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 16px;
}

.estimate-search-shell {
  position: relative;
}

.estimate-search-shell input {
  min-height: 42px;
}

.estimate-lead-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  gap: 4px;
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.estimate-result-button {
  display: grid;
  gap: 3px;
  min-height: 52px;
  justify-items: start;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.estimate-result-button:hover {
  background: var(--surface-soft);
}

.estimate-result-button strong,
.estimate-result-button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-result-button span,
.estimate-selected-lead span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.estimate-selected-lead {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.estimate-selected-lead div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.estimate-selected-lead strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-prompt-card textarea {
  min-height: 180px;
}

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

.estimate-actions button {
  min-width: 112px;
}

.estimate-output h4 {
  margin: 0;
  font-size: 16px;
}

/* Earth site planner */
.earth-view {
  display: grid;
  gap: 16px;
}

.earth-search-card,
.earth-map-card,
.earth-planner-card,
.earth-review-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 16px;
}

.earth-search-form {
  display: grid;
  gap: 8px;
}

.earth-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.earth-search-shell {
  position: relative;
  min-width: 0;
}

.earth-search-shell input {
  min-height: 42px;
}

#earth-search-submit {
  position: relative;
  z-index: 40;
}

.earth-address-results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 35;
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.earth-result-button {
  min-height: 54px;
  display: grid;
  justify-items: start;
  gap: 3px;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.earth-result-button:hover {
  background: var(--surface-soft);
}

.earth-result-button strong,
.earth-result-button span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.earth-result-button span {
  color: var(--muted);
  font-size: 12px;
}

.earth-selected-site {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 12px;
}

.earth-selected-site h3 {
  margin: 0;
  font-size: 18px;
}

.earth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.earth-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.earth-card-heading h3 {
  margin: 2px 0 0;
  font-size: 18px;
}

.earth-link-row {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.earth-map {
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.earth-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
}

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

.earth-controls input {
  min-height: 36px;
}

.earth-adu-size {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.earth-plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.earth-plan-status.ok {
  background: var(--green-soft);
  color: var(--good);
}

.earth-plan-status.warn {
  background: var(--gold-soft);
  color: var(--warn);
}

.earth-planner-canvas {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(207, 213, 223, 0.55) 1px, transparent 1px) 0 0 / 10% 10%,
    linear-gradient(0deg, rgba(207, 213, 223, 0.55) 1px, transparent 1px) 0 0 / 10% 10%,
    #fbfaf6;
  touch-action: none;
}

.earth-lot-outline {
  position: absolute;
  inset: 0;
  border: 2px solid #1f2933;
  pointer-events: none;
}

.earth-street-edge {
  position: absolute;
  inset: 0 0 auto;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(31, 41, 51, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  pointer-events: none;
}

.earth-buildable-area {
  position: absolute;
  border: 2px dashed var(--accent);
  border-radius: 6px;
  background: rgba(0, 168, 107, 0.08);
  pointer-events: none;
}

.earth-adu-box {
  position: absolute;
  min-height: 34px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px;
  border: 2px solid #135e56;
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.9);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(31, 41, 51, 0.18);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.earth-adu-box:active {
  cursor: grabbing;
}

.earth-adu-box small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-weight: 700;
}

.earth-planner-summary {
  display: grid;
  gap: 10px;
}

.earth-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.earth-warning-list span {
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--warn);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

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

.earth-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.earth-chip-list span {
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
}

.earth-notes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.earth-notes li + li {
  margin-top: 6px;
}

@media (max-width: 680px) {
  .sidebar {
    grid-template-areas: "brand menu account" "nav nav nav" !important;
    grid-template-columns: minmax(0, 1fr) 44px auto !important;
    grid-template-rows: 46px auto !important;
    height: auto !important;
    min-height: 70px !important;
    max-height: none !important;
    padding: 12px 14px !important;
  }

  .mobile-nav-toggle {
    grid-area: menu;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    display: inline-grid;
    place-items: center;
    gap: 4px;
    padding: 9px;
    border-color: #49514d;
    background: #2c332f;
    color: #ffffff;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .nav-list {
    grid-area: nav;
    display: none !important;
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px;
    border: 1px solid #49514d;
    border-radius: 10px;
    background: #232826;
  }

  .mobile-nav-open .nav-list {
    display: grid !important;
  }

  .nav-button {
    justify-content: start !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 12px !important;
  }

  .nav-button span {
    display: inline !important;
  }

  .sidebar-footer {
    display: flex !important;
    grid-area: account;
    justify-self: end;
    margin-top: 0 !important;
  }

  .sidebar .brand span {
    display: none;
  }

  .workspace,
  .workspace.events-active,
  .workspace.statistics-active,
  .workspace.estimate-active,
  .workspace.earth-active {
    padding-top: 16px !important;
  }

  .workspace-heading h2,
  .workspace.events-active .workspace-heading h2,
  .workspace.statistics-active .workspace-heading h2,
  .workspace.estimate-active .workspace-heading h2,
  .workspace.earth-active .workspace-heading h2 {
    font-size: clamp(30px, 12vw, 44px) !important;
    line-height: 1.04 !important;
  }

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

  .estimate-search-card,
  .estimate-prompt-card,
  .estimate-output,
  .earth-search-card,
  .earth-map-card,
  .earth-planner-card,
  .earth-review-card {
    padding: 14px;
  }

  .earth-search-row,
  .earth-grid,
  .earth-review-grid {
    grid-template-columns: 1fr;
  }

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

  .earth-map,
  .earth-planner-canvas {
    min-height: 360px;
  }

  .earth-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .earth-link-row {
    justify-content: flex-start;
  }
}

/* Keep the add-lead icon present, but still aligned with the icon system. */
#new-lead-toggle {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(27, 127, 120, 0.18) !important;
  flex-basis: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  width: 42px !important;
}

#new-lead-toggle:hover,
#new-lead-toggle:focus-visible {
  border-color: #146f68 !important;
  background: #146f68 !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(27, 127, 120, 0.24) !important;
}

#new-lead-toggle svg {
  height: 21px !important;
  stroke-width: 2 !important;
  width: 21px !important;
}

/* Keep the lead close control visible on narrow iPhone screens. */
@media (max-width: 680px) {
  .detail-header {
    align-items: start !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 48px !important;
    gap: 12px !important;
    padding: 18px 14px !important;
  }

  .detail-header > div:not(.detail-tools) {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  #close-detail.close-detail-button {
    align-self: start !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    position: relative !important;
    z-index: 3 !important;
  }

  .lead-title-line {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .lead-title-line h2 {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
}

/* Auth visibility guard: mobile layout overrides must never reveal the app before login. */
body.logged-out #app-shell,
.app-shell.hidden,
.login-screen.hidden {
  display: none !important;
}

/* Canonical responsive contract: tablet navigation, compact lead cards, and incremental lists. */
.lead-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.lead-list-pagination button {
  flex: 0 0 auto;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

@media (min-width: 681px) and (max-width: 980px) {
  .sidebar {
    grid-template-areas: "brand menu account" "nav nav nav" !important;
    grid-template-columns: minmax(0, 1fr) 44px auto !important;
    grid-template-rows: 46px auto !important;
    height: auto !important;
    min-height: 70px !important;
    max-height: none !important;
    padding: 12px 16px !important;
  }

  .mobile-nav-toggle {
    grid-area: menu;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    display: inline-grid;
    place-items: center;
    gap: 4px;
    padding: 9px;
    border-color: #49514d;
    background: #2c332f;
    color: #ffffff;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .nav-list {
    grid-area: nav;
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px;
    border: 1px solid #49514d;
    border-radius: 10px;
    background: #232826;
  }

  .mobile-nav-open .nav-list {
    display: grid !important;
  }

  .nav-button {
    width: 100%;
    justify-content: start !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 12px !important;
  }

  .nav-button span {
    display: inline !important;
  }

  .sidebar-footer {
    display: flex !important;
    grid-area: account;
    justify-self: end;
    margin-top: 0 !important;
  }
}

@media (max-width: 1365px) {
  .lead-list {
    max-height: none;
    overflow: visible;
    border-top: 0;
  }

  .lead-table,
  .lead-table colgroup,
  .lead-table thead,
  .lead-table tbody,
  .lead-table tr,
  .lead-table td {
    display: block;
    width: 100%;
  }

  .lead-table thead,
  .lead-table colgroup {
    display: none;
  }

  .lead-row {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .lead-table td {
    min-height: 0;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 7px 0;
    overflow: visible;
  }

  .lead-table td:last-child {
    border-bottom: 0;
  }

  .lead-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
  }

  .lead-table td .badge {
    justify-self: start;
  }

  .lead-list-pagination {
    padding-top: 10px;
  }
}

@media (max-width: 430px) {
  .lead-list-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-list-pagination button {
    width: 100%;
  }
}
