/* ===== BUILDER SHELL ===== */
.builder-body { display: flex; flex-direction: column; min-height: 100vh; background: #F5F0EB; }

/* Top bar */
.builder-topbar {
  height: 56px; background: #1A1A2E; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 200;
  font-family: 'Inter', sans-serif; font-size: 13px;
}
.builder-topbar-left, .builder-topbar-right { display: flex; align-items: center; gap: 12px; }
.builder-topbar-center { display: flex; align-items: center; gap: 10px; }
.topbar-brand { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 16px; color: #fff; text-decoration: none; }
.topbar-sep { color: rgba(255,255,255,0.3); }
.topbar-section { color: rgba(255,255,255,0.6); font-weight: 500; }
.topbar-site-name { color: #fff; font-weight: 600; }
.topbar-status { font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.status-draft { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.6); }
.status-live { background: rgba(34,197,94,0.2); color: #4ADE80; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 16px; border-radius: 6px; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer; border: none; transition: opacity 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: 0.85; text-decoration: none; }
.btn-primary { background: #FF8C00; color: #fff; }
.btn-outline { background: transparent; color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.2); }
.btn-ghost { color: rgba(255,255,255,0.7); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }

/* Layout */
.builder-layout { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.builder-sidebar {
  width: 200px; background: #fff; border-right: 1px solid rgba(26,26,46,0.1);
  display: flex; flex-direction: column; flex-shrink: 0;
}
.sidebar-nav { display: flex; flex-direction: column; padding: 12px 0; }
.sidebar-tab {
  padding: 10px 16px; text-align: left; background: none; border: none;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  color: #6B6B7B; border-left: 3px solid transparent; transition: all 0.15s;
}
.sidebar-tab:hover { color: #1A1A2E; background: #F5F0EB; }
.sidebar-tab.active { color: #FF8C00; border-left-color: #FF8C00; background: #FFF8EE; }
.sidebar-live-badge { margin-top: auto; padding: 12px 16px; border-top: 1px solid rgba(26,26,46,0.08); }
.live-link { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #22C55E; text-decoration: none; }
.live-dot { font-size: 10px; }

/* Main panel */
.builder-main { flex: 1; overflow-y: auto; padding: 40px; }
.panel { display: none; }
.panel-active { display: block; }
.panel-header { margin-bottom: 32px; }
.panel-header h2 { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; color: #1A1A2E; margin-bottom: 6px; }
.panel-header p { font-size: 14px; color: #6B6B7B; }
.panel-body { max-width: 680px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #1A1A2E; margin-bottom: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input {
  width: 100%; padding: 9px 12px; border: 1px solid rgba(26,26,46,0.15);
  border-radius: 6px; font-size: 14px; font-family: 'Inter', sans-serif;
  background: #fff; color: #1A1A2E; transition: border-color 0.15s; box-sizing: border-box;
}
.input:focus { outline: none; border-color: #FF8C00; }
.input-prefix { display: flex; align-items: center; background: #F5F0EB; border: 1px solid rgba(26,26,46,0.15); border-radius: 6px; padding: 0 12px; }
.input-prefix span { font-size: 13px; color: #6B6B7B; white-space: nowrap; padding-right: 8px; }
.input-prefix .input { border: none; background: transparent; }
select.input { appearance: auto; }
textarea.input { resize: vertical; min-height: 80px; }
.color-picker-row { display: flex; align-items: center; gap: 12px; }
.color-input { width: 48px; height: 40px; border: none; background: none; cursor: pointer; padding: 0; border-radius: 6px; }

/* Page cards */
.page-card { background: #fff; border: 1px solid rgba(26,26,46,0.1); border-radius: 10px; margin-bottom: 16px; overflow: hidden; }
.page-card-header { padding: 14px 20px; background: #F5F0EB; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(26,26,46,0.08); }
.page-card-header h4 { font-size: 14px; font-weight: 700; color: #1A1A2E; }
.page-slug { font-size: 12px; color: #6B6B7B; background: #fff; padding: 2px 8px; border-radius: 4px; }
.page-card-body { padding: 20px; }

/* Service item */
.service-item {
  background: #fff; border: 1px solid rgba(26,26,46,0.1); border-radius: 8px;
  padding: 14px 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px;
}
.service-item-name { font-size: 14px; font-weight: 600; color: #1A1A2E; flex: 1; }
.service-item-desc { font-size: 13px; color: #6B6B7B; flex: 1; }
.service-item-price { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: #FF8C00; }
.btn-icon {
  background: none; border: none; font-size: 20px; color: #6B6B7B; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; line-height: 1;
}
.btn-icon:hover { background: #F5F0EB; color: #1A1A2E; }

/* Add form */
.add-service-form {
  background: #F5F0EB; border-radius: 10px; padding: 24px; margin-top: 24px;
  border: 1px solid rgba(26,26,46,0.08);
}
.add-service-form h4 { font-size: 15px; font-weight: 700; color: #1A1A2E; margin-bottom: 16px; }

/* Design preview */
.design-preview { margin-top: 32px; }
.design-preview-label { font-size: 12px; font-weight: 600; color: #6B6B7B; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.design-preview-box { background: #fff; border-radius: 8px; padding: 28px; border-top: 4px solid; }
.preview-hero { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.preview-sub { font-size: 14px; color: #6B6B7B; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: #1A1A2E; color: #fff;
  padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
  font-family: 'Inter', sans-serif; z-index: 9999; animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Empty state */
.empty-state { font-size: 14px; color: #6B6B7B; padding: 16px 0; }

/* ===== TEMPLATE PREVIEW CARDS (Dashboard) ===== */
.template-visual-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.template-visual-card {
  border: 2px solid rgba(26,26,46,0.12);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  position: relative;
}
.template-visual-card:hover {
  border-color: rgba(255,140,0,0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.template-visual-card.selected {
  border-color: #FF8C00;
  background: #FFF8EE;
  box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}
.template-visual-card input[type="radio"] { display: none; }
.template-preview-art {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* Selection checkmark */
.template-visual-card.selected::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 20px; height: 20px;
  background: #FF8C00;
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M10 3L4.5 8.5 2 6'/%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
}
.template-visual-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #1A1A2E;
  text-align: center;
}
.template-visual-sub {
  font-size: 11px;
  color: #6B6B7B;
  text-align: center;
  margin-top: 2px;
}

/* ===== LIVE PREVIEW (Builder Editor) ===== */
.preview-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid rgba(26,26,46,0.1);
  border-radius: 8px;
}
.preview-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
}
.toggle-switch {
  position: relative; width: 40px; height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(26,26,46,0.2);
  border-radius: 22px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #FF8C00; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Live preview iframe */
.preview-container {
  display: none;
  background: #fff;
  border: 1px solid rgba(26,26,46,0.1);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.preview-container.active { display: block; }
.preview-toolbar {
  padding: 12px 20px;
  background: #F5F0EB;
  border-bottom: 1px solid rgba(26,26,46,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-toolbar-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6B6B7B; }
.preview-dots { display: flex; gap: 6px; }
.preview-dot { width: 12px; height: 12px; border-radius: 50%; }
.preview-dot-r { background: #FF5F57; }
.preview-dot-y { background: #FEBC2E; }
.preview-dot-g { background: #28C840; }
.preview-toolbar-url { font-family: 'Space Mono', monospace; font-size: 12px; color: #6B6B7B; }
.preview-iframe-wrap { height: 480px; overflow: hidden; }
.preview-iframe-wrap iframe {
  width: 100%; height: 100%; border: none;
  transform-origin: top left;
  transform: scale(0.75);
  pointer-events: none;
}

/* ===== PUBLISH MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(26,26,46,0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  max-width: 480px;
  width: 90%;
  animation: slideUp 0.2s ease;
  position: relative;
}
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 20px; right: 20px;
  font-size: 24px; color: #6B6B7B; cursor: pointer; background: none; border: none; line-height: 1;
}
.modal-close:hover { color: #1A1A2E; }
.modal-icon { font-size: 48px; margin-bottom: 16px; text-align: center; }
.modal h2 { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: #1A1A2E; margin-bottom: 8px; }
.modal p { font-size: 15px; color: #6B6B7B; margin-bottom: 24px; }

/* Publish checklist */
.publish-checklist { list-style: none; padding: 0; margin: 0 0 28px; }
.publish-checklist li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(26,26,46,0.06);
  font-size: 14px; color: #1A1A2E;
}
.publish-check-icon { width: 22px; height: 22px; border-radius: 50%; background: #FFF8EE; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.publish-check-icon.check { background: #DCFCE7; color: #16A34A; }
.publish-modal-actions { display: flex; gap: 10px; }

/* ===== CUSTOM DOMAIN ===== */
.domain-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.domain-status-badge.pending { background: #FFF7ED; color: #C2410C; }
.domain-status-badge.connected { background: #DCFCE7; color: #16A34A; }
.domain-status-badge.not-configured { background: #F5F0EB; color: #6B6B7B; }
.domain-instructions {
  background: #F5F0EB; border-radius: 8px; padding: 16px;
  margin-top: 16px; font-size: 13px; color: #6B6B7B;
}
.domain-instructions code {
  background: rgba(26,26,46,0.08); padding: 2px 6px; border-radius: 4px;
  font-family: 'Space Mono', monospace; font-size: 12px; color: #1A1A2E;
}

/* Responsive */
@media (max-width: 768px) {
  .builder-layout { flex-direction: column; }
  .builder-sidebar { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid rgba(26,26,46,0.1); }
  .sidebar-nav { flex-direction: row; padding: 0; }
  .sidebar-tab { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .sidebar-tab.active { border-bottom-color: #FF8C00; border-left-color: transparent; }
  .sidebar-live-badge { display: none; }
  .builder-main { padding: 24px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .template-visual-grid { grid-template-columns: repeat(2, 1fr); }
}