/* ============================================================
   DocEnfermagem — style.css — Mobile First Responsivo
   ============================================================ */

:root {
  --teal:       #0D7377;
  --teal-dark:  #095a5d;
  --teal-light: #e0f4f4;
  --teal-mid:   #85c1c1;
  --white:      #ffffff;
  --gray-bg:    #f8f9fa;
  --text:       #333333;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(13,115,119,.10);
  --nav-height: 56px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}

/* ── Navbar ─────────────────────────────────────────────── */
.bg-teal { background-color: var(--teal) !important; }
.text-teal { color: var(--teal) !important; }
.navbar { position: sticky; top: 0; z-index: 1030; }
.navbar-brand { letter-spacing: .5px; font-size: 1.05rem; }
.nav-link { font-weight: 500; transition: opacity .2s; padding: .5rem .75rem; }
.nav-link:hover { opacity: .8; }
.nav-link.active { background: rgba(255,255,255,.15); border-radius: 6px; }
.navbar-toggler { border: none; padding: 4px 8px; }
.navbar-toggler:focus { box-shadow: none; }

/* ── Cards ──────────────────────────────────────────────── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
@media (hover: hover) { .card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(13,115,119,.15); } }
.card-header-teal { background: var(--teal); color: #fff; border-radius: var(--radius) var(--radius) 0 0 !important; font-weight: 600; padding: .6rem 1rem; }

/* ── Botões ─────────────────────────────────────────────── */
.btn-teal { background-color: var(--teal); border-color: var(--teal); color: #fff; font-weight: 500; }
.btn-teal:hover, .btn-teal:active { background-color: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
.btn-outline-teal { color: var(--teal); border-color: var(--teal); }
.btn-outline-teal:hover, .btn-outline-teal:active { background: var(--teal); color: #fff; }
@media (max-width: 576px) { .btn { min-height: 40px; } .btn-sm { min-height: 36px; } }

/* ── Badges ─────────────────────────────────────────────── */
.badge-teal { background-color: var(--teal); color: #fff; }
.badge-light-teal { background-color: var(--teal-light); color: var(--teal); font-weight: 600; }

/* ── Inputs — evita zoom iOS (font-size >= 16px) ──────── */
input, textarea, select { font-size: 16px !important; }
.form-control, .form-select { font-size: 16px !important; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,115,119,.15); }

/* ── Doc Cards ──────────────────────────────────────────── */
.doc-card { cursor: pointer; border-left: 4px solid var(--teal); transition: all .2s; }
@media (hover: hover) { .doc-card:hover { border-left-color: var(--teal-dark); background: var(--teal-light); } }
.doc-card:active { background: var(--teal-light); }
.doc-card .doc-icon { width: 44px; height: 44px; background: var(--teal-light); color: var(--teal); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.doc-card .categoria-badge { font-size: .7rem; padding: 2px 8px; border-radius: 20px; }

/* ── Stats ──────────────────────────────────────────────── */
.stat-card { border-left: 4px solid var(--teal); background: #fff; }
.stat-card .stat-icon { width: 48px; height: 48px; background: var(--teal-light); color: var(--teal); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-card .stat-number { font-size: 1.8rem; font-weight: 700; color: var(--teal); }
@media (max-width: 576px) { .stat-card .stat-number { font-size: 1.3rem; } .stat-card .stat-icon { width: 40px; height: 40px; } }

/* ── Perfil / Logo ──────────────────────────────────────── */
.color-preview { width: 34px; height: 34px; border-radius: 6px; border: 2px solid #ddd; display: inline-block; vertical-align: middle; cursor: pointer; }
.logo-preview { max-width: 120px; max-height: 80px; border-radius: 8px; border: 2px solid var(--teal-light); object-fit: contain; background: #fff; }
.drop-zone { border: 2px dashed var(--teal-mid); border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; cursor: pointer; transition: background .2s; }
.drop-zone:hover, .drop-zone.dragover { background: var(--teal-light); }

/* ── Planos ─────────────────────────────────────────────── */
.plano-card { border: 2px solid #e0e0e0; border-radius: var(--radius); transition: all .2s; }
.plano-card.popular { border-color: var(--teal); }
.plano-card:hover { border-color: var(--teal); }
.plano-badge { background: var(--teal); color: #fff; font-size:.75rem; padding:2px 12px; border-radius:20px; }
.plano-price { font-size: 2.2rem; font-weight: 800; color: var(--teal); }
.plano-price span { font-size: 1rem; font-weight: 400; color: #888; }
@media (max-width: 576px) { .plano-price { font-size: 1.8rem; } }

/* ── Tabelas ─────────────────────────────────────────────── */
.table thead th { background: var(--teal); color: #fff; font-weight: 600; border: none; }
.table tbody tr:hover { background: var(--teal-light); }
@media (max-width: 768px) { .table th, .table td { font-size: 12px; padding: .35rem .45rem; white-space: nowrap; } }

/* ── Login ──────────────────────────────────────────────── */
.auth-wrapper { min-height: 100vh; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: #fff; border-radius: 16px; padding: 2rem 1.5rem; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.auth-logo { font-size: 1.8rem; color: var(--teal); font-weight: 800; }
@media (max-width: 400px) { .auth-card { padding: 1.5rem 1rem; } .auth-logo { font-size: 1.5rem; } }

/* ── Page header ─────────────────────────────────────────── */
.page-header { background: #fff; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.page-header h1 { font-size: 1.2rem; font-weight: 700; color: var(--teal); margin: 0; }

/* ── Filtros de categoria ────────────────────────────────── */
.filter-btn { border: none; background: none; color: var(--teal); font-weight: 500; padding: 6px 12px; border-radius: 20px; cursor: pointer; transition: all .2s; font-size: 13px; white-space: nowrap; }
.filter-btn.active, .filter-btn:hover { background: var(--teal); color: #fff; }
.filtros-wrapper { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .4rem; padding-bottom: .4rem; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filtros-wrapper::-webkit-scrollbar { display: none; }

/* ── Overlay loading ─────────────────────────────────────── */
.spinner-teal { color: var(--teal); }
.overlay-loading { position: fixed; inset: 0; background: rgba(255,255,255,.85); display: flex; align-items: center; justify-content: center; z-index: 9999; }

/* ── Container ───────────────────────────────────────────── */
main.container-fluid { padding-left: 1rem; padding-right: 1rem; }
@media (max-width: 576px) { main.container-fluid { padding-left: .6rem; padding-right: .6rem; } }

/* ════════════════════════════════════════════════════════════
   EDITOR DE DOCUMENTO — TOTALMENTE RESPONSIVO
   ════════════════════════════════════════════════════════════ */

.editor-wrapper { display: flex; gap: 1rem; }

/* Desktop >= 992px: formulário + preview lado a lado */
@media (min-width: 992px) {
  .editor-wrapper { height: calc(100vh - 140px); }
  .editor-form { width: 360px; min-width: 300px; overflow-y: auto; flex-shrink: 0; }
  .editor-preview { flex: 1; overflow: auto; background: #e0e0e0; border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; align-items: center; }
}

/* Tablet 768-991px: formulário em cima, preview embaixo menor */
@media (min-width: 768px) and (max-width: 991px) {
  .editor-wrapper { flex-direction: column; }
  .editor-form { width: 100%; max-height: 50vh; overflow-y: auto; }
  .editor-preview { width: 100%; background: #e0e0e0; border-radius: 10px; padding: .75rem; overflow-x: auto; }
  .doc-page { transform: scale(0.72); transform-origin: top left; width: 794px; margin-bottom: -295px; }
}

/* Mobile < 768px: apenas formulário, preview em accordion */
@media (max-width: 767px) {
  .editor-wrapper { flex-direction: column; gap: .6rem; }
  .editor-form { width: 100%; }
  .editor-preview { width: 100%; background: #e0e0e0; border-radius: 10px; padding: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .doc-page { transform: scale(0.42); transform-origin: top left; width: 794px; min-height: 400px; margin-bottom: -600px; }
}

@media (max-width: 400px) {
  .doc-page { transform: scale(0.35); margin-bottom: -680px; }
}

/* Toggle preview no mobile */
.preview-toggle-btn { display: none; width: 100%; margin-bottom: .5rem; }
@media (max-width: 991px) { .preview-toggle-btn { display: block; } }
.editor-preview.hidden { display: none; }

/* Botões de ação fixos na parte inferior */
.btn-actions { position: sticky; bottom: 0; background: #fff; padding: 10px 0 6px; border-top: 1px solid #eee; z-index: 10; }

/* ════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION — Aparece apenas no mobile
   ════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--teal);
  z-index: 1040;
  box-shadow: 0 -2px 10px rgba(0,0,0,.2);
  padding-bottom: env(safe-area-inset-bottom); /* iPhone X+ */
}
.bottom-nav a {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  padding: 8px 4px 10px;
  font-size: 10px; line-height: 1.2;
  transition: color .15s;
}
.bottom-nav a.active, .bottom-nav a:active { color: #fff; }
.bottom-nav a i { font-size: 1.25rem; margin-bottom: 2px; display: block; }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* No mobile usa bottom nav, esconde menu principal */
  .navbar .navbar-collapse,
  .navbar .navbar-toggler { display: none !important; }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .editor-form, .page-header, nav, footer,
  .btn-actions, .bottom-nav, .d-print-none,
  .preview-toggle-btn { display: none !important; }
  .editor-wrapper { display: block; }
  .editor-preview { background: none !important; padding: 0 !important; overflow: visible !important; }
  .doc-page { box-shadow: none !important; width: 100% !important; transform: none !important; margin-bottom: 0 !important; }
  body { padding-bottom: 0 !important; }
}

/* ── Utilitários mobile ───────────────────────────────────── */
.overflow-x-auto { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 480px) {
  #busca_doc { width: 100% !important; }
  .page-header .d-flex { width: 100%; }
}

/* ── Logo/Marca selector grid ─────────────────────────── */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.thumb-item {
  position: relative;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  background: #f8f9fa;
  aspect-ratio: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.thumb-item:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,115,119,.12);
}
.thumb-item.selected {
  border-color: var(--teal);
  background: #e8f7f7;
  box-shadow: 0 0 0 3px rgba(13,115,119,.2);
}
.thumb-item img {
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
  pointer-events: none;
}
.thumb-n {
  position: absolute;
  bottom: 3px; left: 5px;
  font-size: .6rem;
  font-weight: 700;
  color: #aaa;
}
.thumb-check {
  position: absolute;
  top: 3px; right: 3px;
  color: var(--teal);
  font-size: .85rem;
  line-height: 1;
}
.thumb-zoom {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity .2s;
  border-radius: 8px;
}
.thumb-item:hover .thumb-zoom { opacity: 1; }
.marca-item { background: #fff; }
.current-img-box {
  text-align: center;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
}
.current-img-box img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
}
.separador-ou {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #aaa;
  font-size: .75rem;
  font-weight: 600;
}
.separador-ou::before,
.separador-ou::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dee2e6;
}

/* ── Modal de zoom ─────────────────────────────────────── */
.zoom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.zoom-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  cursor: default;
}
.zoom-modal-inner img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 8px;
}
.zoom-modal-title {
  font-size: .85rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.zoom-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #666;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.zoom-modal-close:hover { color: #e53e3e; }
.zoom-modal-select {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  background: linear-gradient(135deg, var(--teal), #14A085);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: .875rem;
  cursor: pointer;
  transition: all .2s;
}
.zoom-modal-select:hover { opacity: .9; transform: translateY(-1px); }

/* ── Botão Canva Template ─────────────────────────────── */
.btn-canva-template {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #7B2FF7, #9B4DFF);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-size: .855rem;
  font-weight: 700;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(123,47,247,.3);
  width: 100%;
  justify-content: center;
}
.btn-canva-template:hover {
  background: linear-gradient(135deg, #6A1FE6, #8B3DEE);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(123,47,247,.4);
}
.btn-canva-template svg {
  flex-shrink: 0;
}

/* ── Thumb external buttons ──────────────────────────── */
.thumb-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.thumb-btns .btn {
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 100px;
}
/* Zoom icon inside thumb - always visible, small */
.thumb-zoom-icon {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-size: .75rem;
  color: rgba(0,0,0,.35);
  pointer-events: none;
}
.thumb-item:hover .thumb-zoom-icon { color: var(--teal); }
/* Remove old thumb-zoom overlay on hover (replaced by click) */
.thumb-zoom { display: none !important; }

/* ── Canva Sync Panel ─────────────────────────────────── */
.canva-sync-box {
  background: linear-gradient(135deg, #f8f0ff 0%, #fdf4ff 100%);
  border: 1.5px solid #d4a8ff;
  border-radius: 12px;
  padding: 12px;
}
.canva-sync-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.canva-icon {
  width: 20px; height: 20px;
  color: #7B2FF7;
  flex-shrink: 0;
}
.canva-sync-title {
  font-size: .8rem;
  font-weight: 700;
  color: #4a1a8a;
  line-height: 1.2;
}
.canva-sync-sub {
  font-size: .68rem;
  color: #9b59d4;
}
.canva-sync-all-btn {
  margin-left: auto;
  background: linear-gradient(135deg, #7B2FF7, #9B4DFF);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all .2s;
  white-space: nowrap;
}
.canva-sync-all-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(123,47,247,.4);
}
.canva-sync-all-btn.loading {
  opacity: .7;
  cursor: not-allowed;
}
.canva-sync-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.canva-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.canva-slot-num {
  font-size: .6rem;
  font-weight: 700;
  color: #9b59d4;
  text-transform: uppercase;
}
.canva-slot-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1.5px solid #d4a8ff;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.canva-slot-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.marca-preview { background: #f0f0f0; }
.canva-slot-btn {
  background: #7B2FF7;
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 100%;
  padding: 3px 0;
  font-size: .75rem;
  cursor: pointer;
  transition: all .2s;
}
.canva-slot-btn:hover { background: #6a1fe6; }
.canva-slot-btn.syncing { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.canva-slot-status {
  font-size: .6rem;
  text-align: center;
  min-height: 14px;
  color: #2f855a;
  font-weight: 600;
}
.canva-slot-status.error { color: #e53e3e; }
.canva-edit-link {
  display: flex;
  align-items: center;
  font-size: .72rem;
  color: #7B2FF7;
  text-decoration: none;
  font-weight: 600;
  justify-content: center;
}
.canva-edit-link:hover { text-decoration: underline; }

/* ── Canva steps ─────────────────────────────────────── */
.canva-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.canva-step-num {
  width: 20px; height: 20px;
  background: #7B2FF7;
  color: #fff;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.canva-step-link {
  color: #7B2FF7;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(123,47,247,.08);
  border-radius: 8px;
  border: 1px solid rgba(123,47,247,.2);
  transition: all .2s;
}
.canva-step-link:hover {
  background: rgba(123,47,247,.15);
  color: #6a1fe6;
}
.canva-link-status {
  font-size: .75rem;
  min-height: 20px;
  padding: 2px 0;
}

/* ── How-to instructions ─────────────────────────────── */
.canva-howto {
  background: linear-gradient(135deg, #f8f0ff, #fdf6ff);
  border: 1px solid #e0c8ff;
  border-radius: 10px;
  padding: 10px 12px;
}
.canva-howto-title {
  font-size: .72rem;
  font-weight: 800;
  color: #5a1a9a;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.canva-howto-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.canva-howto-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .75rem;
  color: #333;
}
.canva-howto-n {
  width: 18px; height: 18px;
  background: #7B2FF7;
  color: #fff;
  border-radius: 50%;
  font-size: .6rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.canva-howto-hint {
  font-size: .68rem;
  color: #7B2FF7;
  margin-top: 3px;
  font-weight: 600;
}

/* ── Drop Zone Pro ───────────────────────────────────── */
.drop-zone-pro {
  border: 2px dashed var(--teal);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #f8fffe;
  position: relative;
}
.drop-zone-pro:hover,
.drop-zone-pro.dragover {
  border-color: var(--teal2);
  background: #e8f7f7;
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(13,115,119,.15);
}
.drop-zone-pro.dragover {
  border-style: solid;
  border-width: 2px;
}
.drop-zone-pro-marca {
  border-color: #d4a8ff;
  background: #fdf8ff;
}
.drop-zone-pro-marca:hover,
.drop-zone-pro-marca.dragover {
  border-color: #9b59d4;
  background: #f5eeff;
}
.drop-zone-pro-icon {
  font-size: 2rem;
  color: var(--teal);
  margin-bottom: 6px;
  line-height: 1;
}
.drop-zone-pro-marca .drop-zone-pro-icon {
  color: #9b59d4;
}
.drop-zone-pro-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drop-zone-pro-text strong {
  font-size: .82rem;
  color: var(--dark);
}
.drop-zone-pro-text span {
  font-size: .7rem;
  color: var(--muted);
}
.drop-zone-pro-hint {
  font-size: .62rem;
  color: #aaa;
  margin-top: 6px;
}

/* ── Canva open design link ──────────────────────────── */
.canva-open-design-link {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: #7B2FF7;
  font-weight: 700;
  text-decoration: none;
  padding: 4px 10px;
  background: rgba(123,47,247,.08);
  border-radius: 8px;
  border: 1px solid rgba(123,47,247,.2);
  margin-top: 6px;
  transition: all .2s;
  width: fit-content;
}
.canva-open-design-link:hover {
  background: rgba(123,47,247,.15);
  color: #6a1fe6;
}

/* ── Design preview box (Canva thumbnail) ────────────── */
.canva-design-preview-box {
  display: none;
  align-items: center;
  gap: 10px;
  background: #f8f0ff;
  border: 1px solid #d4a8ff;
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
}
.canva-design-preview-box img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid #e0c8ff;
}
.canva-design-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.canva-design-preview-info span {
  font-size: .75rem;
  font-weight: 700;
  color: #4a1a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.canva-design-preview-info a {
  font-size: .7rem;
  color: #7B2FF7;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.canva-design-preview-info a:hover { text-decoration: underline; }

/* ── Canva Import UI ─────────────────────────────────── */
.canva-import-ui { display: flex; flex-direction: column; gap: 0; }
.canva-import-step {
  display: flex; align-items: flex-start; gap: 8px;
}
.canva-import-label {
  font-size: .72rem; font-weight: 700; color: #4a1a8a; margin-bottom: 5px;
}
.canva-select {
  font-size: .75rem !important; border-color: #d4a8ff !important;
  background: #fdf8ff;
}

/* ── Pages grid ──────────────────────────────────────── */
.canva-pages-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.canva-page-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; border: 2px solid #e0c8ff; border-radius: 8px;
  padding: 4px; background: #fff; transition: all .15s; width: 64px;
}
.canva-page-card:hover { border-color: #9b59d4; }
.canva-page-card.selected {
  border-color: #7B2FF7; background: #f0e8ff;
  box-shadow: 0 0 0 2px rgba(123,47,247,.2);
}
.canva-page-thumb {
  width: 56px;
  /*height: 56px; */
  border-radius: 4px;
  overflow: hidden;
  background: #f5f0ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.canva-page-thumb img { width: 100%; height: 100%; object-fit: cover; }
.canva-page-num {
  font-size: .58rem; font-weight: 700; color: #9b59d4; white-space: nowrap;
}

/* ── Slot selector ───────────────────────────────────── */
.canva-slots-selector {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
}
.canva-slot-radio {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; border: 2px solid #dee2e6; border-radius: 8px;
  padding: 5px 3px; background: #f8f9fa; transition: all .15s;
}
.canva-slot-radio:hover { border-color: #7B2FF7; }
.canva-slot-radio.selected {
  border-color: #7B2FF7; background: #f0e8ff;
  box-shadow: 0 0 0 2px rgba(123,47,247,.15);
}
.canva-slot-radio img {
  width: 40px; height: 40px; object-fit: contain; border-radius: 4px;
}
.canva-slot-radio span { font-size: .6rem; font-weight: 700; color: #555; }

/* ── Import button ───────────────────────────────────── */
.canva-import-btn {
  width: 100%; padding: 9px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #7B2FF7, #9B4DFF); color: #fff;
  font-size: .82rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .2s; box-shadow: 0 3px 12px rgba(123,47,247,.3);
}
.canva-import-btn:hover:not(:disabled) {
  transform: translateY(-1px); box-shadow: 0 5px 18px rgba(123,47,247,.4);
}
.canva-import-btn:disabled { opacity: .7; cursor: not-allowed; }

/* ── Thumbnail spinner ───────────────────────────────── */
.canva-thumb-spinner {
  width: 20px; height: 20px;
  border: 2px solid #e0c8ff;
  border-top-color: #7B2FF7;
  border-radius: 50%;
  animation: spin-thumb .7s linear infinite;
}
@keyframes spin-thumb { to { transform: rotate(360deg); } }

/* ── Canva Accordion ─────────────────────────────────── */
.canva-accordion {
  border: 1.5px solid #d4a8ff;
  border-radius: 10px;
  overflow: hidden;
}
.canva-accordion-toggle {
  width: 100%;
  background: linear-gradient(135deg, #f8f0ff, #fdf4ff);
  border: none;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background .15s;
}
.canva-accordion-toggle:hover { background: linear-gradient(135deg, #f0e6ff, #f9eeff); }
.canva-accordion-left {
  display: flex; align-items: center; gap: 7px;
  font-size: .78rem; font-weight: 700; color: #5a1a9a;
}
.canva-acc-chevron {
  color: #9b59d4; font-size: .75rem;
  transition: transform .2s;
}
.canva-acc-badge {
  font-size: .62rem; font-weight: 600;
  background: #e8d8ff; color: #7B2FF7;
  padding: 2px 7px; border-radius: 100px;
}
.canva-acc-badge.connected {
  background: #d1fae5; color: #065f46;
}
.canva-accordion-body {
  animation: fadeDown .15s ease;
}

/* ── Thumb wrapper com botão zoom abaixo ─────────────── */
.thumb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.thumb-zoom-btn {
  font-size: .62rem;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 4px;
  transition: background .15s;
  font-weight: 600;
}
.thumb-zoom-btn:hover { background: var(--teal-lt); }
/* Remove old hover overlay on thumb-item */
.thumb-item .thumb-zoom-icon { display: none !important; }

/* Override thumb-grid to work with thumb-wrapper */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.thumb-grid .thumb-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.thumb-grid .thumb-item {
  width: 100%;
  cursor: pointer;
}