/* Responsabilidade: Layout principal da página */
.top-bar {
  background: var(--dark);
  padding: 12px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #2a2a2a;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.top-bar-title {
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
}

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

#document-page {
  width: 794px;
  margin: 40px auto;
  background: var(--white);
  /* padding: 48px 52px; */
  padding: 23px 23px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.08);
  transform: scale(1.24);
  transform-origin: top center;
  margin-bottom: calc(40px + 794px * 0.24);
}

@media print {
  #document-page {
    transform: none !important;
    margin-bottom: 0 !important;
  }
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--dark);
}

.doc-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--dark);
  margin-top: 10px;
}

.doc-title span {
  color: var(--gold);
}

.logo-circle {
  width: 40px;
  height: 40px;
  background: var(--dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.logo-circle span {
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo-circle img {
  /* dimensions and position handled by getCropStyle inline styles */
}

.doc-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── PRINT / Ctrl+P ───────────────────────────────────── */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 12mm 12mm 12mm;
  }

  html, body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide everything except the document */
  .top-bar,
  .admin-overlay,
  .crop-modal,
  #toast {
    display: none !important;
  }

  #document-page {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Keep cards on same page when possible */
  .property-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
