@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ==========================================================================
   DEVFLUX BIO — DESIGN SYSTEM EDITORIAL IMPECCABLE (ANTI-SLOP)
   Inspirado no design artesanal, limpo e sofisticado de estúdio suíço
   ========================================================================== */

:root {
  --bg: #f5f5f1;
  --surface: #ffffff;
  --ink: #242824;
  --muted: #797e77;
  --line: #e3e6df;
  --line-focus: #8fbd66;
  
  /* Acentos de Estúdio */
  --green: #c7f397;
  --green-dark: #223618;
  --green-soft: #edf3e7;
  --purple: #8d73ee;
  --purple-soft: #eee9ff;
  --amber-soft: #ffedcf;
  --amber-dark: #916d36;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

/* Scrollbar visível e moderna em todo o painel admin */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #f1f2ec;
}

::-webkit-scrollbar-thumb {
  background: #c3c8bc;
  border-radius: 6px;
  border: 2px solid #f1f2ec;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ea496;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
  font-synthesis: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  transition: all 0.18s ease;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   BOTÕES & AÇÕES GERAIS
   ========================================================================== */
.btn-primary, .btn-secondary, .btn-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-primary {
  background: var(--green);
  color: var(--green-dark);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: #fbfbf9;
  border-color: #d2d6cd;
}

.btn-danger-outline {
  padding: 8px 12px;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

/* ==========================================================================
   LAYOUT GERAL: SIDEBAR + MAIN AREA
   ========================================================================== */
.workspace {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Fixa à Esquerda */
.sidebar {
  width: 250px;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 24px 20px 20px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--ink);
  margin-bottom: 24px;
}

.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--green);
  color: var(--green-dark);
  width: 38px;
  height: 38px;
  font-size: 20px;
  font-weight: 800;
}

.nav-section-label {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #91998c;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 4px;
  transition: background 0.15s ease;
}

.nav-item:hover {
  background: #f8faf5;
}

.nav-item.active {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.nav-item .icon {
  font-size: 16px;
}

.nav-item .count-pill {
  margin-left: auto;
  background: #ffffff;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--line);
}

/* Card de Dica de Venda de Placas NFC na Sidebar */
.sidebar-box {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px;
  background: linear-gradient(135deg, #f3f6ee 0%, #ffffff 100%);
  margin-bottom: 14px;
}

.sidebar-box span.badge-tip {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #657e4e;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.sidebar-box strong {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  display: block;
}

.sidebar-box p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 11px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--purple-soft);
  color: var(--purple);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-info strong {
  font-size: 11px;
  color: var(--ink);
}

.user-info span {
  font-size: 9px;
  color: var(--muted);
}

/* Área Principal */
.main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 0 44px 160px;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: 80px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb strong {
  color: var(--ink);
}

.system-status {
  font-size: 11px;
  color: #6c7565;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #8caa6a;
  border-radius: 50%;
  display: inline-block;
}

/* Título Editorial da Página */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 36px 0 28px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1.2px;
  color: var(--ink);
  margin-bottom: 6px;
}

.page-header h1 span {
  color: #799d54;
}

.page-header p {
  color: var(--muted);
  font-size: 13px;
}

/* ==========================================================================
   ESTATÍSTICAS EM CARDS BRANCOS
   ========================================================================== */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  position: relative;
}

.stat-box .label {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  display: block;
}

.stat-box .number {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--ink);
  margin: 14px 0 8px;
  display: block;
}

.stat-box .caption {
  font-size: 11px;
  color: #8a9086;
}

/* ==========================================================================
   GRID DE CLIENTES / COLEÇÃO
   ========================================================================== */
.collection-section {
  margin-top: 36px;
}

.collection-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.collection-top h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.collection-top p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

#dashboardSection {
  padding-bottom: 60px;
}

.clients-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.client-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.client-item:hover {
  border-color: #ced6c6;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.client-cover-art {
  height: 140px;
  position: relative;
  padding: 16px;
  background-color: #1a1e1b;
  background-size: cover;
  background-position: center;
}

.status-badge {
  padding: 5px 9px;
  font-size: 9px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
}

.status-badge.live {
  background: var(--green);
  color: var(--green-dark);
}

.status-badge.paused {
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.client-avatar-monogram {
  position: absolute;
  left: 20px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
}

.client-avatar-monogram img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-details {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.eyebrow-category {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.client-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 6px 0 4px;
}

.client-desc {
  font-size: 11px;
  color: #798375;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.client-bottom-bar {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mrr-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.mrr-tag small {
  font-size: 9px;
  color: var(--muted);
  font-weight: 400;
  display: block;
}

.actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Card "+ Criar Novo Estabelecimento" */
.create-new-card {
  min-height: 280px;
  border: 1px dashed #cbd5c1;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #f0f4ea;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  padding: 20px;
}

.create-new-card:hover {
  background: #e8efe0;
  border-color: #9dbb7d;
  transform: translateY(-2px);
}

.create-plus-icon {
  width: 44px;
  height: 44px;
  background: #dfe8d4;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--green-dark);
}

.create-new-card strong {
  font-size: 16px;
  font-weight: 600;
}

.create-new-card small {
  font-size: 11px;
  color: #7d8b72;
}

/* ==========================================================================
   VIEW 2: EDITOR VISUAL SPLIT-SCREEN (ESTILO BIO.SITE)
   ========================================================================= */
.editor-wrapper {
  padding-top: 28px;
}

.editor-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.editor-header-bar h1 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.8px;
}

.editor-header-bar .slug-url {
  font-size: 12px;
  color: #718067;
  margin-top: 4px;
}

.editor-grid-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  align-items: start;
  gap: 40px;
}

.editor-panel-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  gap: 20px;
  overflow-x: auto;
}

.tab-link {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 18px 0;
  border-bottom: 2px solid transparent;
  color: #81897a;
}

.tab-link.active {
  color: #29381c;
  border-color: #8ebc64;
  font-weight: 700;
}

.tab-pane {
  padding: 28px;
}

.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 8px;
}

.input-text, .select-box, .textarea-box {
  display: block;
  width: 100%;
  border: 1px solid #dfe4d9;
  border-radius: 9px;
  background: #fdfdfc;
  color: var(--ink);
  padding: 12px 14px;
  font-size: 12px;
  outline: none;
  transition: all 0.15s ease;
}

.input-text:focus, .select-box:focus, .textarea-box:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(199, 243, 151, 0.3);
}

.field-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Celular / Mockup iPhone */
.phone-sticky-container {
  position: sticky;
  top: 24px;
}

.phone-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: #929a89;
  margin-bottom: 14px;
}

.phone-casing {
  position: relative;
  border: 8px solid #20241f;
  border-radius: 40px;
  background: #20241f;
  padding-top: 18px;
  box-shadow: 0 25px 60px rgba(39, 61, 19, 0.12);
  overflow: hidden;
  max-width: 320px;
  margin: 0 auto;
}

.phone-speaker-notch {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 10px;
  background: #0f110e;
  border-radius: 10px;
  z-index: 10;
}

.phone-screen-iframe {
  height: 560px;
  width: 100%;
  border: none;
  background: #000;
  border-radius: 8px 8px 30px 30px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 36, 20, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.15);
}

.modal-dialog h2 {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.modal-dialog p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 1050px) {
  .sidebar { width: 80px; padding: 20px 10px; align-items: center; }
  .sidebar-brand span, .nav-section-label, .sidebar-box, .user-info, .sidebar-brand small, .nav-item .count-pill { display: none; }
  .main-content { margin-left: 80px; width: calc(100% - 80px); padding: 0 24px 140px; }
  .editor-grid-split { grid-template-columns: 1fr; }
  .phone-sticky-container { position: static; width: 320px; margin: 30px auto 0; }
}

@media (max-width: 680px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; width: 100%; padding: 0 16px 120px; }
  .stats-strip { grid-template-columns: 1fr; }
  .field-grid-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   DEVFLUX BIO — SEÇÕES & CARDS MODULARES (BUILDER ESTILO BIO.SITE)
   ========================================================================== */

#btnToggleAuthPassword:hover {
  color: var(--ink);
  transform: scale(1.08);
}

.sections-builder-top {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.add-section-toolbar {
  background: var(--bg);
  border: 1px dashed #d5d9cf;
  border-radius: 10px;
  padding: 14px;
}

.add-section-btn-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}

.btn-add-sec {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  transition: all 0.15s ease;
  text-align: center;
}

.btn-add-sec .sec-icon {
  font-size: 16px;
}

.btn-add-sec:hover {
  background: var(--green-soft);
  border-color: var(--line-focus);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.sections-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Card individual de uma Seção no Editor */
.sec-block-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  transition: border-color 0.2s ease;
}

.sec-block-card:hover {
  border-color: #cbd2c5;
}

.sec-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #fafaf8;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.sec-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-reorder-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-reorder-arrow {
  width: 20px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
}

.btn-reorder-arrow:hover:not(:disabled) {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: var(--line-focus);
}

.sec-type-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--purple-soft);
  color: var(--purple);
}

.sec-type-pill.text-type {
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.sec-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.sec-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sec-del {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #fee2e2;
  color: #dc2626;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
}

.btn-sec-del:hover {
  background: #fef2f2;
}

.sec-block-body {
  padding: 18px;
}

/* Seletor de Formato do Layout de Cards */
.layout-picker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}

.layout-picker-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.layout-pill-btn {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.layout-pill-btn.active {
  background: var(--green);
  border-color: var(--green-dark);
  color: var(--green-dark);
  font-weight: 700;
}

/* Lista de Cards da Seção */
.cards-editor-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.card-item-editor {
  display: flex;
  gap: 14px;
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  position: relative;
  align-items: flex-start;
}

.card-image-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  width: 80px;
}

.card-thumb-box {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: #eee;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-thumb-empty {
  font-size: 24px;
  color: #a0a69a;
}

.btn-upload-thumb {
  width: 100%;
  padding: 5px 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}

.btn-upload-thumb:hover {
  background: var(--green-soft);
  border-color: var(--line-focus);
}

.card-inputs-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.card-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.card-item-del-btn {
  background: none;
  border: none;
  color: #999;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.card-item-del-btn:hover {
  color: #dc2626;
  background: #fee2e2;
}

.btn-add-card-to-sec {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--line-focus);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add-card-to-sec:hover {
  background: #dff0d4;
  border-style: solid;
}

/* ==========================================================================
   ALINHAMENTO DE TEXTO & PROPORÇÕES DE CARROSSEL
   ========================================================================== */
.align-picker-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}

.btn-align-pill {
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-align-pill.active {
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.aspect-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px 12px;
  background: #fafaf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.aspect-pill-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.aspect-pill-btn.active {
  background: var(--green);
  border-color: var(--green-dark);
  color: var(--green-dark);
  font-weight: 700;
}

.btn-crop-existing {
  width: 100%;
  padding: 4px 4px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.btn-crop-existing:hover {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: var(--purple);
}

/* ==========================================================================
   MODAL DE RECORTE CROPPER.JS COM GRADE 3X3
   ========================================================================== */
.modal-cropper-box {
  max-width: 640px !important;
  width: 95% !important;
  max-height: 90vh !important;
  display: flex;
  flex-direction: column;
  padding: 22px !important;
}

.cropper-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cropper-modal-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.cropper-modal-header p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.btn-close-modal {
  font-size: 18px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-close-modal:hover {
  background: #f1f3ed;
  color: var(--ink);
}

.cropper-stage-wrap {
  width: 100%;
  height: 380px;
  background: #0d0f0d;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cropper-stage-wrap img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.cropper-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
  flex-wrap: wrap;
}

.cropper-ratios-group, .cropper-tools-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cropper-bar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.5px;
}

.btn-crop-ratio {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-crop-ratio.active {
  background: var(--green);
  border-color: var(--green-dark);
  color: var(--green-dark);
  font-weight: 700;
}

.btn-crop-tool {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

.btn-crop-tool:hover {
  background: var(--green-soft);
  border-color: var(--line-focus);
}

.cropper-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   CARDS DE CAPA & AVATAR (UPLOAD + RECORTE)
   ========================================================================== */
.identity-media-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}

.identity-thumb-box {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background-color: #f1f3ed;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.identity-thumb-box.cover-thumb {
  width: 80px;
  height: 52px;
}

.identity-thumb-box.avatar-thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.identity-thumb-box.favicon-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}

.btn-use-avatar-fav {
  background: #f1f5f9;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-use-avatar-fav:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.thumb-placeholder-icon {
  font-size: 20px;
  color: #9aa095;
}

/* ==========================================================================
   MODELOS PRONTOS (TEMPLATES DE NICHO) — ESTILOS VISUAIS
   ========================================================================== */
#templatesSection {
  padding-bottom: 80px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 24px;
  margin-bottom: 40px;
}

.template-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: #cbd3c5;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.template-cover-art {
  height: 145px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: #1a1a1f;
}

.template-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.6) 100%);
}

.template-badge-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(18, 18, 24, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.template-avatar-badge {
  position: absolute;
  bottom: -22px;
  left: 20px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 3;
}

.template-avatar-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.template-details {
  padding: 24px 20px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.template-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.template-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-features-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.feature-tag {
  font-size: 10.5px;
  font-weight: 700;
  background: #f1f4ed;
  color: #384630;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.template-bottom-actions {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}

/* Modal de Pré-visualização do Template */
.modal-preview-box {
  max-width: 520px;
  width: 100%;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.preview-stage-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  scrollbar-width: none;
}

.preview-stage-wrap::-webkit-scrollbar {
  display: none;
}

/* =============================================================================
   CRM DE PROSPECÇÃO COMERCIAL — KANBAN BOARD
   ============================================================================= */
.crm-stats-strip {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
}

.crm-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.crm-search-box {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 440px;
  width: 100%;
}

.crm-search-box .search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0.6;
}

.crm-search-box input {
  padding-left: 40px;
  width: 100%;
  border-radius: 9999px;
  background: #ffffff;
}

.crm-kanban-hint {
  font-size: 12px;
  color: var(--muted, #64748b);
  background: #ffffff;
  border: 1px dashed var(--line, #e2e8f0);
  padding: 8px 16px;
  border-radius: 9999px;
}

/* Kanban Board Container */
.crm-kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 24px;
  min-height: 580px;
  align-items: stretch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.crm-kanban-board::-webkit-scrollbar {
  height: 8px;
}

.crm-kanban-board::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Kanban Column */
.kanban-col {
  flex: 0 0 290px;
  width: 290px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 250px);
  min-height: 480px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kanban-col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-radius: 14px 14px 0 0;
  border-top: 3px solid transparent;
}

.kanban-col[data-status="novo"] .kanban-col-header { border-top-color: #3b82f6; }
.kanban-col[data-status="contatado"] .kanban-col-header { border-top-color: #8b5cf6; }
.kanban-col[data-status="negociando"] .kanban-col-header { border-top-color: #f59e0b; }
.kanban-col[data-status="fechado"] .kanban-col-header { border-top-color: #10b981; }
.kanban-col[data-status="perdido"] .kanban-col-header { border-top-color: #ef4444; }

.kanban-col-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

.kanban-count-pill {
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.btn-col-quick-add {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  color: var(--muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-col-quick-add:hover {
  background: #f1f5f9;
  border-color: var(--line);
  color: var(--ink);
}

/* Kanban Cards Body */
.kanban-cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  transition: all 0.2s ease;
  border-radius: 0 0 14px 14px;
}

.kanban-cards-container.drag-over {
  background: rgba(99, 102, 241, 0.08);
  outline: 2px dashed #6366f1;
  outline-offset: -3px;
}

.kanban-empty-drop {
  padding: 24px 12px;
  text-align: center;
  border: 1px dashed var(--line, #cbd5e1);
  border-radius: 10px;
  color: var(--muted, #94a3b8);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 90px;
}

/* Kanban Card */
.kanban-card {
  background: #ffffff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.07);
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.kanban-card.is-dragging {
  opacity: 0.35;
  border: 1.5px dashed #6366f1;
  transform: scale(0.97);
  cursor: grabbing;
}

/* Card Header */
.k-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.k-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #1e293b;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.k-info {
  flex: 1;
  min-width: 0;
}

.k-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 2px 0;
}

.k-cat {
  font-size: 10.5px;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Card Links Micro-buttons */
.k-links-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.btn-k-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-k-link:hover {
  transform: scale(1.03);
  opacity: 0.95;
}

.btn-k-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #ffffff;
}

.btn-k-gmb {
  background: #1a73e8;
  color: #ffffff;
}

.btn-k-whatsapp {
  background: #10b981;
  color: #ffffff;
}

.btn-k-disabled {
  background: #f1f5f9;
  color: #94a3b8;
  pointer-events: none;
  opacity: 0.6;
}

/* Card Notes Preview */
.k-notes {
  background: #f8fafc;
  border-left: 2.5px solid #cbd5e1;
  padding: 5px 8px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Card Footer */
.k-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
  gap: 6px;
}

.k-date {
  font-size: 10px;
  color: var(--muted);
}

.k-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-k-action {
  background: none;
  border: 1px solid transparent;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.btn-k-action:hover {
  background: #f1f5f9;
  border-color: var(--line);
  color: var(--ink);
}

.btn-k-action.del:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.btn-k-convert {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.25);
}

.btn-k-convert:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.35);
}

.btn-k-convert.converted {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  box-shadow: none;
  cursor: default;
}

@media (max-width: 900px) {
  .crm-stats-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .crm-stats-strip {
    grid-template-columns: 1fr;
  }
}


