:root {
  --bg: #f5f6f2;
  --panel: #ffffff;
  --panel-soft: #f0f4ee;
  --ink: #17211d;
  --muted: #68736e;
  --line: #dce2dc;
  --green: #1f7a4d;
  --green-dark: #135938;
  --blue: #2b5f92;
  --red: #b23a3a;
  --amber: #b3741f;
  --shadow: 0 18px 44px rgba(34, 49, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.locked .app-shell {
  display: none;
}

body:not(.locked) .auth-screen {
  display: none;
}

.oauth-popup-complete {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-content: center;
  text-align: center;
}

.oauth-popup-complete h1 {
  margin: 0 0 8px;
}

.oauth-popup-complete p {
  color: var(--muted);
  margin: 0;
}

.legal-page {
  min-height: 100vh;
  background: var(--bg);
  padding: clamp(24px, 5vw, 56px);
}

.legal-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.legal-shell .brand-logo-full {
  width: 220px;
  max-width: 100%;
  margin-bottom: 24px;
}

.legal-shell h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.legal-shell h2 {
  margin: 28px 0 10px;
}

.legal-shell p,
.legal-shell li {
  color: var(--muted);
  line-height: 1.65;
}

.legal-shell a {
  color: var(--green);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

.auth-screen {
  height: 100vh;
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  overflow: hidden;
}

.auth-visual {
  background: #17211d;
  color: white;
  padding: clamp(24px, 2.6vw, 42px) clamp(42px, 4.2vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 1.9vh, 24px);
}

.auth-visual h2 {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(3.7rem, 3.95vw, 5.25rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.auth-visual p {
  max-width: 1040px;
  margin: 0;
  color: #c6d6cd;
  font-size: clamp(1rem, 1vw, 1.16rem);
  line-height: 1.55;
}

.auth-map {
  display: block;
  width: min(100%, 1520px);
  max-width: 100%;
  aspect-ratio: 1774 / 652;
  height: auto;
  object-fit: contain;
  object-position: left center;
  border: 1px solid rgba(143, 214, 169, 0.36);
  border-radius: 8px;
  background: #111f1a;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 42px rgba(0, 0, 0, 0.16);
}

.auth-panel {
  padding: clamp(22px, 5vw, 52px);
  display: grid;
  align-content: center;
  gap: 18px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.auth-tab {
  min-height: 44px;
  border: 0;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.active {
  background: var(--green);
  color: #fff;
}

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

.auth-form.active {
  display: grid;
}

.auth-form h2 {
  margin: 0;
}

.auth-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-help summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.auth-help p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.auth-help a {
  color: var(--green);
  font-weight: 800;
}

.auth-legal-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-legal-links a {
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}

.auth-legal-links a:hover {
  color: var(--green);
  text-decoration: underline;
}

.google-btn {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.google-btn:disabled,
.google-btn.is-loading {
  cursor: wait;
  opacity: 0.72;
}

.google-btn::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 900;
}

.outlook-btn::before {
  content: "O";
  background: #e9f2ff;
  color: #0f6cbd;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

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

.sidebar {
  background: #17211d;
  color: #f6fbf6;
  padding: clamp(10px, 2vh, 18px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.3vh, 12px);
  height: 100vh;
  overflow: hidden;
  min-height: 0;
}

.sidebar .brand,
.sidebar-toggle,
.sidebar-bottom-nav,
.sidebar-panel,
.territory-map {
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.brand-logo-full {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 8px;
}

.brand-logo-mark {
  display: none;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d8efd9;
  color: #17211d;
  font-weight: 800;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  line-height: 1;
}

.brand-wordmark {
  display: block;
  width: 150px;
  height: 70px;
}

.brand-wordmark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.16));
}

.brand-agent {
  fill: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 64px;
  font-weight: 900;
}

.brand-pipeline {
  fill: #8fd6a9;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 64px;
  font-weight: 900;
}

.auth-visual .brand {
  gap: 24px;
  margin-bottom: 0;
}

.auth-visual .brand-logo-full {
  width: min(760px, 58%);
  height: auto;
  max-width: none;
}

.auth-visual .brand-logo {
  width: 190px;
  height: 150px;
}

.auth-visual .brand-wordmark {
  width: 340px;
  height: 150px;
}

.sidebar .brand {
  align-items: flex-end;
  gap: 8px;
}

.sidebar .brand-logo-full {
  width: clamp(178px, 23vh, 244px);
  max-width: 100%;
}

.sidebar .brand-logo-mark {
  width: 54px;
  height: 54px;
}

.sidebar .brand-logo {
  width: 86px;
  height: 70px;
}

.sidebar .brand-wordmark {
  width: 150px;
  height: 70px;
}

.eyebrow,
.panel-label {
  margin: 0 0 4px;
  color: #8ea096;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-tabs {
  display: grid;
  gap: clamp(3px, 0.8vh, 6px);
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-color: rgba(143, 214, 169, 0.55) rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.nav-tabs::-webkit-scrollbar {
  width: 8px;
}

.nav-tabs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: rgba(143, 214, 169, 0.55);
  border-radius: 999px;
}

.nav-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #dce8df;
  min-height: clamp(32px, 4.5vh, 42px);
  padding: clamp(5px, 0.9vh, 9px) 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(0.88rem, 1.75vh, 1rem);
}

.nav-icon {
  color: #fff;
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1;
  place-items: center;
}

.nav-tab[data-view="properties"] .nav-icon,
.profile-nav .nav-icon {
  font-size: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 21px 21px;
}

.nav-tab[data-view="properties"] .nav-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5.5 10.5V20h13v-9.5'/%3E%3Cpath d='M9.5 20v-6h5v6'/%3E%3C/svg%3E");
}

.profile-nav .nav-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4.5 20a7.5 7.5 0 0 1 15 0'/%3E%3C/svg%3E");
}

.nav-label {
  min-width: 0;
}

.nav-tab.active,
.nav-tab:hover {
  background: #26362f;
  border-color: #385046;
  color: #fff;
}

.sidebar-bottom-nav {
  margin-top: auto;
  display: grid;
  gap: clamp(3px, 0.8vh, 6px);
  width: 100%;
}

.sidebar-bottom-nav .nav-tab {
  width: 100%;
}

body.super-admin-mode .nav-tabs {
  flex: 1 1 auto;
}

body.super-admin-mode .sidebar-bottom-nav {
  margin-top: 0;
}

.sidebar-toggle {
  display: none;
  border: 1px solid #385046;
  border-radius: 8px;
  background: #26362f;
  color: #fff;
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
  width: 42px;
  height: 42px;
  padding: 0 0 4px;
}

.sidebar-panel {
  border: 1px solid #32483e;
  border-radius: 8px;
  padding: 10px;
  background: #202e28;
  display: grid;
  gap: 8px;
}

.sidebar-panel select {
  width: 100%;
}

.sidebar-panel.quiet span {
  color: #b7c8bf;
  font-size: 0.9rem;
}

.territory-map {
  width: 100%;
  border: 1px solid #32483e;
  border-radius: 8px;
  margin-top: auto;
  display: none;
}

.workspace {
  min-width: 0;
  padding: 26px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

body[data-current-view="calendar"] .app-shell {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body[data-current-view="calendar"] .sidebar {
  position: sticky;
  top: 0;
}

body[data-current-view="calendar"] .workspace {
  height: auto;
  min-height: 100vh;
  overflow-y: visible;
}

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

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

.topbar-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.server-restart-notice {
  align-items: center;
  background: #fff4d8;
  border: 1px solid #d7a83a;
  border-radius: 8px;
  color: #6f4b05;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: -8px 0 22px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(95, 68, 7, 0.08);
}

.server-restart-notice[hidden] {
  display: none;
}

.server-restart-notice div {
  display: grid;
  gap: 4px;
}

.server-restart-notice strong {
  color: #5b3e07;
  font-size: 0.95rem;
}

.server-restart-notice span {
  line-height: 1.35;
}

.server-restart-notice > span {
  background: #fff;
  border: 1px solid #e3c678;
  border-radius: 999px;
  color: #17211d;
  font-weight: 850;
  padding: 7px 11px;
  white-space: nowrap;
}

.super-account-viewer {
  display: grid;
  gap: 4px;
  min-width: 240px;
}

.super-account-viewer span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.super-account-viewer select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font-weight: 800;
}

.manager-team-viewer {
  min-width: 260px;
}

.user-chip {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 11px;
  display: grid;
  line-height: 1.15;
  min-width: 170px;
}

.user-chip strong {
  font-size: 0.88rem;
}

.user-chip span {
  color: var(--muted);
  font-size: 0.76rem;
}

.primary-btn,
.ghost-btn,
.text-btn,
.icon-btn,
.bug-report-btn,
.suggestion-report-btn {
  border-radius: 8px;
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 750;
}

.primary-btn {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.primary-btn:hover {
  background: var(--green-dark);
}

.ghost-btn,
.icon-btn {
  background: #fff;
  color: var(--ink);
}

.bug-report-btn {
  background: #b94035;
  border-color: #b94035;
  color: #fff;
}

.bug-report-btn:hover {
  background: #9f342b;
  border-color: #9f342b;
}

.suggestion-report-btn {
  background: #f0c34a;
  border-color: #f0c34a;
  color: #17211d;
}

.suggestion-report-btn:hover {
  background: #ddb23c;
  border-color: #ddb23c;
}

.text-btn {
  background: transparent;
  color: var(--green);
  border: 0;
}

.icon-btn {
  width: 40px;
  padding: 0;
}

.compact-btn {
  min-height: 34px;
  padding: 0 10px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

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

.report-secondary-metrics {
  margin-top: 14px;
}

.caller-stats-section {
  margin-bottom: 18px;
}

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

.section-head h3 {
  margin: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.report-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 160px;
  gap: 12px;
  margin-bottom: 14px;
}

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

.metric {
  padding: 18px;
  display: grid;
  gap: 8px;
}

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

.form-error {
  color: #9f2f2f;
  font-weight: 700;
}

.metric strong {
  font-size: 2rem;
  line-height: 1;
}

.changelog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

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

.changelog-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.changelog-entry time {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.changelog-entry h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.changelog-entry p,
.changelog-entry ul {
  color: var(--muted);
}

.changelog-entry p {
  margin: 0;
}

.changelog-entry ul {
  margin: 0;
  padding-left: 18px;
}

.latest-changes-dialog-form {
  width: min(720px, calc(100vw - 32px));
}

.latest-changes-list {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 560px);
  overflow: auto;
  padding-right: 4px;
}

.feedback-panel {
  display: grid;
  grid-template-rows: minmax(250px, 1fr) minmax(250px, 1fr);
  gap: 16px;
  max-height: calc(100vh - 150px);
}

.feedback-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.feedback-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

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

.feedback-card.resolved {
  opacity: 0.76;
}

.feedback-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.feedback-description {
  margin: 0;
  white-space: pre-wrap;
}

.feedback-card.resolved .feedback-description {
  text-decoration: line-through;
}

.resolved-label {
  color: var(--green);
  font-weight: 850;
}

.feedback-card .danger-btn {
  justify-self: start;
}

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

.dashboard-grid,
.import-grid,
.caller-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.import-history-panel {
  margin-top: 18px;
}

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

.import-history-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.4fr) auto;
  padding: 12px;
}

.import-history-item.running,
.import-history-item.queued {
  background: #f6fbf7;
  border-color: rgba(63, 127, 84, 0.28);
}

.import-history-item.failed {
  background: #fff5f4;
  border-color: rgba(176, 70, 54, 0.35);
}

.import-history-item.rolled_back {
  background: #f7f8f7;
}

.import-history-main,
.import-history-progress {
  display: grid;
  gap: 4px;
}

.import-history-main span,
.import-history-main small,
.import-history-progress small {
  color: var(--muted);
}

.import-history-status {
  display: flex;
  font-weight: 850;
  justify-content: space-between;
}

.import-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.progress-track {
  background: var(--panel-soft);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.progress-track span {
  background: var(--green);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 180ms ease;
}

.dashboard-insights {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.insight-card {
  display: grid;
  gap: 6px;
}

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

.insight-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.quick-action-grid button {
  justify-content: center;
  min-height: 44px;
}

.today-command {
  display: grid;
  gap: 18px;
}

.today-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.today-hero h3 {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
}

.today-hero span {
  color: var(--muted);
}

.today-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

.today-metric {
  min-height: 112px;
}

.today-metric small {
  color: var(--muted);
}

.today-metric.warning {
  border-color: #e3bb5d;
  background: #fff8e7;
}

.today-metric.success {
  border-color: rgba(66, 125, 83, 0.36);
  background: #f4faf6;
}

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

.today-panel.wide {
  grid-column: 1 / -1;
}

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

.today-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.today-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 7px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.today-item:hover {
  border-color: var(--green);
  background: #f4faf6;
  transform: translateY(-1px);
}

.today-item-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.today-item > span,
.today-item-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.today-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.today-item-meta span {
  border-radius: 999px;
  background: #eef3ee;
  padding: 3px 8px;
}

.today-badge {
  border-radius: 999px;
  background: #eef3ee;
  color: var(--green-dark);
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.today-badge.warning {
  background: #fff0c5;
  color: #825512;
}

.today-badge.danger {
  background: #ffe1df;
  color: #9a2d24;
}

.today-badge.success {
  background: #e4f2e8;
  color: var(--green-dark);
}

.today-badge.info {
  background: #e9f1f8;
  color: #245a78;
}

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

.report-chart-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  background: #fbfcfa;
}

.chart-card h4 {
  width: 100%;
  margin: 0;
}

.chart-card > strong {
  width: 100%;
}

#dashboardView > .panel {
  margin-bottom: 18px;
}

.pie-chart {
  width: clamp(180px, 16vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #edf1ee;
  position: relative;
  box-shadow: inset 0 0 0 1px var(--line);
}

.pie-chart::after {
  content: attr(data-empty);
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.pie-chart[data-empty=""]::after {
  content: "";
}

.chart-legend {
  width: 100%;
  display: grid;
  gap: 7px;
  align-self: start;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.legend-percent {
  color: var(--muted);
  font-weight: 800;
  min-width: 44px;
  text-align: right;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.report-detail-row td:first-child {
  color: var(--muted);
  font-size: 0.84rem;
}

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

.admin-filters {
  grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) minmax(220px, 1fr);
}

.admin-health-panel {
  display: grid;
  gap: 14px;
}

.admin-health-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.admin-restart-field {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.admin-restart-field span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-restart-field input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  min-height: 40px;
  padding: 0 10px;
}

.admin-server-panel {
  display: grid;
  gap: 14px;
}

.admin-server-tools {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-server-status {
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 850;
  padding: 12px 14px;
}

.admin-server-status.warning {
  background: #fff8e6;
  border-color: #e4b94d;
  color: var(--ink);
}

.admin-feature-toggle {
  align-items: center;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
}

.admin-feature-toggle input {
  accent-color: var(--green);
  flex: 0 0 auto;
  height: 20px;
  width: 20px;
}

.admin-feature-toggle span {
  display: grid;
  gap: 3px;
}

.admin-feature-toggle strong {
  color: var(--ink);
}

.admin-feature-toggle small {
  color: var(--muted);
  font-weight: 700;
}

.admin-background-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-background-jobs {
  display: grid;
  gap: 10px;
}

.admin-background-job {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.admin-background-job > div:first-child {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.admin-background-job strong {
  color: var(--ink);
}

.admin-background-job span,
.admin-background-job small,
.admin-background-job p {
  color: var(--muted);
}

.admin-background-job p {
  margin: 0;
}

.admin-background-job.queued,
.admin-background-job.running {
  background: #f7faf6;
}

.admin-background-job.completed {
  border-color: #c8ded0;
}

.admin-background-job.failed {
  background: #fff2f2;
  border-color: #d86969;
}

.admin-background-job.cancelling {
  background: #fff8e6;
  border-color: #e4b94d;
}

.admin-background-job.cancelled {
  background: #f2f4f3;
  border-color: #c8d2ce;
}

.admin-background-progress {
  background: #e6ece8;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}

.admin-background-progress span {
  background: var(--green);
  display: block;
  height: 100%;
}

.admin-opt-out-panel {
  display: grid;
  gap: 16px;
}

.admin-opt-out-field {
  display: grid;
  gap: 8px;
}

.admin-opt-out-field textarea {
  min-height: 260px;
  resize: vertical;
}

.admin-opt-out-field small {
  color: var(--muted);
}

.admin-opt-out-list {
  display: grid;
  gap: 8px;
}

.admin-opt-out-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.opt-out-note {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 800;
}

.admin-health-migration-status {
  background: #eef6ff;
  border: 1px solid #b6d5f2;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  padding: 10px 12px;
}

.admin-health-migration-status.busy {
  background: #fff8e6;
  border-color: #e4b94d;
}

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

.admin-health-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 14px;
}

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

.admin-health-card span {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-health-card strong {
  color: var(--ink);
  font-size: 1.28rem;
  line-height: 1.1;
}

.admin-health-card.warning {
  background: #fff8e6;
  border-color: #e4b94d;
}

.admin-health-card.critical {
  background: #fff0f0;
  border-color: #d86969;
}

.admin-health-card.info {
  background: #eef6ff;
  border-color: #b6d5f2;
}

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

.admin-health-grid h4 {
  margin: 0 0 10px;
}

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

.admin-health-row,
.admin-health-account {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-health-row {
  align-items: start;
  grid-template-columns: auto minmax(0, 1fr);
}

.admin-health-row p,
.admin-health-account p {
  color: var(--muted);
  margin: 4px 0 0;
}

.admin-health-row small,
.admin-health-account span {
  color: var(--muted);
}

.admin-health-row.warning,
.admin-health-account.warning {
  background: #fffaf0;
  border-color: #e5c06a;
}

.admin-health-row.critical,
.admin-health-account.critical {
  background: #fff2f2;
  border-color: #d86969;
}

.admin-health-row.info,
.admin-health-account.info {
  background: #f3f8ff;
  border-color: #b6d5f2;
}

.health-pill {
  background: #eef2ef;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 5px 8px;
  text-transform: uppercase;
}

.admin-health-account dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  margin: 0;
}

.admin-health-account dl div {
  display: grid;
  gap: 2px;
}

.admin-health-account dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-health-account dd {
  color: var(--ink);
  font-weight: 900;
  margin: 0;
}

.admin-health-plan {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-health-plan h4,
.admin-health-plan p {
  margin: 0;
}

.admin-health-plan > p {
  color: var(--muted);
}

.admin-health-plan-steps {
  display: grid;
  gap: 10px;
}

.admin-health-plan-step {
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px;
}

.admin-health-plan-step p {
  color: var(--muted);
  margin-top: 4px;
}

.admin-load-test-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.admin-load-test-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.admin-load-test-head span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.admin-load-test-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.admin-load-test-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1.4fr) repeat(4, minmax(76px, 0.7fr));
  padding: 9px 10px;
}

.admin-load-test-row + .admin-load-test-row {
  border-top: 1px solid var(--line);
}

.admin-load-test-row.heading {
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-load-test-row.warning {
  background: #fff8e6;
}

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

.wide-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

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

.panel-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.pipeline-bars {
  display: grid;
  gap: 14px;
}

.billing-notice {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
}

.billing-notice.access-ok {
  background: #edf7ef;
  border-color: #b9d8bf;
}

.billing-notice.access-locked {
  background: #fff6e1;
  border-color: #e5c06a;
}

.billing-plans {
  display: grid;
  gap: 22px;
}

.pricing-hero {
  border: 1px solid #cfe3d2;
  border-radius: 8px;
  background: linear-gradient(135deg, #f3faf4, #ffffff);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pricing-hero > span {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--green-dark);
}

.compact-pricing-hero {
  margin-bottom: 14px;
}

.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: #fff;
}

.billing-toggle button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  min-height: 34px;
  padding: 0 14px;
}

.billing-toggle button.active {
  background: var(--green);
  color: #fff;
}

.billing-toggle em {
  color: #9b6b13;
  background: #fff1cf;
  border-radius: 999px;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  padding: 7px 10px;
}

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

.pricing-group-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.pricing-group-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pricing-group-tab:hover {
  border-color: #b8d6bd;
  transform: translateY(-1px);
}

.pricing-group-tab span {
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 950;
}

.pricing-group-tab strong {
  font-size: 0.86rem;
}

.pricing-group-tab.active {
  background: #edf7ef;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(65, 124, 84, 0.12);
}

.pricing-group-tab.active strong {
  color: var(--green-dark);
}

.pricing-section-individual {
  background: linear-gradient(180deg, #ffffff, #fbfcfa);
}

.pricing-section-team {
  border-color: #bfd7c3;
  background: linear-gradient(180deg, #f4faf5, #ffffff);
}

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

.pricing-section-head strong {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--green-dark);
  font-size: 0.78rem;
  padding: 8px 11px;
  white-space: nowrap;
}

.pricing-section-kicker {
  display: inline-block;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.pricing-section-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.pricing-section-head p {
  color: var(--muted);
  margin: 3px 0 0;
}

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

.pricing-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  display: grid;
  gap: 16px;
  grid-template-rows: minmax(150px, max-content) minmax(86px, max-content) 38px auto 1fr auto auto;
  min-height: 460px;
  align-content: start;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
  border-color: #b8d6bd;
  box-shadow: 0 18px 36px rgba(25, 39, 31, 0.1);
}

.pricing-card.recommended {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(65, 124, 84, 0.12);
}

.pricing-card.current {
  background: #fbfcfa;
}

.pricing-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.pricing-card-top > div:first-child {
  display: contents;
}

.pricing-card h4 {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0 7px;
  min-width: 0;
  padding-right: 8px;
  font-size: 1.15rem;
}

.pricing-card-top p {
  grid-column: 1 / -1;
  grid-row: 2;
  line-height: 1.38;
  margin: 0;
}

.pricing-card p,
.pricing-card li,
.pricing-price span,
.pricing-equivalent {
  color: var(--muted);
}

.plan-badge,
.current-plan-pill {
  border-radius: 999px;
  color: var(--green-dark);
  background: #e9f4eb;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 6px 9px;
  white-space: nowrap;
}

.pricing-badges {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pricing-price strong {
  display: block;
  font-size: clamp(1.6rem, 2.6vw, 2.25rem);
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

.pricing-price {
  align-self: start;
}

.pricing-equivalent {
  display: block;
  font-size: 0.86rem;
  margin-top: 5px;
}

.pricing-card ul {
  display: grid;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pricing-card .pricing-feature-label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
  margin: 0;
  text-transform: uppercase;
}

.plus-feature-label {
  margin-top: 8px;
}

.pricing-variant-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  align-self: start;
  background: #f7faf7;
}

.pricing-variant-toggle button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  min-height: 30px;
}

.pricing-variant-toggle button.active {
  background: var(--green);
  color: #fff;
}

.pricing-variant-spacer {
  min-height: 38px;
}

.pricing-card li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
}

.pricing-card li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
  margin-right: 8px;
}

.pricing-card li::before {
  content: "\2713";
  grid-column: 1;
  line-height: 1.35;
  margin-right: 0;
  text-align: center;
}

.pricing-card-footer {
  display: grid;
  gap: 10px;
}

.downgrade-warning {
  border: 1px solid #e8be62;
  border-radius: 8px;
  background: #fff7df;
  color: #805915;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 9px 10px;
}

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

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.bar-track {
  height: 12px;
  background: var(--panel-soft);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green);
}

.compact-list,
.lead-list,
.followup-table,
.followup-agenda,
.caller-list,
.team-list,
.team-invite-list {
  display: grid;
  gap: 10px;
}

.compact-item,
.lead-card,
.followup-row,
.caller-card,
.team-card,
.team-invite-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.compact-item strong,
.lead-card strong,
.caller-card strong,
.team-card strong,
.team-invite-card strong {
  display: block;
}

.compact-item span,
.lead-card span,
.followup-row span,
.caller-card span,
.team-card span,
.team-invite-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.team-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.team-invite-form {
  display: grid;
  gap: 12px;
}

.team-card {
  display: grid;
  gap: 12px;
}

.team-card-head,
.team-card-actions,
.team-invite-card {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.team-card-head {
  align-items: flex-start;
}

.team-stats-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.team-stat {
  background: var(--panel-soft);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.team-stat span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.team-stat strong {
  font-size: 1.15rem;
}

.team-invite-card {
  align-items: flex-start;
}

.team-invite-card code {
  color: var(--green);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.management-filters,
.property-filters {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.followup-filters {
  grid-template-columns: minmax(220px, 360px);
  margin-bottom: 16px;
}

.client-list-filters {
  grid-template-columns: minmax(260px, 1fr) max-content max-content max-content;
  align-items: end;
}

.goal-progress-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 14px;
  padding: 12px;
  box-shadow: 0 12px 26px rgba(18, 27, 22, 0.05);
}

.goal-progress-panel[hidden] {
  display: none;
}

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

.goal-progress-head strong,
.goal-progress-card h4 {
  display: block;
  margin: 0;
  color: var(--ink);
}

.goal-progress-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.goal-progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

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

.goal-period-row {
  display: grid;
  grid-template-columns: minmax(78px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.goal-period-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.goal-period-row strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.goal-bar {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6ece8;
  border: 1px solid #d7e2db;
}

.goal-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.22s ease;
}

.report-target-panel[hidden] {
  display: none;
}

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

.report-target-user {
  display: grid;
  gap: 8px;
}

.report-target-user-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.report-target-user-head strong {
  color: var(--ink);
}

.report-target-user-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.report-target-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.report-target-metric {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.report-target-metric:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.report-target-metric > strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.active-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.column-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

#propertyColumnGroups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  align-items: start;
  width: 100%;
}

.property-column-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 5px;
  position: relative;
}

.property-group-check {
  background: #fff;
}

.property-column-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.property-column-dropdown {
  position: relative;
}

.property-column-dropdown summary {
  list-style: none;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 28px 8px 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
}

.property-column-dropdown summary::-webkit-details-marker {
  display: none;
}

.property-column-dropdown summary::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 8px;
  color: var(--muted);
}

.property-column-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.property-column-subchecks {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  width: 100%;
  min-width: 0;
  max-width: none;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(18, 27, 22, 0.14);
}

.property-column-check {
  min-height: 32px;
  padding: 6px 8px;
  background: #fff;
  font-size: 0.82rem;
}

.property-column-group {
  padding: 0;
  min-width: 0;
}

.property-column-group-head {
  min-height: 36px;
  gap: 8px;
  padding: 0 10px 0 0;
  background: #fff;
  cursor: pointer;
  width: 100%;
}

.property-column-group.open .property-column-group-head {
  background: #f4faf6;
}

.property-group-check {
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0 0 0 10px;
}

.property-group-title {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.property-column-caret {
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: auto;
}

.property-column-group.open .property-column-caret {
  transform: rotate(180deg);
}

.property-column-subchecks {
  left: 0;
  right: auto;
}

#propertyColumnGroups .property-column-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

#propertyColumnGroups .property-column-group.open {
  border-color: var(--green);
}

#propertyColumnGroups .property-column-group-head {
  border-radius: 8px;
  box-sizing: border-box;
}

#propertyColumnGroups .property-group-check {
  align-self: stretch;
  background: transparent;
}

#propertyColumnGroups .property-column-subchecks {
  top: calc(100% + 8px);
  width: 100%;
}

.compact-check {
  width: auto;
  min-height: 36px;
  padding: 8px 10px;
}

.suburb-access-field {
  display: grid;
  gap: 8px;
}

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

.suburb-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.suburb-check {
  margin: 0;
}

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

.caller-permissions-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.caller-permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

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

.caller-permission-view,
.caller-permission-action {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.caller-permission-view {
  color: var(--ink);
  font-weight: 850;
}

.caller-permission-actions {
  display: grid;
  gap: 6px;
}

.caller-permission-action {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.caller-permission-card input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

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

.goal-settings-head .field-title {
  margin: 0;
}

.goal-settings-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.goal-settings-grid {
  display: grid;
  gap: 8px;
}

.goal-setting-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 96px 96px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.goal-track {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 850;
}

.goal-track input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.goal-setting-row input[type="number"] {
  min-height: 36px;
  text-align: center;
}

.tag-cleanup-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.tag-picker-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
}

.tag-picker-option.selected {
  background: #e7f4ec;
  border-color: var(--green);
  color: var(--green-dark);
}

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

.template-editor {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 12px;
  font-weight: 700;
  line-height: 1.7;
  outline: none;
}

.template-editor.multiline {
  min-height: 130px;
}

.template-editor:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(64, 126, 82, 0.12);
}

.template-placeholder-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.template-actions [data-save-template],
.template-actions [data-discard-template],
.template-actions [data-save-message-template],
.template-actions [data-discard-message-template] {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.template-actions [data-save-template],
.template-actions [data-save-message-template] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.template-actions [data-discard-template],
.template-actions [data-discard-message-template] {
  background: #eef1ef;
  border-color: var(--line);
  color: var(--muted);
}

.template-manager-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.template-manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.danger-outline {
  border: 1px solid #e6b9b3;
  background: #fff;
  color: #9c3c2f;
}

.quick-template-dialog {
  width: min(720px, calc(100vw - 28px));
}

.quick-template-dialog textarea {
  min-height: 180px;
}

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

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

  .template-manager-actions {
    justify-content: stretch;
  }

  .template-manager-actions button {
    flex: 1 1 auto;
  }
}

.template-action-note {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.placeholder-token {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 850;
}

.template-token {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 1px solid #b9dcc8;
  border-radius: 999px;
  background: #e7f4ec;
  color: var(--green-dark);
  padding: 2px 5px 2px 9px;
  margin: 0 3px;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.4;
  vertical-align: middle;
}

.template-token-remove {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 999px;
  background: rgba(64, 126, 82, 0.16);
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.removable-tag {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef4ef;
  color: var(--ink);
  min-height: 34px;
  padding: 7px 30px 7px 12px;
  font-weight: 850;
  cursor: pointer;
}

.removable-tag.follow {
  background: #fff0cb;
  border-color: #f2cf8f;
  color: #93641c;
}

.removable-tag.lead {
  background: #e7f4ec;
  border-color: #b9dcc8;
  color: var(--green-dark);
}

.removable-tag.dnc {
  background: #ffe4e4;
  border-color: #e5b5b5;
  color: #9f2f2f;
}

.tag-remove-x {
  position: absolute;
  top: 3px;
  right: 8px;
  font-size: 0.72rem;
  line-height: 1;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-title {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}

input[readonly] {
  background: #f4f7f3;
  color: var(--muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
}

select[multiple] {
  min-height: 118px;
}

label small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.lead-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: start;
}

.lead-list {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding-right: 4px;
}

.lead-card {
  text-align: left;
  width: 100%;
  display: grid;
  gap: 8px;
}

.lead-card.active {
  border-color: var(--green);
  background: #f6fbf6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-tag-row {
  min-width: 220px;
}

#leadManagementTable .tag-row,
#processedLeadManagementTable .tag-row {
  gap: 10px;
  min-width: 190px;
  align-items: center;
  row-gap: 9px;
}

.lead-management-tag-row .tag {
  border: 1px solid rgba(99, 116, 106, 0.18);
  padding: 6px 10px;
  line-height: 1.2;
}

.tag {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.lead {
  background: #e5f3ea;
  color: var(--green);
}

.tag.dnc {
  background: #f8e5e5;
  color: var(--red);
}

.tag.follow {
  background: #fff0d6;
  color: var(--amber);
}

.lead-detail {
  display: grid;
  gap: 16px;
}

.empty-state {
  min-height: 320px;
  place-items: center;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
  padding: 18px;
}

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

.lead-top-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

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

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

.section-title h3 {
  margin: 0;
}

.section-title span {
  color: var(--muted);
  font-size: 0.82rem;
}

.owner-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  display: grid;
  gap: 6px;
}

.owner-box a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.owner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.owner-actions .quick-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.82rem;
}

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

.outcome-option {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  font-weight: 800;
}

.outcome-option.active {
  border-color: var(--green);
  background: #e5f3ea;
  color: var(--green-dark);
}

.followup-indicator {
  border: 1px solid #e1b14f;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff4d8;
  color: #7c4d11;
  font-weight: 850;
}

.callback-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.followup-date-field {
  align-content: start;
}

.mandate-date-field {
  align-content: start;
}

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

.scheduler-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: start;
}

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

.inline-calendar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
  display: grid;
  gap: 8px;
}

.calendar-head,
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-head {
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
}

.calendar-head strong {
  text-align: center;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.calendar-day.blank {
  background: transparent;
  pointer-events: none;
}

.calendar-day.today {
  border-color: #d1a03c;
}

.calendar-day.active {
  background: var(--green);
  color: #fff;
}

.calendar-day:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f2f4f1;
}

.appointment-slots {
  display: grid;
  gap: 12px;
  align-content: start;
}

.appointment-slots label,
.followup-options label {
  max-width: 360px;
}

.followup-options {
  display: grid;
  gap: 12px;
  align-content: start;
}

.mandate-options {
  display: grid;
  gap: 12px;
  align-content: start;
}

.followup-options .slot-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
}

.followup-options .callback-presets {
  gap: 8px;
}

.followup-options .callback-presets .compact-btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.slot-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.time-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  width: 100%;
}

.time-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 42px;
  font-weight: 850;
  font-size: 0.92rem;
}

.time-slot.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.appointment-email-list {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.invite-recipient-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.75fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: end;
}

.slot-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.appointment-warning {
  border: 1px solid #e1b14f;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff4d8;
  color: #7c4d11;
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
}

.appointment-warning strong {
  color: #7c4d11;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calendar-panel-head {
  align-items: flex-start;
}

.calendar-date-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-range-label {
  min-width: 12rem;
  text-align: center;
  font-weight: 900;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.62rem 0.9rem;
  background: var(--panel);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(220px, 1fr) auto auto auto;
  gap: 0.75rem;
  align-items: end;
}

.calendar-toolbar label {
  display: grid;
  gap: 0.35rem;
  font-weight: 800;
  color: var(--muted);
}

.calendar-view-toggle {
  width: 100%;
}

.calendar-view-toggle button {
  min-height: 2.6rem;
}

.calendar-filter-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.calendar-filter-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 900;
  padding: 0.48rem 0.78rem;
  cursor: pointer;
}

.calendar-filter-toggle.active {
  background: #e6f2ea;
  color: var(--green-dark);
  border-color: rgba(63, 128, 83, 0.35);
}

.calendar-filter-toggle.active[data-calendar-filter="followup"] {
  background: #fff4d6;
  color: #815513;
  border-color: #e6bd62;
}

.calendar-filter-toggle.active[data-calendar-filter="valuation"] {
  background: #eaf2ff;
  color: #1d4f91;
  border-color: #8ab7ef;
}

.calendar-filter-toggle.active[data-calendar-filter="mandate"] {
  background: #fff0e6;
  color: #9a4517;
  border-color: #e6a56f;
}

.calendar-filter-toggle.active[data-calendar-filter="appointment"] {
  background: #e7f5eb;
  color: var(--green-dark);
  border-color: rgba(63, 128, 83, 0.42);
}

.calendar-filter-toggle.active[data-calendar-filter="block"] {
  background: #ffe8e6;
  color: #8f1d14;
  border-color: #f0a29a;
}

.calendar-filter-toggle.active[data-calendar-filter="external"] {
  background: #edf1f7;
  color: #344458;
  border-color: #aeb8c8;
}

.calendar-filter-divider {
  width: 1px;
  align-self: stretch;
  min-height: 1.75rem;
  background: var(--line);
}

.calendar-filter-toggle.source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.calendar-filter-toggle.source-toggle.active {
  background: var(--calendar-filter-bg);
  color: var(--calendar-filter-text);
  border-color: var(--calendar-filter-border);
}

.calendar-filter-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--calendar-filter-accent, var(--muted));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.calendar-sync-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
}

.calendar-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: var(--panel-soft);
  font-weight: 800;
  color: var(--ink);
}

.calendar-sync-pill.connected {
  color: var(--green);
  background: #e8f2eb;
}

.calendar-sync-pill.source-pill {
  color: var(--calendar-filter-text);
  background: var(--calendar-filter-bg);
  border-color: var(--calendar-filter-border);
}

.calendar-sync-pill.warning {
  color: #8a5a00;
  background: #fff4d6;
  border-color: #e4b85c;
}

.calendar-shell {
  min-height: 36rem;
  overflow-y: visible;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--line);
}

.calendar-weekday-header,
.calendar-month-day {
  background: var(--panel);
}

.calendar-weekday-header {
  padding: 0.75rem;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.calendar-month-day {
  min-height: 8.5rem;
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calendar-month-day.outside {
  background: #f8faf7;
  color: #98a29c;
}

.calendar-month-day.today {
  box-shadow: inset 0 0 0 2px rgba(63, 128, 83, 0.35);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 900;
}

.calendar-day-add {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  padding: 0;
  opacity: 0;
}

.calendar-month-day:hover .calendar-day-add {
  opacity: 1;
}

.calendar-event-stack {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
}

.calendar-event-pill,
.calendar-event-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 0.6rem;
  background: #f7fbf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.calendar-event-pill {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 0.4rem;
  padding: 0.32rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.calendar-event-pill span,
.calendar-event-card span {
  min-width: 0;
}

.calendar-event-time {
  display: block;
  min-width: 3.35rem;
  font-weight: 900;
  color: var(--green);
  white-space: nowrap;
}

.calendar-event-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-more {
  color: var(--muted);
  font-weight: 800;
  padding: 0.25rem 0.1rem;
}

.calendar-event-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem;
}

.calendar-event-card strong {
  display: block;
  font-size: 1rem;
}

.calendar-event-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-event-source {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  background: #edf3ef;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 900;
}

.calendar-type-followup {
  border-left-color: #c2952f;
  background: #fff8e4;
}

.calendar-type-appointment {
  border-left-color: #3f8053;
  background: #f3fbf5;
}

.calendar-category-valuation {
  border-left-color: #3f65a0;
  background: #f1f5ff;
}

.calendar-category-mandate {
  border-left-color: #b57b21;
  background: #fff6e6;
}

.calendar-type-block {
  border-left-color: #b42318;
  background: #ffe8e6;
  color: #5f1711;
}

.calendar-event-pill.calendar-type-block,
.calendar-event-card.calendar-type-block,
.calendar-week-event.calendar-type-block {
  border-color: #f3b4ae;
  border-left-color: #b42318;
  background: #ffe8e6;
  color: #5f1711;
}

.calendar-type-block .calendar-event-time,
.calendar-type-block .calendar-event-source,
.calendar-week-event.calendar-type-block span,
.calendar-week-event.calendar-type-block em {
  color: #8f1d14;
}

.calendar-type-external {
  border-left-color: #3f65a0;
  background: #f1f5ff;
}

.calendar-week-shell {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--panel);
}

.calendar-week-header-grid,
.calendar-week-all-day-grid,
.calendar-week-time-grid {
  display: grid;
  grid-template-columns: 5.25rem repeat(7, minmax(8.5rem, 1fr));
  min-width: 60rem;
}

.calendar-week-header-grid {
  z-index: 5;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.calendar-week-day-header {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.15rem;
  padding: 0.65rem 0.5rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-week-day-header strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.calendar-week-day-header.today,
.calendar-week-time-column.today {
  background: #f4fbf6;
}

.calendar-week-day-header .calendar-day-add {
  position: absolute;
  right: 0.35rem;
  top: 0.35rem;
}

.calendar-week-day-header:hover .calendar-day-add {
  opacity: 1;
}

.calendar-week-all-day-grid {
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.calendar-week-time-gutter {
  background: #fbfcfb;
  border-right: 1px solid var(--line);
}

.calendar-week-all-day-label {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-week-all-day-cell {
  min-height: 3.2rem;
  padding: 0.45rem;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calendar-week-empty-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.calendar-week-time-grid {
  height: var(--calendar-week-height);
  position: relative;
}

.calendar-week-time-rail {
  position: relative;
  background: #fbfcfb;
  border-right: 1px solid var(--line);
}

.calendar-week-hour-label {
  position: absolute;
  right: 0.55rem;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-week-time-column {
  position: relative;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.calendar-week-slot {
  height: 18px;
  border-top: 1px solid rgba(220, 227, 222, 0.55);
}

.calendar-week-slot:nth-child(4n + 1) {
  border-top-color: var(--line);
}

.calendar-week-slot:hover {
  background: rgba(63, 128, 83, 0.07);
}

.calendar-week-event-layer {
  pointer-events: none;
  position: absolute;
  inset: 0.15rem 0.22rem;
}

.calendar-week-event {
  pointer-events: auto;
  position: absolute;
  left: 0.15rem;
  right: 0.15rem;
  display: grid;
  align-content: start;
  gap: 0.08rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 0.55rem;
  background: #f3fbf5;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(16, 33, 24, 0.08);
}

.calendar-week-event[data-calendar-draggable-id] {
  cursor: grab;
}

.calendar-week-event.dragging {
  opacity: 0.28;
  outline: 2px dashed rgba(63, 128, 83, 0.45);
  outline-offset: -3px;
}

.calendar-week-event.moving {
  opacity: 0.14;
}

.calendar-week-event.resizing {
  cursor: ns-resize;
}

.calendar-week-event.pending-move {
  outline: 2px dashed rgba(63, 128, 83, 0.45);
}

.calendar-week-event span,
.calendar-week-event em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.calendar-week-event strong {
  font-size: 0.82rem;
  line-height: 1.15;
}

.calendar-drag-ghost {
  pointer-events: none;
  position: fixed;
  z-index: 3000;
  display: grid;
  align-content: start;
  gap: 0.08rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 0.55rem;
  background: #f3fbf5;
  color: var(--ink);
  padding: 0.25rem 0.4rem;
  overflow: hidden;
  box-shadow: 0 16px 34px rgba(16, 33, 24, 0.22);
}

.calendar-drag-ghost.invalid {
  opacity: 0.55;
}

.calendar-drag-ghost span,
.calendar-drag-ghost em {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.calendar-drag-ghost strong {
  font-size: 0.82rem;
  line-height: 1.15;
}

.calendar-event-pill.calendar-type-followup,
.calendar-event-card.calendar-type-followup,
.calendar-week-event.calendar-type-followup,
.calendar-drag-ghost.calendar-type-followup {
  border-color: #efd08a;
  border-left-color: #b7791f;
  background: #fff7df;
  color: #5f3d0b;
}

.calendar-event-pill.calendar-type-appointment,
.calendar-event-card.calendar-type-appointment,
.calendar-week-event.calendar-type-appointment,
.calendar-drag-ghost.calendar-type-appointment {
  border-color: #b7d8c2;
  border-left-color: #2f7d4a;
  background: #f0fbf4;
  color: #173c27;
}

.calendar-event-pill.calendar-category-valuation,
.calendar-event-card.calendar-category-valuation,
.calendar-week-event.calendar-category-valuation,
.calendar-drag-ghost.calendar-category-valuation {
  border-color: #b5cff8;
  border-left-color: #2563eb;
  background: #edf5ff;
  color: #173b78;
}

.calendar-event-pill.calendar-category-mandate,
.calendar-event-card.calendar-category-mandate,
.calendar-week-event.calendar-category-mandate,
.calendar-drag-ghost.calendar-category-mandate {
  border-color: #f0bd93;
  border-left-color: #c45116;
  background: #fff0e6;
  color: #6b2d0e;
}

.calendar-event-pill.calendar-type-block,
.calendar-event-card.calendar-type-block,
.calendar-week-event.calendar-type-block,
.calendar-drag-ghost.calendar-type-block {
  border-color: #f3b4ae;
  border-left-color: #b42318;
  background: #ffe8e6;
  color: #5f1711;
}

.calendar-event-pill.calendar-type-external,
.calendar-event-card.calendar-type-external,
.calendar-week-event.calendar-type-external,
.calendar-drag-ghost.calendar-type-external {
  border-color: #c6ceda;
  border-left-color: #59677a;
  background: #f5f7fa;
  color: #283443;
}

.calendar-type-followup .calendar-event-time,
.calendar-type-followup .calendar-event-source,
.calendar-week-event.calendar-type-followup span,
.calendar-week-event.calendar-type-followup em,
.calendar-drag-ghost.calendar-type-followup span,
.calendar-drag-ghost.calendar-type-followup em {
  color: #94610f;
}

.calendar-type-appointment .calendar-event-time,
.calendar-type-appointment .calendar-event-source,
.calendar-week-event.calendar-type-appointment span,
.calendar-week-event.calendar-type-appointment em,
.calendar-drag-ghost.calendar-type-appointment span,
.calendar-drag-ghost.calendar-type-appointment em {
  color: #2f7d4a;
}

.calendar-category-valuation .calendar-event-time,
.calendar-category-valuation .calendar-event-source,
.calendar-week-event.calendar-category-valuation span,
.calendar-week-event.calendar-category-valuation em,
.calendar-drag-ghost.calendar-category-valuation span,
.calendar-drag-ghost.calendar-category-valuation em {
  color: #1d5db8;
}

.calendar-category-mandate .calendar-event-time,
.calendar-category-mandate .calendar-event-source,
.calendar-week-event.calendar-category-mandate span,
.calendar-week-event.calendar-category-mandate em,
.calendar-drag-ghost.calendar-category-mandate span,
.calendar-drag-ghost.calendar-category-mandate em {
  color: #a74b16;
}

.calendar-type-block .calendar-event-time,
.calendar-type-block .calendar-event-source,
.calendar-week-event.calendar-type-block span,
.calendar-week-event.calendar-type-block em,
.calendar-drag-ghost.calendar-type-block span,
.calendar-drag-ghost.calendar-type-block em {
  color: #8f1d14;
}

.calendar-type-external .calendar-event-time,
.calendar-type-external .calendar-event-source,
.calendar-week-event.calendar-type-external span,
.calendar-week-event.calendar-type-external em,
.calendar-drag-ghost.calendar-type-external span,
.calendar-drag-ghost.calendar-type-external em {
  color: #4c596b;
}

.calendar-type-followup .calendar-event-source {
  background: #fff0bf;
}

.calendar-type-appointment .calendar-event-source {
  background: #dff1e5;
}

.calendar-category-valuation .calendar-event-source {
  background: #dceaff;
}

.calendar-category-mandate .calendar-event-source {
  background: #ffe0ca;
}

.calendar-type-block .calendar-event-source {
  background: #ffd6d2;
}

.calendar-type-external .calendar-event-source {
  background: #e7ebf1;
}

.calendar-event-pill.calendar-source-coloured,
.calendar-event-card.calendar-source-coloured,
.calendar-week-event.calendar-source-coloured,
.calendar-drag-ghost.calendar-source-coloured {
  border-color: var(--calendar-event-border);
  border-left-color: var(--calendar-event-accent);
  background: var(--calendar-event-bg);
  color: var(--calendar-event-text);
}

.calendar-source-coloured .calendar-event-time,
.calendar-source-coloured .calendar-event-source,
.calendar-week-event.calendar-source-coloured span,
.calendar-week-event.calendar-source-coloured em,
.calendar-drag-ghost.calendar-source-coloured span,
.calendar-drag-ghost.calendar-source-coloured em {
  color: var(--calendar-event-accent);
}

.calendar-source-coloured .calendar-event-source {
  background: var(--calendar-event-bg);
}

.calendar-resize-handle {
  position: absolute;
  left: 50%;
  width: 34px;
  height: 7px;
  border-radius: 999px;
  background: rgba(63, 128, 83, 0.95);
  box-shadow: 0 2px 6px rgba(16, 33, 24, 0.18);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.12s ease;
  cursor: ns-resize;
}

.calendar-resize-handle.top {
  top: 3px;
}

.calendar-resize-handle.bottom {
  bottom: 3px;
}

.calendar-week-event:hover .calendar-resize-handle,
.calendar-week-event.resizing .calendar-resize-handle {
  opacity: 1;
}

.calendar-agenda {
  display: grid;
  gap: 0.8rem;
}

.calendar-agenda-day {
  display: grid;
  grid-template-columns: minmax(150px, 210px) 1fr;
  gap: 0.9rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--panel);
}

.calendar-agenda-date strong {
  display: block;
  font-size: 1.05rem;
}

.calendar-agenda-date span {
  color: var(--muted);
}

.calendar-agenda-events {
  display: grid;
  gap: 0.5rem;
}

.calendar-empty {
  display: grid;
  place-items: center;
  min-height: 12rem;
  border: 1px dashed var(--line);
  border-radius: 0.75rem;
  color: var(--muted);
  background: #fbfcfb;
  font-weight: 800;
}

.calendar-item-detail {
  display: grid;
  gap: 0.65rem;
}

.calendar-item-detail-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.calendar-item-detail-row span:first-child {
  color: var(--muted);
  font-weight: 900;
}

.calendar-all-day-toggle {
  align-self: end;
  min-height: 3.25rem;
}

.ownership-warning ul {
  margin: 0;
  padding-left: 18px;
}

.lead-details-section {
  gap: 14px;
}

.outcome-detail-stack {
  display: grid;
  gap: 14px;
}

.outcome-detail-section {
  background: #fff;
}

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

.property-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.property-detail-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.property-detail-grid {
  align-items: end;
}

.buyer-criteria-grid {
  align-items: end;
}

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

.buyer-criteria-summary,
.buyer-match-item,
.buyer-score {
  display: grid;
  gap: 4px;
}

.buyer-criteria-summary span:not(.buyer-criteria-label),
.buyer-match-meta,
.buyer-score small {
  color: var(--muted);
  font-size: 0.82rem;
}

.buyer-criteria-label {
  color: var(--green-dark);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.buyer-match-main {
  font-weight: 800;
}

.buyer-score {
  min-width: 120px;
}

.buyer-score strong {
  font-size: 1rem;
}

.buyer-score-bar {
  height: 7px;
  border-radius: 999px;
  background: #e7eeea;
  overflow: hidden;
}

.buyer-score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.lead-property-picker {
  max-width: 520px;
}

.selected-property-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfa;
  display: grid;
  gap: 4px;
}

.selected-property-note span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.toggle-grid.two-up {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
}

.lead-feature-check {
  min-height: 40px;
  justify-content: center;
}

.feature-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-feature-field {
  max-width: 86px;
  align-items: center;
}

.compact-feature-field input {
  min-height: 40px;
  text-align: center;
}

.buyer-min-field > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.buyer-min-field small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.check-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-pill input {
  width: 18px;
  min-height: 18px;
}

.wrong-number-clear {
  background: #fff7f7;
  border-color: #e5b5b5;
}

.wrong-number-clear[hidden] {
  display: none;
}

.notes-box {
  display: grid;
  gap: 8px;
}

.agenda-day {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.agenda-day:first-child {
  border-top: 0;
  padding-top: 0;
}

.agenda-date {
  display: grid;
  align-content: start;
  gap: 4px;
}

.agenda-date strong {
  font-size: 1rem;
}

.agenda-date span {
  color: var(--muted);
  font-size: 0.86rem;
}

.agenda-items {
  display: grid;
  gap: 10px;
}

.bulk-actions {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 0 4px;
}

.bulk-actions.is-visible {
  display: flex;
}

.bulk-actions span {
  color: var(--muted);
  font-weight: 700;
}

.agenda-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 28px minmax(220px, 1.1fr) minmax(140px, 0.45fr) minmax(160px, 0.55fr) minmax(180px, 1fr) auto;
  gap: 16px;
  text-align: left;
  align-items: center;
  cursor: pointer;
}

.agenda-item.is-selected {
  border-color: var(--green);
  background: #f7fbf6;
}

.agenda-select {
  display: grid;
  place-items: center;
  min-height: 28px;
  cursor: pointer;
}

.agenda-select input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.agenda-item span,
.agenda-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.agenda-item strong {
  display: block;
}

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

.danger-btn {
  color: #9f2f2f;
  border-color: #e5b5b5;
}

.danger-btn:hover {
  background: #fff1f1;
}

.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 190px);
}

.table-load-more {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: center;
  min-height: 42px;
  padding: 10px 0 0;
}

.compact-load-more {
  min-height: 34px;
  padding-top: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
  background: #fff;
}

.property-table {
  table-layout: auto;
  max-width: none;
  min-width: 100%;
  width: max-content;
}

.property-table th:last-child,
.property-table td:last-child {
  max-width: none !important;
  width: auto !important;
}

.property-table textarea {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.admin-table {
  min-width: 1740px;
}

.admin-table select,
.admin-table input[type="date"] {
  min-width: 128px;
}

.admin-amount-input {
  max-width: 116px;
  min-width: 104px;
}

.admin-caller-limit-input {
  max-width: 96px;
  min-width: 84px;
}

.admin-plus-toggle {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-weight: 800;
  margin-bottom: 4px;
  white-space: nowrap;
}

.admin-plus-toggle input {
  height: 18px;
  margin: 0;
  width: 18px;
}

.admin-presence {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 6px;
  margin-top: 7px;
}

.admin-presence-dot {
  border-radius: 999px;
  height: 9px;
  width: 9px;
}

.admin-presence strong {
  display: inline;
}

.admin-presence.online {
  color: #2f7d49;
}

.admin-presence.online .admin-presence-dot {
  background: #2f8f4e;
  box-shadow: 0 0 0 3px rgba(47, 143, 78, 0.14);
}

.admin-presence.offline {
  color: #b33a34;
}

.admin-presence.offline .admin-presence-dot {
  background: #c2413a;
  box-shadow: 0 0 0 3px rgba(194, 65, 58, 0.12);
}

.admin-last-online {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  line-height: 1.35;
  margin-top: 2px;
  white-space: nowrap;
}

#leadManagementView .data-table {
  min-width: 100%;
  table-layout: auto;
  width: max-content;
}

#leadManagementView .data-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

#leadManagementView.active {
  align-content: start;
  display: grid;
  gap: 26px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

#leadManagementView .panel {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.lead-management-controls {
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
}

.lead-flow-note {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.lead-management-edit-context {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.lead-management-edit-context strong,
.lead-management-edit-context span {
  display: block;
}

.lead-management-edit-context > div:first-child span {
  color: var(--muted);
  margin-top: 2px;
}

.lead-management-context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-management-filter-panel {
  padding-bottom: 14px;
}

.lead-management-leads-panel {
  min-height: calc(50vh - 72px);
}

.lead-management-leads-panel .data-table-wrap {
  max-height: calc(50vh - 220px);
}

#leadManagementView input,
#leadManagementView select,
#leadManagementView textarea {
  min-width: 0;
  padding: 7px 8px;
  font-size: 0.82rem;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: middle;
  font-size: 0.86rem;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f0f4ee;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  user-select: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

.data-table th.resizable {
  position: sticky;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sorted {
  color: var(--ink);
}

.sort-indicator {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #dfe9df;
  color: var(--green-dark);
  font-size: 0.62rem;
  line-height: 1.35;
  vertical-align: middle;
  white-space: nowrap;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 3px;
  width: 1px;
  background: transparent;
}

.col-resizer:hover::after,
body.resizing-columns .col-resizer::after {
  background: #7f9188;
}

body.resizing-columns {
  cursor: col-resize;
  user-select: none;
}

.data-table input,
.data-table select,
.data-table textarea {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  padding: 4px;
  background: transparent;
}

.data-table input[type="date"] {
  box-sizing: border-box;
  min-width: 148px;
  padding-right: 36px;
}

.data-table input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin-left: 4px;
}

.data-table .money-input {
  text-align: right;
}

.data-table .icon-input {
  width: 40px;
  text-align: center;
  margin: 0 auto;
  display: block;
}

.data-table .check-cell {
  display: inline-grid;
  place-items: center;
  width: 100%;
}

.data-table .check-cell input {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0 auto;
  display: inline-block;
  border: 1px solid #9aa59f;
  border-radius: 3px;
  background: #fff;
}

.icon-col {
  width: 50px;
  text-align: center;
  vertical-align: middle;
}

.data-table th.icon-col {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.mini-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  vertical-align: middle;
}

.icon-bed {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2368736e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7v10'/%3E%3Cpath d='M21 12v5'/%3E%3Cpath d='M3 12h18'/%3E%3Cpath d='M7 12V7h8a3 3 0 0 1 3 3v2'/%3E%3Cpath d='M3 17h18'/%3E%3C/svg%3E");
}

.icon-bath {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2368736e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6 6.5 3.5a1.5 1.5 0 0 0-2.1 0A1.5 1.5 0 0 0 4 4.6V12'/%3E%3Cpath d='M4 12h16a1 1 0 0 1 1 1v1a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5v-1a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M8 19v2'/%3E%3Cpath d='M16 19v2'/%3E%3C/svg%3E");
}

.icon-garage {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2368736e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V9l9-6 9 6v12'/%3E%3Cpath d='M7 21v-8h10v8'/%3E%3Cpath d='M7 17h10'/%3E%3Cpath d='M7 13h10'/%3E%3C/svg%3E");
}

.icon-pool {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2368736e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 16c2 0 2-1 4-1s2 1 4 1 2-1 4-1 2 1 4 1 2-1 4-1'/%3E%3Cpath d='M2 20c2 0 2-1 4-1s2 1 4 1 2-1 4-1 2 1 4 1 2-1 4-1'/%3E%3Cpath d='M6 11V5a3 3 0 0 1 6 0'/%3E%3Cpath d='M12 11V5a3 3 0 0 1 6 0'/%3E%3Cpath d='M6 8h12'/%3E%3C/svg%3E");
}

.status-active td {
  background: #fff5b8;
}

.status-sold td {
  background: #ffd8d8;
}

.status-under-offer td,
.status-sale-pending td {
  background: #ffe2bd;
}

.status-expired td {
  background: #c9f3ff;
}

.data-table tr[style*="--property-status-row-color"] td {
  background: var(--property-status-row-color);
}

.client-wrong-number td {
  background: #ffe4e4;
}

.client-selected td,
.property-selected td {
  box-shadow: inset 0 0 0 9999px rgba(62, 128, 82, 0.08);
}

.table-select-checkbox {
  cursor: pointer;
  height: 18px;
  margin: 0;
  min-height: 18px;
  width: 18px;
}

.data-table textarea {
  min-width: 220px;
}

.data-table.property-table textarea {
  display: block;
  max-width: 100%;
  min-width: 0;
  resize: none;
  width: 100%;
}

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

.activity-timeline .section-title {
  margin-bottom: 4px;
}

.activity-timeline .section-title span {
  color: var(--muted);
  font-size: 0.9rem;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.history-item.activity-item {
  border-left: 4px solid #cfd8d2;
}

.history-item.activity-item.call {
  border-left-color: var(--green);
}

.history-item.activity-item.note {
  border-left-color: #4f6fa8;
}

.history-item.activity-item.appointment {
  border-left-color: #b47a24;
}

.history-item.activity-item.followup {
  border-left-color: #d2a737;
}

.history-item.activity-item.status {
  border-left-color: #6c7b75;
}

.history-item.activity-item.import,
.history-item.activity-item.create {
  border-left-color: #7a61a8;
}

.history-item.activity-item.delete {
  border-left-color: var(--red);
}

.history-item strong {
  display: block;
}

.history-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

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

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.history-meta span {
  border-radius: 999px;
  background: #eef3ee;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.history-item p {
  color: var(--ink);
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.danger-text {
  color: var(--red);
  min-height: auto;
  padding: 0;
}

.data-table .center-cell {
  text-align: center;
  vertical-align: middle;
}

.data-table .action-cell {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
}

.table-edit-btn {
  min-height: 30px;
  width: 30px;
  padding: 0;
}

.drop-zone {
  border: 1px dashed #95a79e;
  border-radius: 8px;
  min-height: 120px;
  display: grid;
  place-items: center;
  background: #fbfcfa;
  margin-top: 14px;
}

.drop-zone input {
  display: none;
}

.drop-zone.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.import-preview {
  display: grid;
  gap: 12px;
}

.import-actions {
  justify-content: flex-start;
  padding-left: 0;
}

.import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.import-preview-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  justify-content: space-between;
}

.import-preview-toolbar .import-summary {
  flex: 1 1 420px;
}

.import-summary span {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 0.82rem;
  font-weight: 800;
}

.import-preview-filter {
  flex: 0 0 auto;
  padding: 8px 10px;
}

.import-preview-toolbar > .muted {
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 800;
}

.import-preview-dialog {
  max-height: calc(100vh - 24px);
  width: min(1760px, calc(100vw - 24px));
}

.import-preview-dialog-form {
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.import-preview-dialog-panel {
  min-height: 0;
  overflow: hidden;
}

.import-preview-dialog-panel .import-preview-table {
  max-height: min(64vh, 680px);
  overflow-x: hidden;
}

.import-preview-dialog-panel .data-table {
  min-width: 0;
  table-layout: fixed;
}

.import-preview-dialog-panel .data-table th,
.import-preview-dialog-panel .data-table td {
  overflow-wrap: anywhere;
  vertical-align: top;
  white-space: normal;
}

.import-preview-dialog-panel .data-table th:nth-child(1),
.import-preview-dialog-panel .data-table td:nth-child(1) {
  width: 54px;
}

.import-preview-dialog-panel .data-table th:nth-child(5),
.import-preview-dialog-panel .data-table td:nth-child(5) {
  width: 92px;
}

.import-preview-dialog-panel .data-table th:nth-child(6),
.import-preview-dialog-panel .data-table td:nth-child(6) {
  width: 180px;
}

.import-preview-table select {
  min-width: 0;
  width: 100%;
}

.import-preview-patch-status {
  font-size: 0.9rem;
  font-weight: 800;
  margin: -4px 0 0;
}

.import-preview-admin-action {
  border-color: var(--green);
  color: var(--green);
}

.import-preview-admin-date {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 8px;
}

.import-preview-admin-date input {
  min-height: 36px;
  min-width: 150px;
  padding: 7px 9px;
}

.import-owner-bulk-actions {
  align-items: center;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 12px;
}

.import-owner-bulk-actions p {
  margin: 4px 0 0;
}

.import-owner-bulk-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.import-owner-bulk-buttons .is-selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.import-owner-details {
  display: grid;
  gap: 7px;
}

.import-owner-card {
  display: grid;
  gap: 3px;
}

.import-owner-card strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.import-owner-card small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.preview-invalid td {
  background: #fff1f1;
}

.setup-list,
.audit-list {
  display: grid;
  gap: 10px;
}

.compact-setup-list .empty-state {
  min-height: 86px;
}

.setup-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.setup-item strong,
.setup-item span {
  display: block;
}

.setup-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.setup-item em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--green-dark);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 850;
}

.caller-card {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.caller-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.role-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: #fbfcfa;
}

.role-note.error-note {
  border-color: #e5b5b5;
  color: #9f2f2f;
  background: #fff1f1;
  font-weight: 800;
}

.calendar-note {
  border: 1px solid #c9ddcd;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--green-dark);
  background: #f3faf4;
}

.permission-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.calendar-connection-issues {
  display: grid;
  gap: 10px;
}

.calendar-connection-issue {
  border: 1px solid #f0c879;
  border-radius: 8px;
  background: #fff7df;
  padding: 12px;
  display: grid;
  gap: 4px;
}

.calendar-connection-issue strong {
  color: #7a5411;
}

.calendar-connection-issue span {
  color: var(--muted);
  line-height: 1.35;
}

.calendar-connection-actions {
  gap: 8px;
  flex-wrap: wrap;
}

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

.profile-form {
  display: grid;
  gap: 12px;
}

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

.profile-accordion {
  display: grid;
  gap: 14px;
}

.profile-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.profile-accordion summary::-webkit-details-marker {
  display: none;
}

.profile-accordion summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 900;
  transition: transform 0.16s ease;
}

.profile-accordion:not([open]) summary::after {
  transform: rotate(-90deg);
}

.profile-accordion summary strong {
  display: block;
  font-size: 1.05rem;
}

.profile-accordion summary small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 750;
}

.profile-accordion > :not(summary) {
  margin-top: 14px;
}

.dropdown-settings-form .primary-btn {
  justify-self: start;
}

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

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

.dropdown-settings-card.wide {
  grid-column: 1 / -1;
}

.dropdown-settings-card > span,
.dropdown-settings-head strong {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 850;
}

.dropdown-settings-card small,
.dropdown-settings-head small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.dropdown-status-editor {
  display: grid;
  gap: 8px;
}

.dropdown-status-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 58px 38px;
  gap: 8px;
  align-items: center;
}

.dropdown-status-row input[type="color"] {
  min-height: 42px;
  padding: 4px;
}

.account-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.account-status-card + .primary-btn {
  width: 100%;
  margin-bottom: 12px;
}

.account-status-card span,
.calendar-status-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.account-status-card strong {
  display: block;
  font-size: 2.35rem;
  line-height: 1;
  margin-top: 5px;
}

.account-status-card p {
  color: var(--muted);
  margin: 0;
}

.calendar-status-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.calendar-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.sidebar-calendar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.calendar-provider-options {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 12px;
}

.calendar-provider-options > span {
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-provider-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 800;
}

.calendar-ics-list {
  display: grid;
  gap: 8px;
}

.calendar-ics-list:empty {
  display: none;
}

.calendar-ics-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.calendar-ics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 850;
  white-space: nowrap;
}

.calendar-ics-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-ics-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-ics-item small {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-ics-field {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.calendar-ics-field > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.calendar-ics-field small {
  color: var(--muted);
  line-height: 1.35;
}

.template-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.template-tab-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
  font-weight: 850;
  cursor: pointer;
}

.template-tab-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.template-form > label {
  max-width: 520px;
}

.template-tab-panel {
  display: grid;
  gap: 12px;
}

.template-tab-panel[hidden] {
  display: none;
}

.template-panel-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.template-panel-section h4 {
  font-size: 0.95rem;
  margin: 0;
}

.subscription-dashboard,
.subscription-grid {
  display: grid;
  gap: 16px;
}

.subscription-summary-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(320px, 2fr);
  gap: 18px;
  align-items: center;
}

.subscription-summary-panel .billing-notice {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.subscription-hero-copy h3 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin: 0 0 6px;
}

.subscription-hero-copy p {
  color: var(--muted);
  margin: 0;
}

.subscription-hero-copy .plan-badge {
  display: inline-block;
  margin: 0 0 10px;
}

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

.subscription-status-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.subscription-status-grid span,
.usage-bar-head span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.subscription-status-grid strong {
  display: block;
  margin-top: 4px;
}

.subscription-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
}

.usage-bar {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.usage-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.usage-track {
  height: 10px;
  border-radius: 999px;
  background: #e9eeea;
  overflow: hidden;
}

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

.usage-bar.warning .usage-track span {
  background: #d69b2d;
}

.usage-bar.danger .usage-track span,
.usage-bar.limit .usage-track span {
  background: #c74f3f;
}

.usage-bar small {
  color: var(--muted);
}

.usage-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.usage-detail-grid span {
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 7px 10px;
}

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

.subscription-detail-list span {
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
}

.subscription-detail-list span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.billing-history-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.billing-history-row div {
  display: grid;
  gap: 4px;
}

.billing-history-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.subscription-plan-limits {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.subscription-plan-limits > strong {
  display: block;
  margin-bottom: 8px;
}

.subscription-limit-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.subscription-limit-item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.subscription-limit-item small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.subscription-limit-item b {
  color: var(--ink);
  font-size: 0.93rem;
  line-height: 1.25;
}

.subscription-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subscription-plan-matrix {
  display: grid;
  gap: 20px;
}

.availability-grid {
  overflow-x: auto;
  padding-bottom: 6px;
}

.availability-table {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-width: 1050px;
  background: #fff;
}

.availability-day-column {
  border-right: 1px solid var(--line);
  padding: 10px;
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 180px;
}

.availability-day-column:last-child {
  border-right: 0;
}

.availability-day-head {
  justify-content: center;
  background: #f0f4ee;
  margin: -10px -10px 2px;
  padding: 10px;
  border-radius: 0;
  border: 0;
}

.availability-ranges {
  display: grid;
  gap: 8px;
}

.availability-range-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  width: min(820px, calc(100vw - 28px));
  padding: 0;
}

dialog::backdrop {
  background: rgba(15, 25, 20, 0.55);
}

.dialog-form {
  padding: 20px;
}

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

.wide {
  grid-column: 1 / -1;
}

.form-section-title {
  margin: 8px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.grouped-form .form-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

menu {
  margin: 18px 0 0;
  padding: 0;
  justify-content: flex-end;
}

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

.status-pill {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 850;
  justify-content: center;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
}

.status-pill.success {
  background: #e5f2e9;
  color: #27643f;
}

.status-pill.danger {
  background: #f9e4e4;
  color: #9f2f2f;
}

.status-pill.neutral {
  background: #eef2ef;
  color: var(--muted);
}

.empty-state-card {
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 28px;
  place-items: center;
  text-align: center;
}

.empty-state-card h3,
.empty-state-card p {
  margin: 0;
}

.showhouse-list {
  display: grid;
  gap: 18px;
}

.showhouse-section {
  display: grid;
  gap: 12px;
}

.showhouse-section + .showhouse-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.showhouse-section-head h3 {
  margin: 0;
}

.showhouse-section-head span {
  color: var(--muted);
  font-weight: 800;
}

.showhouse-section-list {
  display: grid;
  gap: 14px;
}

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

.showhouse-card-main {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
}

.showhouse-card-main h3 {
  margin: 10px 0 6px;
}

.showhouse-card-main p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.showhouse-card-main img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.showhouse-meta,
.showhouse-dates {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.showhouse-meta span,
.showhouse-dates span {
  background: var(--panel-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 6px 10px;
}

.showhouse-link-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.showhouse-link-row input {
  flex: 1 1 360px;
  min-width: 0;
}

.showhouse-bookings {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.showhouse-booking-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(17, 31, 25, 0.04);
}

.showhouse-booking-summary {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(230px, 1.4fr) minmax(150px, 0.8fr) minmax(170px, 1fr);
}

.showhouse-booking-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.showhouse-booking-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.showhouse-bookings span,
.showhouse-bookings small {
  color: var(--muted);
}

.showhouse-booking-summary strong {
  color: var(--ink);
  line-height: 1.25;
}

.showhouse-booking-summary span:not(.showhouse-booking-label):not(.showhouse-booking-pill),
.showhouse-booking-summary small {
  overflow-wrap: anywhere;
}

.showhouse-booking-pill {
  align-self: start;
  background: #eef4ef;
  border: 1px solid #d9e4dc;
  border-radius: 999px;
  color: var(--green-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 5px 10px;
  width: fit-content;
}

.showhouse-booking-actions {
  align-items: center;
  border-top: 1px solid #edf1ee;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}

.showhouse-booking-actions .ghost-btn {
  min-height: 36px;
  padding: 8px 12px;
  width: auto;
}

.showhouse-booking-details {
  border: 0;
  padding: 0;
}

.showhouse-booking-details summary {
  align-items: center;
  background: #f4f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  font-size: 0.86rem;
  font-weight: 900;
  justify-content: center;
  list-style: none;
  min-height: 36px;
  padding: 8px 12px;
  user-select: none;
}

.showhouse-booking-details summary::-webkit-details-marker {
  display: none;
}

.showhouse-booking-details summary:hover {
  background: #eaf2ed;
  border-color: #c9d8ce;
}

.showhouse-booking-details[open] summary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.showhouse-booking-hide-text {
  display: none;
}

.showhouse-booking-details[open] .showhouse-booking-show-text {
  display: none;
}

.showhouse-booking-details[open] .showhouse-booking-hide-text {
  display: inline;
}

.showhouse-booking-details[open] .showhouse-booking-chevron {
  transform: rotate(45deg);
}

.showhouse-booking-chevron {
  display: inline-grid;
  font-size: 1rem;
  line-height: 1;
  place-items: center;
  transition: transform 0.16s ease;
}

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

.showhouse-booking-detail-section {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.showhouse-booking-detail-section h4 {
  border-bottom: 1px solid #e6ece7;
  color: var(--ink);
  margin: 0 0 10px;
  padding-bottom: 8px;
}

.showhouse-booking-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.showhouse-booking-detail-row {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(92px, 0.85fr) minmax(0, 1.15fr);
}

.showhouse-booking-detail-row dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.showhouse-booking-detail-row dd {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.showhouse-booking-detail-row ul {
  margin: 0;
  padding-left: 16px;
}

.showhouse-booking-nested {
  display: grid;
  gap: 4px;
  margin: 0;
}

.showhouse-document-section {
  align-content: start;
}

.showhouse-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.showhouse-document-actions .ghost-btn {
  min-height: 34px;
  padding: 8px 12px;
  width: auto;
}

.showhouse-document-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 10px 0 0;
}

.showhouse-dialog {
  width: min(1040px, calc(100vw - 28px));
}

.showhouse-booking-edit-dialog {
  max-width: min(980px, calc(100vw - 28px));
}

.showhouse-dialog-form {
  display: grid;
  gap: 16px;
}

.showhouse-booking-edit-form {
  display: grid;
  gap: 16px;
  width: min(940px, calc(100vw - 48px));
}

.showhouse-dialog-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.showhouse-booking-edit-section {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.showhouse-dialog-section h4 {
  margin: 0;
}

.showhouse-booking-edit-section h4 {
  margin: 0;
}

.showhouse-booking-edit-form textarea {
  min-height: 88px;
  resize: vertical;
}

.showhouse-option-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.compact-panel-head {
  padding: 0;
}

.compact-panel-head h4,
.compact-panel-head span {
  margin: 0;
}

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

.showhouse-date-row {
  align-items: end;
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  padding: 10px;
}

.public-showhouse-page {
  background: #17211d;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.public-showhouse-root {
  min-height: 100vh;
  padding: clamp(16px, 4vw, 48px);
}

.public-showhouse-card {
  background:
    linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.94)),
    radial-gradient(circle at top, rgba(124, 183, 139, 0.18), transparent 42%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 960px;
  overflow: hidden;
}

.public-showhouse-hero {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 5vw, 54px);
  text-align: center;
}

.public-showhouse-brand {
  display: grid;
  place-items: center;
}

.public-showhouse-brand img {
  max-height: 130px;
  max-width: min(420px, 100%);
  object-fit: contain;
}

.public-showhouse-brand strong {
  color: var(--green);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.public-showhouse-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0;
}

.public-showhouse-hero h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 0;
}

.public-showhouse-price {
  color: #3b4a44;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
}

.public-showhouse-welcome {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.65;
  margin-inline: auto;
  max-width: 760px;
}

.public-showhouse-cover {
  border-radius: 8px;
  max-height: 560px;
  object-fit: cover;
  width: 100%;
}

.public-listing-link {
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}

.public-listing-link a {
  color: var(--blue);
  font-weight: 800;
}

.public-showhouse-progress {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 18px;
}

.public-showhouse-progress span {
  align-items: center;
  background: var(--panel-soft);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.public-showhouse-progress .active,
.public-showhouse-progress .done {
  background: var(--green);
  color: white;
}

.public-validation-anchor {
  height: 1px;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 20px;
  width: 1px;
}

.public-form-section {
  display: grid;
  gap: 24px;
  padding: clamp(22px, 5vw, 54px);
}

.public-form-section h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
  margin: 0;
}

.public-form-section h3 {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

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

.public-form-grid label,
.public-form-section label {
  color: var(--ink);
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.public-form-section input:not([type="radio"]):not([type="file"]) {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  min-height: 50px;
  padding: 0 14px;
  width: 100%;
}

.public-form-section input:not([type="radio"]):not([type="file"]):focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(64, 124, 79, 0.13);
  outline: none;
}

.public-form-section input::placeholder {
  color: #9aa6a0;
  font-weight: 650;
}

.public-form-section small {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.public-radio-group {
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 20px;
}

.public-radio-group legend {
  color: var(--ink);
  font-weight: 850;
  padding: 0 4px;
}

.public-radio-group label {
  align-items: center;
  display: flex;
  gap: 10px;
  font-weight: 750;
}

.public-radio-group input[type="radio"] {
  accent-color: var(--green);
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.public-upload-field {
  background: var(--panel);
  border: 1px dashed var(--muted);
  border-radius: 8px;
  padding: 20px;
}

.public-upload-field input[type="file"] {
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 14px;
  width: 100%;
}

.public-booking-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 1.15fr);
}

.public-date-options,
.public-slot-grid {
  display: grid;
  gap: 10px;
}

.public-date-options {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.public-slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.public-date-options button,
.public-slot-grid button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  min-height: 48px;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.public-date-options button:hover:not(:disabled),
.public-slot-grid button:hover:not(:disabled) {
  border-color: var(--green);
  transform: translateY(-1px);
}

.public-date-options button.active,
.public-slot-grid button.active {
  background: #e5f2e9;
  border-color: var(--green);
  color: var(--green-dark);
}

.public-slot-grid button:disabled {
  color: #a4aca7;
  cursor: not-allowed;
}

.public-showhouse-actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.public-showhouse-actions button {
  align-items: center;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  justify-content: center;
  min-height: 50px;
  min-width: 160px;
  padding: 0 18px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.public-showhouse-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.public-showhouse-actions .primary-btn {
  background: var(--green);
  border: 1px solid var(--green);
  color: white;
}

.public-showhouse-actions .ghost-btn {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.public-success-card {
  display: grid;
  gap: 12px;
  min-height: 320px;
  padding: clamp(28px, 6vw, 70px);
  place-content: center;
  text-align: center;
}

.form-error {
  background: #fff1f1;
  border: 1px solid #e5b5b5;
  border-radius: 8px;
  color: #9f2f2f;
  font-weight: 850;
  margin: 0 24px;
  padding: 12px 14px;
}

@media (max-width: 1500px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 10px;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 20;
    width: 76px;
    transition: width 180ms ease, box-shadow 180ms ease;
  }

  .sidebar .brand {
    justify-content: center;
  }

  .sidebar .brand h1,
  .sidebar-panel .panel-label,
  .sidebar-panel strong,
  .sidebar-panel button,
  .nav-label {
    display: none;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar .brand-logo {
    width: 42px;
    height: 42px;
  }

  .sidebar .brand-logo-full {
    display: none;
  }

  .sidebar .brand-logo-mark {
    display: block;
    width: 46px;
    height: 46px;
  }

  .nav-tabs {
    width: 100%;
    gap: 7px;
  }

  .nav-tab {
    min-height: clamp(34px, 5vh, 42px);
    padding: 0;
    place-items: center;
    justify-content: center;
  }

  .sidebar-panel {
    width: 100%;
    padding: 8px;
    display: grid;
    place-items: center;
  }

  body.sidebar-open .sidebar {
    align-items: stretch;
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.28);
    width: 280px;
  }

  body.sidebar-open .sidebar .brand {
    justify-content: flex-start;
  }

  body.sidebar-open .sidebar .brand h1,
  body.sidebar-open .sidebar-panel .panel-label,
  body.sidebar-open .sidebar-panel strong,
  body.sidebar-open .sidebar-panel button,
  body.sidebar-open .nav-label {
    display: inline;
  }

  body.sidebar-open .sidebar .brand h1 {
    display: block;
  }

  body.sidebar-open .sidebar .brand-logo-full {
    display: block;
    width: clamp(178px, 23vh, 244px);
    height: auto;
    object-fit: contain;
    object-position: center;
  }

  body.sidebar-open .sidebar .brand-logo-mark {
    display: none;
  }

  body.sidebar-open .nav-tab {
    justify-content: flex-start;
    padding: clamp(5px, 0.9vh, 9px) 12px;
  }

  body.sidebar-open .sidebar-panel {
    place-items: stretch;
    padding: 10px;
  }

  .workspace {
    padding: 22px;
  }

  .filters {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .lead-layout {
    grid-template-columns: minmax(240px, 0.48fr) minmax(0, 1.52fr);
  }

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

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

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

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

@media (max-width: 900px) {
  .import-history-item {
    grid-template-columns: 1fr;
  }

  .import-history-actions {
    justify-content: flex-start;
  }
}

@media (min-width: 1281px) and (max-width: 1500px) {
  .workspace {
    padding: 20px;
  }

  .panel {
    padding: 14px;
  }

  .lead-list-panel {
    max-width: 360px;
  }

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

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

@media (max-height: 760px) {
  .sidebar {
    padding: 8px;
    gap: 5px;
  }

  .sidebar .brand-logo-full {
    width: 160px;
  }

  .sidebar .brand-logo-mark {
    width: 40px;
    height: 40px;
  }

  .sidebar-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.55rem;
  }

  .nav-tabs,
  .sidebar-bottom-nav {
    gap: 3px;
  }

  .nav-tab {
    min-height: 30px;
    padding: 4px 10px;
    gap: 8px;
    font-size: 0.84rem;
  }

  .nav-icon {
    flex-basis: 21px;
    width: 21px;
    height: 21px;
    font-size: 0.92rem;
  }

  .nav-tab[data-view="properties"] .nav-icon,
  .profile-nav .nav-icon {
    background-size: 19px 19px;
  }

  body.sidebar-open .sidebar .brand-logo-full {
    width: 160px;
  }
}

@media (max-width: 1320px) {
  .showhouse-booking-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .pricing-hero,
  .subscription-summary-panel,
  .subscription-grid,
  .team-layout {
    grid-template-columns: 1fr;
  }

  .pricing-hero {
    align-items: stretch;
    display: grid;
  }

  .billing-toggle {
    justify-content: center;
  }

  .pricing-group-tabs {
    grid-template-columns: 1fr;
  }

  .pricing-section-head {
    display: grid;
  }

  .pricing-section-head strong {
    white-space: normal;
  }

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

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

  .sidebar {
    position: static;
  }

  .nav-tabs,
    .metric-grid,
    .dashboard-insights,
    .dashboard-grid,
    .today-metrics,
    .today-grid,
    .import-grid,
    .caller-layout,
    .setup-grid,
    .profile-grid,
    .profile-password-grid,
    .dropdown-settings-grid,
    .report-controls,
    .chart-grid,
    .management-filters,
    .property-filters,
    .billing-plans,
    .admin-filters,
    .admin-health-grid,
    .lead-layout,
    .goal-progress-grid,
    .goal-setting-row,
    .lead-top-grid,
    .scheduler-grid,
    .filters,
    .owner-grid,
    .toggle-grid,
    .outcome-grid,
    .followup-row,
    .agenda-day,
    .agenda-item,
    .calendar-toolbar,
    .calendar-agenda-day,
    .caller-card,
    .showhouse-card-main,
    .showhouse-link-row,
    .showhouse-booking-actions,
    .showhouse-booking-summary,
    .showhouse-booking-detail-grid,
    .showhouse-date-row,
    .public-form-grid,
    .public-booking-layout {
    grid-template-columns: 1fr;
  }

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

  .today-actions {
    justify-content: stretch;
  }

  .today-actions button {
    flex: 1 1 180px;
  }

  .showhouse-booking-actions {
    display: grid;
  }

  .showhouse-booking-actions .ghost-btn {
    width: 100%;
  }

  .calendar-date-actions {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-month-grid,
  .calendar-week-header-grid,
  .calendar-week-all-day-grid,
  .calendar-week-time-grid {
    min-width: 780px;
  }

  .calendar-shell {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .appointment-slots label,
  .followup-options label {
    max-width: none;
  }

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

  .topbar-actions {
    width: 100%;
  }

  .super-account-viewer {
    width: 100%;
  }

  .topbar-actions button {
    flex: 1;
  }

  .admin-restart-field {
    width: 100%;
  }

  .server-restart-notice {
    align-items: stretch;
    display: grid;
  }

  .server-restart-notice > span {
    justify-self: start;
  }

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

  .feedback-panel {
    max-height: none;
  }

  .availability-range-row {
    grid-template-columns: 1fr;
  }
}

.app-toast {
  background: #14231b;
  border: 1px solid rgba(160, 215, 174, 0.45);
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  color: #fff;
  font-weight: 800;
  left: 50%;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.app-toast.is-hiding {
  opacity: 0;
  transform: translate(-50%, 8px);
}

/* Mobile web app layer: visual/responsive only. */
@media (max-width: 980px) {
  html {
    scroll-padding-bottom: 92px;
  }

  body {
    -webkit-tap-highlight-color: rgba(64, 126, 82, 0.14);
  }

  body:not(.locked) .app-shell {
    display: block;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding-bottom: 84px;
  }

  body:not(.locked) .workspace {
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding: 16px;
    padding-bottom: 104px;
  }

  body:not(.locked) .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 1000;
    width: 100%;
    height: 76px;
    min-height: 76px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -16px 34px rgba(14, 24, 19, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }

  body:not(.locked) .sidebar .brand,
  body:not(.locked) .sidebar-toggle,
  body:not(.locked) .sidebar-panel {
    display: none;
  }

  body:not(.locked) .nav-tabs,
  body:not(.locked) .sidebar-bottom-nav {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 0 2px 3px;
    scrollbar-width: none;
  }

  body:not(.locked) .nav-tabs {
    flex: 1 1 auto;
  }

  body:not(.locked) .sidebar-bottom-nav {
    margin: 0;
  }

  body:not(.locked) .nav-tabs::-webkit-scrollbar,
  body:not(.locked) .sidebar-bottom-nav::-webkit-scrollbar {
    display: none;
  }

  body:not(.locked) .nav-tab {
    flex: 0 0 76px;
    min-height: 58px;
    height: 58px;
    padding: 7px 8px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    scroll-snap-align: center;
  }

  body:not(.locked) .nav-icon {
    flex: none;
    width: 22px;
    height: 22px;
    font-size: 0.92rem;
  }

  body:not(.locked) .nav-tab[data-view="properties"] .nav-icon,
  body:not(.locked) .profile-nav .nav-icon {
    background-size: 20px 20px;
  }

  body:not(.locked) .nav-label {
    display: block;
    max-width: 100%;
    color: inherit;
    font-size: 0.67rem;
    line-height: 1.08;
    white-space: normal;
  }

  body:not(.locked) .nav-tab.active {
    background: #2e4439;
    border-color: #4e755f;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    margin: -16px -16px 14px;
    padding: 12px 16px;
    background: rgba(247, 249, 246, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
  }

  .topbar h2 {
    font-size: clamp(1.35rem, 6vw, 1.9rem);
    line-height: 1.1;
  }

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

  .topbar-actions > .account-pill,
  .topbar-actions > .super-account-viewer,
  .topbar-actions > .manager-team-viewer {
    grid-column: 1 / -1;
  }

  .topbar-actions button {
    min-height: 42px;
    padding: 9px 10px;
    white-space: normal;
  }

  .metric-grid,
  .dashboard-grid,
  .today-metrics,
  .compact-metrics,
  .goal-progress-grid {
    gap: 10px;
  }

  .metric-card,
  .panel,
  .today-hero,
  .dashboard-insights,
  .setup-grid > *,
  .profile-section,
  .subscription-panel,
  .pricing-section,
  .caller-card,
  .showhouse-card,
  .feedback-panel {
    border-radius: 12px;
  }

  .panel,
  .metric-card,
  .today-hero,
  .profile-section,
  .subscription-panel,
  .pricing-section {
    padding: 14px;
  }

  .filters,
  .management-filters,
  .property-filters,
  .client-list-filters,
  .followup-filters,
  .admin-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filters label,
  .management-filters label,
  .property-filters label,
  .client-list-filters label,
  .followup-filters label,
  .admin-filters label {
    min-width: 0;
  }

  input,
  select,
  textarea,
  button,
  .primary-btn,
  .ghost-btn,
  .danger-btn,
  .text-btn {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    border-radius: 10px;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    min-height: 44px;
    border-radius: 10px;
  }

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

  .lead-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .lead-list-panel {
    max-width: none;
  }

  .lead-card {
    border-radius: 12px;
    padding: 14px;
  }

  .lead-detail,
  .owner-card,
  .lead-detail-section,
  .call-history-item {
    min-width: 0;
  }

  .outcome-grid,
  .lead-top-grid,
  .owner-grid,
  .scheduler-grid,
  .followup-row,
  .template-manager-toolbar,
  .showhouse-card-main,
  .showhouse-link-row,
  .showhouse-booking-summary,
  .showhouse-booking-actions,
  .showhouse-booking-detail-grid,
  .showhouse-date-row,
  .public-form-grid,
  .public-booking-layout {
    grid-template-columns: 1fr;
  }

  .outcome-button,
  .appointment-slots button,
  .available-time,
  .calendar-day {
    min-height: 44px;
  }

  .data-table-wrap,
  .property-table-wrap,
  .client-list-table-wrap,
  .import-preview-dialog-panel {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  .data-table,
  .property-table,
  .admin-table {
    min-width: 860px;
  }

  #leadManagementView .data-table,
  #propertiesView .data-table,
  #clientsView .data-table {
    table-layout: auto;
  }

  .table-toolbar,
  .column-toggle-toolbar,
  .property-column-groups,
  .lead-column-controls,
  .client-list-toolbar,
  .showhouse-actions-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .column-toggle,
  .property-column-group-toggle,
  .lead-column-toggle,
  .client-field-toggle,
  .showhouse-actions-row button {
    flex: 0 0 auto;
  }

  dialog,
  .dialog-form,
  .quick-template-dialog,
  .import-preview-dialog,
  .showhouse-dialog {
    max-width: calc(100vw - 16px);
  }

  dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 18px);
    border-radius: 14px;
  }

  .dialog-form,
  .showhouse-dialog-form,
  .import-preview-dialog-form {
    max-height: calc(100dvh - 18px);
    overflow: auto;
    padding: 16px;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px -16px -16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
  }

  .dialog-actions button {
    width: 100%;
  }

  .calendar-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  .calendar-toolbar {
    gap: 10px;
  }

  .calendar-date-actions,
  .calendar-view-toggle {
    width: 100%;
  }

  .calendar-view-toggle button {
    flex: 1;
  }

  .calendar-month-grid,
  .calendar-week-header-grid,
  .calendar-week-all-day-grid,
  .calendar-week-time-grid {
    min-width: 760px;
  }

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

  .available-times-grid,
  .appointment-slots,
  .followup-options {
    grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  }

  .auth-screen {
    min-height: 100dvh;
  }

  .auth-visual {
    min-height: auto;
    padding: 28px 18px;
  }

  .auth-visual .brand-logo-full {
    width: min(420px, 92%);
  }

  .auth-visual h2 {
    font-size: clamp(2.2rem, 13vw, 4rem);
    max-width: 100%;
  }

  .auth-card {
    padding: 20px;
  }

  .public-showhouse-root {
    padding: 12px;
  }

  .public-showhouse-card {
    border-radius: 14px;
  }

  .public-showhouse-hero,
  .public-showhouse-form-step {
    padding: 18px;
  }

  .public-showhouse-cover {
    max-height: 52vh;
  }

  .showhouse-booking-detail-grid {
    gap: 10px;
  }
}

@media (max-width: 540px) {
  body:not(.locked) .workspace {
    padding: 12px;
    padding-bottom: 104px;
  }

  .topbar {
    margin: -12px -12px 12px;
    padding: 10px 12px;
  }

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

  .topbar-actions .primary-btn,
  .topbar-actions .ghost-btn,
  .topbar-actions .danger-btn {
    width: 100%;
  }

  body:not(.locked) .sidebar {
    height: 72px;
    min-height: 72px;
    padding-inline: 7px;
  }

  body:not(.locked) .nav-tab {
    flex-basis: 68px;
    min-height: 54px;
    height: 54px;
    padding: 6px;
  }

  body:not(.locked) .nav-label {
    font-size: 0.62rem;
  }

  .metric-card strong,
  .metric-value {
    font-size: clamp(1.55rem, 11vw, 2.35rem);
  }

  .panel,
  .metric-card,
  .today-hero,
  .profile-section,
  .subscription-panel,
  .pricing-section {
    padding: 12px;
  }

  .quick-actions,
  .today-actions,
  .panel-actions,
  .form-actions,
  .bulk-actions,
  .showhouse-booking-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .quick-actions button,
  .today-actions button,
  .panel-actions button,
  .form-actions button,
  .bulk-actions button,
  .showhouse-booking-actions button {
    width: 100%;
  }

  .data-table,
  .property-table,
  .admin-table {
    min-width: 760px;
  }

  .calendar-month-grid,
  .calendar-week-header-grid,
  .calendar-week-all-day-grid,
  .calendar-week-time-grid {
    min-width: 720px;
  }

  .available-times-grid,
  .appointment-slots,
  .followup-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    padding: 16px;
  }

  .auth-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .auth-visual p {
    max-width: 100%;
  }

  .public-showhouse-actions {
    grid-template-columns: 1fr;
  }
}

@media (pointer: coarse) {
  .nav-tab,
  .primary-btn,
  .ghost-btn,
  .danger-btn,
  .text-btn,
  .table-edit-btn,
  .icon-btn,
  .calendar-nav,
  .calendar-day,
  .appointment-slots button,
  .available-time {
    min-height: 44px;
  }

  .table-select-checkbox,
  input[type="checkbox"],
  input[type="radio"] {
    min-width: 22px;
    min-height: 22px;
  }
}

/* Mobile login/menu repair: visual/responsive only. */
@media (max-width: 980px) {
  body.locked {
    min-height: 100dvh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.locked .auth-screen {
    height: auto;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    overflow: visible;
  }

  body.locked .auth-visual {
    min-height: auto;
    padding: 18px 16px 12px;
    display: grid;
    gap: 12px;
  }

  body.locked .auth-visual .brand-logo-full {
    width: min(260px, 78vw);
  }

  body.locked .auth-visual h2 {
    margin: 0;
    font-size: clamp(1.85rem, 9vw, 3rem);
    line-height: 1.02;
  }

  body.locked .auth-visual p {
    max-width: 48rem;
    margin: 0;
    font-size: 0.95rem;
  }

  body.locked .auth-map {
    width: min(520px, 100%);
    max-height: 26vh;
    object-fit: contain;
  }

  body.locked .auth-panel {
    width: 100%;
    min-height: auto;
    align-content: start;
    padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  }

  body.locked .auth-panel > * {
    width: 100%;
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }

  body.locked .auth-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(247, 249, 246, 0.98);
    backdrop-filter: blur(12px);
  }

  body.locked .auth-form {
    gap: 10px;
  }

  body.locked .auth-form h2 {
    margin: 8px 0 2px;
  }

  body.locked .auth-form label {
    gap: 5px;
  }

  body.locked .google-btn,
  body.locked .primary-btn {
    min-height: 44px;
  }

  body:not(.locked) {
    overflow-x: hidden;
  }

  body:not(.locked) .app-shell {
    min-height: 100dvh;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body:not(.locked) .workspace {
    min-height: 100dvh;
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  body:not(.locked) .sidebar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    height: auto;
    min-height: 76px;
    max-height: 42vh;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid #2b4037;
    box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.24);
    -webkit-overflow-scrolling: touch;
  }

  body:not(.locked) .nav-tabs,
  body:not(.locked) .sidebar-bottom-nav {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    overflow: visible;
  }

  body:not(.locked) .nav-tabs {
    flex: 1 0 auto;
  }

  body:not(.locked) .nav-tab {
    flex: 0 0 76px;
    min-width: 76px;
    min-height: 58px;
    height: 58px;
    padding: 7px 8px;
    justify-content: center;
    text-align: center;
    gap: 5px;
  }

  body:not(.locked) .nav-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  body:not(.locked) .nav-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.67rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 540px) {
  body.locked .auth-screen {
    display: block;
  }

  body.locked .auth-visual {
    padding: 14px 14px 10px;
    gap: 8px;
  }

  body.locked .auth-visual .brand-logo-full {
    width: min(210px, 72vw);
  }

  body.locked .auth-visual h2 {
    font-size: clamp(1.65rem, 9.5vw, 2.35rem);
  }

  body.locked .auth-visual p {
    font-size: 0.88rem;
  }

  body.locked .auth-map {
    max-height: 18vh;
  }

  body.locked .auth-panel {
    padding: 12px 14px calc(28px + env(safe-area-inset-bottom));
  }

  body.locked .auth-form h2 {
    font-size: 1.28rem;
  }

  body:not(.locked) .app-shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  body:not(.locked) .workspace {
    padding-bottom: calc(98px + env(safe-area-inset-bottom));
  }

  body:not(.locked) .sidebar {
    min-height: 70px;
    padding-inline: 7px;
  }

  body:not(.locked) .nav-tab {
    flex-basis: 68px;
    min-width: 68px;
    min-height: 54px;
    height: 54px;
    padding: 6px;
  }

  body:not(.locked) .nav-label {
    font-size: 0.62rem;
  }
}

@media (max-width: 390px), (max-height: 720px) and (max-width: 540px) {
  body.locked .auth-map {
    display: none;
  }
}

/* Ultra mobile Call Workspace: visual/responsive only. */
.mobile-menu-toggle,
.mobile-menu-scrim {
  display: none;
}

@media (max-width: 980px) {
  body.mobile-call-workspace-only:not(.locked) .mobile-menu-toggle,
  body.mobile-call-workspace-only:not(.locked) .mobile-menu-scrim,
  body.mobile-call-workspace-only:not(.locked) .sidebar {
    display: none !important;
  }

  body.mobile-call-workspace-only:not(.locked).sidebar-open .mobile-menu-scrim:not([hidden]) {
    display: none !important;
  }

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

  body:not(.locked) {
    overflow-x: hidden;
  }

  body:not(.locked) .app-shell {
    display: block;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  body:not(.locked) .workspace {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    min-height: 100dvh;
    overflow-x: hidden;
    padding: 12px 10px 24px;
  }

  body:not(.locked) .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: -12px -10px 12px;
    padding: calc(10px + env(safe-area-inset-top)) 10px 10px 58px;
    position: sticky;
    top: 0;
  }

  body.mobile-call-workspace-only:not(.locked) .topbar {
    padding-left: 10px;
  }

  body:not(.locked) .topbar-actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body:not(.locked) .topbar-actions > * {
    flex: 0 0 auto;
  }

  body:not(.locked) .topbar-actions > .account-pill,
  body:not(.locked) .topbar-actions > .super-account-viewer,
  body:not(.locked) .topbar-actions > .manager-team-viewer {
    flex-basis: min(100%, 360px);
  }

  .mobile-menu-toggle {
    position: fixed;
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    z-index: 2100;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    border: 1px solid rgba(198, 220, 205, 0.32);
    border-radius: 10px;
    background: #13221b;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  }

  .mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.16s ease, opacity 0.16s ease;
  }

  .mobile-menu-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-scrim[hidden] {
    display: none !important;
  }

  body.sidebar-open:not(.locked) .mobile-menu-scrim:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1990;
    border: 0;
    background: rgba(7, 16, 12, 0.52);
  }

  body:not(.locked) .sidebar {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    z-index: 2000;
    width: min(86vw, 330px);
    height: 100dvh;
    min-height: 0;
    max-height: none;
    padding: calc(62px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    border-top: 0;
    border-right: 1px solid #2b4037;
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.32);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    -webkit-overflow-scrolling: touch;
  }

  body.sidebar-open:not(.locked) .sidebar {
    transform: translateX(0);
  }

  body:not(.locked) .sidebar-toggle {
    display: none;
  }

  body:not(.locked) .sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 6px;
  }

  body:not(.locked) .brand-logo-full {
    display: block;
    width: min(220px, 100%);
    height: auto;
  }

  body:not(.locked) .brand-logo-mark {
    display: none;
  }

  body:not(.locked) .nav-tabs,
  body:not(.locked) .sidebar-bottom-nav {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  body:not(.locked) .nav-tabs {
    flex: 0 0 auto;
  }

  body:not(.locked) .nav-tab {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    height: auto;
    flex: 0 0 auto;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    white-space: normal;
  }

  body:not(.locked) .nav-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
  }

  body:not(.locked) .nav-label {
    display: inline;
    max-width: none;
    overflow: visible;
    font-size: 0.92rem;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
  }

  body:not(.locked) .sidebar-panel:not([hidden]) {
    display: grid;
    width: 100%;
    margin-top: auto;
  }

  body:not(.locked) .territory-map {
    display: none;
  }

  body:not(.locked) .view,
  body:not(.locked) .page-section,
  body:not(.locked) .card,
  body:not(.locked) .metric-grid,
  body:not(.locked) .dashboard-insights,
  body:not(.locked) .form-grid,
  body:not(.locked) .filter-grid,
  body:not(.locked) .filters,
  body:not(.locked) .action-row {
    max-width: 100%;
    min-width: 0;
  }

  body:not(.locked) .filters,
  body:not(.locked) .filter-grid,
  body:not(.locked) .form-grid {
    grid-template-columns: 1fr !important;
  }

  body:not(.locked) input,
  body:not(.locked) select,
  body:not(.locked) textarea,
  body:not(.locked) button {
    max-width: 100%;
  }

  body:not(.locked) .table-scroll,
  body:not(.locked) .spreadsheet-scroll,
  body:not(.locked) .table-wrapper,
  body:not(.locked) .resizable-table-shell,
  body:not(.locked) .data-table-wrap,
  body:not(.locked) .property-table-wrap,
  body:not(.locked) .client-list-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 760px) {
  body:not(.locked) #leadsView .filters {
    margin-bottom: 10px;
  }

  body:not(.locked) #leadsView .lead-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body:not(.locked) #leadsView .lead-list-panel,
  body:not(.locked) #leadsView #leadDetail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body:not(.locked) #leadsView .lead-list-panel {
    max-height: 44dvh;
    overflow: hidden;
  }

  body:not(.locked) #leadsView .lead-list {
    max-height: calc(44dvh - 70px);
    overflow-y: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  body:not(.locked) #leadsView .lead-card {
    padding: 12px;
    border-radius: 8px;
    gap: 6px;
  }

  body:not(.locked) #leadsView .lead-card strong {
    font-size: 1rem;
  }

  body:not(.locked) #leadsView .panel-head,
  body:not(.locked) #leadsView .section-title {
    align-items: flex-start;
    gap: 8px;
  }

  body:not(.locked) #leadsView .panel-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  body:not(.locked) #leadsView .lead-top-grid,
  body:not(.locked) #leadsView .owner-grid,
  body:not(.locked) #leadsView .scheduler-grid,
  body:not(.locked) #leadsView .mandate-scheduler-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  body:not(.locked) #leadsView .detail-section {
    padding: 12px;
    border-radius: 8px;
    gap: 10px;
  }

  body:not(.locked) #leadsView .owner-box {
    padding: 11px;
  }

  body:not(.locked) #leadsView .owner-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:not(.locked) #leadsView .owner-actions .quick-action {
    width: 100%;
    min-height: 40px;
    padding: 8px 6px;
  }

  body:not(.locked) #leadsView .outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body:not(.locked) #leadsView .outcome-option {
    min-height: 44px;
    padding: 9px 8px;
    font-size: 0.86rem;
    line-height: 1.15;
  }

  body:not(.locked) #leadsView .inline-calendar {
    padding: 8px;
  }

  body:not(.locked) #leadsView .calendar-days,
  body:not(.locked) #leadsView .calendar-weekdays {
    gap: 3px;
  }

  body:not(.locked) #leadsView .calendar-day {
    min-height: 36px;
    border-radius: 6px;
    font-size: 0.9rem;
  }

  body:not(.locked) #leadsView .appointment-slots label,
  body:not(.locked) #leadsView .followup-options label {
    max-width: none;
  }

  body:not(.locked) #leadsView .appointment-slots,
  body:not(.locked) #leadsView .followup-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body:not(.locked) #leadsView .callback-presets,
  body:not(.locked) #leadsView .time-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 8px;
  }

  body:not(.locked) #leadsView .time-slot {
    min-height: 40px;
    padding: 8px 6px;
    font-size: 0.94rem;
  }

  body:not(.locked) #leadsView .lead-details-section .form-grid {
    grid-template-columns: 1fr !important;
  }

  body:not(.locked) #leadsView .history-list {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body:not(.locked) #leadsView .call-actions {
    position: sticky;
    bottom: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 -10px -24px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(247, 249, 246, 0), #f7f9f6 34%);
    backdrop-filter: blur(8px);
  }

  body:not(.locked) #leadsView .call-actions .primary-btn,
  body:not(.locked) #leadsView .call-actions .ghost-btn {
    width: 100%;
    min-height: 46px;
  }
}

@media (max-width: 440px) {
  body:not(.locked) #leadsView .outcome-grid,
  body:not(.locked) #leadsView .owner-actions,
  body:not(.locked) #leadsView .call-actions {
    grid-template-columns: 1fr;
  }

  body:not(.locked) #leadsView .lead-list-panel {
    max-height: 40dvh;
  }

  body:not(.locked) #leadsView .lead-list {
    max-height: calc(40dvh - 70px);
  }
}
