/* Quiet Executive module refinements. Shared tokens and components live in their base owners. */

body { background: var(--bg); color: var(--ink); }
.app-shell { background: var(--bg); }
.sidebar { background: rgba(255, 255, 255, 0.94); color: var(--ink); border-right: 1px solid var(--line); box-shadow: none; backdrop-filter: blur(18px); }
.sidebar:hover,
body.sidebar-pinned .sidebar { box-shadow: 12px 0 32px rgba(25, 31, 28, 0.07); }
.sidebar .brand strong,
.auth-brand { color: var(--ink); }
.sidebar .brand span,
.sidebar-footer { color: var(--muted); }
.brand-mark { border: 1px solid var(--line); background: #fff; color: var(--accent-strong); box-shadow: var(--shadow-soft); }
.nav-item,
.nav-group-toggle,
.nav-action-item { color: var(--muted); font-weight: 600; }
.nav-icon { background: transparent; color: var(--soft); }
.nav-item:hover,
.nav-group-toggle:hover,
.nav-action-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active,
.nav-group.has-active-view > .nav-group-toggle { background: var(--accent-soft); color: var(--accent-strong); }
.nav-item.active::after { background: var(--accent); }
.nav-item.active .nav-icon,
.nav-group.has-active-view > .nav-group-toggle .nav-icon { background: transparent; color: var(--accent-strong); }
.nav-children .nav-item.active { background: var(--accent-soft); color: var(--accent-strong); }
.sidebar-pin,
.sidebar-settings { border-color: var(--line); background: var(--surface); color: var(--muted); }
.topbar { min-height: 72px; padding: 12px 32px; background: rgba(247, 247, 245, 0.9); border-bottom: 1px solid rgba(226, 227, 223, 0.8); box-shadow: none; backdrop-filter: blur(18px); }
.topbar-area-label,
.eyebrow,
.section-kicker { color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar-heading-row h1,
h1 { color: var(--ink); font-size: clamp(1.5rem, 2.1vw, 2rem); font-weight: 650; letter-spacing: -0.03em; }
.topbar-description-line p { color: var(--muted); }
.content { width: 100%; max-width: 1520px; margin-inline: auto; padding: 26px 36px 52px; }
.search-box { height: 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-soft); }
.quick-create-button { min-height: 40px; gap: 6px; padding-inline: 13px; white-space: nowrap; }
.quick-create-button > span:first-child { font-size: 1rem; line-height: 1; }
.search-box:focus-within { border-color: rgba(38, 127, 123, 0.42); box-shadow: var(--focus-ring); }
.panel,
.surface-card,
.stat-card { border-color: var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: none; }
.auth-card,
.modal { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.panel:hover { border-color: var(--line-strong); }
.primary-button { border-color: var(--ink); border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow-soft); }
.primary-button:hover { border-color: #111412; background: #111412; }
.secondary-button,
.ghost-button { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); box-shadow: none; }
.icon-button { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); box-shadow: none; }
input,
select,
textarea { border-color: var(--line); border-radius: var(--radius-sm); background: var(--surface); }
input:focus,
select:focus,
textarea:focus { border-color: rgba(38, 127, 123, 0.45); box-shadow: var(--focus-ring); }
.empty-state,
.empty-hint { border-color: var(--line); background: var(--surface-muted); }

/* Hoje v3 — briefing diário: prioridade, ação e detalhe progressivo. */
#view-today .attention-today-summary {
  gap: 18px;
  margin-bottom: 16px;
  padding: 0 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

#view-today .attention-today-icon {
  background: var(--surface-2);
  color: var(--ink);
}

#view-today .attention-today-title span {
  font-weight: 700;
}

#view-today .attention-today-counts span {
  color: var(--muted);
}

#view-today .dashboard-grid {
  gap: 12px;
}

#view-today .today-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 2px 2px;
}

#view-today .today-section-heading span {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

#view-today .today-section-heading small {
  color: var(--muted);
  font-size: 0.75rem;
}

#view-today .today-strategy-heading {
  justify-content: space-between;
}

#view-today .today-strategy-heading > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#view-today.today-strategy-collapsed .metrics-panel,
#view-today.today-strategy-collapsed .today-objectives-panel,
#view-today.today-strategy-collapsed .today-reading-panel,
#view-today.today-strategy-collapsed .today-expenses-panel,
#view-today.today-strategy-collapsed .today-signals-panel {
  display: none;
}

#view-today .today-attention-panel { grid-row: 1; }
#view-today .important-dates-panel { grid-row: 1; }
#view-today .today-work-heading { grid-row: 2; }
#view-today .agenda-panel { grid-row: 3; }
#view-today .tasks-panel { grid-row: 3; }
#view-today .work-diary-panel { grid-row: 4; }
#view-today .today-strategy-heading { grid-row: 5; }
#view-today .metrics-panel { grid-row: 6; }
#view-today .today-objectives-panel,
#view-today .today-reading-panel { grid-row: 7; }
#view-today .today-expenses-panel { grid-column: 1 / -1; grid-row: 8; }
#view-today .today-signals-panel { grid-column: 1 / -1; grid-row: 9; }

#view-today .panel,
#view-today .metrics-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-today .today-attention-panel {
  padding: 18px 20px;
  border-color: #ded9cc;
  background: var(--champagne);
  box-shadow: none;
}

#view-today .panel-header {
  margin-bottom: 12px;
}

#view-today .panel-header h2 {
  font-size: 1.05rem;
  font-weight: 650;
}

#view-today .panel-icon {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}

#view-today .today-decision-list > li {
  border-top-color: rgba(120, 116, 106, 0.18);
}

#view-today .today-decision-check span {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.84);
}

#view-today .metric {
  min-height: 92px;
  padding: 13px 14px;
}

#view-today .metric strong {
  font-size: 1.55rem;
  font-weight: 650;
}

#view-today .work-diary-panel {
  padding: 14px 16px;
}

/* Pessoas e relações — leitura operacional, não uma grelha administrativa. */
#view-contacts .module-header,
#view-followups .module-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-contacts .module-header h2,
#view-followups .module-header h2 {
  margin-top: 5px;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

#view-contacts .module-header .muted,
#view-followups .module-header .muted {
  max-width: 680px;
  margin-top: 6px;
  line-height: 1.45;
}

#view-contacts .contact-list-toolbar {
  margin: 0 0 10px;
}

#view-contacts .contact-search input {
  min-height: 42px;
  background: var(--surface);
}

#view-contacts .contact-filter-bar {
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

#view-contacts .contact-filter-bar label > span {
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
}

#view-contacts .contact-filter-bar select,
#view-contacts .contacts-archive-button {
  min-height: 38px;
  background: var(--surface);
  box-shadow: none;
}

#view-contacts .contact-record-id {
  display: none;
}

#view-contacts .contacts-radar {
  gap: 0;
  border-top: 1px solid var(--line);
}

#view-contacts .contact-radar-row {
  min-height: 70px;
  padding: 11px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

#view-contacts .contact-radar-row:hover,
#view-contacts .contact-radar-row:focus-visible,
#view-contacts .contact-radar-row:focus-within {
  background: var(--surface-2);
  border-bottom-color: var(--line-strong);
}

#view-contacts .contact-radar-title-line > strong {
  font-size: 0.96rem;
  font-weight: 650;
}

#view-contacts .contact-type-badge,
#view-contacts .contact-list-state {
  font-size: 0.66rem;
  font-weight: 700;
}

#view-followups .followup-threshold-note {
  margin: -8px 0 18px;
  padding: 0;
  color: var(--soft);
  font-size: 0.76rem;
}

#view-followups .followup-center-list {
  gap: 8px;
}

#view-followups .followup-card {
  padding: 14px 16px;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-followups .followup-kind {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
}

#view-followups .followup-card-main strong {
  font-weight: 650;
}

#view-followups .followup-actions button {
  min-height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

/* Ficha 360 — resumo primeiro, profundidade progressiva. */
.detail-modal {
  width: min(1080px, 100%);
  border-radius: 14px;
}

.detail-modal .modal-header {
  padding: 18px 22px 16px;
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.detail-modal .modal-header h2 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.detail-modal .detail-hero {
  padding: 12px 0 16px;
}

.detail-modal .detail-hero h3 {
  font-size: 1.4rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.detail-modal .detail-summary-strip {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.detail-modal .detail-decision-panel {
  border-color: #ded9cc;
  border-radius: var(--radius);
  background: var(--champagne);
  box-shadow: none;
}

.detail-modal .detail-card,
.detail-modal .detail-facts div {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.detail-modal .detail-collapsible-indicator::before {
  border-radius: var(--radius-sm);
}

/* Imóveis e estudos — carteira legível, preço informativo, ação contextual. */
#view-properties .module-header,
#view-studies .module-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-properties .module-header h2,
#view-studies .module-header h2 {
  margin-top: 5px;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

#view-properties .module-header .muted,
#view-studies .module-header .muted {
  max-width: 680px;
  margin-top: 6px;
  line-height: 1.45;
}

#view-properties .list-status {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

#view-properties .property-grid {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-properties .property-card {
  min-height: 112px;
  padding: 14px 16px;
  border-bottom-color: var(--line);
  background: var(--surface);
}

#view-properties .property-card::before {
  display: none;
}

#view-properties .property-card:hover,
#view-properties .property-card:focus-visible {
  background: var(--surface-2);
}

#view-properties .property-image {
  width: 76px;
  height: 76px;
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

#view-properties .property-placeholder span {
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

#view-properties .property-body > strong {
  font-size: 1rem;
  font-weight: 650;
}

#view-properties .property-location {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

#view-properties .property-action {
  border: 1px solid #e3dccb;
  border-radius: var(--radius-sm);
  background: var(--champagne);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 650;
}

#view-properties .property-price-column strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
}

#view-properties .property-price-column span {
  display: none;
}

#view-studies .market-study-list {
  padding: 0;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-studies .market-study-row {
  padding: 15px 16px;
  border-bottom-color: var(--line);
}

#view-studies .market-study-row:hover,
#view-studies .market-study-row:focus-visible {
  background: var(--surface-2);
  outline: none;
}

#view-studies .market-study-row strong {
  font-weight: 650;
}

#view-studies .market-study-form,
#view-studies .market-study-contact-picker,
#view-studies .market-study-related {
  border-color: var(--line);
}

#view-studies .market-study-contact-picker,
#view-studies .market-study-related {
  border-radius: var(--radius);
  background: var(--surface-muted);
}

#view-studies .market-study-choice,
#view-studies .market-study-contact-selected > span {
  border-radius: var(--radius-sm);
}

/* Ficha 360 do imóvel */
.detail-modal .property-360-v2 .property-360-header {
  gap: 18px;
  padding-bottom: 18px;
}

.detail-modal .property-360-media img,
.detail-modal .property-360-media .property-detail-placeholder {
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.detail-modal .property-360-main h3 {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.detail-modal .property-360-address {
  font-weight: 600;
}

.detail-modal .property-360-executive-grid div {
  border-left-color: var(--line-strong);
}

.detail-modal .property-360-executive-grid div.readiness {
  border-left-color: var(--accent);
}

.detail-modal .property-360-action {
  border-color: #ded9cc;
  border-radius: var(--radius);
  background: var(--champagne);
}

.detail-modal .property-360-strip,
.detail-modal .property-readiness-compact,
.detail-modal .property-compact-table {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.detail-modal .property-readiness-compact button:hover {
  background: var(--surface-2);
}

/* Negócio — operação, potencial e compatibilidade no mesmo percurso. */
#view-processes .module-header,
#view-commercial .module-header,
#view-matches .module-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-processes .module-header h2,
#view-commercial .module-header h2,
#view-matches .module-header h2 {
  margin-top: 5px;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

#view-processes .module-header .muted,
#view-commercial .module-header .muted,
#view-matches .module-header .muted {
  max-width: 720px;
  margin-top: 6px;
  line-height: 1.45;
}

#view-processes .process-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

#view-processes .process-card {
  padding: 15px 16px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-processes .process-card:hover,
#view-processes .process-card:focus-visible {
  transform: none;
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: none;
  outline: none;
}

#view-processes .process-card .panel-header {
  margin-bottom: 8px;
}

#view-processes .process-card .panel-header strong {
  font-size: 1rem;
  font-weight: 650;
}

#view-processes .process-card .entity-id {
  display: none;
}

#view-processes .process360-card-counts {
  gap: 6px;
  margin-top: 8px;
}

#view-processes .process360-card-counts span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 0.75rem;
}

#view-commercial .opportunity-mode-tabs {
  width: fit-content;
  padding: 3px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

#view-commercial .opportunity-mode-tabs button {
  border-radius: var(--radius-sm);
}

#view-commercial .opportunity-sync-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-commercial .opportunity-summary {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

#view-commercial .opportunity-summary button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#view-commercial .opportunity-summary button:last-child {
  border-right: 0;
}

#view-commercial .opportunity-summary button:hover,
#view-commercial .opportunity-summary button.active {
  transform: none;
  border-color: var(--line);
  background: var(--surface-2);
  box-shadow: none;
}

#view-commercial .opportunity-summary strong {
  font-size: 1.35rem;
  font-weight: 650;
}

#view-commercial .opportunity-workspace,
#view-commercial .opportunity-recommendations-panel,
#view-commercial .opportunity-engine-configuration {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-commercial .opportunity-area-tabs button {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

#view-commercial .opportunity-area-tabs button.active {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

#view-commercial .opportunity-table th,
#view-commercial .opportunity-table td {
  border-bottom-color: var(--line);
}

#view-commercial .opportunity-main-row:hover,
#view-commercial .opportunity-main-row:focus-visible,
#view-commercial .opportunity-main-row.expanded {
  background: var(--surface-2);
}

#view-commercial .opportunity-inline-detail,
#view-commercial .opportunity-config-grid article {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  box-shadow: none;
}

#view-matches .match-center-settings {
  padding: 14px 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#view-matches .match-center-table-wrap {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-matches .match-center-table th,
#view-matches .match-center-table td {
  border-bottom-color: var(--line);
}

#view-matches .match-center-table tbody tr:hover {
  background: var(--surface-2);
}

#view-matches .match-score {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
}

.detail-modal .process-assistant,
.detail-modal .process360-tablist button,
.detail-modal .check-row,
.detail-modal .dependency-row {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

/* Agenda e tarefas — um percurso contínuo de captura, decisão e execução. */
#view-workspace .module-header,
#view-tasks .module-header,
#view-calendar .module-header,
#view-inbox .module-header,
#view-brain .module-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-workspace .module-header h2,
#view-tasks .module-header h2,
#view-calendar .module-header h2,
#view-inbox .module-header h2,
#view-brain .module-header h2 {
  margin-top: 5px;
  font-size: clamp(1.45rem, 2vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

#view-workspace .module-header .muted,
#view-tasks .module-header .muted,
#view-calendar .module-header .muted,
#view-inbox .module-header .muted,
#view-brain .module-header .muted {
  max-width: 720px;
  margin-top: 6px;
  line-height: 1.45;
}

#view-workspace .workspace-daily-grid {
  gap: 10px;
}

#view-workspace .panel {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-workspace .workspace-next-card {
  border-color: #ded9cc;
  background: var(--champagne);
}

#view-workspace .workspace-next-action {
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
}

#view-workspace .workspace-list-row:hover,
#view-workspace .workspace-list-row:focus-visible {
  background: var(--surface-2);
  outline: none;
}

#view-workspace .workspace-brain-form button {
  border-radius: var(--radius-sm);
  background: var(--ink);
}

#view-tasks .kanban {
  gap: 10px;
}

#view-tasks .kanban-column {
  padding: 14px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-tasks .kanban-column h3 {
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#view-tasks .kanban-quick-task input {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-tasks .kanban-quick-task button {
  color: var(--ink);
}

#view-tasks .kanban-card {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  box-shadow: none;
}

#view-tasks .kanban-card:hover,
#view-tasks .kanban-card:focus-visible {
  transform: none;
  border-color: var(--line-strong);
  background: var(--surface-2);
  box-shadow: none;
}

#view-calendar .main-calendar-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-calendar .week-day,
#view-calendar .time-row div,
#view-calendar .calendar-event {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

#view-calendar .calendar-event {
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-inbox .inbox-quick-form {
  padding: 10px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  box-shadow: none;
}

#view-inbox .inbox-status-summary {
  padding: 2px 0 10px;
  border-bottom: 1px solid var(--line);
}

#view-inbox .inbox-table-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-inbox .inbox-row:hover {
  background: var(--surface-2);
}

#view-inbox .inbox-type {
  color: var(--muted);
  font-weight: 700;
}

#view-inbox .inbox-links span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-brain .brain-direct-capture,
#view-brain .brain-stream {
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

#view-brain .brain-direct-capture {
  background: var(--champagne);
}

#view-brain .brain-temporary-banner {
  padding: 10px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

#view-brain .brain-stream .panel-header > strong,
#view-brain .brain-row-kind {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-brain .brain-quick-form button,
#view-brain .brain-direct-capture button {
  border-radius: var(--radius-sm);
  background: var(--ink);
}

#view-brain .brain-processed-group > summary {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

/* Knowledge + support — one calm, searchable reference layer. */
#view-knowledge .module-header,
#view-library .module-header,
#view-books .module-header,
#view-documents .module-header {
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-knowledge .module-header h2,
#view-library .module-header h2,
#view-books .module-header h2,
#view-documents .module-header h2 {
  margin: 4px 0 6px;
  letter-spacing: -0.035em;
}

#view-knowledge .panel,
#view-library .panel,
#view-books .panel,
#view-documents .panel,
#view-documents .document-summary .metric,
.integrations-grid .integration-card,
.integration-health-panel,
.tool-menu-panel {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-knowledge .knowledge-summary,
#view-books .book-library-summary,
#view-documents .document-summary {
  gap: 10px;
}

#view-knowledge .knowledge-summary article,
#view-books .book-library-summary article,
#view-documents .document-summary .metric {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
}

#view-knowledge .knowledge-summary article:first-child,
#view-books .book-library-summary article:first-child,
#view-documents .document-summary .metric:first-child {
  background: var(--champagne);
}

#view-knowledge .knowledge-create-panel,
#view-books .book-upload-form,
#view-documents .document-upload-form {
  border-color: var(--line);
  background: var(--surface-muted);
}

#view-knowledge .knowledge-filters,
#view-library .smart-library-toolbar,
#view-books .knowledge-library-toolbar,
#view-documents .document-filters {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-knowledge .knowledge-result-list > *,
#view-library .smart-library-list > *,
#view-books .book-library-row,
#view-documents .document-row {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
}

#view-books .book-library-row:hover,
#view-documents .document-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  transform: none;
}

#view-books .book-library-row.is-active,
#view-documents .document-row.active {
  border-color: var(--line-strong);
  background: var(--champagne);
  box-shadow: inset 3px 0 var(--ink);
}

#view-knowledge .knowledge-preview,
#view-library .smart-library-history,
#view-documents .document-preview {
  border-color: var(--line);
  background: var(--surface);
}

.integrations-grid .integration-card::before {
  background: var(--line-strong);
}

.integrations-grid .integration-icon {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.integration-health-panel,
.integration-onboarding,
.integration-health-detail {
  border-color: var(--line);
  background: var(--surface-muted);
  box-shadow: none;
}

.modal-card .modal-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* Analysis — direction, attention, activity and historical reading. */
#view-objectives .module-header,
#view-intelligence .module-header,
#view-commercial-panel .module-header,
#view-reports .module-header {
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-objectives .module-header h2,
#view-intelligence .module-header h2,
#view-commercial-panel .module-header h2,
#view-reports .module-header h2 {
  margin: 4px 0 6px;
  letter-spacing: -0.035em;
}

#view-objectives .view-tabs {
  gap: 4px;
  margin-bottom: 16px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-objectives .view-tabs button {
  border-radius: 7px;
  color: var(--muted);
}

#view-objectives .view-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

#view-objectives .panel,
#view-intelligence .panel,
#view-commercial-panel .commercial-panel-card,
#view-reports .panel,
#view-reports .analytics-kpi-card {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-intelligence .intelligence-next-action {
  border-color: var(--line-strong);
  background: var(--champagne);
}

#view-intelligence .intelligence-next-action .panel-header,
#view-intelligence .intelligence-questions .panel-header,
#view-reports .panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

#view-intelligence .intelligence-question-list button {
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

#view-intelligence .intelligence-question-list button:hover,
#view-intelligence .intelligence-question-list button.active {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

#view-intelligence .intelligence-answer {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-intelligence .intelligence-action-rank {
  background: var(--surface-2);
  color: var(--ink);
}

#view-commercial-panel .commercial-panel-period,
#view-reports .analytics-period-bar {
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-commercial-panel .commercial-panel-card {
  min-height: 132px;
  padding: 18px;
}

#view-commercial-panel .commercial-panel-card strong,
#view-reports .analytics-kpi-card > strong {
  color: var(--ink);
  letter-spacing: -0.045em;
}

#view-reports .analytics-kpi-card:first-child {
  background: var(--champagne);
}

#view-reports .analytics-funnel > div,
#view-reports .analytics-compact-metrics > div {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

#view-reports .analytics-report-builder {
  margin-top: 16px;
}

#view-reports .analytics-report-builder > summary {
  background: var(--surface);
}

/* Communication + Marketing — quiet, contextual working surfaces. */
#view-communications .module-header {
  align-items: end;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#view-communications .module-header h2 {
  margin: 4px 0 6px;
  letter-spacing: -0.035em;
}

#view-communications .communication-editor,
#view-communications .communication-filters {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

#view-communications .communication-editor {
  padding: 20px;
}

#view-communications .communication-filters {
  padding: 14px;
  background: var(--surface-muted);
}

#view-communications .communication-row {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease;
}

#view-communications .communication-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

#view-communications .communication-row-icon {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
}

#view-communications .communication-row-heading > span,
#view-communications .communication-row-heading > em {
  background: var(--surface-2);
  color: var(--muted);
}

#view-communications .communication-actions > div {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-breath);
}

@media (max-width: 900px) {
  .topbar {
    padding-inline: 18px;
  }

  .content {
    padding: 22px 18px 40px;
  }

  #view-today .dashboard-grid > * {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  #view-today .today-attention-panel { order: 1; }
  #view-today .important-dates-panel { order: 2; }
  #view-today .today-work-heading { order: 3; }
  #view-today .tasks-panel { order: 4; }
  #view-today .agenda-panel { order: 5; }
  #view-today .work-diary-panel { order: 6; }
  #view-today .today-strategy-heading { order: 7; }
  #view-today .metrics-panel { order: 8; }
  #view-today .today-objectives-panel { order: 9; }
  #view-today .today-reading-panel { order: 10; }
  #view-today .today-expenses-panel { order: 11; }
  #view-today .today-signals-panel { order: 12; }

  #view-contacts .contact-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-contacts .contacts-archive-button {
    width: 100%;
  }

  #view-followups .followup-card {
    grid-template-columns: 1fr;
  }

  #view-followups .followup-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    background: rgba(255, 255, 255, 0.96);
  }

  .content {
    padding: 18px 14px 32px;
  }

  .topbar-heading-row h1,
  h1 {
    font-size: 1.4rem;
  }

  .quick-create-button {
    width: 40px;
    padding: 0;
  }

  .quick-create-button > span:last-child {
    display: none;
  }

  #view-today .today-section-heading {
    display: grid;
    gap: 2px;
    padding-top: 10px;
  }

  #view-today .today-strategy-heading > div {
    display: grid;
    gap: 2px;
  }

  #view-contacts .module-header,
  #view-followups .module-header {
    align-items: stretch;
  }

  #view-contacts .contact-filter-bar {
    grid-template-columns: 1fr;
  }

  #view-followups .followup-card dl {
    grid-template-columns: 1fr;
  }

  #view-properties .module-header,
  #view-studies .module-header {
    align-items: stretch;
  }

  #view-properties .property-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  #view-properties .property-image {
    width: 60px;
    height: 60px;
  }

  #view-properties .property-price-column {
    grid-column: 2;
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  #view-studies .market-study-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #view-processes .module-header,
  #view-commercial .module-header,
  #view-matches .module-header {
    align-items: stretch;
  }

  #view-workspace .module-header,
  #view-tasks .module-header,
  #view-calendar .module-header,
  #view-inbox .module-header,
  #view-brain .module-header {
    align-items: stretch;
  }

  #view-communications .module-header {
    align-items: stretch;
  }

  #view-objectives .module-header,
  #view-intelligence .module-header,
  #view-commercial-panel .module-header,
  #view-reports .module-header {
    align-items: stretch;
  }

  #view-knowledge .module-header,
  #view-library .module-header,
  #view-books .module-header,
  #view-documents .module-header {
    align-items: stretch;
  }

  #view-documents .module-header .action-row > * {
    flex: 1 1 100%;
  }

  #view-objectives .view-tabs {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  #view-objectives .view-tabs button {
    flex: 0 0 auto;
  }

  #view-commercial .opportunity-summary {
    grid-template-columns: 1fr;
  }

  #view-commercial .opportunity-summary button {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  #view-commercial .opportunity-summary button:last-child {
    border-bottom: 0;
  }

  #view-matches .match-center-sync {
    align-items: stretch;
    flex-direction: column;
  }

  #view-matches .match-center-sync span {
    text-align: left;
  }
}

/* Sprint 1 consolidation — one navigation language and one creation gateway. */
.sidebar:hover,
body.sidebar-pinned .sidebar {
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
  border-right-color: var(--line);
}

.sidebar:hover .brand strong,
.sidebar:hover .brand span,
.sidebar:hover .nav-item,
.sidebar:hover .nav-group-toggle,
.sidebar:hover .nav-action-item,
body.sidebar-pinned .sidebar .brand strong,
body.sidebar-pinned .sidebar .brand span,
body.sidebar-pinned .sidebar .nav-item,
body.sidebar-pinned .sidebar .nav-group-toggle,
body.sidebar-pinned .sidebar .nav-action-item {
  color: var(--muted);
}

.sidebar:hover .nav-item.active,
.sidebar:hover .nav-group.has-active-view > .nav-group-toggle,
body.sidebar-pinned .sidebar .nav-item.active,
body.sidebar-pinned .sidebar .nav-group.has-active-view > .nav-group-toggle {
  color: var(--accent-strong);
}

.quick-create-capture-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--champagne);
  color: var(--ink);
  text-align: left;
}

.quick-create-capture-shortcut > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
}

.quick-create-capture-shortcut > span:last-child {
  display: grid;
  gap: 2px;
}

.quick-create-capture-shortcut small {
  color: var(--muted);
}

@media (min-width: 1051px) {
  .app-shell,
  body.sidebar-pinned .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .sidebar,
  .sidebar:hover,
  body.sidebar-pinned .sidebar {
    width: 232px;
    padding-inline: 14px;
  }

  .sidebar .brand,
  .sidebar .nav-group,
  .sidebar .sidebar-profile-row {
    min-width: 0;
  }
}

@media (min-width: 761px) and (max-width: 1050px) {
  .sidebar .nav-group.expanded .nav-children {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .sidebar .nav-group.expanded .nav-children .nav-item,
  .sidebar .nav-group.expanded .nav-children .nav-action-item {
    color: var(--muted);
  }
}

@media (max-width: 760px) {
  .sidebar,
  .sidebar:hover,
  body.sidebar-pinned .sidebar {
    background: #fff;
    color: var(--ink);
    box-shadow: 18px 0 48px rgba(25, 31, 28, 0.16);
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(3, 44px);
    gap: 8px;
  }

  .topbar-actions .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar-actions .primary-button {
    grid-column: auto;
    width: auto;
  }

  .quick-create-button {
    width: auto;
    min-height: 44px;
    padding-inline: 12px;
  }

  .quick-create-button > span:last-child {
    display: inline;
  }

  .topbar-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .sidebar .nav-home {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
  }

}
