/* Embed Dalucare — layout full-width e denso */

:root {
  --embed-bg: #f4f6f8;
  --embed-ink: #142033;
  --embed-muted: #5b6575;
  --embed-line: rgba(20, 32, 51, 0.12);
  --embed-accent: #0d6efd;
  --embed-card: #ffffff;
}

* { box-sizing: border-box; }

html, body.embed-body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--embed-ink);
  background: var(--embed-bg);
}

/* Evita scroll duplo quando o parent redimensiona; ainda permite rolar se o iframe for baixo */
html.embed-framed,
html.embed-framed body.embed-body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  background: #fff;
}

.embed-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.55rem 0.65rem 0.85rem;
}

.embed-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding: 0.15rem 0 0.45rem;
  border-bottom: 1px solid var(--embed-line);
}

.embed-brand {
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: -0.01em;
}

.embed-brand span { color: var(--embed-accent); }

/* Embed parceiro: sem toggle de tema (fica sempre claro) */
.embed-body .theme-toggle {
  display: none !important;
}

.embed-user {
  font-size: 0.78rem;
  color: var(--embed-muted);
  text-align: right;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.embed-gate {
  background: var(--embed-card);
  border: 1px solid var(--embed-line);
  border-radius: 0.85rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
}

.embed-gate h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.embed-gate p {
  margin: 0 0 1.1rem;
  color: var(--embed-muted);
}

.embed-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1.05rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  color: inherit;
}

.btn-primary {
  background: var(--embed-ink);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--embed-line);
}

/* Quebra o limite de 640px do .dashboard-card do style.css */
.embed-app .content-panel,
.embed-app .card.dashboard-card.rx-wrap,
.embed-app .dashboard-card,
.embed-app .rx-wrap {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-shadow: none;
}

.embed-app .rx-wrap {
  background: var(--embed-card);
  border: 1px solid var(--embed-line);
  border-radius: 0.85rem;
  padding: 0.85rem 0.9rem 1rem;
}

.embed-app h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.embed-app .muted,
.embed-app .compliance-inline-notice {
  color: var(--embed-muted);
  font-size: 0.86rem;
}

.embed-app .ps-search-label {
  margin-top: 0.15rem;
  font-size: 0.82rem;
}

.embed-app .ps-search {
  width: 100%;
  margin-bottom: 0.35rem;
}

/* Grade mais densa — melhor aproveitamento da largura */
.embed-app .calc-category-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.embed-app .calc-category-btn {
  padding: 0.7rem 0.75rem;
  border-radius: 0.7rem;
  gap: 0.5rem;
  background: #fff;
}

.embed-app .calc-category-icon {
  font-size: 1.15rem;
}

.embed-app .calc-category-name {
  font-size: 0.84rem;
  line-height: 1.25;
  font-weight: 600;
}

.embed-partner-note {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--embed-muted);
  text-align: center;
}

.embed-guest-bar {
  margin-bottom: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: var(--embed-card);
  border: 1px solid var(--embed-line);
  border-radius: 0.85rem;
}

.embed-guest-bar[hidden] {
  display: none !important;
}

.embed-guest-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.embed-guest-fields {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
}

.embed-guest-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--embed-muted);
}

.embed-guest-field input,
.embed-guest-field select {
  font: inherit;
  font-weight: 500;
  color: var(--embed-ink);
  border: 1px solid var(--embed-line);
  border-radius: 0.55rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
}

.embed-guest-field input.embed-guest-locked,
.embed-guest-field select.embed-guest-locked {
  background: #eef6f3;
  border-color: rgba(42, 107, 90, 0.35);
  color: #1a3347;
}

.embed-guest-uf { width: 4.25rem; }
.embed-guest-crm { width: 7.5rem; }

.embed-blank-card {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  margin: 0.55rem 0 0.75rem;
  padding: 0.85rem 1rem;
  text-align: left;
  border: 2px solid var(--embed-ink);
  border-radius: 0.85rem;
  background: var(--embed-ink);
  color: #fffdf9;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(20, 32, 51, 0.1);
}

.embed-blank-card strong {
  font-size: 1rem;
}

.embed-blank-card span {
  font-size: 0.8rem;
  opacity: 0.88;
  font-weight: 500;
}

.embed-blank-card:hover {
  filter: brightness(1.08);
}

.embed-blank-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin: 0.85rem 0 1rem;
}

.embed-blank-hint {
  font-size: 0.82rem;
}

.rx-print-blank-body p {
  margin: 0.55rem 0;
  border-bottom: 1px solid rgba(20, 32, 51, 0.12);
  min-height: 1.25rem;
}

.rx-disclaimer-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
}

.rx-disclaimer-modal[hidden] {
  display: none !important;
}

.rx-disclaimer-dialog {
  width: min(420px, 100%);
  background: #fffdf9;
  color: #142033;
  border-radius: 1rem;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.rx-disclaimer-dialog h3 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}

.rx-disclaimer-dialog p {
  margin: 0 0 1rem;
  line-height: 1.45;
  font-size: 0.95rem;
}

.rx-disclaimer-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.rx-disclaimer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .embed-guest-fields {
    grid-template-columns: 1fr 1fr;
  }
  .embed-guest-field:first-child {
    grid-column: 1 / -1;
  }
  .embed-guest-uf,
  .embed-guest-crm {
    width: auto;
  }

  .embed-app .calc-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  }
}

@media (min-width: 900px) {
  .embed-app .calc-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}
