/* Entrada única Web/MAUI. Fonte visual: ../assets/design_system_condominio_astra.html (a partir da raiz do repositório).
   Ordem: tokens/fontes → tipografia → componentes → composição das telas. */
@import url('css/astra-tokens.css?v=astra-ds-4');
@import url('css/astra-typography.css?v=astra-ds-4');
@import url('css/astra-components.css?v=astra-ds-4');
@import url('css/astra-mudblazor.css?v=astra-ds-4');

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.ds-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 13px;
}

.ds-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.ds-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 15px 16px;
  transition:
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.ds-icon-chip {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.ds-icon-chip--brand {
  background: var(--accent-soft);
  color: var(--accent);
}
.ds-icon-chip--ai {
  background: var(--blue-soft);
  color: var(--blue);
}
.ds-icon-chip--amber {
  background: var(--yellow-soft);
  color: var(--yellow);
}
.ds-icon-chip--ok {
  background: var(--green-soft);
  color: var(--green);
}
.ds-icon-chip--danger {
  background: var(--error-soft);
  color: var(--error);
}
.ds-icon-chip--info {
  background: var(--blue-soft);
  color: var(--blue);
}

.ds-kpi-value {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.045em;
  color: var(--fg);
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ds-kpi-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.4;
}

.ds-kpi-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}

.ds-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}

.ds-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.ds-panel-head-main {
  min-width: 0;
}

.ds-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

/* Mobile-first (DS LIMIAR/Astra): cabecalho do painel empilha e as acoes
   viram botoes full-width com alvo de toque de 48px. */
@media (max-width: 640px) {
  .ds-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ds-panel-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .ds-panel-actions .astra-btn {
    width: 100%;
    min-height: var(--touch-target);
  }
}

.ds-panel-title {
  font: var(--type-panel-title);
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.ds-panel-sub {
  font: var(--type-caption);
  color: var(--muted);
  margin-top: 1px;
}

/* Controle segmentado registros/auditoria (EntityAuditPanel).
   Referência: scene-controls do design system LIMIAR/Astra — pill container,
   opção ativa com inversão de cor. */
.entity-audit-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}

.entity-audit-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 12.5px var(--body);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

.entity-audit-toggle button:hover {
  color: var(--fg);
}

.entity-audit-toggle button[aria-pressed='true'] {
  background: var(--fg);
  color: var(--panel);
}

.entity-audit-toggle button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.entity-audit-toggle__count {
  min-width: 19px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(var(--blue-rgb), 0.16);
  font: 500 10px var(--mono);
  text-align: center;
}

.entity-audit-toggle button[aria-pressed='true'] .entity-audit-toggle__count {
  background: rgba(255, 104, 71, 0.22);
}

/* .badge do Astra: pílula mono com borda no tom; o fundo é só um véu. */
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: var(--r-pill);
  font: var(--type-tag);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ds-badge--brand {
  color: var(--accent);
  background: var(--accent-soft);
}
.ds-badge--ok {
  color: var(--green);
  background: var(--green-soft);
}
.ds-badge--amber {
  color: var(--yellow);
  background: var(--yellow-soft);
}
.ds-badge--danger {
  color: var(--error);
  background: var(--error-soft);
}
.ds-badge--ai {
  color: var(--blue);
  background: var(--blue-soft);
}
.ds-badge--neutral {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.ds-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Autorizações: CSS global de propósito. O card entra num fragmento e o
   formulário no portal do MudDialog — CSS isolado da página não chega. */
.page-header.autorizacoes-hero,
.page-header.portaria-hero {
  --db-accent: var(--accent);
  align-items: flex-end;
  margin-bottom: 20px;
}

.page-header.autorizacoes-hero h1,
.page-header.portaria-hero h1 {
  font: var(--type-page-title);
  letter-spacing: -0.045em;
  color: var(--fg);
  text-wrap: balance;
}

.page-header.autorizacoes-hero .subtitle,
.page-header.portaria-hero .subtitle {
  max-width: 44ch;
  margin-top: 8px;
  font: 400 16px/1.55 var(--body);
  color: var(--muted);
  text-wrap: pretty;
}

.autorizacoes-search {
  margin-bottom: 16px;
}

.autorizacoes-kpis {
  margin: 1.25rem 0 0;
}

.autorizacoes-loading {
  margin: 1.25rem 0;
}

.autorizacoes-loading p {
  margin: 0.75rem 0 0;
  font: var(--type-body);
  color: var(--muted);
}

.ds-panel.autorizacoes-panel,
.ds-panel.portaria-panel {
  overflow: visible;
}

.ds-panel.autorizacoes-panel > div:last-child,
.ds-panel.portaria-panel > div:last-child {
  padding: 16px 18px 18px;
  min-width: 0;
}

h2.autorizacoes-section,
h2.portaria-section {
  font: 500 10px/1.6 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 1.25rem 0 0.75rem;
}

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

.autorizacao-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.autorizacao-card--wait {
  border-color: color-mix(in srgb, var(--yellow) 45%, var(--line));
}

.autorizacao-card__heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.autorizacao-card__who {
  flex: 1;
  min-width: 0;
}

.autorizacao-card__who h3 {
  margin: 0;
  font: var(--type-panel-title);
  letter-spacing: -0.025em;
  color: var(--fg);
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.autorizacao-card__who p {
  margin: 4px 0 0;
  font: var(--type-caption);
  color: var(--muted);
}

.autorizacao-card__meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.autorizacao-card__meta > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.autorizacao-card__meta dt,
.autorizacao-card__audit dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.autorizacao-card__meta dd,
.autorizacao-card__audit dd {
  margin: 0;
  color: var(--fg);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.autorizacao-card__contact {
  margin: 0;
  font: 400 13px/1.5 var(--body);
  color: var(--muted);
  overflow-wrap: anywhere;
}

.autorizacao-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.autorizacao-card__actions .astra-btn {
  flex: 1 1 140px;
}

.autorizacao-card__audit {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.autorizacao-card__audit summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
}

.autorizacao-card__audit summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.autorizacao-card__audit dl {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.autorizacao-card__audit dl > div {
  display: grid;
  gap: 2px;
}

.autorizacoes-empty-action {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.autorizacao-lead {
  margin: 0;
  font: 400 16px/1.55 var(--body);
  color: var(--muted);
  max-width: 44ch;
}

.autorizacao-loading {
  margin: 0;
  font: var(--type-body);
  color: var(--muted);
}

.autorizacao-unidade {
  margin: 0;
  font: 400 13px/1.4 var(--body);
  color: var(--muted);
}

.autorizacao-unidade strong {
  display: block;
  margin-top: 4px;
  font: 500 16px/1.3 var(--display);
  letter-spacing: -0.02em;
  color: var(--fg);
}

.autorizacao-actions {
  width: 100%;
  justify-content: flex-end;
}

.autorizacao-form {
  min-width: 0;
  /* A rolagem pertence ao conteúdo do diálogo, sem uma segunda área interna. */
}

.autorizacao-dialog .mud-dialog-title,
.mud-dialog.autorizacao-dialog .mud-dialog-title,
.portaria-dialog .mud-dialog-title,
.mud-dialog.portaria-dialog .mud-dialog-title {
  font: 500 22px/1.2 var(--display);
  letter-spacing: -0.035em;
  color: var(--fg);
}

.autorizacao-dialog .mud-dialog-content,
.mud-dialog.autorizacao-dialog .mud-dialog-content,
.portaria-dialog .mud-dialog-content,
.mud-dialog.portaria-dialog .mud-dialog-content {
  overflow-y: auto;
  max-height: min(72vh, 36rem);
  overscroll-behavior: contain;
}

.autorizacao-dialog .mud-dialog-actions,
.mud-dialog.autorizacao-dialog .mud-dialog-actions,
.portaria-dialog .mud-dialog-actions,
.mud-dialog.portaria-dialog .mud-dialog-actions {
  padding: 8px 24px 20px;
}

.portaria-dialog .astra-photo,
.encomenda-foto-preview {
  max-height: min(42vh, 220px);
  width: auto;
  margin-inline: auto;
  object-fit: contain;
}

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

.portaria-dialog p.field-error {
  margin: 0;
  color: var(--error);
  font: 400 14px/1.45 var(--body);
}

.portaria-dialog p.field-error:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* No telefone o diálogo vira bottom sheet (astra-components.css): o flex do sheet
   controla a rolagem do conteúdo e as ações ficam fixas no rodapé com safe area. */
@media (max-width: 640px) {
  .autorizacao-dialog .mud-dialog-content,
  .mud-dialog.autorizacao-dialog .mud-dialog-content,
  .portaria-dialog .mud-dialog-content,
  .mud-dialog.portaria-dialog .mud-dialog-content {
    max-height: none;
  }

  .autorizacao-dialog .mud-dialog-actions,
  .mud-dialog.autorizacao-dialog .mud-dialog-actions,
  .portaria-dialog .mud-dialog-actions,
  .mud-dialog.portaria-dialog .mud-dialog-actions {
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .portaria-dialog .mud-dialog-actions .astra-btn,
  .autorizacao-dialog .mud-dialog-actions .astra-btn,
  .autorizacao-actions .astra-btn {
    flex: 1 1 140px;
    min-height: 48px;
  }
}

/* Entrada de tela do Astra: fadeInUpBlur 850ms / ease-reveal, atraso por
   --rv-delay. Só anima quando o usuário não pediu movimento reduzido. */
@keyframes atria-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: blur(0);
  }
}

/* Pulso do Astra (dot-pulse) para indicadores de pendência crítica. */
@keyframes atria-dot-pulse {
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--error) 18%, transparent);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .atria-reveal {
    animation: atria-fade-up 0.85s var(--ease-reveal) both;
    animation-delay: var(--rv-delay, 0s);
  }
}

/* List rows inside a DsPanel (for card-list screens that aren't tabular). */
.ds-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.ds-list-row:last-child {
  border-bottom: none;
}

.ds-list-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}
.ds-list-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}
.ds-list-time {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

.ds-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

/* Topbar "Copiloto" (AI) pill from the design. */
.atria-copiloto {
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, transparent);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.atria-copiloto:hover {
  background: color-mix(in srgb, var(--blue) 20%, var(--panel));
}

/* App shell em flex, sem MudDrawer. O menu segue o tema ativo (Paper ou escuro)
   e usa a mesma superfície da topbar; o miolo da página fica em --bg. */
.app-shell {
  font: var(--type-body);
  color: var(--fg);
  --community-panel-width: clamp(340px, 32vw, 420px);
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

.app-shell-stage {
  display: contents;
}

.app-sidebar {
  width: 264px;
  flex: none;
  background: var(--panel);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  min-height: 0;
}

.app-sidebar--closed {
  display: none;
}

.app-sidebar-scrim {
  display: none;
}

.app-side-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--shell-topbar-height);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--line);
}

.app-side-brand .astra-brand {
  flex: 1;
  min-width: 0;
}

.app-sidebar .app-side-close {
  display: none;
}

.app-side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding: var(--space-3) var(--space-3) var(--space-6);
  min-height: 0;
  scrollbar-color: color-mix(in srgb, var(--fg) 22%, transparent) transparent;
  scrollbar-width: thin;
}

.app-side-group {
  margin-top: var(--space-2);
}

.app-side-section {
  margin: 0;
  font: inherit;
}

.app-side-section-button {
  width: 100%;
  min-height: var(--touch-target);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 10px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background var(--duration-feedback) var(--ease),
    color var(--duration-feedback) var(--ease);
}

.app-side-section-button:hover {
  background: var(--wash);
  color: var(--fg);
}

.app-side-section-button:active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.app-side-section-button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-side-group--current .app-side-section-button,
.app-side-group--current .app-side-section-icon {
  color: var(--accent);
}

.app-side-section-icon {
  display: inline-flex;
  flex: none;
  color: var(--dim);
}

.app-side-section-title {
  flex: 1;
  min-width: 0;
  text-wrap: balance;
}

.app-side-section-chevron {
  flex: none;
  color: var(--dim);
  transition: transform 0.25s var(--ease);
}

.app-side-group--open .app-side-section-chevron {
  transform: rotate(180deg);
}

.app-side-group-panel {
  margin: 2px 0 4px 10px;
  padding-left: var(--space-2);
  border-left: 1px solid var(--line);
}

.app-side-group-panel[hidden] {
  display: none;
}

.app-side-group-links {
  display: grid;
  gap: 2px;
}

.app-side-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch-target);
  padding: 8px 10px;
  border-radius: 10px;
  margin: 0;
  font: var(--type-nav);
  letter-spacing: 0;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition:
    background var(--duration-feedback) var(--ease),
    color var(--duration-feedback) var(--ease);
  text-align: left;
  touch-action: manipulation;
}

.app-side-link-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-side-link:hover {
  background: var(--wash);
  color: var(--fg);
}

.app-side-link:active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .app-side-group-panel:not([hidden]) .app-side-group-links {
    animation: app-side-links-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

@keyframes app-side-links-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-side-link:focus-visible,
.app-account-trigger:focus-visible,
.app-account-menu button:focus-visible,
.app-topbar-btn:focus-visible,
.app-skip-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-side-link .astra-icon {
  flex: none;
  color: var(--dim);
}

.app-side-link.active {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--fg);
}

.app-side-link.active:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--fg);
}

.app-side-link.active .astra-icon {
  color: var(--accent);
}

.app-side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.app-side-badge {
  margin-left: auto;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
  font: var(--type-label);
  letter-spacing: 0;
  text-transform: none;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-account {
  position: relative;
  flex: none;
}

.app-account-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  min-height: 48px;
  max-width: 220px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  font-family: var(--body);
  touch-action: manipulation;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.app-account-trigger:hover {
  border-color: color-mix(in srgb, var(--muted) 45%, var(--line));
  background: var(--panel);
}

.app-account-trigger[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.community-rail-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 12px/1 var(--body);
  letter-spacing: 0.02em;
  color: var(--on-accent);
  flex: none;
}

.app-account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.app-account-name {
  max-width: 132px;
  font: 600 13px/1.25 var(--body);
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-account-role {
  max-width: 132px;
  font: 400 12px/1.3 var(--body);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-account-chevron {
  color: var(--muted);
  flex: none;
}

/* Menu da conta: painel no desktop (raio de card) e sheet no telefone
   (raio de diálogo). Resposta 220 ms; o sheet entra em 420 ms. */
.app-account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(320px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-spec);
  padding: 8px;
  box-shadow: var(--shadow-pop);
  z-index: 40;
  transform-origin: top right;
  animation: app-account-menu-in 0.22s var(--ease) both;
}

@keyframes app-account-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Alça do bottom sheet: só existe visualmente no mobile. */
.app-account-menu-handle {
  display: none;
}

.app-account-menu-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.app-account-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 14px/1 var(--body);
  letter-spacing: 0.02em;
  color: var(--on-accent);
  background: var(--accent);
}

.app-account-menu-id {
  min-width: 0;
}

.app-account-menu-name {
  font: 600 16px/1.25 var(--display);
  letter-spacing: -0.03em;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-account-menu-sub {
  margin-top: 2px;
  font: var(--type-caption);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-account-menu-condo {
  margin-top: 4px;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: 0.02em;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-account-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-field);
  color: var(--fg);
  font: 400 14px/1.4 var(--body);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s var(--ease);
}

.app-account-menu button .astra-icon {
  flex: none;
  color: var(--dim);
}

.app-account-menu button:hover {
  background: var(--wash);
}
.app-account-menu button:active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.app-account-menu button:focus-visible {
  outline-offset: -2px;
}
.app-account-menu button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.app-account-menu-item-label {
  min-width: 0;
}

.app-account-menu-item-aside {
  margin-left: auto;
  flex: none;
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-account-menu button.danger {
  color: var(--error);
}
.app-account-menu button.danger .astra-icon {
  color: var(--error);
}
.app-account-menu button.danger:hover {
  background: var(--error-soft);
}

.app-account-menu-divider {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 8px;
}

.app-pop-overlay--dim {
  background: rgba(0, 0, 0, 0.45);
}

/* Mobile: o menu da conta vira bottom sheet (uma decisão por vez, alvo grande
   perto do polegar). Scrim e movimento conforme a ficha Modal da referência. */
@media (max-width: 640px) {
  .app-account .app-pop-overlay {
    z-index: 1390;
    background: rgba(4, 6, 8, 0.76);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    animation: app-account-scrim-in 0.25s ease both;
  }

  .app-account-menu {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    max-height: min(82dvh, 640px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--r-dialog) var(--r-dialog) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 6px 10px calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 1391;
    transform-origin: center bottom;
    animation: app-account-sheet-in 0.42s var(--ease) both;
  }

  .app-account-menu-handle {
    display: block;
    width: 40px;
    height: 4px;
    margin: 6px auto 8px;
    border-radius: var(--r-pill);
    background: var(--control);
    opacity: 0.55;
  }

  .app-account-menu-meta {
    padding: 6px 10px 12px;
    gap: 14px;
  }

  .app-account-menu-avatar {
    width: 52px;
    height: 52px;
    font-size: 16px;
  }

  .app-account-menu-name,
  .app-account-menu-condo {
    white-space: normal;
  }
  .app-account-menu-name {
    font-size: 18px;
  }
  .app-account-menu-sub,
  .app-account-menu-condo {
    font-size: 13px;
  }

  .app-account-menu button {
    min-height: 48px;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .app-account-menu-divider {
    margin: 6px 10px;
  }
}

@keyframes app-account-scrim-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes app-account-sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-account-menu,
  .app-account .app-pop-overlay {
    animation: none;
  }
}

.app-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}

.app-skip-link:focus {
  left: 0;
}

.profile-page {
  max-width: 36rem;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--accent) 85%, var(--chalk)),
    color-mix(in srgb, var(--accent) 82%, var(--mineral))
  );
  color: var(--on-accent);
  font-weight: 700;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.profile-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.profile-meta {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--fg);
}

.profile-meta--muted {
  color: var(--dim);
}

.profile-section-title {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.profile-dl {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.profile-dl-row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
  align-items: center;
}

.profile-dl-row:last-child {
  border-bottom: none;
}

.profile-dl-row dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dim);
}

.profile-dl-row dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--fg);
  word-break: break-word;
}

.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  .profile-dl-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-rail-toggle,
  .app-side-section-button,
  .app-side-section-chevron,
  .app-side-link,
  .app-account-trigger,
  .app-account-menu button,
  .hub-tile {
    transition: none;
  }

  .app-side-link:hover {
    transform: none;
  }

}

/* Main column */
.app-maincol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-topbar {
  height: var(--shell-topbar-height);
  flex: none;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--shell-padding);
  gap: 10px;
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.app-topbar-titles {
  min-width: 0;
  flex: 1;
}
.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 0;
}

.app-condo-switch {
  position: relative;
  min-width: 0;
  flex: none;
}

.app-condo-switch-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  height: 48px;
  max-width: min(220px, 34vw);
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}

.app-condo-switch-trigger:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.app-condo-switch-trigger:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-condo-switch-trigger[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.app-condo-switch-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-condo-switch-chevron {
  color: var(--muted);
  flex: none;
}

.app-condo-switch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  max-height: min(420px, 70dvh);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 34px rgba(8, 9, 10, 0.18);
  z-index: 40;
}

.app-condo-switch-label {
  padding: 8px 12px 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-condo-switch-menu button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--body);
  font-size: 13px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: background 0.18s var(--ease);
}

.app-condo-switch-menu button:hover {
  background: var(--bg);
}
.app-condo-switch-menu button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.app-condo-switch-menu button:disabled {
  cursor: default;
}
.app-condo-switch-menu button.active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.app-condo-switch-menu button.active:disabled {
  opacity: 1;
}
.app-condo-switch-menu button .astra-icon {
  margin-top: 2px;
  color: var(--dim);
}
.app-condo-switch-menu button.active .astra-icon {
  color: var(--accent);
}

.app-condo-switch-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.app-condo-switch-condo {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-condo-switch-role {
  font-size: 11px;
  color: var(--muted);
}
.app-condo-switch-status {
  padding: 4px 12px 6px;
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app-condo-switch-trigger {
    max-width: 132px;
  }
}

@media (max-width: 420px) {
  .app-condo-switch-trigger {
    width: 48px;
    max-width: 48px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
  .app-condo-switch-name,
  .app-condo-switch-chevron {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-condo-switch-trigger,
  .app-condo-switch-menu button {
    transition: none;
  }
}

.app-topbar-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  cursor: pointer;
  flex: none;
  position: relative;
}

.app-topbar-btn:hover {
  border-color: color-mix(in srgb, var(--muted) 45%, var(--line));
}

.app-topbar-crumb {
  font: var(--type-tag);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-topbar-title {
  font: var(--type-panel-title);
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 901px) and (max-width: 1199px) {
  .app-sidebar {
    width: 220px;
  }
  .app-topbar {
    padding-inline: 12px;
  }
  .app-topbar-left {
    gap: 8px;
  }
  .app-topbar-right {
    gap: 8px;
  }
  .app-topbar-crumb {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app-topbar-title {
    font-size: 16px;
  }
  .app-account-trigger {
    max-width: 132px;
    gap: 5px;
    padding-right: 6px;
  }
  .app-account-name {
    max-width: 72px;
  }
  .app-account-role {
    display: none;
  }
}

/* No telefone o gatilho é só o avatar. Nome, papel e condomínio ficam no sheet. */

.app-topbar-notif-wrap .app-topbar-dot {
  top: 6px;
  right: 6px;
}

.app-topbar-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--error);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--panel);
  font-family: var(--mono);
}

.app-notif-pop {
  position: absolute;
  top: 47px;
  right: 0;
  width: 366px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 22px 54px -14px rgba(0, 0, 0, 0.32);
  z-index: 45;
  overflow: hidden;
  cursor: default;
}

.app-notif-caption {
  display: block;
  margin-top: 2px;
  color: var(--dim);
  font-size: 10.5px;
}

.app-notif-mark-all {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 650;
  padding: 6px 0 6px 10px;
}

.app-notif-mark-all:focus-visible,
.app-notif-item:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.app-notif-item {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 72px;
  padding: 13px 16px;
  text-align: left;
  transition: background 0.16s ease;
  width: 100%;
}

.app-notif-item:hover,
.app-notif-item--unread {
  background: var(--accent-soft);
}
.app-notif-item:hover {
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel));
}
.app-notif-item__icon {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--accent);
  display: inline-flex;
  flex: none;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.app-notif-item__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.app-notif-item__title {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.app-notif-item__body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 2px;
  max-width: 65ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-notif-item__time {
  color: var(--dim);
  font-size: 10.5px;
  margin-top: 4px;
}
.app-notif-item__dot {
  background: var(--error);
  border-radius: 50%;
  flex: none;
  height: 8px;
  margin-top: 6px;
  width: 8px;
}
.app-notif-empty {
  align-items: center;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 8px;
  justify-content: center;
  min-height: 120px;
  padding: 20px;
  text-align: center;
}

@media (max-width: 520px) {
  .app-notif-pop {
    right: -8px;
    width: min(366px, calc(100vw - 24px));
  }
  .app-notif-item__body {
    white-space: normal;
  }
}

.app-pop-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: transparent;
  border: none;
  cursor: default;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--shell-padding);
  min-height: 0;
}

@media (max-width: 420px) {
  .app-topbar-title {
    max-width: min(42vw, 170px);
  }
}

/* Morador: hero do boleto e três status. A coluna muda com a largura útil
   (sidebar e canal), não com a viewport. */
.home-root--morador .home-grid-top {
  container-type: inline-size;
  container-name: home-morador;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-grid-top__boleto {
  min-width: 0;
}

.home-status-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.home-status-stack .ds-feature-card {
  height: 100%;
}

@container home-morador (max-width: 560px) {
  .home-status-stack {
    grid-template-columns: 1fr;
  }
}

.home-grid-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.home-grid-bottom > * {
  min-height: 0;
}


.home-boleto-hero {
  background: linear-gradient(125deg, var(--raised), var(--bg));
  border: 1px solid var(--line);
  border-radius: var(--r-spec);
  padding: 22px;
  color: var(--fg);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

.home-boleto-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-boleto-hero::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(var(--accent-rgb), 0.35),
    transparent 70%
  );
}

.home-boleto-hero--late::before {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--error) 55%, transparent),
    transparent 70%
  );
}

.home-boleto-hero--late .home-boleto-kicker,
.home-boleto-hero--late .home-boleto-value {
  color: var(--error);
}

.home-boleto-kicker {
  position: relative;
  margin: 0;
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-boleto-value {
  font: var(--type-h4);
  letter-spacing: var(--tracking-h4);
}

.home-boleto-sub {
  margin: 2px 0 18px;
  font: var(--type-body-sm);
  color: var(--muted);
}

.home-boleto-actions {
  margin-top: 4px;
}

a.ds-feature-card,
button.ds-feature-card {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

button.ds-feature-card {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px;
}

.ds-feature-card:hover,
.ds-feature-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--fg) 6%, transparent);
}

.ds-feature-card:hover .astra-btn::before,
.ds-feature-card:focus-visible .astra-btn::before {
  transform: translateY(0);
}

.ds-feature-card:hover .astra-btn,
.ds-feature-card:focus-visible .astra-btn {
  color: var(--bg);
  border-color: var(--fg);
}

.ds-feature-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  min-width: 0;
}

.ds-feature-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ds-feature-card .ds-icon-chip {
  width: 40px;
  height: 40px;
}

.ds-feature-card-action {
  margin-top: auto;
  min-height: var(--touch-target);
  white-space: normal;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  a.ds-feature-card,
  button.ds-feature-card {
    transition: none;
  }

  .ds-feature-card:hover .astra-btn::before,
  .ds-feature-card:focus-visible .astra-btn::before {
    transform: none;
  }
}

.ds-feature-card-title {
  font: var(--type-panel-title);
  margin: 0;
  letter-spacing: -0.025em;
  color: var(--fg);
}

.ds-feature-card-sub {
  flex: 1;
  margin-top: 6px;
  font: var(--type-body-sm);
  color: var(--muted);
}

/* Label de seção no padrão Astra (Martian Mono, caps, tracking) — usado na
   Home e nas grades de atrativos. */
.home-section-label {
  font: 500 10px/1.6 var(--mono);
  color: var(--dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

/* Atalhos da home: grade de blocos DsFeatureCard. Visual em HomeAttractGrid.razor.css. */
.home-attract {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-attract-item {
  display: flex;
  min-width: 0;
}

.home-hero-kicker {
  color: color-mix(in srgb, var(--chalk) 78%, transparent);
  margin-bottom: 0.35rem;
}

.home-hero-cta {
  align-self: flex-start;
}

.home-copiloto {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 22px;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-spec);
  background: var(--grad);
  color: var(--mineral);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    box-shadow 0.4s var(--ease),
    transform 0.4s var(--ease);
}

.home-copiloto:hover {
  box-shadow: 0 6px 45px rgba(var(--accent-rgb), 0.25);
  transform: translateY(-2px);
}

.home-copiloto:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.home-copiloto-deco {
  position: absolute;
  top: -30px;
  right: -20px;
  opacity: 0.18;
  pointer-events: none;
}

.home-copiloto-hint {
  margin-top: 8px;
  max-width: 28rem;
  font: 400 14px/1.45 var(--body);
  color: rgba(8, 9, 10, 0.78);
}

.home-copiloto-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 11px;
  border: 1px solid rgba(8, 9, 10, 0.25);
  border-radius: var(--r-pill);
  font: 400 10px/1.5 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-copiloto-title {
  max-width: 320px;
  font: 500 24px/1.15 var(--display);
  letter-spacing: -0.045em;
}

.home-copiloto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.home-copiloto-chip {
  padding: 6px 10px;
  border: 1px solid rgba(8, 9, 10, 0.22);
  border-radius: var(--r-pill);
  font: 400 10px/1.5 var(--mono);
}

/* Morador: package grid (Encomendas) and area-booking grid (Reservas). */
.ds-package-grid,
.ds-booking-grid {
  display: grid;
  gap: 14px;
}

.ds-package-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.ds-booking-grid {
  grid-template-columns: 1fr;
}

/* Morador boletos: tabela no desktop, cards no telefone */
.boletos-page {
  container: boletos / inline-size;
}

.boleto-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--control) transparent;
  scrollbar-width: thin;
}

.boleto-table-scroll .boleto-table-desktop {
  min-width: 860px;
}

.boleto-list-mobile {
  display: none;
}

@container boletos (max-width: 920px) {
  .boletos-page .boleto-table-scroll {
    display: none;
  }
  .boletos-page .boleto-list-mobile {
    display: block;
  }

  .boletos-page .boletos-staff-table {
    overflow: visible;
  }
  .boletos-page .boletos-staff-table .astra-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .boletos-page .boletos-staff-table .astra-table,
  .boletos-page .boletos-staff-table .astra-table tbody,
  .boletos-page .boletos-staff-table .astra-table tr,
  .boletos-page .boletos-staff-table .astra-table td {
    display: block;
    width: 100%;
  }
  .boletos-page .boletos-staff-table .astra-table tbody {
    display: grid;
    gap: 8px;
  }
  .boletos-page .boletos-staff-table .astra-table tbody tr {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
  }
  .boletos-page .boletos-staff-table .astra-table td,
  .boletos-page .boletos-staff-table .astra-table--dense td {
    display: grid;
    grid-template-columns: minmax(96px, 38%) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 6px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .boletos-page .boletos-staff-table .astra-table td[data-label]::before {
    content: attr(data-label);
    font: 500 10px/1.5 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
  }
  .boletos-page .boletos-staff-table .astra-table td:not([data-label]) {
    grid-template-columns: 1fr;
  }
  .boletos-page .boletos-staff-table .astra-table td .astra-btn {
    width: 100%;
    min-height: var(--touch-target);
  }
  .boletos-page .boletos-staff-table .ds-num {
    white-space: nowrap;
  }
}

.boleto-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.boleto-card:last-child {
  border-bottom: none;
}

.boleto-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boleto-card-comp {
  font-weight: 650;
  color: var(--fg);
  font-size: 15px;
}

.boleto-card-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}

.boleto-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.boleto-card-action {
  margin-top: 12px;
}

.boleto-card-action .astra-btn {
  width: 100%;
}

/* Availability day-chip (legacy decorative strip). */
.ds-day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 30px;
  padding: 0 4px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.ds-day-chip--available {
  background: var(--green-soft);
  color: var(--green);
}
.ds-day-chip--busy {
  background: var(--error-soft);
  color: var(--error);
}
.ds-day-chip--disabled {
  background: var(--bg);
  color: var(--dim);
}
.ds-day-chip--selected {
  background: var(--blue);
  color: var(--on-accent);
}

/* Morador area booking: month calendar + hour slots */
.booking-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 20px;
  align-items: start;
}

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

.booking-layout-cal,
.booking-layout-areas {
  min-width: 0;
}

.booking-layout-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
}

.booking-layout-sub {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.4;
}

.booking-layout-areas-head {
  margin-bottom: 4px;
}

.booking-cal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
}

.booking-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.booking-cal-month {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
}

.booking-cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

.booking-cal-nav-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

.booking-cal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.booking-cal-weekdays,
.booking-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.booking-cal-weekdays {
  margin-bottom: 6px;
}

.booking-cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
}

.booking-cal-day {
  aspect-ratio: 1;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.booking-cal-day--empty {
  visibility: hidden;
  pointer-events: none;
}

.booking-cal-day--free {
  background: var(--green-soft);
  color: var(--green);
}

.booking-cal-day--partial {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.booking-cal-day--full {
  background: var(--error-soft);
  color: var(--error);
  cursor: not-allowed;
  opacity: 0.75;
}

.booking-cal-day--past {
  background: var(--bg);
  color: var(--dim);
  cursor: not-allowed;
  opacity: 0.55;
}

.booking-cal-day:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.booking-cal-day.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.booking-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--dim);
}

.booking-cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.booking-cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.booking-cal-dot--free {
  background: var(--green);
}
.booking-cal-dot--partial {
  background: var(--yellow);
}
.booking-cal-dot--full {
  background: var(--error);
}

.booking-area-card {
  padding: 14px 16px;
}

.booking-area-daylabel {
  font-size: 11px;
  font-weight: 600;
  color: var(--dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.booking-day-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.booking-day-status--free {
  background: var(--green-soft);
  color: var(--green);
}
.booking-day-status--full {
  background: var(--error-soft);
  color: var(--error);
}
.booking-day-status--past,
.booking-day-status--partial {
  background: var(--bg);
  color: var(--dim);
}

.booking-hours {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.booking-hour {
  min-width: 40px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}

.booking-hour--available {
  background: var(--green-soft);
  color: var(--green);
}

.booking-hour--busy {
  background: var(--error-soft);
  color: var(--error);
  cursor: not-allowed;
  opacity: 0.85;
}

.booking-hour--past {
  background: var(--bg);
  color: var(--dim);
  cursor: not-allowed;
  opacity: 0.55;
}

.booking-hour--selected {
  background: var(--accent);
  color: var(--on-accent);
}

.booking-hour:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

/* Toque: no telefone, dia, hora e navegação do calendário com alvo mínimo de 44px. */
@media (max-width: 640px) {
  .booking-cal-nav-btn {
    width: 44px;
    height: 44px;
  }
  .booking-cal-day {
    min-height: 44px;
  }
  .booking-hours {
    gap: 8px;
  }
  .booking-hour {
    min-width: 56px;
    min-height: 44px;
    height: auto;
    padding: 0 10px;
  }
}

.booking-dialog-hint {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--dim);
  line-height: 1.45;
}

.booking-dialog-day {
  margin-top: 16px;
}

.booking-dialog-day-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.booking-dialog-selection {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg);
}

.booking-dialog-selection-muted {
  color: var(--dim);
}

/* ============================================================================
   Copiloto side panel (docked, per the design). See AppCopilotPanel.razor for
   which parts are real (Answer/Sources/status line) vs. static UI copy. */
.copilot-panel {
  width: var(--community-panel-width);
  flex: none;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.community-rail-toggle {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 48px;
  min-height: 100px;
  padding: 10px 4px;
  border: 1px solid color-mix(in srgb, var(--accent) 27%, var(--line));
  border-right: 0;
  border-radius: 13px 0 0 13px;
  background: var(--panel);
  color: var(--accent);
  box-shadow: -7px 7px 24px rgba(8, 9, 10, 0.12);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.community-rail-toggle:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  box-shadow: -9px 7px 28px color-mix(in srgb, var(--accent) 14%, transparent);
}

.community-rail-toggle span:last-child {
  writing-mode: vertical-rl;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font: 700 9px var(--mono);
}

.copilot-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(
    120deg,
    color-mix(in srgb, var(--blue) 10%, var(--panel)),
    var(--panel)
  );
}

.copilot-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(
    140deg,
    color-mix(in srgb, var(--blue) 78%, var(--chalk)),
    var(--blue)
  );
  box-shadow: 0 4px 12px rgba(var(--blue-rgb), 0.4);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.copilot-title {
  font-family: var(--display);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--fg);
}

.copilot-status {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.copilot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.copilot-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  flex: none;
}

.copilot-icon-btn:hover {
  background: var(--bg);
}

.copilot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.copilot-turn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.copilot-turn--user {
  align-items: flex-end;
}

.copilot-turn-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
}

.copilot-ai-chip {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.copilot-bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.copilot-bubble--ai {
  background: var(--bg);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.copilot-bubble--user {
  background: var(--blue);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}

.copilot-source-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  max-width: 92%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 11px;
}

.copilot-source-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg);
}
.copilot-source-sub {
  font-size: 10.5px;
  color: var(--muted);
}

.copilot-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.copilot-chips {
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
  overflow-x: auto;
}

.copilot-chip {
  flex: none;
  font-size: 11.5px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 12px;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--body);
}

.copilot-chip:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}
.copilot-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.copilot-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 6px 6px 6px 14px;
}

.copilot-input-row input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: var(--fg);
  font-family: var(--body);
}

.copilot-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--blue);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: none;
  cursor: pointer;
}

.copilot-send-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--blue) 85%, var(--fg));
}
.copilot-send-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.copilot-disclaimer {
  font-size: 10.5px;
  color: var(--dim);
  text-align: center;
  margin-top: 9px;
}

/* Community chat channel */
.community-chat .community-channel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: none;
}

.community-chat .copilot-title {
  margin: 0;
  font: var(--type-panel-title);
  letter-spacing: -0.025em;
  color: var(--fg);
}

.community-channel-titles {
  flex: 1;
  min-width: 0;
}

.community-status-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.copilot-header-icon.community-chat-icon {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
  border-radius: 12px;
}

.community-chat-body {
  gap: 14px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 8px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--control) 45%, transparent)
    transparent;
}

.community-history-control {
  display: flex;
  justify-content: center;
  flex: none;
  min-height: 36px;
}

.community-loading,
.community-empty {
  margin: auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  color: var(--dim);
}

.community-empty .astra-body-sm {
  font: var(--type-panel-title);
  letter-spacing: -0.025em;
  color: var(--fg);
  margin: 4px 0 0;
}

.community-empty .astra-caption {
  max-width: 34ch;
}

.community-empty-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  color: var(--accent);
}

/* Surgimento da referência: opacidade + leve subida, faixa "Resposta". */
.community-msg {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  max-width: 100%;
  animation: community-msg-in 0.26s var(--ease) both;
}

@keyframes community-msg-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-msg {
    animation: none;
  }
}

.community-msg--mine {
  align-items: stretch;
}

.community-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.community-msg-row--mine {
  justify-content: flex-end;
}

.community-msg-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: min(88%, 340px);
}

.community-msg-row--mine .community-msg-col {
  align-items: flex-end;
}

.community-meta-muted {
  color: var(--dim);
}

.community-text {
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.community-system-pill {
  margin: 0 auto;
  max-width: 92%;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font: var(--type-caption);
  letter-spacing: 0.01em;
  text-align: center;
}

.community-msg--continued {
  margin-top: -8px;
}

.community-avatar--spacer {
  visibility: hidden;
}

.community-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font: var(--type-label);
  letter-spacing: 0;
  background: color-mix(in srgb, var(--accent) 16%, var(--bg));
  color: var(--accent);
}

.community-avatar--mine {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.community-avatar--vse {
  background: var(--grad);
  color: var(--mineral);
}

.community-msg--system {
  align-items: center;
  width: 100%;
}

.community-msg--system .community-bubble {
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.community-msg-meta {
  font: var(--type-caption);
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 0 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.community-msg-meta strong {
  font: 600 var(--size-body-sm) / var(--leading-body-sm) var(--body);
  letter-spacing: 0;
  color: var(--fg);
}

.community-author-name {
  font-weight: 500;
  color: var(--muted);
}

/* Papel do autor: badge da referência — Martian Mono 400, 9/13,5 px, sem caixa alta. */
.community-role {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  font: 400 9px/1.5 var(--mono);
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.community-bubble {
  border-radius: var(--r-spec);
  padding: 10px 13px;
  font: var(--type-body);
  max-width: 100%;
  letter-spacing: -0.01em;
}

.community-bubble--other {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.community-bubble--mine {
  background: var(--accent);
  color: var(--on-accent);
  border-bottom-right-radius: 4px;
}

.community-msg-time {
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--muted);
  padding: 0 4px;
}

.community-caption {
  margin-top: 6px;
  font: var(--type-caption);
  letter-spacing: 0.01em;
}

.community-video {
  width: 100%;
  max-width: 260px;
  border-radius: 10px;
  background: var(--mineral);
  display: block;
}

.community-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.community-file-btn {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.community-file-btn input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.community-recording {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--error);
  font-weight: 600;
  margin-bottom: 8px;
}

.community-recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--error);
  animation: community-pulse 1s ease-in-out infinite;
}

@keyframes community-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.community-call {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}

.community-call-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.community-call-video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--mineral);
  object-fit: cover;
}

.community-call-hint {
  margin: 8px 0;
  font-size: 12px;
  color: var(--dim);
}

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

.community-chat-footer {
  position: relative;
  flex: none;
  padding: 12px 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.community-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.community-chips .community-meta-muted {
  flex: 1 1 12rem;
  font: var(--type-caption);
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* Atalho #vseresponde: pílula de precisão (Martian Mono + Brasa). */
.astra-btn.community-chip {
  font: 400 12px/1.5 var(--mono);
  letter-spacing: 0.09em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  min-height: 44px;
  padding: 8px 14px;
}

.astra-btn.community-chip:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}

.community-composer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 4px;
  background: var(--field-bg);
  border: 1px solid var(--control);
  border-radius: 16px;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.community-composer:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(var(--blue-rgb), 0.16);
}

.community-attach {
  position: relative;
  overflow: hidden;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s var(--ease);
}

.community-attach:hover {
  background: var(--accent-soft);
}
.community-attach:active {
  background: color-mix(in srgb, var(--accent) 16%, var(--field-bg));
}
.community-attach:focus-within {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.community-attach input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.community-composer-field {
  flex: 1;
  min-width: 0;
  align-self: flex-end;
}

.community-composer-field textarea {
  --community-composer-max: calc(1.6em * 6);
  min-height: 44px;
  max-height: var(--community-composer-max);
  height: auto;
  padding: 11px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: var(--type-body);
  letter-spacing: -0.01em;
  overflow-y: hidden;
  resize: none;
  field-sizing: content;
  box-shadow: none;
}

.community-composer-field textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

/* Enviar = ação primária: preenchido em Brasa, com resposta tátil (180–300 ms). */
.astra-icon-btn.community-send {
  width: 44px;
  height: 44px;
  flex: none;
  align-self: flex-end;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  transition:
    background 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.astra-icon-btn.community-send:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: transparent;
}

.astra-icon-btn.community-send:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.astra-icon-btn.community-send:disabled {
  opacity: 1;
  background: var(--wash);
  color: var(--control);
}

.community-send-progress {
  margin-top: 8px;
  border-radius: 4px;
}

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

.community-image {
  display: block;
  width: 100%;
  max-width: min(72vw, 260px);
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 4px;
  background: var(--bg);
}

/* FAB comunidade: escondido no desktop; no mobile vira MudFab posicionado. */
.community-fab {
  display: none;
}

.app-bottom-nav {
  display: none;
}

.astra-icon-btn.app-topbar-iconbtn {
  width: 48px;
  height: 48px;
  color: var(--fg);
}

.app-topbar-iconbtn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-topbar-notif-wrap {
  position: relative;
  display: inline-flex;
}

.app-topbar--compact .app-topbar-title {
  font-size: 18px;
  line-height: 1.25;
}

.community-tag {
  display: inline;
  padding: 0 5px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95em;
}

/* Na bolha enviada (fundo escuro da marca), a tag em --brand ficava sem contraste. */
.community-bubble--mine .community-tag {
  background: color-mix(in srgb, var(--on-accent) 20%, transparent);
  color: var(--on-accent);
}

.community-msg--vse {
  align-items: flex-start;
}

.community-vse-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-bubble--vse {
  background: var(--accent-soft);
  color: var(--fg);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-bottom-left-radius: 4px;
}

.community-sources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.community-sources-title {
  font: var(--type-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.citation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.citation:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.citation:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.citation-number {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--accent);
  font: var(--type-label);
  letter-spacing: 0;
}

.citation-icon {
  flex: none;
  font-size: 1.1rem;
  color: var(--accent);
  margin-top: 1px;
}

.citation-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.citation-file {
  font: 600 var(--size-body-sm) / var(--leading-body-sm) var(--body);
  letter-spacing: 0;
}

.citation-quote {
  color: var(--muted);
  font: var(--type-caption);
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Marcador [n] clicável dentro do texto da resposta da VSE */
.citation-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin: 0 1px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  color: var(--accent);
  font: var(--type-label);
  letter-spacing: 0;
  line-height: 1;
  cursor: pointer;
}

.citation-ref:hover {
  background: color-mix(in srgb, var(--accent) 32%, var(--panel));
}

.citation-ref:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Mobile: canal full-screen (messenger), safe areas, composer sticky */
@media (max-width: 900px) {
  .app-shell--chat-open {
    overflow: hidden;
  }

  .app-shell--chat-open .app-maincol {
    visibility: hidden;
    pointer-events: none;
  }

  .copilot-panel.community-chat {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    z-index: 1400;
    border-left: none;
    padding-top: env(safe-area-inset-top, 0px);
    background: var(--panel);
  }

  .community-channel-header {
    padding-top: 8px;
    padding-bottom: 8px;
    min-height: 60px;
  }

  .community-chat-body {
    padding: 14px 12px;
    gap: 14px;
  }

  .community-msg-col {
    max-width: min(86%, 100%);
  }

  .community-bubble {
    padding: 12px 14px;
  }

  .community-avatar {
    width: 36px;
    height: 36px;
  }

  .community-chat-footer {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  }

  .community-composer {
    gap: 4px;
  }

  .astra-icon-btn.community-send,
  .community-attach {
    width: 48px;
    height: 48px;
  }

  .community-fab {
    display: inline-flex;
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 1200;
    min-width: 48px;
    min-height: 48px;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.4);
  }

  .community-fab--above-nav {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .community-rail-toggle {
    display: none;
  }

  /* Navegação Astra — destinos móveis com fundo sutil e sublinhado Brasa. */
  .app-shell--bottom-nav .app-bottom-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1180;
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  }

  .app-shell--bottom-nav .app-content {
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  }

  .app-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    padding: 4px 2px;
    border-radius: 12px;
    text-decoration: none;
    /* --mut (não --mut2): labels de 10.5px precisam de contraste ≥ 4.5:1 (WCAG 1.4.3). */
    color: var(--muted);
    font-family: var(--body);
    -webkit-tap-highlight-color: transparent;
    transition:
      background 0.2s var(--ease),
      color 0.2s var(--ease);
  }

  .app-bottom-nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .app-bottom-nav-item:active {
    background: color-mix(in srgb, var(--accent) 10%, transparent);
  }

  .app-bottom-nav-item--active {
    color: var(--accent);
    font-weight: 650;
  }

  .app-bottom-nav-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }
  .app-bottom-nav-item {
    position: relative;
    border-radius: var(--r-field);
  }
  .app-bottom-nav-item--active {
    background: var(--wash);
  }
  .app-bottom-nav-item--active::after {
    content: '';
    position: absolute;
    inset: auto 30% 2px;
    height: 2px;
    background: var(--accent);
  }

  .app-bottom-nav-label {
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell--chat-open .app-bottom-nav,
  .app-shell--chat-open .community-fab {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-bottom-nav-item,
  .app-bottom-nav-icon-wrap,
  .app-side-section-button,
  .app-side-link,
  .community-rail-toggle,
  .community-attach,
  .astra-icon-btn.community-send,
  .astra-btn.community-chip,
  .home-copiloto {
    transition: none;
  }

  .community-attach:active,
  .astra-icon-btn.community-send:active:not(:disabled) {
    transform: none;
  }

  .home-copiloto:hover {
    transform: none;
  }
}

h1:focus:not(:focus-visible) {
  outline: none;
}

.valid.modified:not([type='checkbox']) {
  outline: 1px solid var(--green);
}

.invalid {
  outline: 1px solid var(--error);
}

.validation-message {
  color: var(--error);
}

.blazor-error-boundary {
  background: var(--error);
  padding: 1rem 1rem 1rem 1.5rem;
  color: var(--on-accent);
}

.blazor-error-boundary::after {
  content: 'An error has occurred.';
}

/* Auth / marketing surfaces.
   public-auth-page is shared by login, senha and 404 — global on purpose, because
   those pages are not Landing and never receive its scoped CSS. */
.public-auth-page {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
}

.public-auth-page .auth-shell {
  min-height: calc(100dvh - 76px);
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  /* Lighter at top (let the illustration read) ? darker at bottom (keep copy legible). */
  background:
    linear-gradient(
      180deg,
      rgba(255, 104, 71, 0.26) 0%,
      rgba(18, 21, 25, 0.45) 45%,
      rgba(8, 9, 10, 0.9) 100%
    ),
    url('images/login-hero.svg') center / cover no-repeat;
  color: var(--chalk);
  padding: clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
}

.auth-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: overlay;
}

.auth-hero-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-hero-mark-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.auth-hero-mark-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

.auth-hero-body {
  position: relative;
  z-index: 1;
}

.auth-hero-brand {
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 20ch;
}

.auth-hero-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.auth-hero-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.auth-hero-feature-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--chalk);
  line-height: 1.3;
}

.auth-hero-feature-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.15rem;
}

.auth-hero-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.auth-hero-footer a {
  color: var(--blue);
  text-decoration: none;
}
.auth-hero-footer a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-hero-mark,
  .auth-hero-brand,
  .auth-hero-features {
    animation: auth-hero-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .auth-hero-brand {
    animation-delay: 0.06s;
  }
  .auth-hero-features {
    animation-delay: 0.14s;
  }
}

@keyframes auth-hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background:
    radial-gradient(
      ellipse 80% 50% at 100% 0%,
      rgba(255, 104, 71, 0.08),
      transparent 55%
    ),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 26rem;
}

.auth-card-title {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.auth-card-sub {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.public-auth-page--web .auth-shell {
  width: min(var(--content-max), calc(100% - 2 * var(--content-gutter)));
  min-height: calc(100dvh - 76px);
  margin-inline: auto;
  padding-block: 24px;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
}

.public-auth-page--web .auth-hero {
  border-radius: var(--r-spec);
  background:
    linear-gradient(
      180deg,
      rgba(8, 9, 10, 0.08) 18%,
      rgba(8, 9, 10, 0.58) 54%,
      rgba(8, 9, 10, 0.94) 100%
    ),
    url('images/landing/condominio-jardins.webp') center / cover no-repeat;
}

.auth-hero-lead {
  position: relative;
  z-index: 1;
  max-width: 46ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.6;
}

.public-auth-page--web .auth-panel {
  min-width: 0;
}

.home-hero {
  position: relative;
  border-radius: var(--r-spec);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 24px;
  background:
    radial-gradient(
      ellipse at 100% 0,
      rgba(var(--accent-rgb), 0.085),
      transparent 65%
    ),
    var(--panel);
  color: var(--fg);
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.home-hero h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 500;
  margin: 0 0 0.35rem;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.home-hero p {
  margin: 0;
  opacity: 0.92;
  max-width: 36rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.hub-tile {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  text-decoration: none;
  color: var(--fg);
  border-radius: var(--r-card);
  background: var(--panel);
  border: 1px solid var(--line);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.hub-tile-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Auth / inline links ? WebView2 can render MudLink with near-invisible theme tokens */
.auth-inline-link {
  color: var(--accent);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: underline;
}

/* Force visibility in WebView2, but stay theme-aware: use MudBlazor's drawer palette vars
   (light-on-dark in dark mode) instead of the static light-mode --atria-* tokens, which made
   the nav text/icons vanish when dark mode was on. */

/* Fills the viewport height remaining below the shell topbar (60px) minus the content area's
   22px top+bottom padding ? for pages like Chat that need a real scroll region. */
.app-fill-height {
  height: calc(100dvh - var(--shell-topbar-height) - 2 * var(--shell-padding));
}

.hub-tile:hover {
  border-color: var(--accent);
  background: var(--raised);
}

.hub-tile-body {
  min-width: 0;
}

.hub-tile-body h3 {
  margin: 0 0 8px;
  font: 500 19px/1.4 var(--body);
  letter-spacing: -0.01em;
}

.hub-tile-body p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.4;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  /* margin-bottom: 1.25rem; */
}

.page-header h1 {
  font: var(--type-page-title);
  margin: 0;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.page-header .subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font: var(--type-body);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.stat-tile {
  padding: 1.15rem 1.25rem;
  border-radius: 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  height: 100%;
}

.stat-tile .label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.stat-tile .value {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.03em;
}

.stat-tile .sub {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.app-main {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* ?? Splash (entry sequence ? mobile + web) ?? */
.splash {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
  /* Mineral/Chalk fixos (nao seguem o tema): a splash nativa do MAUI e
       #08090A, entao a splash Blazor mantem a mesma cena — sem flash claro. */
  color: var(--chalk);
  background: var(--mineral);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.splash-atmosphere {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 75% 28%,
      rgba(var(--accent-rgb), 0.085),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 10% 88%,
      rgba(var(--blue-rgb), 0.085),
      transparent 60%
    );
  z-index: 0;
}

.auth-captcha {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--panel);
}

.auth-captcha-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-captcha-image {
  display: block;
  width: min(100%, 15rem);
  height: auto;
  margin: 0.35rem auto 0;
  border-radius: 0.6rem;
}

.auth-captcha-question {
  margin-top: 0.35rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.6rem;
  background: var(--bg);
  border: 1px dashed var(--line);
  font-weight: 600;
}

.splash-grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}

.splash-mark {
  color: var(--fg);
  margin-bottom: 0.25rem;
  will-change: transform, opacity;
}

.splash-brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  display: flex;
  gap: 0.35em;
  flex-wrap: wrap;
  justify-content: center;
}

.splash-brand-word {
  display: inline-block;
}

.splash-tagline {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.splash-progress {
  margin-top: 1.25rem;
  width: min(12rem, 50vw);
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.splash-progress-bar {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--grad);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .splash-mark {
    animation: splash-mark-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .splash-brand-word {
    animation: splash-word-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .splash-brand-word--delay {
    animation-delay: 0.12s;
  }

  .splash-tagline {
    animation: splash-fade-up 0.55s ease 0.28s both;
  }

  .splash-progress {
    animation: splash-fade-up 0.55s ease 0.4s both;
  }

  .splash-progress-bar {
    animation: splash-bar 1.35s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  }

  .splash-atmosphere {
    animation: splash-drift 8s ease-in-out infinite alternate;
  }
}

@keyframes splash-mark-in {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes splash-word-in {
  from {
    opacity: 0;
    transform: translateY(0.4em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-bar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}

@keyframes splash-drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.04) translate(-1.5%, 1%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-tile {
    transition: none;
  }

  .hub-tile:hover {
    transform: none;
  }

  .splash-progress-bar {
    width: 100%;
    opacity: 0.65;
  }
}

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

  .public-auth-page--web .auth-shell {
    width: min(600px, calc(100% - 40px));
    min-height: calc(100dvh - 64px);
    padding-block: 24px;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
  }

  .public-auth-page--web .auth-hero {
    display: none;
  }

  .public-auth-page--web .auth-panel {
    grid-row: 1;
    padding: 0;
  }

  .auth-hero {
    min-height: 200px;
    justify-content: flex-end;
  }

  /* Compact banner on mobile: keep the headline, drop the mark/features/footer. */
  .auth-hero-mark,
  .auth-hero-features,
  .auth-hero-footer {
    display: none;
  }

  /* ?? Shell morador / mobile: drawer + safe areas ?? */
  .app-sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1290;
    border: none;
    background: rgba(8, 14, 22, 0.48);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1300;
    width: min(280px, 86vw);
    max-width: 280px;
    transform: translateX(0);
    transition: transform 0.22s ease;
    background: var(--panel);
    box-shadow: 8px 0 32px color-mix(in srgb, var(--fg) 18%, transparent);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .app-sidebar .app-side-close {
    display: inline-grid;
  }

  /* Antes do JS detectar viewport: menu fechado no telefone (evita flash). */
  .app-shell:not(.app-shell--ready) .app-sidebar,
  .app-sidebar--closed {
    display: flex;
    transform: translateX(-105%);
    pointer-events: none;
    box-shadow: none;
  }

  .app-topbar {
    height: 56px;
    padding: 0 8px;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    gap: 4px;
  }

  .app-topbar--compact {
    height: 56px;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(56px + env(safe-area-inset-top, 0px));
  }

  .app-topbar-btn,
  .astra-icon-btn.app-topbar-iconbtn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .app-topbar-title {
    font-size: 17px;
  }

  .app-topbar-left {
    gap: 8px;
  }
  .app-topbar-right {
    gap: 8px;
  }

  .app-account-copy,
  .app-account-chevron {
    display: none;
  }

  .app-account-trigger {
    width: 48px;
    height: 48px;
    min-height: 48px;
    max-width: none;
    padding: 0;
    justify-content: center;
    border-radius: var(--r-pill);
  }

  .app-content {
    padding: 16px 16px calc(88px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

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

  .home-attract {
    grid-template-columns: 1fr;
  }

  .ds-kpi {
    min-width: 0;
    padding: 14px;
  }

  .ds-kpi-value {
    font-size: 1.3rem;
  }

  .boleto-table-desktop {
    display: none;
  }
  .boleto-list-mobile {
    display: block;
  }

  .ds-package-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-boleto-hero {
    padding: 18px 16px;
    gap: 20px;
  }

  .home-boleto-body .astra-btn {
    width: 100%;
    white-space: normal;
  }

  .booking-cal-nav-btn {
    width: 44px;
    height: 44px;
  }

  .booking-cal-day {
    min-height: 44px;
    font-size: 14px;
  }

  .booking-cal-weekdays,
  .booking-cal-grid {
    gap: 6px;
  }

  .booking-hour {
    min-height: 44px;
    font-size: 14px;
  }

  .app-side-link,
  .app-side-section-button {
    min-height: var(--touch-target);
  }
}

@media (max-width: 370px) {
  .ds-kpi-grid {
    grid-template-columns: 1fr;
  }

  .app-topbar-title {
    max-width: 34vw;
  }
}

/* Console admin — tipografia Astra (Syne 500, não 700). */
.ad-meter-list,
.ad-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ad-check-list > li > .ds-list-row {
  border-bottom: 1px solid var(--line-soft);
}

.ad-check-list > li:last-child > .ds-list-row {
  border-bottom: none;
}

.admin-role-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-role-row:last-child {
  border-bottom: none;
}

.admin-role-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-role-count {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

.admin-usage-row {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-usage-row:last-child {
  border-bottom: none;
}

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

.astra-progress.admin-usage-bar,
.astra-progress.admin-role-bar {
  height: 8px;
  border-radius: 99px;
}

.admin-role-bar {
  grid-column: 1 / -1;
}

.admin-activity-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 180px;
  margin: 0;
  padding: 16px 18px 12px;
  list-style: none;
}

.admin-activity-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.admin-activity-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.admin-activity-bar {
  width: 100%;
  max-width: 28px;
  height: var(--bar-h, 0%);
  border-radius: 6px 6px 2px 2px;
  min-height: 0;
}

.admin-activity-bar--access {
  background: color-mix(in srgb, var(--blue) 55%, var(--panel));
}
.admin-activity-bar--interact {
  background: var(--blue);
}

.admin-activity-bar--empty {
  height: 2px;
  background: var(--line);
}

.admin-activity-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  line-height: 1.2;
}

.admin-activity-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
}

.admin-activity-legend {
  display: flex;
  gap: 16px;
  padding: 0 18px 14px;
  font-size: 12px;
  color: var(--muted);
}

.admin-activity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.admin-legend-dot--access {
  background: color-mix(in srgb, var(--blue) 55%, var(--panel));
}
.admin-legend-dot--interact {
  background: var(--blue);
}

.admin-sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 18px 16px;
}

.admin-sec-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--bg);
}

.admin-sec-label {
  font: var(--type-caption);
  color: var(--muted);
}

.admin-sec-status {
  font: var(--type-caption);
  color: var(--fg);
}

.admin-sec-cell--amber {
  border-color: color-mix(in srgb, var(--yellow) 55%, var(--line));
  background: color-mix(in srgb, var(--yellow) 12%, var(--panel));
}

.admin-sec-cell--danger {
  border-color: color-mix(in srgb, var(--error) 55%, var(--line));
  background: color-mix(in srgb, var(--error) 10%, var(--panel));
}

.admin-sec-value {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.admin-sec-value--danger {
  color: var(--error);
}
.admin-sec-value--amber {
  color: var(--yellow);
}
.admin-sec-value--ok {
  color: var(--green);
}

@media (max-width: 600px) {
  .admin-sec-grid {
    grid-template-columns: 1fr;
  }
}

/* ?? Staff dashboard (sindico / gerente) ?? */
.staff-kpi-link {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}

.staff-kpi-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.staff-kpi-link:hover .ds-kpi {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
/* Canal nativo (MAUI): telas públicas sem marketing — painel único centralizado,
   sem o hero de apresentação nem o header público. */
.public-auth-page--native .auth-shell {
  min-height: 100dvh;
  grid-template-columns: 1fr;
}

.public-auth-page--native .auth-hero {
  display: none;
}

.auth-native-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.75rem;
}

.auth-native-brand img {
  display: block;
  width: 48px;
  height: 48px;
  flex: none;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-field);
}

.auth-native-brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.auth-native-brand-sub {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Dashboard síndico/gerente — papéis Astra. Vive em app.css para não depender
   do bundle scoped (o CSS isolado do .razor.css não chegava na página). */
.db-page {
  --db-accent: var(--accent);
  container: dashboard / inline-size;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  width: 100%;
}

.db-page h1,
.db-page h2 {
  margin: 0;
}

.db-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.db-block--linked {
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}

.db-block--detail[aria-busy='true'] {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.db-hero,
.db-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.db-overline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font: var(--type-tag);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--db-accent, var(--accent));
  margin-bottom: 8px;
}

.db-overline::before {
  content: '';
  width: 24px;
  height: 1px;
  border-radius: 2px;
  background: currentColor;
}

.db-title {
  font: var(--type-page-title);
  letter-spacing: -0.045em;
  color: var(--fg);
  text-wrap: balance;
}

.db-title--detail {
  font: var(--type-section-title);
  letter-spacing: -0.035em;
}

.db-sub {
  margin: 8px 0 0;
  max-width: 46rem;
  color: var(--muted);

  font: var(--type-body);
}

.db-page .db-section-title,
.db-page h2.home-section-label {
  display: block;
  margin: 0 0 var(--space-4);
  line-height: 1.4;
}

.db-page .cp-head .cp-title {
  margin: 0;
}

.db-progress {
  margin-top: 8px;
  border-radius: 99px;
  overflow: hidden;
}

/* 6 colunas: 3 indicadores fecham a linha; 4 ficam 2×2; 5 fecham a segunda linha. */
.db-page:not(.ad-page) .ds-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.db-page:not(.ad-page) .ds-kpi-grid > * {
  grid-column: span 2;
  min-width: 0;
  height: 100%;
}

.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(1):nth-last-child(2),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(2):nth-last-child(1),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(1):nth-last-child(4),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(2):nth-last-child(3),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(3):nth-last-child(2),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(1),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(2),
.db-page:not(.ad-page) .ds-kpi-grid > :nth-child(5):nth-last-child(1) {
  grid-column: span 3;
}

.db-page.ad-page .db-kpi-grid:not(.ad-kpi-grid--4) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.db-kpi-link,
.db-kpi-static {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.db-kpi-static {
  cursor: default;
}

.db-kpi-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.db-page .db-kpi-link .ds-kpi,
.db-page .db-kpi-static .ds-kpi {
  height: 100%;
  transition:
    transform 0.25s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

@media (hover: hover) {
  .db-kpi-link:hover .ds-kpi {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--fg) 8%, transparent);
  }
}

.db-page .ds-kpi {
  padding: 18px;
}

.db-page .ds-kpi-value {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  color: var(--fg);
}

.db-page .ds-kpi-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.db-page .ds-kpi-label.ds-num {
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 500;
}

.db-condo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.db-condo-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.db-condo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(
      ellipse at 100% 0%,
      color-mix(in srgb, var(--blue) 7%, transparent),
      transparent 65%
    ),
    var(--panel);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  font: inherit;
  appearance: none;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .db-condo-card:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 10px 28px color-mix(in srgb, var(--fg) 8%, transparent);
  }
}

.db-condo-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.db-condo-card:disabled {
  opacity: 1;
  cursor: default;
}

.db-condo-card--active,
.db-condo-card--active:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent),
    0 10px 30px color-mix(in srgb, var(--accent) 12%, transparent);
}

.db-condo-card--active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18px;
  right: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.db-condo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.db-condo-card-iconchip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}

.db-condo-card-side {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
}

.db-condo-card-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.db-condo-card-status--ok {
  background: var(--green);
}
.db-condo-card-status--brand {
  background: var(--accent);
}
.db-condo-card-status--amber {
  background: var(--yellow);
}

.db-condo-card-status--danger {
  background: var(--error);
  animation: atria-dot-pulse 2.4s var(--ease) infinite;
}

.db-condo-card-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--fg);
}

.db-condo-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
}

.db-condo-card-stats > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.db-condo-card-stats dt {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-condo-card-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.db-stat--amber {
  color: var(--yellow);
}
.db-stat--danger {
  color: var(--error);
}

.db-condo-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

@media (hover: hover) {
  .db-condo-card:hover:not(:disabled) .db-condo-card-cta {
    color: var(--accent);
  }
}

.db-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.db-page .db-split .ds-panel {
  height: 100%;
}

.db-page .ds-panel-title {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.db-page .ds-panel-sub {
  font-family: var(--body);
  line-height: 1.45;
}

.db-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.2s var(--ease);
}

.db-alert:last-child {
  border-bottom: none;
}

@media (hover: hover) {
  .db-alert:hover {
    background: color-mix(in srgb, var(--fg) 3%, transparent);
  }
}

.db-alert-body {
  min-width: 0;
  flex: 1;
}

.db-alert-badge {
  display: inline-flex;
  margin-bottom: 6px;
}

.db-page .ds-list-title {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.db-page .ds-list-sub {
  font-family: var(--body);
  line-height: 1.45;
  color: var(--muted);
}

.db-page .db-alert-cta {
  flex: none;
}

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

.db-ops-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.db-ops-cell:nth-child(2n) {
  border-right: none;
}
.db-ops-cell:nth-last-child(-n + 2) {
  border-bottom: none;
}

.db-ops-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

.db-ops-value {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.db-page:not(.ad-page) .home-attract-section .home-attract {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.db-page:not(.ad-page) .home-attract-section .home-attract > * {
  grid-column: span 2;
  min-width: 0;
}

.db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(4):nth-last-child(2),
.db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(5):nth-last-child(1) {
  grid-column: span 3;
}

.db-page .home-attract-lead {
  font-family: var(--body);
  color: var(--muted);
}

.db-page .empty-state {
  padding: 28px 18px;
  color: var(--muted);
  font-family: var(--body);
}

@container dashboard (max-width: 860px) {
  .db-split {
    grid-template-columns: 1fr;
  }

  .db-page:not(.ad-page) .home-attract-section .home-attract {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .db-page:not(.ad-page) .home-attract-section .home-attract > *,
  .db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(4):nth-last-child(2),
  .db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(5):nth-last-child(1) {
    grid-column: auto;
  }
}

@container dashboard (max-width: 680px) {
  .db-page:not(.ad-page) .ds-kpi-grid,
  .db-page.ad-page .db-kpi-grid:not(.ad-kpi-grid--4) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .db-page:not(.ad-page) .ds-kpi-grid > *,
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(1):nth-last-child(2),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(2):nth-last-child(1),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(1):nth-last-child(4),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(2):nth-last-child(3),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(3):nth-last-child(2),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(1),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(2),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(5):nth-last-child(1) {
    grid-column: auto;
  }

  .db-page:not(.ad-page) .ds-kpi-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@container dashboard (max-width: 640px) {
  .db-page {
    gap: var(--space-6);
  }

  .db-condo-grid,
  .db-page:not(.ad-page) .home-attract-section .home-attract,
  .db-page.ad-page .home-attract {
    grid-template-columns: 1fr;
  }

  .db-condo-grid > :last-child:nth-child(odd),
  .db-page:not(.ad-page) .home-attract-section .home-attract > *,
  .db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(4):nth-last-child(2),
  .db-page:not(.ad-page) .home-attract-section .home-attract > :nth-child(5):nth-last-child(1),
  .db-page:not(.ad-page) .home-attract-section .home-attract > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .db-condo-card-stats {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .db-condo-card-stats > div {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
  }
  .db-condo-card-stats dt {
    white-space: normal;
  }
  .db-condo-card-stats dd {
    text-align: right;
  }

  .db-hero,
  .db-detail-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ad-hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .ad-hero-actions .astra-btn {
    width: 100%;
    min-height: var(--touch-target);
  }
  .db-detail-head > .astra-btn {
    width: 100%;
    min-height: var(--touch-target);
  }

  .db-alert {
    flex-direction: column;
    align-items: stretch;
  }
  .db-page .db-alert-cta {
    width: 100%;
    min-height: var(--touch-target);
  }

  .db-ops {
    grid-template-columns: 1fr;
  }
  .db-ops-cell,
  .db-ops-cell:nth-child(2n) {
    border-right: none;
  }
  .db-ops-cell:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line-soft);
  }
  .db-ops-cell:last-child {
    border-bottom: none;
  }
}

@container dashboard (max-width: 420px) {
  .db-page:not(.ad-page) .ds-kpi-grid,
  .db-page.ad-page .db-kpi-grid,
  .db-page.ad-page .ad-kpi-grid--4 {
    grid-template-columns: 1fr;
  }

  .db-page:not(.ad-page) .ds-kpi-grid > *,
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(1):nth-last-child(4),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(2):nth-last-child(3),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(3):nth-last-child(2),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(1),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(4):nth-last-child(2),
  .db-page:not(.ad-page) .ds-kpi-grid > :nth-child(5):nth-last-child(1),
  .db-page:not(.ad-page) .ds-kpi-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .db-condo-card-status--danger {
    animation: none;
  }
  .db-condo-card,
  .ad-condo-card,
  .db-kpi-link .ds-kpi,
  .db-block--detail[aria-busy='true'] {
    transition: none;
  }
  .db-kpi-link:hover .ds-kpi {
    transform: none;
  }
}

/* Console admin: kicker Óptico; CTA e foco continuam Brasa. */
.ad-page {
  --db-accent: var(--blue);
}

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

.ad-mono-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.ad-anchor {
  scroll-margin-top: calc(var(--shell-topbar-height) + var(--space-4));
  min-width: 0;
  height: 100%;
  border-radius: 12px;
}

.ad-anchor:focus {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.ad-anchor > .ds-panel {
  height: 100%;
}

.ad-probe {
  border-top: 1px solid var(--line-soft);
}

.ad-probe summary {
  display: flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: 8px 18px;
  cursor: pointer;
  font: var(--type-body-sm);
  color: var(--fg);
  list-style: none;
}

.ad-probe summary::-webkit-details-marker {
  display: none;
}

.ad-probe summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}

.ad-probe-note {
  margin: 0;
  padding: 0 18px 16px;
  font: var(--type-caption);
  color: var(--muted);
}

.ad-probe-note code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
}

.db-page.ad-page .home-attract {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.db-page.ad-page .ad-kpi-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ad-page .db-condo-card-iconchip {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.ad-condo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(
      ellipse at 100% 0%,
      color-mix(in srgb, var(--blue) 8%, transparent),
      transparent 65%
    ),
    var(--panel);
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.ad-condo-name {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.ad-condo-name:hover {
  color: var(--accent);
}

.ad-condo-name:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.ad-condo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ad-gerente-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-gerente-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ad-gerente-list strong {
  font-family: var(--body);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}

.ad-gerente-list span {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ad-gerente-empty {
  margin: 0;
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.45;
  color: var(--yellow);
}

.ad-condo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.ad-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.ad-toolbar--inset {
  margin: 0;
  padding: 4px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.ad-search {
  max-width: 28rem;
}

.ad-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  width: fit-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.ad-switch button {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 14px/1.3 var(--body);
  cursor: pointer;
  touch-action: manipulation;
}

.ad-switch button span {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ad-switch button[aria-pressed='true'] {
  background: var(--fg);
  color: var(--bg);
}

.ad-switch button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.ad-pause-since {
  margin: 0;
  color: var(--muted);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.04em;
}

.ad-people-label {
  margin: 0;
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.ad-condo-card .db-condo-card-stats dt {
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: normal;
}

.ad-page .ds-list-time {
  font-size: 12px;
  color: var(--muted);
}

.ad-audit-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.ad-check-list .ds-list-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

.ad-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 8px 18px 18px;
}

.ad-empty p {
  margin: 0;
  max-width: 42rem;
  color: var(--muted);
  font: var(--type-body);
}

.ad-page > .admin-sec-grid,
.ad-page .ds-panel .admin-sec-grid {
  padding-left: 18px;
  padding-right: 18px;
}

.ad-error-summary {
  margin: 0 0 8px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--error) 45%, var(--line));
  border-radius: 12px;
  background: var(--error-soft);
}

.ad-error-summary:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ad-error-summary h2 {
  margin: 0 0 8px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.ad-error-summary ul {
  margin: 0;
  padding-left: 18px;
}

.ad-error-summary a {
  color: var(--fg);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}

.ad-page--form {
  max-width: 720px;
}

.ad-form-alert {
  margin-bottom: 4px;
}

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

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

.ad-switch-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.ad-switch-card > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

@media (max-width: 1100px) {
  .db-page.ad-page .ad-kpi-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .db-page.ad-page .home-attract,
  .ad-condo-grid {
    grid-template-columns: 1fr;
  }
  .ad-form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ad-switch {
    width: 100%;
    border-radius: 16px;
  }
  .ad-switch button {
    flex: 1 1 calc(50% - 4px);
    text-wrap: balance;
  }
  .ad-condo-actions {
    flex-direction: column;
  }
  .ad-condo-actions .astra-btn {
    width: 100%;
  }
  .ad-audit-meta {
    width: 100%;
    justify-content: flex-start;
    margin-left: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-switch button,
  .ad-condo-name,
  .portaria-slices button,
  .routine-switch button {
    transition: none;
  }
}

@media (max-width: 400px) {
  .db-page.ad-page .ad-kpi-grid--4 {
    grid-template-columns: 1fr;
  }
}

/* Rotinas do morador: informação prioritária e ações acessíveis no telefone. */
.routine-header {
  margin-bottom: 20px;
}
.routine-summary {
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
}
.routine-summary__label {
  font: 500 12px/1.5 var(--mono);
  color: var(--muted);
}
.routine-summary__amount {
  font: 500 clamp(26px, 7vw, 40px)/1.25 var(--mono);
  overflow-wrap: anywhere;
}
.routine-summary p,
.delivery-card p {
  margin: 0;
  color: var(--muted);
}
.routine-switch {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.routine-switch button {
  min-height: 48px;
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  color: var(--fg);
  background: var(--panel);
  font: 500 15px/1.4 var(--body);
  cursor: pointer;
}
.routine-switch button[aria-pressed='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
}
.routine-switch button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.portaria-slices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 148px), 1fr));
  gap: 8px;
  margin: 20px 0 0;
}
.portaria-slices button {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.portaria-slices button span {
  color: var(--muted);
  font: 500 13px/1.35 var(--body);
  text-wrap: balance;
}
.portaria-slices button strong {
  font: 500 22px/1 var(--mono);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.portaria-slices button[aria-pressed='true'] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}
.portaria-slices button[aria-pressed='true'] strong {
  color: var(--accent);
}
.portaria-slices button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.routine-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
.delivery-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--panel);
  overflow-wrap: anywhere;
}
.delivery-card--wait {
  border-color: color-mix(in srgb, var(--yellow) 45%, var(--line));
}
.delivery-card__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.delivery-card__who {
  flex: 1 1 160px;
  min-width: 0;
}
.delivery-card__kicker {
  margin: 0 0 4px;
  font: 500 10px/1.6 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.delivery-card__heading h3 {
  margin: 0;
  font: 500 20px/1.3 var(--body);
  text-wrap: pretty;
}
.delivery-card__heading > .ds-badge {
  flex: none;
  max-width: 100%;
  white-space: normal;
}
.delivery-card__heading svg {
  flex: none;
  color: var(--accent);
}
.delivery-card .delivery-card__instruction {
  color: var(--fg);
}
.routine-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.routine-card-actions:empty {
  display: none;
}
.routine-card-actions .astra-btn {
  flex: 1;
  min-height: 48px;
}
.routine-visit-summary {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font: 400 16px/1.5 var(--body);
}
@media (max-width: 600px) {
  .routine-header h1,
  .autorizacoes-hero h1,
  .portaria-hero h1 {
    font-size: 30px;
  }
  .autorizacoes-hero,
  .portaria-hero {
    gap: 16px;
  }
  .autorizacoes-hero > .astra-btn,
  .portaria-hero > .astra-btn {
    width: 100%;
    min-height: 54px;
  }
  .autorizacao-card__heading {
    flex-wrap: wrap;
  }
  .autorizacao-card__heading > .ds-badge {
    margin-left: 0;
  }
  .autorizacao-card__actions {
    flex-direction: column;
    gap: 12px;
  }
  .autorizacao-card__actions .astra-btn {
    width: 100%;
    min-height: 48px;
  }
  .delivery-card__heading {
    flex-wrap: wrap;
  }
  .delivery-card__heading > .ds-badge {
    max-width: 100%;
  }
  .routine-card-actions {
    flex-direction: column;
  }
  .boleto-card-top,
  .boleto-card-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
  .boleto-card-value {
    font-size: 24px;
  }
  .boleto-card-action .astra-btn {
    width: 100%;
    min-height: 54px;
  }
  .boleto-card > .ds-badge {
    margin-top: 12px;
  }
}

.autorizacoes-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.delivery-card > .ds-badge {
  justify-self: start;
}
@media (max-width: 600px) {
  .page-header.autorizacoes-hero h1,
  .page-header.portaria-hero h1 {
    font-size: 30px;
  }
  .autorizacao-card__heading > .ds-badge {
    flex-basis: auto;
    max-width: 100%;
    white-space: normal;
  }
  .autorizacao-card__meta dt {
    font-size: 12px;
  }
}

.ds-panel.deliveries-panel > div:last-child {
  padding: 16px;
}

.boleto-detail {
  display: grid;
  gap: 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}
/* Modal de pagamento: largura até 680 px (Astra: até 520 px para modais simples; este tem QR + código lado a lado). */
.mud-dialog.boleto-dialog {
  max-width: min(680px, calc(100vw - 32px));
}
.mud-dialog.boleto-dialog .mud-dialog-content {
  max-height: calc(100svh - 190px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* No telefone o diálogo vira bottom sheet (astra-components.css): largura total
   e altura controlada pelo flex do sheet, não por max-height próprio. */
@media (max-width: 640px) {
  .mud-dialog.boleto-dialog {
    max-width: 100%;
  }
  .mud-dialog.boleto-dialog .mud-dialog-content {
    max-height: none;
  }
}

/* Abas entre telas irmãs. Ficam no CSS global porque o identificador
   isolado de SectionTabs.razor.css não coincide com o atributo renderizado. */
.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.section-tabs__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel);
  color: var(--fg);
  font: 500 14px/1.4 var(--body);
  text-decoration: none;
  touch-action: manipulation;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.section-tabs__link:hover { border-color: var(--accent); }
.section-tabs__link[aria-current="page"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent);
}
.section-tabs__link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .section-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .section-tabs__link { flex: none; }
}

/* ── Financeiro logado: trilho + folha de lista. Papel claro, cartão branco, rótulo mono. ── */
.fin-page {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.fin-page:not(.boletos-page) { container: fin / inline-size; }
.fin-page > .page-header { margin-bottom: 0; }
.fin-kpis,
.gestao-kpis,
.com-kpis {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.fin-kpis:has(> :nth-child(3):last-child),
.gestao-kpis:has(> :nth-child(3):last-child),
.com-kpis:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-kpis:has(> :nth-child(4):last-child),
.gestao-kpis:has(> :nth-child(4):last-child),
.com-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fin-kpis .ds-kpi,
.gestao-kpis .ds-kpi,
.com-kpis .ds-kpi { min-width: 0; }
.fin-kpis .ds-kpi-value,
.gestao-kpis .ds-kpi-value,
.com-kpis .ds-kpi-value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fin-sheet,
.gestao-sheet,
.com-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-width: 0;
  overflow: hidden;
}
.fin-sheet__bar,
.gestao-sheet__bar,
.com-sheet__bar {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.fin-sheet .com-empty,
.gestao-sheet .com-empty,
.com-sheet .com-empty,
.fin-sheet .contas-empty { margin: 8px 18px 18px; border: 0; padding: 12px 0 4px; }
.gestao-sheet > .astra-alert { margin: 0 18px 16px; }
.fin-switch {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}
.fin-switch button {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 14px/1.3 var(--body);
  cursor: pointer;
  touch-action: manipulation;
}
.fin-switch button[aria-pressed='true'] { background: var(--fg); color: var(--bg); }
.fin-switch button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 900px) {
  .fin-kpis:has(> :nth-child(3):last-child),
  .fin-kpis:has(> :nth-child(4):last-child),
  .gestao-kpis:has(> :nth-child(3):last-child),
  .gestao-kpis:has(> :nth-child(4):last-child),
  .com-kpis:has(> :nth-child(3):last-child),
  .com-kpis:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fin-switch { display: flex; width: 100%; }
  .fin-switch button { flex: 1 1 0; min-width: 0; white-space: normal; text-wrap: balance; }
}
@media (max-width: 480px) {
  .fin-sheet__bar,
  .gestao-sheet__bar,
  .com-sheet__bar { padding: 12px 14px; }
  .gestao-kpis:has(> :nth-child(3):last-child) > :last-child,
  .com-kpis:has(> :nth-child(3):last-child) > :last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .fin-switch button { transition: none; }
}

/* ── Comunicação: padrão compartilhado (avisos, ocorrências, assembleias, enquetes) ── */
.com-page {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.com-page > .page-header {
  margin-bottom: 0;
}
.com-filters {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(auto-fit, minmax(0, 1fr));
  gap: 16px;
}
.com-filters > * {
  min-width: 0;
}
.com-count {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.com-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}
.com-empty {
  padding: 24px;
  display: grid;
  gap: 12px;
  justify-items: start;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.com-empty h2 {
  margin: 0;
  font: 500 22px/1.25 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.com-empty p {
  margin: 0;
  color: var(--muted);
}
.com-table .com-table__main {
  min-width: 0;
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
}
.com-table .com-table__main strong {
  font-weight: 500;
  color: var(--fg);
}
.com-table .com-table__clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
}
.com-table .com-table__main small,
.com-table .com-table__audit small {
  color: var(--muted);
  font: 400 11px/1.6 var(--mono);
}
.com-table .com-table__date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.com-table .com-table__audit {
  display: grid;
  gap: 2px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.com-table .com-table__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.com-history {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.com-history summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font: 500 15px/1.5 var(--body);
}
.com-history summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  border-radius: 4px;
}
.com-history ul {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  display: grid;
  gap: 10px;
}
.com-history li {
  display: grid;
  gap: 2px;
  font-size: 14px;
}
.com-history li span {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 1024px) {
  .com-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .com-table .com-table__date {
    white-space: normal;
  }
}
@media (min-width: 641px) {
  .gestao-sheet .com-table .com-table__actions {
    flex-wrap: nowrap;
  }
}
@media (max-width: 480px) {
  .com-filters {
    grid-template-columns: 1fr;
  }
  .com-table .com-table__actions .astra-btn {
    flex: 1 1 120px;
  }
}
