:root {
  --bg-dark: #0f1114;
  --bg-section: #161921;
  --bg-card: #1c2029;
  --fg: #e8e9ed;
  --fg-muted: #9499a8;
  --accent: #e8842c;
  --accent-glow: rgba(232, 132, 44, 0.15);
  --accent-bright: #f5a623;
  --border: rgba(255, 255, 255, 0.06);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-dark);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Editor Navigation */
.editor-nav {
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.back-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover { color: #fff; }

.name-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 4px 8px;
  width: 200px;
  transition: border-color 0.2s, background 0.2s;
}

.name-input:hover,
.name-input:focus {
  border-color: var(--border);
  background: var(--bg-card);
  outline: none;
}

.editor-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pro-nav {
  background: var(--accent-glow);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  border: 1px solid rgba(232, 132, 44, 0.3);
  text-decoration: none;
  transition: background 0.2s;
}

.btn-pro-nav:hover { background: rgba(232, 132, 44, 0.25); }

button, .btn-save, .btn-preview {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-save {
  background: var(--accent);
  color: #fff;
  border: none;
}

.btn-save:hover { background: var(--accent-bright); }

.btn-preview { background: var(--bg-card); }
.btn-preview:hover { border-color: rgba(255,255,255,0.15); color: #fff; }

.btn-exit {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}

.btn-exit:hover { color: #fff; border-color: rgba(255,255,255,0.15); }

/* Pro Banner */
.pro-banner {
  background: var(--accent-glow);
  border-bottom: 1px solid rgba(232, 132, 44, 0.2);
  padding: 10px 24px;
  text-align: center;
  font-size: 0.9rem;
}

.pro-banner span { color: var(--fg-muted); }

.pro-banner a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.pro-banner a:hover { text-decoration: underline; }

/* Layout */
.editor-layout {
  display: flex;
  height: calc(100vh - 56px);
}

.editor-sidebar {
  width: 240px;
  background: var(--bg-section);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-section h3 {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

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

.template-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.template-btn:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
}

.template-btn.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.template-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.template-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
}

.section-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg-muted);
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.2s, color 0.2s;
}

.section-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}

.section-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pro-section {
  position: relative;
}

.pro-tag {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.ai-btn {
  display: block;
  width: 100%;
  background: var(--accent-glow);
  border: 1px solid rgba(232, 132, 44, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.ai-btn:hover { background: rgba(232, 132, 44, 0.2); }

.ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Main Editor */
.editor-main {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  display: flex;
  justify-content: center;
}

.resume-editor-area {
  width: 100%;
  max-width: 800px;
}

.resume-content {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Georgia', serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 48px 40px;
  min-height: 600px;
  border-radius: 2px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  outline: none;
}

.resume-content:focus {
  box-shadow: 0 4px 32px rgba(232, 132, 44, 0.15);
}

/* Preview Pane */
.editor-preview {
  width: 50%;
  overflow-y: auto;
  padding: 40px;
  background: var(--bg-section);
  border-left: 1px solid var(--border);
  justify-content: center;
}

.preview-content {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Georgia', serif;
  font-size: 14px;
  padding: 48px 40px;
  min-height: 600px;
  border-radius: 2px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .editor-sidebar { display: none; }
  .editor-preview { display: none !important; }
}