/* Admin & Site Builder Styles */
:root {
  --admin-bg: #141414;
  --admin-surface: #1e1e1e;
  --admin-surface-hover: #262626;
  --admin-border: #333333;
  --admin-text: #f0f0f0;
  --admin-muted: #999999;
  --admin-accent: #3b82f6;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
}

body.admin-body {
  margin: 0;
  background: var(--admin-bg);
  color: var(--admin-text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
}

.admin-header {
  height: 68px;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.admin-brand .badge {
  background: #2b2b2b;
  border: 1px solid #444;
  color: #aaa;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.admin-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-user-pill {
  font-size: 12px;
  color: #bbb;
  background: #222;
  border: 1px solid #333;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--admin-success);
}

.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 80px;
}

/* Tabs */
.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--admin-border);
  margin-bottom: 28px;
}

.admin-tab-btn {
  background: none;
  border: none;
  color: var(--admin-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-tab-btn:hover {
  color: #fff;
}

.admin-tab-btn.active {
  color: #fff;
  border-bottom-color: #fff;
}

/* Builder Toolbar */
.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  position: sticky;
  top: 80px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.toolbar-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.toolbar-title p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--admin-muted);
}

.toolbar-buttons {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s;
}

.btn-primary {
  background: #fff;
  color: #111;
}

.btn-primary:hover {
  background: #e5e5e5;
  box-shadow: 0 0 16px rgba(255,255,255,0.25);
}

.btn-secondary {
  background: #2a2a2a;
  border-color: #444;
  color: #eee;
}

.btn-secondary:hover {
  background: #333;
  color: #fff;
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.4);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239,68,68,0.25);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Builder Sections Accordion */
.builder-sections {
  display: grid;
  gap: 18px;
}

.builder-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow: hidden;
}

.builder-card-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: #1c1c1c;
  transition: background .2s;
}

.builder-card-header:hover {
  background: #222;
}

.builder-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
}

.builder-card-title .icon {
  font-size: 18px;
}

.builder-card-body {
  padding: 24px;
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--admin-border);
}

.builder-card-body[hidden] {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: #ccc;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: #161616;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color .2s;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}

.form-group small {
  font-size: 11px;
  color: #777;
}

/* FAQ Items */
.faq-builder-item {
  background: #181818;
  border: 1px solid #383838;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
}

.faq-remove-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 14px;
}

.faq-remove-btn:hover {
  color: var(--admin-danger);
}

/* Tables */
.admin-table-wrap {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th {
  background: #181818;
  color: var(--admin-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #282828;
}

.admin-table tr:hover td {
  background: #242424;
}

.status-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-tag.pro {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
}

.status-tag.trial {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.3);
}

.status-tag.expired {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}

/* Toast */
.admin-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #252525;
  border: 1px solid #444;
  color: #fff;
  padding: 14px 22px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.admin-toast.success {
  border-color: rgba(16,185,129,0.5);
  background: #172a22;
  color: #86efac;
}

.admin-toast.error {
  border-color: rgba(239,68,68,0.5);
  background: #2c1a1a;
  color: #fca5a5;
}

/* Preview Modal */
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.preview-modal-bar {
  height: 54px;
  background: #181818;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.preview-modal-bar .title {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
}

.preview-modal-bar .modes {
  display: flex;
  gap: 8px;
}

.preview-iframe-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.preview-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1c1c1c;
  transition: width .3s ease;
}

.preview-iframe-wrap.mobile iframe {
  width: 390px;
  height: 844px;
  border-radius: 36px;
  box-shadow: 0 0 0 10px #2a2a2a, 0 20px 50px rgba(0,0,0,0.8);
}
