:root {
  --ink: #191817;
  --muted: #6d6964;
  --line: #dedad4;
  --paper: #f5f4f2;
  --surface: #ffffff;
  --brand: #841503;
  --brand-dark: #4f0c01;
  --accent: #a42a16;
  --gold: #a77f3e;
  --blue: #566d77;
  --shadow: 0 18px 45px rgba(42, 32, 29, 0.11);
  --home-bg: #f2f1ef;
  --home-surface: #ffffff;
  --home-surface-soft: #eeece8;
  --home-border: #ddd8d1;
  --home-shadow: 0 12px 30px rgba(42, 32, 29, 0.08);
  --home-radius: 8px;
  --priority-high: #841503;
  --priority-medium: #9a6819;
  --priority-low: #566d77;
  --area-real-estate: #841503;
  --area-real-estate-soft: #f4e8e5;
  --area-wood-homes: #856c36;
  --area-wood-homes-soft: #f2ede2;
  --area-construction: #a34b32;
  --area-construction-soft: #f5e9e5;
  --area-design: #4f6675;
  --area-design-soft: #e9eef1;
  --area-consulting: #6b4e5b;
  --area-consulting-soft: #f0eaed;
  --area-training: #3f6c61;
  --area-training-soft: #e7f0ed;
}

/* Phase 2B: ciclo commerciale persistente */
.commercial-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, .8fr)) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
}

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

.commercial-filter-bar input,
.commercial-filter-bar select,
.commercial-dialog input,
.commercial-dialog select,
.commercial-dialog textarea {
  width: 100%;
}

.module-feedback,
.dialog-feedback {
  padding: 10px 12px;
  border: 1px solid #d9d3cd;
  border-radius: 6px;
  background: #faf8f6;
  color: #584f49;
}

.module-feedback.is-error,
.dialog-feedback.is-error {
  border-color: #d88b80;
  color: #8f1d0d;
}

.commercial-dialog {
  width: min(760px, calc(100vw - 32px));
}

.commercial-row {
  cursor: pointer;
}

.commercial-row:hover {
  background: #faf7f4;
}

.commercial-row .row-actions {
  width: 1%;
  white-space: nowrap;
}

.deal-card.is-persistent {
  display: grid;
  width: 100%;
  gap: 5px;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid #ded8d2;
  border-radius: 6px;
  cursor: pointer;
}

.deal-card.is-persistent:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 16px rgba(40, 28, 22, .08);
}

.deal-card.is-persistent .deal-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.commercial-empty {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed #d8d1cb;
  border-radius: 6px;
  background: #fbfaf9;
}

.split-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1050px) {
  .commercial-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .commercial-filter-bar,
  .split-actions {
    grid-template-columns: 1fr;
  }

  .split-actions > span {
    display: none;
  }
}

/* Admin access management */
.access-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(520px, 1.5fr);
  gap: 16px;
  align-items: start;
}

.access-user-panel,
.access-editor-panel,
.access-legend-panel {
  min-width: 0;
}

.access-user-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 128px);
  overflow: auto;
}

.access-legend-panel {
  grid-column: 1 / -1;
}

.access-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.access-search svg {
  width: 17px;
  color: var(--muted);
}

.access-search input {
  width: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

.access-user-row {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  color: var(--ink);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.access-user-row:hover,
.access-user-row.active {
  border-color: #d9c9c5;
  background: #f8f2f0;
}

.access-user-row:focus-visible {
  outline: 3px solid rgba(132, 21, 3, 0.22);
  outline-offset: 2px;
}

.access-user-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--brand-dark);
  background: #efe4e1;
  font-size: 13px;
  font-weight: 900;
}

.access-user-row strong,
.access-user-row small,
.access-user-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-user-row small,
.access-user-row em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.access-user-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.access-user-state.is-active {
  color: #2f5d46;
  background: #e7f1eb;
}

.access-user-state.is-disabled {
  color: #7b2922;
  background: #f5e7e4;
}

.access-pending-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b78428;
}

.access-security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  padding: 11px 12px;
  border: 1px solid #d8cbc0;
  border-radius: 6px;
  color: #594a43;
  background: #f8f4ef;
  font-size: 13px;
  line-height: 1.4;
}

.access-security-note svg {
  flex: 0 0 18px;
  width: 18px;
  color: var(--brand);
}

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

.access-form-grid label,
.access-password-block,
.access-matrix-list label {
  min-width: 0;
}

.access-form-grid label > span,
.access-password-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.access-form-grid input,
.access-form-grid select,
.access-password-input input,
.access-matrix-list select {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}

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

.access-password-block {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(230px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #faf9f7;
}

.access-password-block small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.access-password-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
}

.access-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
}

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

.access-matrix-section {
  margin-top: 20px;
}

.access-matrix-section h3 {
  margin: 3px 0 10px;
  font-size: 18px;
}

.access-matrix-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.access-matrix-list label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.65fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.access-matrix-list label > span strong,
.access-matrix-list label > span small {
  display: block;
}

.access-matrix-list label > span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.access-matrix-list select {
  min-height: 36px;
}

.access-editor-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.access-editor-footer > span {
  color: var(--muted);
  font-size: 12px;
}

.access-editor-footer > span.is-error {
  color: #a12b20;
  font-weight: 800;
}

.access-editor-footer > div {
  display: flex;
  gap: 8px;
}

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

.access-level-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.access-level-item strong,
.access-level-item span {
  display: block;
}

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

.access-legend-copy {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.permission-hidden {
  display: none !important;
}

button:disabled,
.file-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.access-level-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 1180px) {
  .access-admin-layout {
    grid-template-columns: minmax(250px, 0.7fr) minmax(420px, 1.3fr);
  }

  .access-password-block,
  .access-matrix-list {
    grid-template-columns: 1fr;
  }
}

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

  .access-user-panel {
    position: static;
    max-height: none;
  }

  .access-legend-panel {
    grid-column: auto;
  }

  .access-form-grid,
  .access-level-legend {
    grid-template-columns: 1fr;
  }

  .access-form-grid .wide {
    grid-column: auto;
  }

  .access-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .access-editor-footer > div {
    justify-content: flex-end;
  }
}


* {
  box-sizing: border-box;
}

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

.login-error {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #d9a49b;
  border-radius: 8px;
  color: #7b1707;
  background: #fff3f1;
  font-size: 12px;
  font-weight: 700;
}

.login-error.is-status {
  color: var(--blue);
  border-color: #bdc9ce;
  background: #f0f4f5;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #171717;
}

.login-screen.hidden {
  display: none;
}

.module-hub {
  display: none;
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
  background: var(--home-bg);
}

.authenticated:not(.workspace-open) .module-hub {
  display: block;
}

.workspace-open .module-hub {
  display: none;
}

.hub-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: 100%;
}

.hub-head {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 12px max(24px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid var(--home-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}

.hub-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hub-brand .brand-logo {
  width: 40px;
  height: 40px;
}

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

.control-main {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  min-width: 0;
  max-width: 100%;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 32px 28px 56px;
}

.home-zone,
.crm-section,
.tools-section,
.home-secondary-section {
  grid-column: 1 / -1;
}

.home-zone {
  min-width: 0;
  padding: 24px 0 28px;
  border-top: 1px solid var(--home-border);
}

.overview-zone {
  padding-top: 0;
  border-top: 0;
}

.priority-zone {
  margin-inline: -18px;
  padding-inline: 18px;
  background: #ebe8e4;
}

.tools-section {
  margin-inline: -18px;
  padding-inline: 18px;
  background: #f7f5f2;
}

.home-zone-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.home-zone-heading h2 {
  margin: 3px 0 0;
  font-size: 23px;
  letter-spacing: 0;
}

.home-hero {
  padding: 4px 0 20px;
}

.hero-personal-copy {
  min-width: 0;
}

.home-date {
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.hero-personal-copy h1 {
  margin: 8px 0 10px;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-personal-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.home-ai-console {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d8c5bf;
  border-radius: var(--home-radius);
  background: var(--home-surface);
  box-shadow: 0 18px 38px rgba(79, 12, 1, 0.10);
}

.ai-console-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-console-heading div {
  display: grid;
  gap: 1px;
}

.ai-console-heading small,
.hub-card small,
.section-note {
  color: var(--muted);
}

.ai-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-dark);
}

.ai-mark svg,
.hub-icon-button svg,
.hub-ai-header-button svg,
.hub-profile summary > svg,
.ai-mic-button svg {
  width: 18px;
  height: 18px;
}

.hub-ai-header-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.home-ai-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px auto;
  gap: 8px;
}

.home-ai-form input {
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  outline: 0;
  background: #f9fbfa;
}

.home-ai-form input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(132, 21, 3, 0.16);
}

.ai-mic-button,
.ai-submit-button,
.hub-icon-button,
.hub-ai-header-button {
  min-height: 42px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  font-weight: 800;
}

.ai-mic-button {
  color: var(--brand-dark);
  background: #f2e9e6;
}

.ai-submit-button,
.hub-ai-header-button {
  padding: 0 16px;
  color: #fff;
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-suggestions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.ai-suggestions button:hover {
  color: var(--brand-dark);
  border-color: #c7aaa3;
  background: #f8f2f0;
}

.ai-suggestions svg {
  width: 14px;
  height: 14px;
}

.ai-suggestions b {
  color: var(--brand);
}

.home-ai-result {
  padding-top: 12px;
  border-top: 1px solid var(--home-border);
}

.ai-result-heading,
.ai-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ai-result-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.ai-result-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  background: #f8faf9;
}

.ai-result-card small {
  color: var(--muted);
}

.notification-wrap,
.hub-profile {
  position: relative;
}

.hub-icon-button {
  position: relative;
  width: 42px;
  padding: 0;
  color: var(--ink);
  background: #fff;
}

.hub-icon-button b {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
}

.hub-popover,
.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--home-shadow);
}

.hub-popover[hidden] {
  display: none;
}

.hub-popover > strong {
  display: block;
  margin-bottom: 8px;
}

.hub-popover button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  border: 0;
  border-top: 1px solid var(--home-border);
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.hub-popover button:hover {
  background: var(--home-surface-soft);
}

.hub-popover button small {
  color: var(--muted);
  font-size: 11px;
}

.hub-profile summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  list-style: none;
  cursor: pointer;
}

.hub-profile summary::-webkit-details-marker {
  display: none;
}

.profile-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.profile-copy {
  display: grid;
  min-width: 120px;
}

.profile-copy small,
.profile-menu span {
  color: var(--muted);
  font-size: 11px;
}

.profile-menu {
  display: grid;
  gap: 10px;
}

.profile-menu button {
  min-height: 38px;
  border: 1px solid #efc8c1;
  border-radius: 8px;
  color: #a33122;
  background: #fff8f6;
  text-align: left;
}

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

.personal-kpi {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-surface);
  box-shadow: 0 7px 18px rgba(42, 32, 29, 0.05);
}

.personal-kpi small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.personal-kpi-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.personal-kpi-label svg {
  width: 15px;
  height: 15px;
  color: var(--brand);
}

.personal-kpi.is-alert .personal-kpi-label svg,
.personal-kpi.is-alert strong {
  color: var(--priority-high);
}

.personal-kpi strong {
  display: block;
  margin: 5px 0 2px;
  font-size: 25px;
  line-height: 1;
}

.kpi-progress {
  display: block;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe7e2;
}

.kpi-progress i {
  display: block;
  width: var(--kpi-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

.personal-kpi.is-alert .kpi-progress i {
  background: var(--priority-high);
}

.home-priority-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.home-section {
  padding: 18px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: var(--home-surface);
  box-shadow: var(--home-shadow);
}

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

.home-section-heading h2 {
  margin: 2px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.section-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.section-count {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #f1e7e4;
  font-size: 11px;
  font-weight: 800;
}

.text-action {
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.attention-list,
.home-task-list {
  display: grid;
  gap: 6px;
}

.attention-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(130px, auto) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--home-border);
  border-left: 3px solid var(--priority-low);
  border-radius: 8px;
  background: #fbfcfc;
}

.attention-row.priority-high { border-left-color: var(--priority-high); }
.attention-row.priority-medium { border-left-color: var(--priority-medium); }

.attention-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: #e9eef0;
}

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

.priority-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--priority-low);
}

.priority-dot.high { background: var(--priority-high); }
.priority-dot.medium { background: var(--priority-medium); }

.attention-copy {
  display: grid;
  gap: 2px;
}

.attention-type {
  color: var(--accent);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.attention-copy small,
.attention-meta,
.home-task small {
  color: var(--muted);
  font-size: 11px;
}

.attention-meta {
  display: grid;
  gap: 2px;
  text-align: right;
}

.attention-meta small {
  display: block;
}

.attention-meta b {
  color: var(--accent);
  font-size: 10px;
}

.attention-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  color: var(--brand-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.home-task {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--home-border);
}

.home-task:last-child {
  border-bottom: 0;
}

.task-due {
  align-self: center;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

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

.crm-area-card {
  --area-color: var(--brand);
  --area-soft: var(--area-real-estate-soft);
  grid-column: span 3;
  display: grid;
  gap: 14px;
  min-height: 232px;
  padding: 16px;
  border: 1px solid var(--home-border);
  border-top: 4px solid var(--area-color);
  border-radius: var(--home-radius);
  color: var(--ink);
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 20px rgba(42, 32, 29, 0.055);
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.crm-area-card { grid-column: span 4; }

.crm-area-card[data-area-tone="realEstate"] { --area-color: var(--area-real-estate); --area-soft: var(--area-real-estate-soft); }
.crm-area-card[data-area-tone="woodHomes"] { --area-color: var(--area-wood-homes); --area-soft: var(--area-wood-homes-soft); }
.crm-area-card[data-area-tone="construction"] { --area-color: var(--area-construction); --area-soft: var(--area-construction-soft); }
.crm-area-card[data-area-tone="design"] { --area-color: var(--area-design); --area-soft: var(--area-design-soft); }
.crm-area-card[data-area-tone="consulting"] { --area-color: var(--area-consulting); --area-soft: var(--area-consulting-soft); }
.crm-area-card[data-area-tone="training"] { --area-color: var(--area-training); --area-soft: var(--area-training-soft); }

.crm-area-card:hover,
.hub-card:hover {
  border-color: var(--area-color, var(--brand));
  box-shadow: 0 14px 30px rgba(79, 12, 1, 0.11);
  transform: translateY(-2px);
}

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

.crm-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.crm-card-icon,
.tool-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--area-color, var(--brand-dark));
  background: var(--area-soft, #f1e7e4);
  font-weight: 900;
}

.crm-card-icon svg,
.tool-icon svg {
  width: 18px;
  height: 18px;
}

.crm-card-title strong {
  font-size: 16px;
}

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

.crm-card-metrics span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.crm-card-metrics b {
  color: var(--ink);
  font-size: 19px;
}

.crm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--area-color);
  font-size: 12px;
  font-weight: 850;
}

.crm-card-footer svg {
  width: 16px;
  height: 16px;
}

.status-badge {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--area-color);
  background: var(--area-soft);
  font-size: 10px;
  font-weight: 850;
}

.status-badge.is-urgent {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--area-color) 24%, transparent);
}

.crm-card-visual {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 7px;
  border-radius: 7px;
  background: var(--area-soft);
}

.crm-card-visual small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  width: 74px;
  height: 28px;
}

.mini-bars i {
  flex: 1;
  height: var(--bar);
  min-height: 4px;
  border-radius: 2px 2px 0 0;
  background: var(--area-color);
  opacity: 0.82;
}

.hub-tool-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.hub-card {
  color: var(--ink);
  text-align: left;
}

.hub-tool-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: #fff;
  box-shadow: 0 5px 14px rgba(42, 32, 29, 0.045);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.hub-tool-card .tool-icon {
  grid-row: span 2;
}

.hub-tool-card strong {
  font-size: 13px;
}

.hub-tool-card small {
  font-size: 10px;
}

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

.hub-secondary-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 8px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--home-border);
  border-radius: 8px;
  background: transparent;
}

.hub-secondary-card > span {
  grid-row: span 2;
  color: var(--muted);
}

.hub-secondary-card svg {
  width: 17px;
  height: 17px;
}

.hub-secondary-card strong {
  font-size: 12px;
}

.hub-secondary-card small {
  font-size: 10px;
}

.home-empty-state {
  padding: 18px;
  border: 1px dashed var(--home-border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.control-room button:focus-visible,
.control-room input:focus-visible,
.control-room summary:focus-visible {
  outline: 3px solid rgba(208, 79, 53, 0.35);
  outline-offset: 2px;
}

.login-card {
  display: grid;
  gap: 16px;
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  align-items: center;
  color: var(--ink);
}

.login-brand > div {
  min-width: 0;
}

.login-brand .brand-logo {
  width: 82px;
  height: 82px;
}

.login-card h1 {
  margin: 6px 0 0;
  font-size: 34px;
  letter-spacing: 0;
}

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

.login-step[hidden] {
  display: none;
}

.login-otp-target {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  line-height: 1.35;
}

.login-otp-target strong {
  color: var(--ink);
}

.login-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.login-card label,
.content-brief label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.login-card input,
.content-brief input,
.content-brief select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

button {
  cursor: pointer;
}

.suite-layout {
  display: none;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.workspace-open .suite-layout {
  display: grid;
}

.workspace-open:not(.module-crm) .crm-only,
.workspace-open:not(.module-crm) .topbar-actions {
  display: none;
}

.schedule-only {
  display: none;
}

.workspace-open.module-schedule .schedule-only {
  display: grid;
}

.context-only {
  display: none;
}

.workspace-open:is(.module-conversations, .module-communications, .module-models, .module-blog, .module-archive, .module-administration) .context-only {
  display: grid;
}

.workspace-open.module-conversations .conversation-area-tabs {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  color: #f5f4f2;
  background: #171717;
}

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

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #f6f4f1;
  color: var(--brand-dark);
  font-weight: 800;
}

.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(132, 21, 3, 0.18);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(25, 24, 23, 0.12);
}

.sidebar-logo {
  width: 52px;
  height: 52px;
  border-color: rgba(255, 255, 255, 0.34);
}

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

.brand span,
.sidebar-panel p {
  color: rgba(238, 246, 244, 0.72);
}

.account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.account-strip span {
  min-width: 0;
  overflow: hidden;
  color: rgba(238, 246, 244, 0.8);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-strip b,
.account-strip em {
  font-style: normal;
}

.account-strip button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: #fff;
  background: transparent;
}

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

.area-switcher {
  display: grid;
  gap: 8px;
}

.area-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: rgba(238, 246, 244, 0.76);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.area-button span {
  color: rgba(238, 246, 244, 0.62);
  font-size: 12px;
}

.area-button.active {
  color: #4f0c01;
  background: #f6f4f1;
}

.area-button.active span {
  color: #655f59;
}

.schedule-area-switcher {
  gap: 7px;
}

.schedule-area-switcher::before {
  content: "Categorie";
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.schedule-area-button {
  --schedule-area-color: #841503;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 3px solid var(--schedule-area-color);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.schedule-area-button[data-schedule-area="woodHomes"] { --schedule-area-color: var(--area-wood-homes); }
.schedule-area-button[data-schedule-area="construction"] { --schedule-area-color: var(--area-construction); }
.schedule-area-button[data-schedule-area="design"] { --schedule-area-color: var(--area-design); }
.schedule-area-button[data-schedule-area="consulting"] { --schedule-area-color: var(--area-consulting); }
.schedule-area-button[data-schedule-area="training"] { --schedule-area-color: var(--area-training); }

.schedule-area-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.schedule-area-button.active {
  color: #171717;
  border-color: #f6f4f1;
  border-left-color: var(--schedule-area-color);
  background: #f6f4f1;
}

.schedule-area-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--schedule-area-color);
  background: rgba(255, 255, 255, 0.09);
}

.schedule-area-button.active .schedule-area-icon {
  background: color-mix(in srgb, var(--schedule-area-color) 13%, #fff);
}

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

.schedule-area-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.schedule-area-copy strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-area-copy small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
}

.schedule-area-button.active .schedule-area-copy small {
  color: #6e6862;
}

.schedule-area-count {
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--schedule-area-color);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.module-context-switcher {
  gap: 7px;
}

.module-context-switcher::before {
  content: "Aree operative";
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.module-context-switcher[data-context-type="legal-entity"]::before {
  content: "Societa";
}

.module-context-button {
  --context-color: var(--area-real-estate);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 3px solid var(--context-color);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.module-context-button[data-context-area="woodHomes"] { --context-color: var(--area-wood-homes); }
.module-context-button[data-context-area="construction"] { --context-color: var(--area-construction); }
.module-context-button[data-context-area="design"] { --context-color: var(--area-design); }
.module-context-button[data-context-area="consulting"] { --context-color: var(--area-consulting); }
.module-context-button[data-context-area="training"] { --context-color: var(--area-training); }
.module-context-button[data-context-legal="realty"] { --context-color: var(--area-real-estate); }
.module-context-button[data-context-legal="contract"] { --context-color: #9a7732; }

.module-context-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.module-context-button.active {
  color: #171717;
  border-color: #f6f4f1;
  border-left-color: var(--context-color);
  background: #f6f4f1;
}

.module-context-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--context-color);
  background: rgba(255, 255, 255, 0.09);
}

.module-context-button.active .module-context-icon {
  background: color-mix(in srgb, var(--context-color) 13%, #fff);
}

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

.module-context-button > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.module-context-button strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-context-button small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-context-button.active small {
  color: #6e6862;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: rgba(238, 246, 244, 0.78);
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.workspace-open.module-crm .nav-item:not([data-module-scope="crm"]),
.workspace-open.module-conversations .nav-item:not([data-module-scope="conversations"]),
.workspace-open.module-communications .nav-item:not([data-module-scope="communications"]),
.workspace-open.module-blog .nav-item:not([data-module-scope="blog"]),
.workspace-open.module-social .nav-item:not([data-module-scope="social"]),
.workspace-open.module-analytics .nav-item:not([data-module-scope="analytics"]),
.workspace-open.module-automations .nav-item:not([data-module-scope="automations"]),
.workspace-open.module-models .nav-item:not([data-module-scope="models"]),
.workspace-open.module-schedule .nav-item:not([data-module-scope="schedule"]),
.workspace-open.module-archive .nav-item:not([data-module-scope="archive"]),
.workspace-open.module-administration .nav-item:not([data-module-scope="administration"]),
.workspace-open.module-settings .nav-item:not([data-module-scope="settings"]),
.workspace-open.module-trash .nav-item:not([data-module-scope="trash"]) {
  display: none;
}

.admin-only {
  display: none;
}

.admin-user .hub-card.admin-only {
  display: grid;
}

.admin-user .nav-item.admin-only {
  display: flex;
}

.admin-user .view.admin-only.active {
  display: block;
}

.role-operator .hub-card[data-module="blog"],
.role-operator .hub-card[data-module="social"],
.role-operator .hub-card[data-module="analytics"],
.role-operator .hub-card[data-module="automations"],
.role-operator .hub-card[data-module="administration"],
.role-operator .hub-card[data-module="settings"],
.role-marketing .hub-card[data-module="crm"],
.role-marketing .hub-card[data-module="schedule"],
.role-marketing .hub-card[data-module="archive"],
.role-marketing .hub-card[data-module="automations"],
.role-marketing .hub-card[data-module="administration"],
.role-marketing .hub-card[data-module="settings"] {
  display: none;
}

.workspace-open.role-operator .nav-item[data-module-scope="blog"],
.workspace-open.role-operator .nav-item[data-module-scope="social"],
.workspace-open.role-operator .nav-item[data-module-scope="analytics"],
.workspace-open.role-operator .nav-item[data-module-scope="automations"],
.workspace-open.role-marketing .nav-item[data-module-scope="crm"],
.workspace-open.role-marketing .nav-item[data-module-scope="schedule"],
.workspace-open.role-marketing .nav-item[data-module-scope="archive"],
.workspace-open.role-marketing .nav-item[data-module-scope="automations"] {
  display: none;
}

.role-readonly .primary-button,
.role-readonly .danger,
.role-readonly .file-button,
.role-readonly .trello-add-card,
.role-readonly .quick-edit-schedule {
  opacity: 0.45;
  pointer-events: none;
}

.non-real-estate .real-only {
  display: none;
}

.service-only {
  display: none;
}

.non-real-estate .service-only {
  display: flex;
}

.icon {
  width: 24px;
  text-align: center;
}

.sidebar-panel {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-panel strong {
  display: block;
  margin-top: 8px;
}

.main {
  min-width: 0;
  padding: 28px;
}

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

.topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(420px, 42vw);
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.primary-button {
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.icon-button {
  width: 38px;
  background: transparent;
  border-color: var(--line);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.eyebrow,
.label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.module-intro {
  display: grid;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.module-intro h2 {
  margin: 4px 0 8px;
  font-size: 24px;
  letter-spacing: 0;
}

.module-intro p {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
}

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

.metric {
  padding: 18px;
}

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

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 34px;
}

.dashboard-grid,
.builder-layout,
.portal-layout,
.matching-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

.dashboard-grid > * {
  min-width: 0;
}

.panel {
  padding: 18px;
}

.wide {
  grid-column: span 2;
}

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

.section-heading h2,
.panel h2 {
  margin: 4px 0 0;
  font-size: 19px;
  letter-spacing: 0;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-column {
  min-height: 260px;
  padding: 10px;
  border-radius: 8px;
  background: #f0f3f6;
}

.pipeline-column h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.deal-card,
.timeline-item,
.campaign-card,
.segment,
.automation-step {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.deal-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.deal-card strong {
  font-size: 14px;
}

.deal-card small,
.timeline-item small,
.property-card small,
.campaign-card small {
  color: var(--muted);
}

.score {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.timeline,
.campaign-list,
.segment-list,
.campaign-table,
.automation-board,
.portal-list,
.request-list,
.match-list,
.match-results,
.stat-list,
.content-list,
.quick-actions {
  display: grid;
  gap: 10px;
}

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

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

.team-box strong {
  font-size: 13px;
}

.timeline-item,
.campaign-card,
.segment,
.automation-step {
  padding: 12px;
}

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

.conversation-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.conversation-sidebar,
.conversation-thread-panel,
.conversation-context-panel {
  min-height: 620px;
}

.conversation-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.conversation-search input {
  width: 100%;
  border: 0;
  outline: 0;
}

.conversation-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.conversation-filters button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.conversation-filters button.active {
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.conversation-list {
  display: grid;
  gap: 8px;
  max-height: 480px;
  overflow: auto;
}

.conversation-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  border-color: var(--brand);
  background: #f7f1ef;
}

.conversation-item span,
.conversation-item em {
  display: grid;
  gap: 3px;
}

.conversation-item em {
  grid-column: 1 / -1;
  font-style: normal;
  font-weight: 800;
}

.conversation-item small {
  color: var(--muted);
}

.conversation-item b {
  min-width: 28px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  text-align: center;
  font-size: 12px;
}

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

.conversation-thread-head h2,
.conversation-thread-head p {
  margin: 4px 0 0;
}

.conversation-thread-head p,
.context-block p {
  color: var(--muted);
  line-height: 1.45;
}

.message-list {
  display: grid;
  gap: 12px;
  min-height: 360px;
  max-height: 440px;
  overflow: auto;
  padding: 16px 0;
}

.message-bubble {
  display: grid;
  gap: 6px;
  max-width: 78%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-bubble.outbound {
  justify-self: end;
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.message-bubble.ai {
  border-color: #d9cbc7;
  background: #f7f1ef;
}

.message-bubble.internal {
  border-style: dashed;
  background: #fffaf0;
}

.message-bubble small {
  color: var(--muted);
  font-weight: 800;
}

.message-bubble.outbound small {
  color: rgba(255, 255, 255, 0.78);
}

.message-bubble p {
  margin: 0;
}

.conversation-composer {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.conversation-composer textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.context-grid,
.context-block {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.context-grid span,
.context-tags span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafb;
  font-size: 12px;
  font-weight: 800;
}

.context-grid strong {
  color: var(--ink);
  font-size: 14px;
}

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

.stacked {
  display: grid;
  grid-template-columns: 1fr;
}

.conversation-area-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 2px 1px 6px;
}

.conversation-area-tab,
[data-area-tone="all"] {
  --area-color: #555a62;
  --area-soft: #f1f2f3;
}

[data-area-tone="realEstate"] {
  --area-color: #841503;
  --area-soft: #f7e9e5;
}

[data-area-tone="woodHomes"] {
  --area-color: #8b6415;
  --area-soft: #f7f0df;
}

[data-area-tone="construction"] {
  --area-color: #b3472e;
  --area-soft: #faece7;
}

[data-area-tone="design"] {
  --area-color: #27637a;
  --area-soft: #e7f1f4;
}

[data-area-tone="consulting"] {
  --area-color: #625276;
  --area-soft: #f0ecf4;
}

[data-area-tone="training"] {
  --area-color: var(--area-training);
  --area-soft: var(--area-training-soft);
}

.automation-profiles-panel {
  margin-top: 18px;
}

.automation-intro {
  max-width: 820px;
  margin: -4px 0 18px;
  color: var(--muted);
}

.automation-safety {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--area-training);
  font-size: 13px;
  font-weight: 700;
}

.automation-safety svg,
.approval-rule svg {
  width: 17px;
  height: 17px;
}

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

.messaging-profile {
  padding: 15px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--area-color);
  border-radius: 8px;
  background: #fff;
}

.messaging-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.messaging-profile-head > div {
  flex: 1;
}

.messaging-profile-head h3 {
  margin: 2px 0 0;
  font-size: 17px;
}

.messaging-profile-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--area-color);
  background: var(--area-soft);
}

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

.messaging-profile dl {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.messaging-profile dl div {
  display: grid;
  gap: 3px;
}

.messaging-profile dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.messaging-profile dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.approval-rule {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  color: var(--area-color);
  background: var(--area-soft);
  font-size: 12px;
  line-height: 1.35;
}

.approval-rule b {
  display: block;
}

.conversation-area-tab {
  position: relative;
  display: grid;
  min-width: 156px;
  min-height: 72px;
  gap: 7px;
  padding: 11px 34px 11px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.conversation-area-tab::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--area-color);
  content: "";
}

.conversation-area-tab:hover,
.conversation-area-tab.active {
  border-color: color-mix(in srgb, var(--area-color) 45%, #d8dce2);
  background: var(--area-soft);
  box-shadow: 0 8px 20px rgba(24, 28, 35, 0.07);
}

.conversation-area-tab span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.conversation-area-tab span strong {
  line-height: 1.12;
}

.conversation-area-tab svg {
  width: 17px;
  height: 17px;
  color: var(--area-color);
}

.conversation-area-tab small {
  color: var(--muted);
  font-size: 12px;
}

.conversation-area-tab b {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--area-color);
  font-size: 11px;
}

.conversation-layout {
  grid-template-columns: 330px minmax(430px, 1fr) 310px;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(30, 34, 41, 0.08);
}

.conversation-sidebar,
.conversation-thread-panel,
.conversation-context-panel {
  min-height: 680px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.conversation-sidebar {
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: #fbfbfa;
}

.conversation-thread-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  background: #f4f1ec;
}

.conversation-context-panel {
  padding: 18px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #fff;
}

.conversation-list {
  gap: 3px;
  max-height: 540px;
}

.conversation-item {
  position: relative;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 10px;
  border-color: transparent;
  border-radius: 7px;
  background: transparent;
}

.conversation-item.active,
.conversation-item:hover {
  border-color: color-mix(in srgb, var(--area-color) 25%, var(--line));
  background: var(--area-soft);
}

.conversation-item.active::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--area-color);
  content: "";
}

.conversation-avatar {
  display: grid !important;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--area-color) 30%, #fff);
  border-radius: 50%;
  color: var(--area-color);
  background: var(--area-soft);
  font-size: 13px;
  font-weight: 900;
}

.conversation-avatar.large {
  width: 46px;
  height: 46px;
}

.conversation-avatar.profile {
  width: 64px;
  height: 64px;
  font-size: 18px;
}

.conversation-preview {
  display: grid !important;
  min-width: 0;
  gap: 4px;
}

.conversation-preview-head {
  display: flex !important;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.conversation-preview-head time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.conversation-item .conversation-preview em {
  display: block;
  grid-column: auto;
  overflow: hidden;
  color: #555a62;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview small {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview small svg {
  width: 12px;
  height: 12px;
  color: var(--area-color);
}

.conversation-item > b {
  align-self: start;
  min-width: 20px;
  min-height: 20px;
  padding: 3px 6px;
  background: var(--area-color);
}

.conversation-thread-head {
  align-items: center;
  padding: 14px 16px;
  background: #fff;
}

.conversation-contact-heading,
.conversation-head-actions,
.conversation-profile-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.conversation-contact-heading h2,
.conversation-contact-heading p,
.conversation-profile-head h2 {
  margin: 0;
}

.conversation-contact-heading h2 {
  font-size: 17px;
}

.conversation-contact-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.conversation-head-actions .icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
}

.conversation-head-actions svg {
  width: 17px;
  height: 17px;
}

.message-list {
  align-content: start;
  min-height: 470px;
  max-height: 520px;
  padding: 22px 18px;
}

.chat-date {
  justify-self: center;
  padding: 5px 10px;
  border: 1px solid #ded9d0;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.message-bubble {
  max-width: min(78%, 520px);
  padding: 10px 12px 7px;
  border-color: #ded9d0;
  border-radius: 8px 8px 8px 2px;
  box-shadow: 0 2px 5px rgba(30, 34, 41, 0.05);
}

.message-bubble.outbound {
  color: var(--ink);
  border-color: #b9d8c5;
  border-radius: 8px 8px 2px 8px;
  background: #dff2e5;
}

.message-bubble.outbound small {
  color: #527060;
}

.message-bubble small {
  justify-self: end;
  font-size: 10px;
}

.conversation-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.conversation-composer textarea {
  min-height: 46px;
  max-height: 120px;
  padding: 12px 14px;
  border-radius: 8px;
  resize: none;
}

.composer-actions {
  flex-wrap: nowrap;
}

.conversation-profile-head {
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.conversation-profile-head h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.area-chip {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--area-color);
  background: var(--area-soft);
  font-size: 10px;
  font-weight: 900;
}

.conversation-empty {
  display: grid;
  min-height: 440px;
  place-items: center;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.conversation-empty svg {
  width: 32px;
  height: 32px;
}

.conversation-empty h2,
.conversation-empty p {
  margin: 8px 0 0;
}

.conversation-empty.compact {
  min-height: 160px;
}

@media (max-width: 1400px) {
  .conversation-layout {
    grid-template-columns: 310px minmax(430px, 1fr);
  }

  .conversation-context-panel {
    grid-column: 1 / -1;
    min-height: auto;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 980px) {
  .conversation-area-tabs {
    grid-template-columns: repeat(7, 156px);
  }

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

  .conversation-metrics {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .conversation-metrics .metric {
    min-width: 190px;
    scroll-snap-align: start;
  }

  .conversation-layout {
    overflow: visible;
  }

  .conversation-sidebar,
  .conversation-context-panel {
    min-height: auto;
  }

  .conversation-thread-panel {
    min-height: 560px;
  }

  .conversation-list {
    max-height: 340px;
  }

  .message-list {
    min-height: 360px;
  }
}

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

.lead-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lead-count {
  color: var(--muted);
  font-weight: 800;
}

.lead-search-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-search-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-search-panel select,
.lead-search-panel input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.lead-search-panel button {
  align-self: end;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contacts-layout {
  display: block;
  position: relative;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1060px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

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

.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1e7e4;
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 12px;
}

.lead-row {
  cursor: pointer;
}

.lead-row:hover,
.lead-row.selected {
  background: #f7f1ef;
}

.contact-cell {
  display: grid;
  gap: 4px;
}

.contact-cell small {
  color: var(--muted);
}

.link-button {
  display: inline;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.link-button:hover {
  color: var(--brand);
  text-decoration: underline;
}

.row-open-button {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

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

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

.lead-select,
.property-select,
.trash-select {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.category-pill {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff4e8;
  color: #9b4a24;
  font-size: 12px;
  font-weight: 800;
}

.contact-detail {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: none;
  width: min(520px, calc(100vw - 36px));
  overflow: auto;
  min-height: 420px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: none;
  background: rgba(29, 36, 51, 0.18);
}

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

.empty-detail {
  display: grid;
  gap: 8px;
  min-height: 250px;
  align-content: center;
}

.empty-detail h2,
.empty-detail p {
  margin: 0;
}

.empty-detail p {
  color: var(--muted);
}

.contact-form,
.activity-box,
.documents-box,
.request-box {
  display: grid;
  gap: 14px;
}

.activity-box,
.documents-box,
.request-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

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

.form-grid label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.activity-form input,
.dialog-card select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-transform: none;
}

.form-grid textarea {
  resize: vertical;
}

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

.detail-actions,
.activity-form {
  display: flex;
  gap: 10px;
}

.detail-actions {
  justify-content: space-between;
}

.danger {
  color: #b53126;
  border-color: #f0b8b1;
}

.compact {
  margin-bottom: 0;
}

.activity-list,
.document-list {
  display: grid;
  gap: 8px;
}

.activity-item,
.document-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
}

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

.document-item strong,
.document-item small {
  display: block;
}

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

.document-item span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 800;
}

.document-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.document-form select,
.document-form input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--muted);
  font-weight: 800;
}

.inline-check input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: var(--brand);
}

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

.requested-property {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.requested-property strong,
.requested-property small {
  display: block;
}

.requested-property small {
  color: var(--muted);
}

.requested-property span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

#conversationSummary {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
}

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

.promote {
  color: var(--brand-dark);
  border-color: #c6aba4;
  background: #f7f1ef;
}

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

.property-search-panel {
  display: grid;
  grid-template-columns: 1fr repeat(4, minmax(140px, 0.8fr)) auto;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.property-search-panel label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.property-search-panel input,
.property-search-panel select {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.property-search-panel button {
  align-self: end;
}

.property-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 16px;
  align-items: start;
}

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

.property-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.property-list-head span {
  color: var(--muted);
}

.property-list {
  display: grid;
}

.property-row {
  display: grid;
  grid-template-columns: 24px 92px minmax(0, 1fr) 170px;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.property-row:hover,
.property-row.selected {
  background: #f7f1ef;
}

.property-thumb {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 92px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--blue));
}

.property-thumb strong {
  font-size: 24px;
}

.property-thumb span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-top: 8px;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  font-weight: 800;
}

.property-row-main {
  display: grid;
  gap: 8px;
}

.property-row-main h3,
.property-row-main p {
  margin: 0;
}

.property-row-main p,
.property-row-side small {
  color: var(--muted);
}

.property-row-side {
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: center;
}

.property-detail {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
}

.property-form,
.property-assets {
  display: grid;
  gap: 14px;
}

.property-assets {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.property-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafb;
}

.property-summary strong {
  color: var(--brand);
  font-size: 24px;
}

.sync-box p {
  margin: 0;
  color: var(--muted);
}

.sync-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sync-grid span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  color: var(--muted);
}

.sync-grid strong {
  color: var(--ink);
}

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

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

.asset-head strong,
.asset-head small {
  display: block;
}

.asset-head small {
  color: var(--muted);
}

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

.asset-tile {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.asset-preview {
  display: grid;
  min-height: 62px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #9aa7b2, #c59b45);
  font-weight: 800;
}

.asset-tile strong {
  font-size: 12px;
}

.asset-tile span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

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

.client-card h3,
.client-card p {
  margin: 0;
}

.client-card p,
.client-card small {
  color: var(--muted);
}

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

.client-meta span {
  padding: 6px 8px;
  border-radius: 6px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.property-card {
  overflow: hidden;
}

.property-photo {
  height: 150px;
  background:
    linear-gradient(135deg, rgba(20, 59, 53, 0.82), rgba(208, 79, 53, 0.36)),
    var(--photo);
  background-size: cover;
  background-position: center;
}

.property-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.property-body h3 {
  margin: 0;
}

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

.property-meta span {
  padding: 5px 8px;
  border-radius: 6px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 12px;
}

.portal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-chips span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.email-preview {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.email-preview h3,
.email-preview p {
  margin: 0;
}

.email-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--gold), var(--accent));
}

.campaign-row {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

.portal-card strong,
.portal-card small {
  display: block;
}

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

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.publication-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.publication-table table {
  min-width: 1180px;
  box-shadow: none;
}

.publication-table th small,
.publication-table td small,
.publication-table td em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.publish-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.publish-toggle input,
.publication-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.publish-toggle span {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #f0e8e5;
  font-size: 11px;
  font-weight: 900;
}

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

.publication-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 4px solid #b8c0cd;
  border-radius: 8px;
  background: #fff;
}

.publication-card.automatico {
  border-top-color: var(--brand);
}

.publication-card.manuale {
  border-top-color: var(--gold);
}

.publication-card small,
.publication-card span,
.publication-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.field-grid span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.match-card {
  grid-template-columns: 1fr 1.4fr auto;
  align-items: center;
}

.match-card b {
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
}

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

.trash-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.trash-item strong,
.trash-item small {
  display: block;
}

.trash-item small {
  color: var(--muted);
}

.archive-heading {
  align-items: flex-start;
}

.archive-heading h2 small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.archive-heading .bulk-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.archive-heading button i,
.archive-search-actions button i,
.archive-pagination button i {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

#archiveSearchBtn.is-active {
  border-color: var(--brand);
  color: var(--brand);
  background: #f8edeb;
}

.archive-search-panel {
  display: grid;
  gap: 18px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #c9b7b1;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #faf8f7;
}

.archive-search-panel[hidden] {
  display: none;
}

.archive-form-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.archive-form-heading h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.archive-form-heading > span,
.archive-dialog-note {
  color: var(--muted);
  font-size: 13px;
}

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

.archive-field-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.archive-field-grid label span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.archive-field-grid input {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.archive-field-grid input:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(157, 33, 11, 0.12);
}

.archive-field-grid .is-prominent input {
  border-color: #b8a7a1;
}

.archive-search-actions,
.archive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.archive-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 315px);
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.archive-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.archive-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 11px 10px;
  border-bottom: 1px solid #cfc7c3;
  color: #5f5754;
  background: #f4f1ef;
  font-size: 11px;
  text-align: left;
  text-transform: uppercase;
}

.archive-table td {
  max-width: 280px;
  padding: 10px;
  border-bottom: 1px solid #ebe6e3;
  color: #312d2b;
  vertical-align: top;
}

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

.archive-table tbody tr:hover td {
  background: #faf7f5;
}

.archive-table .archive-found-row td {
  background: #fffaf0;
}

.archive-table .archive-found-row:hover td {
  background: #fff5df;
}

.archive-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.archive-reference {
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid #d9c7c0;
  border-radius: 4px;
  color: var(--brand-dark);
  background: #fbf2ef;
  font-weight: 800;
  white-space: nowrap;
}

.archive-object {
  overflow: hidden;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.archive-detail-btn {
  width: 36px;
  height: 36px;
}

.archive-detail-btn i,
.archive-empty i {
  width: 18px;
  height: 18px;
}

.archive-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.archive-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 255px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.archive-empty strong {
  color: var(--text);
  font-size: 18px;
}

.archive-record-dialog {
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
}

.archive-record-dialog .dialog-card {
  max-height: calc(100vh - 64px);
  overflow: auto;
}

.archive-record-fields {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.archive-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.archive-detail-grid div {
  min-height: 72px;
  padding: 12px;
  background: #fff;
}

.archive-detail-grid span,
.archive-detail-grid strong {
  display: block;
}

.archive-detail-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.archive-detail-grid strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.stat-row,
.content-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-row div,
.content-card {
  min-width: 0;
}

.stat-row strong,
.stat-row small,
.content-card strong,
.content-card small {
  display: block;
}

.stat-row small,
.content-card small {
  color: var(--muted);
}

.content-card b {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #f0e8e5;
  font-size: 12px;
}

.model-card .ghost-button {
  align-self: start;
}

.role-select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.stat-row span {
  flex: 0 0 auto;
  color: var(--brand);
  font-weight: 800;
}

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

.invoice-card {
  gap: 10px;
}

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

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

.automation-board.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.trello-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.trello-board.single-area {
  grid-template-columns: minmax(0, 1fr);
  overflow: visible;
}

.schedule-area-column {
  --schedule-area-color: var(--area-real-estate);
  min-height: 460px;
  border-top-color: var(--schedule-area-color);
  background: #f3f4f5;
}

.schedule-area-column[data-area-tone="woodHomes"] { --schedule-area-color: var(--area-wood-homes); }
.schedule-area-column[data-area-tone="construction"] { --schedule-area-color: var(--area-construction); }
.schedule-area-column[data-area-tone="design"] { --schedule-area-color: var(--area-design); }
.schedule-area-column[data-area-tone="consulting"] { --schedule-area-color: var(--area-consulting); }
.schedule-area-column[data-area-tone="training"] { --schedule-area-color: var(--area-training); }

.schedule-area-column > h2 {
  align-items: center;
  padding: 2px 2px 8px;
}

.schedule-area-column > h2 small {
  color: var(--schedule-area-color);
  font-size: 13px;
  font-weight: 800;
}

.schedule-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.schedule-area-column .trello-card {
  min-height: 154px;
}

.schedule-area-column .trello-add-card {
  width: min(100%, 360px);
  margin-top: 2px;
}

.schedule-empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  border: 1px dashed #b8c0cd;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.schedule-feedback {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #d8d2cc;
  border-radius: 6px;
  background: #fff;
  color: #5f5a56;
}

.schedule-feedback.is-error,
.schedule-empty-state.is-error {
  border-color: #b73a2b;
  color: #8f2114;
}

.trello-card.is-overdue {
  border-color: #b73a2b;
}

.trello-card.is-complete {
  opacity: .72;
}

.trello-card.is-complete strong {
  text-decoration: line-through;
}

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

.schedule-comments-note {
  color: #6f6964;
  font-size: .85rem;
  line-height: 1.4;
}

.trello-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--brand);
  border-radius: 8px;
  background: #f0f3f6;
}

.trello-column.gold {
  border-top-color: var(--gold);
}

.trello-column.accent {
  border-top-color: var(--accent);
}

.trello-column.blue {
  border-top-color: var(--blue);
}

.trello-column.training {
  border-top-color: var(--area-training);
}

.trello-column h2 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 18px;
}

.trello-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.trello-card:hover {
  border-color: var(--brand);
  box-shadow: 0 10px 20px rgba(29, 36, 51, 0.08);
}

.trello-select {
  flex: 0 0 auto;
  padding-top: 2px;
}

.trello-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.trello-card-open {
  display: grid;
  flex: 1;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.trello-card small {
  color: var(--muted);
}

.trello-card span {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: #f0e8e5;
  font-size: 12px;
  font-weight: 800;
}

.trello-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.trello-add-card {
  min-height: 38px;
  border: 1px dashed #b8c0cd;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(20, 59, 53, 0.42);
}

.schedule-modal.hidden {
  display: none;
}

.schedule-modal-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  width: min(1080px, 100%);
  max-height: min(760px, calc(100vh - 56px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 70px rgba(29, 36, 51, 0.25);
}

.schedule-modal-main,
.schedule-modal-side {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: auto;
  padding: 24px;
}

.schedule-modal-side {
  border-left: 1px solid var(--line);
  background: #f8fafb;
}

.modal-head,
.schedule-card-actions,
.inline-add,
.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-head {
  justify-content: space-between;
}

.modal-head select,
.schedule-card-actions select,
.schedule-card-actions input,
.schedule-title-row input,
.schedule-detail-block textarea,
.inline-add input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.schedule-title-row input {
  border: 0;
  padding: 0;
  font-size: 28px;
  font-weight: 900;
  outline: 0;
}

.schedule-card-actions {
  align-items: end;
}

.schedule-card-actions label {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.schedule-detail-block {
  display: grid;
  gap: 10px;
}

.schedule-detail-block h3,
.schedule-modal-side h3 {
  margin: 0;
}

.schedule-detail-block textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.check-progress {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.check-progress b {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
}

.check-progress {
  background: linear-gradient(to right, transparent 42px, #e5e9ef 42px);
}

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

.checklist-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.checklist-item input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.inline-add input {
  flex: 1;
}

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

.content-brief .span-2,
.content-brief button {
  grid-column: span 2;
}

.automation-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.automation-step {
  min-height: 170px;
  border-top: 4px solid var(--brand);
}

.automation-step:nth-child(2n) {
  border-top-color: var(--gold);
}

.automation-step:nth-child(3n) {
  border-top-color: var(--accent);
}

dialog {
  width: min(520px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(20, 28, 36, 0.35);
}

.dialog-card {
  display: grid;
  gap: 14px;
}

.dialog-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.dialog-card input,
.dialog-card select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

@media (max-width: 1100px) {
  .control-main {
    padding: 24px 20px 44px;
  }

  .home-hero,
  .home-priority-grid {
    grid-template-columns: 1fr;
  }

  .home-zone-heading {
    align-items: flex-start;
  }

  .personal-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .crm-area-card,
  .crm-area-card:first-child,
  .crm-area-card:nth-child(2),
  .crm-area-card:nth-child(3),
  .crm-area-card:nth-child(4),
  .crm-area-card:nth-child(5) {
    grid-column: span 6;
  }

  .hub-tool-grid,
  .hub-secondary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .sidebar {
    position: static;
    gap: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item {
    justify-content: center;
    min-width: 130px;
  }

  .sidebar-panel {
    display: none;
  }

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

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

  .metrics-grid,
  .dashboard-grid,
  .builder-layout,
  .portal-layout,
  .matching-grid,
  .content-brief,
  .contacts-layout,
  .conversation-layout,
  .lead-search-panel,
  .property-search-panel,
  .property-workspace,
  .client-grid,
  .property-grid,
  .trello-board,
  .automation-board,
  .automation-board.compact,
  .automation-board.single {
    grid-template-columns: 1fr;
  }

  .content-brief .span-2,
  .content-brief button {
    grid-column: auto;
  }

  .contact-detail {
    position: fixed;
    left: 18px;
    width: auto;
  }

  .property-detail {
    position: static;
    max-height: none;
  }

  .property-row {
    grid-template-columns: 24px 76px minmax(0, 1fr);
  }

  .property-row-side {
    grid-column: 3;
    justify-items: start;
  }

  .wide {
    grid-column: auto;
  }

  .schedule-modal {
    padding: 14px;
  }

  .schedule-modal-card {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 28px);
  }

  .schedule-modal-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .schedule-card-actions,
  .inline-add {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .area-switcher,
  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .area-button {
    flex: 0 0 178px;
    scroll-snap-align: start;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    scroll-snap-align: start;
  }

  .section-heading {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .section-heading > button {
    width: 100%;
    max-width: 100%;
  }

  .module-hub {
    padding: 0;
  }

  .hub-head {
    min-height: 62px;
    padding: 9px 14px;
  }

  .hub-brand span,
  .profile-copy,
  .hub-ai-header-button span {
    display: none;
  }

  .hub-brand .brand-logo,
  .profile-avatar {
    width: 34px;
    height: 34px;
  }

  .hub-ai-header-button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .control-main {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px 14px 40px;
  }

  .control-main > * + * {
    margin-top: 16px;
  }

  .home-zone {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 20px 0 22px;
  }

  .priority-zone,
  .tools-section {
    margin-inline: -14px;
    padding-inline: 14px;
  }

  .home-zone-heading {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
  }

  .home-zone-heading h2 {
    font-size: 20px;
  }

  .home-hero {
    gap: 18px;
    min-width: 0;
    padding-top: 8px;
  }

  .hero-personal-copy h1 {
    font-size: 34px;
  }

  .hero-personal-copy p {
    font-size: 15px;
    overflow-wrap: anywhere;
  }

  .home-ai-console,
  .home-section {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px;
  }

  .home-priority-grid,
  .crm-area-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .home-ai-form {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .ai-submit-button {
    grid-column: 1 / -1;
  }

  .ai-suggestions button,
  .attention-action {
    min-height: 40px;
  }

  .personal-kpi-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .personal-kpi {
    flex: 0 0 142px;
    scroll-snap-align: start;
  }

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

  .attention-meta {
    display: none;
  }

  .attention-action {
    align-self: center;
  }

  .crm-area-grid,
  .hub-tool-grid,
  .hub-secondary-grid {
    grid-template-columns: 1fr;
  }

  .crm-area-card,
  .crm-area-card:first-child,
  .crm-area-card:nth-child(2),
  .crm-area-card:nth-child(3),
  .crm-area-card:nth-child(4),
  .crm-area-card:nth-child(5) {
    grid-column: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 218px;
  }

  .crm-card-head,
  .crm-card-title,
  .home-section-heading {
    min-width: 0;
  }

  .crm-card-title strong,
  .home-section-heading h2 {
    overflow-wrap: anywhere;
  }

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

  .home-section-heading {
    align-items: flex-start;
  }

  .section-note {
    display: none;
  }

  .main,
  .sidebar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px;
  }

  .suite-layout,
  .view.active,
  .module-intro,
  .toolbar,
  .lead-toolbar-left,
  .bulk-actions,
  .trello-board.single-area,
  .schedule-area-column,
  .schedule-project-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .module-intro p,
  .schedule-area-column,
  .schedule-empty-state {
    overflow-wrap: anywhere;
  }

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

  .bulk-actions > button {
    max-width: 100%;
  }

  .schedule-project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics-grid {
    gap: 10px;
  }

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

  .lead-toolbar-left {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented {
    overflow-x: auto;
  }

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

  .document-form {
    grid-template-columns: 1fr;
  }

  .asset-columns,
  .asset-grid,
  .sync-grid {
    grid-template-columns: 1fr;
  }

  .match-card,
  .portal-card {
    grid-template-columns: 1fr;
  }

  .archive-heading,
  .archive-form-heading,
  .archive-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .archive-heading .bulk-actions,
  .archive-search-actions,
  .archive-dialog-actions {
    justify-content: flex-start;
  }

  .archive-field-grid,
  .archive-record-fields,
  .archive-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .archive-pagination span {
    order: -1;
  }
}
.real-estate-request-summary {
  margin: 16px 0;
}

.data-origin-badge {
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
}

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

.property-request-row {
  align-items: center;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(130px, .65fr);
  padding: 12px 0;
}

.gestim-summary { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:8px; margin:14px 0 20px; }
.gestim-summary article { border:1px solid var(--border); padding:12px; background:var(--surface-soft); }
.gestim-summary strong,.gestim-summary span { display:block; }
.gestim-summary strong { font-size:1.35rem; }
.gestim-summary span { color:var(--muted); font-size:.8rem; }
.gestim-admin-grid { display:grid; grid-template-columns:minmax(280px,.8fr) minmax(420px,1.2fr); gap:18px; }
.gestim-mapping-row,.gestim-review-row { display:grid; gap:10px; align-items:center; border:1px solid var(--border); padding:10px; }
.gestim-mapping-row { grid-template-columns:minmax(150px,1fr) 130px minmax(150px,.8fr) 40px; }
.gestim-review-row { grid-template-columns:minmax(220px,1fr) auto; }
.gestim-mapping-row small,.gestim-review-row small { display:block; color:var(--muted); }
.gestim-review-actions { display:flex; flex-wrap:wrap; gap:6px; }
.gestim-contact-search { grid-column:1/-1; padding:10px; background:var(--surface-soft); border:1px solid var(--border); }
.gestim-contact-search label { display:grid; gap:6px; font-weight:700; }
.gestim-contact-search input,.gestim-queue-toolbar select { min-height:40px; border:1px solid var(--border); background:var(--surface); padding:8px 10px; }
.gestim-contact-result { width:100%; display:grid; grid-template-columns:1fr auto; gap:3px 12px; text-align:left; border:0; border-top:1px solid var(--border); padding:9px 4px; background:transparent; cursor:pointer; }
.gestim-contact-result:hover,.gestim-contact-result:focus-visible { background:var(--surface); outline:2px solid var(--accent); outline-offset:2px; }
.gestim-contact-result small { grid-column:1/-1; color:var(--muted); }
.gestim-queue-toolbar,.gestim-pagination { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.gestim-pagination { margin-top:10px; }
@media (max-width: 980px) { .gestim-summary { grid-template-columns:repeat(3,1fr); } .gestim-admin-grid { grid-template-columns:1fr; } }
@media (max-width: 640px) { .gestim-summary { grid-template-columns:repeat(2,1fr); } .gestim-review-row,.gestim-mapping-row { grid-template-columns:1fr; } .gestim-mapping-row .icon-button { justify-self:end; } }

.property-request-row:first-child {
  border-top: 0;
}

.property-request-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.property-request-row strong,
.property-request-row b,
.property-request-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-request-row small {
  color: var(--muted);
}

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