/* ═══════════════════════════════════════════════
   FORT SITES — Painel do Cliente
   Design: Dark + Verde Esmeralda (Agência Fort)
   ═══════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0A0A0F;
  --bg2: #0E0E15;
  --surface: #111118;
  --surface2: #1A1A24;
  --surface3: #22222E;
  --border: #2A2A3A;
  --border-light: #33334A;
  --text: #F0FDF4;
  --text2: #9CA3AF;
  --text3: #6B7280;
  --accent: #10B981;
  --accent2: #34D399;
  --accent-glow: #6EE7B7;
  --accent-bg: rgba(16, 185, 129, 0.08);
  --red: #EF4444;
  --yellow: #F59E0B;
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ─── SCREENS ───────────────────────────────── */
.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ─── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--accent2);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-large { padding: 16px 40px; font-size: 1rem; border-radius: var(--radius); }

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ═══ ONBOARDING ════════════════════════════ */
.onboard-container {
  width: 100%;
  height: 100vh;
  position: relative;
}

.onboard-step {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.onboard-step.active { display: flex; }

.onboard-center {
  text-align: center;
  max-width: 560px;
  padding: 24px;
}

.onboard-center.wide { max-width: 900px; }

.onboard-center h1 {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.onboard-center h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.accent { color: var(--accent); }

.subtitle {
  color: var(--text2);
  font-size: 1rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.hint {
  color: var(--text3);
  font-size: 0.8rem;
  margin-top: 16px;
}

.step-indicator {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--bg);
  margin: 0 auto 20px;
}

.input-large {
  width: 100%;
  padding: 18px 20px;
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  text-align: center;
  transition: border-color 0.3s;
  margin-bottom: 24px;
}

.input-large:focus { border-color: var(--accent); }

.input-large::placeholder { color: var(--text3); }

.step-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ─── NICHE GRID ────────────────────────────── */
.niche-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.niche-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.niche-card:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.niche-card.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.niche-icon { font-size: 1.6rem; margin-bottom: 8px; }

.niche-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}

/* ─── TEMPLATE GRID ─────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.template-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.15);
}

.template-preview {
  height: 180px;
  background: var(--surface2);
  position: relative;
  overflow: hidden;
}

.template-preview iframe {
  width: 400%;
  height: 400%;
  border: none;
  transform: scale(0.25);
  transform-origin: top left;
  pointer-events: none;
}

.template-info {
  padding: 16px;
}

.template-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.template-desc {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.4;
}

/* ─── LOADING ───────────────────────────────── */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══ PAINEL PRINCIPAL ══════════════════════ */
.panel-layout {
  display: flex;
  height: 100vh;
  width: 100%;
}

/* ─── SIDEBAR ───────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.logo-small {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
}

.logo-icon-sm {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--bg);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text2);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sidebar-link:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-bg);
  color: var(--accent);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.usage-info { margin-bottom: 12px; }

.usage-label {
  font-size: 0.72rem;
  color: var(--text3);
  display: block;
  margin-bottom: 6px;
}

.usage-bar {
  width: 100%;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.usage-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

.usage-count {
  font-size: 0.72rem;
  color: var(--text3);
}

.plan-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

/* ─── TOPBAR ────────────────────────────────── */
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.site-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.site-status.online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent);
}

.site-status.draft {
  background: rgba(245, 158, 11, 0.1);
  color: var(--yellow);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ─── URL BAR ───────────────────────────────── */
.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  min-width: 0;
}

.url-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0 14px;
  height: 32px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

.url-bar-icon {
  color: var(--text3);
  flex-shrink: 0;
  margin-right: 8px;
}

.url-bar-domain {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.url-bar-sep {
  font-size: 0.78rem;
  color: var(--text3);
  margin: 0 1px;
}

.url-bar-page {
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  outline: none;
  padding: 0;
  min-width: 0;
}

.url-bar-page option {
  background: var(--surface);
  color: var(--text);
}

.url-bar-domain {
  cursor: pointer;
  transition: opacity 0.15s;
}

.url-bar-domain:hover {
  opacity: 0.7;
}

.url-bar-edit {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  padding: 0;
  width: 120px;
}

/* ─── PANEL MAIN ────────────────────────────── */
.panel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── WORKSPACE (PREVIEW + CHAT) ────────────── */
.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.preview-area {
  flex: 1;
  background: var(--bg2);
  padding: 16px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.preview-frame {
  width: 100%;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}

.preview-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ─── CHAT ──────────────────────────────────── */
.chat-area {
  width: 380px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  flex-shrink: 0;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.chat-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.chat-hint {
  font-size: 0.75rem;
  color: var(--text3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}

.chat-msg.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

.chat-msg.user .chat-avatar {
  background: var(--surface3);
  color: var(--text2);
}

.chat-bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

.chat-msg.user .chat-bubble {
  background: var(--accent-bg);
  border-color: rgba(16, 185, 129, 0.2);
}

.chat-suggestions {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-suggestions li {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--accent2);
  cursor: pointer;
  transition: all 0.2s;
}

.chat-suggestions li:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input-area textarea {
  flex: 1;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color 0.2s;
}

.chat-input-area textarea:focus { border-color: var(--accent); }
.chat-input-area textarea::placeholder { color: var(--text3); }

.chat-send {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send:hover { background: var(--accent2); }

/* ─── TAB CONTENT ───────────────────────────── */
.tab-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.tab-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ─── PAGES LIST ────────────────────────────── */
.pages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.page-item:hover { border-color: var(--border-light); }

.page-item-info {
  min-width: 0;
}

.page-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.page-item-url {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0.8;
}

.page-item-url svg {
  flex-shrink: 0;
  color: var(--text3);
}

.page-item-url[onclick] {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 8px;
  margin: -4px -8px;
  transition: background 0.15s;
}

.page-item-url[onclick]:hover {
  background: rgba(16, 185, 129, 0.08);
}

.page-slug-edit-icon {
  color: var(--text3);
  opacity: 0;
  transition: opacity 0.15s;
}

.page-item-url[onclick]:hover .page-slug-edit-icon {
  opacity: 1;
}

.page-slug-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  outline: none;
  padding: 0;
  width: 140px;
}

.page-item-actions {
  display: flex;
  gap: 8px;
}

/* ─── SETTINGS ──────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.setting-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.setting-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.setting-field {
  margin-bottom: 16px;
}

.setting-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
}

.setting-field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.setting-field input:focus { border-color: var(--accent); }

.setting-hint {
  font-size: 0.75rem;
  color: var(--text3);
  margin-top: 6px;
}

.domain-display {
  padding: 10px 14px;
  background: var(--accent-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
}

.plan-current {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.plan-name-lg {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.plan-price-lg {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text2);
}

.plan-features-list {
  list-style: none;
}

.plan-features-list li {
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text2);
}

.plan-features-list li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 800;
}

/* ─── SCROLLBAR ─────────────────────────────── */
.chat-messages::-webkit-scrollbar,
.tab-content::-webkit-scrollbar { width: 5px; }
.chat-messages::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── DEVICE TOGGLE ─────────────────────────── */
.device-toggle {
  display: flex;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.device-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.15s;
}

.device-btn:first-child {
  border-right: 1px solid var(--border);
}

.device-btn:hover {
  color: var(--text2);
  background: var(--surface3);
}

.device-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* ─── PREVIEW MOBILE ────────────────────────── */
.preview-area.preview-mobile {
  align-items: center;
  justify-content: center;
}

.preview-area.preview-mobile .preview-frame {
  width: 375px;
  max-width: 375px;
  height: 100%;
  max-height: 812px;
  border-radius: 40px;
  border: 4px solid var(--border-light);
  position: relative;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5), inset 0 0 0 2px var(--surface3);
}

.preview-area.preview-mobile .preview-frame::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: var(--bg);
  border-radius: 0 0 16px 16px;
  z-index: 10;
}

.preview-area.preview-mobile .preview-frame::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: var(--surface3);
  border-radius: 4px;
  z-index: 11;
}

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 1024px) {
  .chat-area { width: 320px; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* ─── BADGE ─────────────────────────────────── */
.msg-badge {
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: auto;
}

/* ─── MENSAGENS ─────────────────────────────── */
.messages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}

.messages-empty p {
  color: var(--text2);
  font-weight: 600;
  font-size: 1rem;
}

.messages-empty span {
  color: var(--text3);
  font-size: 0.82rem;
  max-width: 320px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px;
}

.msg-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.msg-card:hover {
  border-color: var(--accent);
}

.msg-card.unread {
  border-left: 3px solid var(--accent);
}

.msg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.msg-card-sender {
  font-weight: 700;
  font-size: 0.9rem;
}

.msg-card-time {
  font-size: 0.72rem;
  color: var(--text3);
}

.msg-card-preview {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.4;
}

.msg-card-fields {
  margin-top: 10px;
  display: none;
}

.msg-card.expanded .msg-card-fields {
  display: block;
}

.msg-field {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.msg-field:last-child {
  border-bottom: none;
}

.msg-field-label {
  color: var(--text3);
  min-width: 100px;
  font-weight: 600;
  text-transform: capitalize;
}

.msg-field-value {
  color: var(--text);
}

.msg-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.msg-card.expanded .msg-card-actions {
  display: flex;
}

/* ─── BLOG CONFIG ───────────────────────────── */
.blog-config {
  padding: 16px 24px;
}

.layout-selector {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.layout-option {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  min-width: 80px;
}

.layout-option:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.layout-option.active {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.06);
}

.layout-preview {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
}

.layout-preview.cols-1 { grid-template-columns: 1fr; }
.layout-preview.cols-2 { grid-template-columns: 1fr 1fr; }
.layout-preview.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.layout-preview.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.layout-preview span {
  display: block;
  height: 24px;
  background: var(--border);
  border-radius: 3px;
}

.layout-option.active .layout-preview span {
  background: var(--accent);
  opacity: 0.5;
}

.layout-option small {
  font-size: 0.68rem;
  color: var(--text3);
  font-weight: 600;
}

.layout-option.active small {
  color: var(--accent);
}

.blog-config-preview {
  margin-top: 8px;
}

.blog-layout-demo {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
  margin-top: 8px;
}

.demo-card {
  height: 80px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ─── BLOG FORM + POSTS ────────────────────── */
.blog-form {
  padding: 16px 24px;
}

.blog-form-inner {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text2);
}

.form-hint {
  font-weight: 400;
  color: var(--text3);
  font-size: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent);
}

.post-content-editor {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
}

.blog-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

.blog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  gap: 12px;
}

.blog-empty p {
  color: var(--text2);
  font-weight: 600;
  font-size: 1rem;
}

.blog-empty span {
  color: var(--text3);
  font-size: 0.82rem;
  max-width: 320px;
}

.blog-posts-list {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blog-post-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: border-color 0.15s;
}

.blog-post-card:hover {
  border-color: var(--accent);
}

.blog-post-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.blog-post-card-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.blog-post-card-cat {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.blog-post-card-excerpt {
  font-size: 0.82rem;
  color: var(--text2);
  margin-bottom: 10px;
  line-height: 1.4;
}

.blog-post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-post-card-date {
  font-size: 0.72rem;
  color: var(--text3);
}

.blog-post-card-actions {
  display: flex;
  gap: 6px;
}

/* ─── TAB DESC ───────────────────────────────── */
.tab-desc {
  padding: 0 24px 16px;
  font-size: 0.82rem;
  color: var(--text3);
  line-height: 1.5;
}

/* ─── MENU BUILDER ──────────────────────────── */
.menu-builder { padding: 0 24px 24px; }

.menu-items { min-height: 60px; }

.menu-empty {
  text-align: center;
  color: var(--text3);
  padding: 32px;
  font-size: 0.85rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  transition: border-color 0.15s, padding-left 0.2s, background 0.15s;
  user-select: none;
}

.menu-item.mi-child {
  border-left: 3px solid rgba(16,185,129,0.3);
}

.menu-item.mi-dragging {
  border-color: var(--accent);
  background: rgba(16,185,129,0.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.menu-item .mi-grip {
  color: var(--text3);
  cursor: grab;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 2px;
}

.menu-item .mi-grip:active { cursor: grabbing; }

.menu-item .mi-label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: default;
}

.menu-item .mi-label:hover { color: var(--accent); }

.mi-label-input {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 8px;
  outline: none;
}

.menu-item .mi-url {
  font-size: 0.7rem;
  color: var(--text3);
  margin-right: 4px;
  flex-shrink: 0;
}

.menu-item .mi-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.mi-type-badge {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.mi-type-badge.normal { background: rgba(255,255,255,0.06); color: var(--text3); }
.mi-type-badge.cta { background: rgba(239,68,68,0.15); color: #ef4444; }
.mi-type-badge.mega { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.mi-type-badge.sub { background: rgba(16,185,129,0.1); color: var(--accent); }

.mi-type-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.7rem;
  padding: 3px 4px;
  cursor: pointer;
  outline: none;
}
.mi-type-select:focus { border-color: var(--accent); }

.menu-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mi-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.mi-btn:hover:not(:disabled) { color: var(--accent); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.06); }
.mi-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.mi-remove-btn:hover:not(:disabled) { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }

/* ─── MEGA MENU EDITOR ─────────────────────── */
.mega-editor {
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  background: var(--surface2);
  overflow: hidden;
}

.mega-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(139,92,246,0.15);
  background: rgba(139,92,246,0.04);
}

.mega-editor-header .mi-label { flex: 1; font-size: 0.85rem; font-weight: 600; cursor: default; }
.mega-editor-header .mi-label:hover { color: var(--accent); }
.mega-editor-header .mi-url { font-size: 0.7rem; color: var(--text3); }
.mega-editor-header .mi-actions { display: flex; gap: 4px; align-items: center; }

.mega-columns {
  display: flex;
  gap: 8px;
  padding: 12px;
  overflow-x: auto;
  align-items: flex-start;
}

.mega-column {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.mega-col-header {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}

.mega-col-title {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.15s;
}

.mega-col-title:focus { border-color: var(--accent); background: var(--surface2); }
.mega-col-title::placeholder { color: var(--text3); font-weight: 400; }

/* Dica de arrastar itens para o mega menu */
.mega-drop-tip {
  font-size: 0.72rem;
  color: var(--accent);
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.06);
  border-radius: 6px;
  margin-bottom: 8px;
  text-align: center;
  border: 1px dashed rgba(16, 185, 129, 0.25);
}

/* Itens do menu arrastáveis */
.menu-item[draggable="true"] { cursor: grab; }
.menu-item[draggable="true"]:active, .menu-item.mi-dragging { cursor: grabbing; opacity: 0.6; }

/* Zona de drop nas colunas */
.mega-col-drop {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 50px;
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 8px;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.mega-col-drop-active {
  border-color: var(--accent) !important;
  background: rgba(16, 185, 129, 0.08) !important;
}

.mega-drop-hint {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text3);
  padding: 6px;
  opacity: 0.6;
}

.mega-col-drop .mega-link-chip ~ .mega-drop-hint { display: none; }

/* Chips dos links adicionados */
.mega-link-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 8px;
}

.mega-link-chip-name {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}

.mega-link-chip-url {
  font-size: 0.65rem;
  color: var(--text3);
  font-family: monospace;
}

.mega-link-chip-remove {
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}

.mega-link-chip-remove:hover { color: #ef4444; }

.mega-add-col-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 80px;
  min-height: 80px;
  background: none;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--text3);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.mega-add-col-btn span { font-size: 1.2rem; }
.mega-add-col-btn:hover { border-color: #8b5cf6; color: #8b5cf6; }

/* ─── DESIGN TAB ────────────────────────────── */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.color-input {
  width: 48px;
  height: 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 2px;
  background: var(--surface2);
}

.color-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: #fff; }

.font-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.font-option {
  padding: 10px 16px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
  font-size: 0.88rem;
}

.font-option:hover { border-color: rgba(16,185,129,0.4); }
.font-option.active { border-color: var(--accent); background: rgba(16,185,129,0.06); }

/* ─── SEO TAB ───────────────────────────────── */
.seo-page-selector {
  padding: 0 24px 16px;
}

.google-preview {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: Arial, sans-serif;
}

.gp-title {
  color: #1a0dab;
  font-size: 1.1rem;
  font-weight: 400;
  margin-bottom: 2px;
  text-decoration: underline;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gp-url {
  color: #006621;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.gp-desc {
  color: #545454;
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.char-count {
  font-size: 0.7rem;
  color: var(--text3);
  text-align: right;
  display: block;
  margin-top: 2px;
}

/* ─── TOGGLE SWITCH ─────────────────────────── */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .chat-area { width: 100%; position: fixed; bottom: 0; height: 50vh; z-index: 50; }
  .niche-grid { grid-template-columns: repeat(2, 1fr); }
  .template-grid { grid-template-columns: 1fr 1fr; }
}
