/* Base compartilhada com o concept pre-cadastro-ia: tokens dark do design system, escala e interação */
:root {
  --background: #0a0a0a;
  --foreground: #fafafa;
  --card: #171717;
  --muted: #262626;
  --border: #ffffff1a;
  --input: #ffffff26;
  --primary: #48db90;
  --primary-foreground: #eff6ff;
  --secondary: #27272a;
  --secondary-foreground: #fafafa;
  --muted-foreground: #a1a1a1;
  --destructive: #ff6467;
  --sidebar: #171717;
  --sidebar-foreground: #fafafa;
  --sidebar-accent: #262626;
  --amber\/9: #ffc53d;
  --amber\/11: #ffca16;
  --white\/12: #fffffff2;
  --font-definitions\/font-family-body: "Geist";

  --z: 1;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
html,
body {
  margin: 0;
  background: var(--sidebar);
}
body {
  font-family: "Geist", system-ui, sans-serif;
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
/* O layout é desenhado em 1440px e escalado para a largura da janela */
#stage {
  width: 1440px;
  zoom: var(--z);
}
.view.is-active {
  animation: view-in 0.5s var(--ease) both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
[data-action] {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.18s ease, transform 0.18s var(--ease), background-color 0.18s ease;
}
[data-action]:hover {
  opacity: 0.88;
}
[data-action]:active {
  transform: scale(0.975);
}
[data-action]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Página ---------- */
[data-node-id="3813:2367"] {
  height: calc(100vh / var(--z));
  min-height: 640px;
}
[data-name="badge/permissoes"] {
  padding: 0;
}
[data-name="badge/permissoes"] > div {
  width: auto;
}
[data-name="badge/permissoes"] p {
  flex: none;
}
.tab {
  cursor: pointer;
  user-select: none;
}
.table-swap {
  animation: view-in 0.35s var(--ease) both;
}
#table-sent[hidden] {
  display: none;
}
.row-link {
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.row-link:hover,
.row-link:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}
.chip-neutral > div:first-child {
  background: var(--muted-foreground);
}
.chip-neutral p {
  color: var(--muted-foreground);
}

/* ---------- Painel de detalhes (drawer à direita, 8px de margem como no frame) ---------- */
#overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
}
#overlay[hidden] {
  display: none;
}
#scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#drawer {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: 520px;
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.28s ease, transform 0.45s var(--ease);
}
#overlay.is-open #scrim {
  opacity: 1;
}
#overlay.is-open #drawer {
  opacity: 1;
  transform: none;
}
.drawer-panel {
  position: absolute;
  inset: 0;
  display: none;
}
.drawer-panel.is-active {
  display: flex;
}
/* o conteúdo rola por baixo dos botões fixos no rodapé do painel */
.drawer-panel > div:nth-child(2) {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 116px;
  scrollbar-width: thin;
  scrollbar-color: var(--input) transparent;
}
.drawer-panel[data-drawer="refused"] > div:nth-child(2) {
  padding-bottom: 64px;
}
.drawer-panel > div:nth-child(2) > * {
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* no Figma os traços da tabela não ocupam espaço no layout (linhas de 53px, tabela de 305px) */
[data-name="Table"] {
  border-width: 0;
  box-shadow: inset 0 0 0 1px var(--border);
}
[data-name="Table"] > [data-name="Row"],
[data-name="Table"] > [data-name="Header"] {
  border-bottom-width: 0;
  box-shadow: inset 0 -1px 0 var(--border);
}

/* painel e card "Imóvel": traço sem ocupar layout, como no frame (conteúdo a 24px, card de 136px) */
.drawer-panel {
  border-width: 0;
  box-shadow: inset 0 0 0 1px var(--border), 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}
.drawer-panel > [data-name="cta"] {
  left: 0;
  bottom: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: inset 1px 0 0 var(--border), inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border);
}
.drawer-panel > div:nth-child(2) > [data-name="Wrapper"] {
  border-width: 0;
  box-shadow: inset 0 0 0 1px var(--border), 0 1px 0 rgba(0, 0, 0, 0.05);
}
#table-sent [data-name="Avatar"] p {
  white-space: nowrap;
}
.drawer-panel > div:first-child {
  border-bottom-width: 0;
  box-shadow: inset 0 -1px 0 var(--border);
}

/* ---------- Recebidas: detalhes do imóvel, aba Parcerias (painel de 800px) ---------- */
#drawer {
  transition: opacity 0.28s ease, transform 0.45s var(--ease), width 0s;
}
#drawer[data-size="wide"] {
  width: 800px;
}
.drawer-panel[data-drawer="owner"] {
  border-radius: 10px;
}
.drawer-panel[data-drawer="owner"] > div:nth-child(2) {
  padding-bottom: 24px;
}
[data-node-id="3816:3696"] {
  padding: 0;
}
[data-node-id="3816:3696"] > div {
  width: auto;
}
[data-node-id="3816:3696"] p {
  flex: none;
}
.is-leaving {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.is-entering {
  animation: view-in 0.4s var(--ease) both;
}
.link-action {
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.link-action:hover {
  opacity: 0.75;
}

/* ---------- Encerrar parceria (modal 4.4, 400×610) ---------- */
#modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  padding: 16px;
  overflow: auto;
}
#modal-wrap[hidden] {
  display: none;
}
#modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.28s ease;
}
#modal {
  position: relative;
  margin: auto;
  width: 400px;
  opacity: 0;
  transform: translateY(14px) scale(0.965);
  transition: opacity 0.28s ease, transform 0.45s var(--ease);
}
#modal-wrap.is-open #modal-scrim {
  opacity: 1;
}
#modal-wrap.is-open #modal {
  opacity: 1;
  transform: none;
}
#modal textarea {
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--foreground);
  font: 400 14px/24px "Geist", sans-serif;
}
#modal textarea::placeholder {
  color: var(--muted-foreground);
}

/* ---------- Pedidos aguardando: card neutro, avatar, botões na variante pequena ---------- */
[data-name="Pedido"] > [data-name="Tint"] {
  background: var(--card);
  border-color: var(--border);
  opacity: 1;
}
[data-name="Pedido"] > div:nth-child(2) {
  gap: 12px;
  align-items: center;
}
[data-name="Pedido"] > div:nth-child(2) > p {
  align-self: flex-start;
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: var(--muted);
  color: var(--foreground);
  font: 500 12px/16px "Geist", sans-serif;
  letter-spacing: 0.02em;
}
[data-name="Pedido"] [data-name="Buttons"] {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
}
.site-link {
  color: var(--primary);
  text-decoration: none;
}
.site-link:hover,
.site-link:focus-visible {
  text-decoration: underline;
  outline: none;
}
