/* ─── PostForge — Application Styles ─────────────────────────────────────── */
/* Design: Dark editorial/industrial. Syne + DM Sans. Amber accents.          */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
  --bg-base:        #0a0c10;
  --bg-surface:     #111318;
  --bg-raised:      #171b22;
  --bg-overlay:     #1d2230;
  --border:         #232838;
  --border-light:   #2c3347;

  --amber:          #f59e0b;
  --amber-dark:     #d97706;
  --amber-light:    #fcd34d;
  --amber-dim:      rgba(245, 158, 11, 0.12);

  --blue:           #3b82f6;
  --blue-dim:       rgba(59, 130, 246, 0.12);
  --green:          #10b981;
  --green-dim:      rgba(16, 185, 129, 0.12);
  --red:            #ef4444;
  --red-dim:        rgba(239, 68, 68, 0.12);
  --purple:         #8b5cf6;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #4b5568;

  --font-display:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-amber: 0 0 24px rgba(245, 158, 11, 0.2);

  --sidebar-width: 240px;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-light); }

img { max-width: 100%; display: block; }

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
#app { min-height: 100vh; display: flex; flex-direction: column; }

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: var(--amber);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--amber);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-base);
  font-size: 14px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 8px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-raised);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--amber-dim);
  color: var(--amber);
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  cursor: pointer;
  transition: background 0.15s;
}

.user-badge:hover { background: var(--bg-overlay); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg-base);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  padding: 28px 32px 0;
  margin-bottom: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-body {
  padding: 0 32px 32px;
  flex: 1;
}

/* ─── Auth Layout ───────────────────────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

.auth-visual {
  flex: 1;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-visual-content {
  text-align: center;
  z-index: 1;
  padding: 40px;
}

.auth-visual-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 60%);
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.auth-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 48px;
  color: var(--amber);
  letter-spacing: -2px;
  line-height: 1;
  margin-bottom: 16px;
}

.auth-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

.auth-features {
  margin-top: 40px;
  text-align: left;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.auth-form-panel {
  width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px;
}

.auth-form-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ─── Form Elements ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-dim);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-input { flex: 1; }

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--amber);
  color: var(--bg-base);
}

.btn-primary:hover { background: var(--amber-dark); color: var(--bg-base); }

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover { background: var(--border-light); border-color: var(--text-muted); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-raised); color: var(--text-primary); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover { background: var(--green); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-sm { padding: 16px; border-radius: var(--radius-md); }
.card-flush { padding: 0; overflow: hidden; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ─── Grid & Layout Utilities ───────────────────────────────────────────────── */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* ─── Badges & Tags ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-amber  { background: var(--amber-dim); color: var(--amber); }
.badge-blue   { background: var(--blue-dim);  color: var(--blue); }
.badge-green  { background: var(--green-dim); color: var(--green); }
.badge-red    { background: var(--red-dim);   color: var(--red); }
.badge-gray   { background: var(--bg-overlay); color: var(--text-secondary); }
.badge-purple { background: rgba(139,92,246,0.12); color: var(--purple); }

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}

.alert-error   { background: var(--red-dim);   border: 1px solid rgba(239,68,68,0.3);   color: #fca5a5; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(16,185,129,0.3);  color: #6ee7b7; }
.alert-info    { background: var(--blue-dim);  border: 1px solid rgba(59,130,246,0.3);  color: #93c5fd; }
.alert-warning { background: var(--amber-dim); border: 1px solid rgba(245,158,11,0.3);  color: var(--amber-light); }

/* ─── Tables ────────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  background: var(--bg-surface);
  transition: background 0.1s;
}

tbody tr:hover { background: var(--bg-raised); }

/* ─── Site Cards ────────────────────────────────────────────────────────────── */
.site-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.site-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--amber) 0%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-card:hover { border-color: var(--amber); box-shadow: var(--shadow-amber); }
.site-card:hover::after { transform: scaleX(1); }

.site-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--amber-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.site-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 4px;
}

.site-card-url {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-card-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.site-card-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  line-height: 1;
  margin-bottom: 2px;
}

/* ─── Subject Queue ─────────────────────────────────────────────────────────── */
.subject-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.15s;
  cursor: default;
}

.subject-item:hover { border-color: var(--border-light); background: var(--bg-raised); }
.subject-item.dragging { opacity: 0.4; }

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.drag-handle:active { cursor: grabbing; }

.subject-title {
  flex: 1;
  font-weight: 500;
  font-size: 14px;
  min-width: 0;
}

.subject-keyword {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Generator / Post Preview ──────────────────────────────────────────────── */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  align-items: start;
}

.outline-editor {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.outline-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
}

.outline-section {
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.outline-section:last-child { border-bottom: none; }

.outline-section-heading {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.h2-label { color: var(--amber); font-size: 11px; font-weight: 700; }
.h3-label { color: var(--text-muted); font-size: 11px; font-weight: 700; }

.outline-points {
  padding: 0 16px 12px 36px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outline-point {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.outline-point::before {
  content: '·';
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.post-preview-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-preview-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.preview-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.preview-tab.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
  background: var(--bg-surface);
}

.preview-tab:hover:not(.active) { color: var(--text-secondary); }

.post-content-preview {
  padding: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-height: 600px;
  overflow-y: auto;
}

.post-content-preview h1,
.post-content-preview h2 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 16px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.post-content-preview h3 {
  color: var(--text-primary);
  margin: 12px 0 6px;
  font-size: 15px;
}

.post-content-preview p { margin-bottom: 12px; }
.post-content-preview ul, .post-content-preview ol { padding-left: 20px; margin-bottom: 12px; }
.post-content-preview li { margin-bottom: 4px; }
.post-content-preview strong { color: var(--text-primary); }

/* ─── Image Picker ──────────────────────────────────────────────────────────── */
.image-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.image-picker-item {
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.image-picker-item:hover { border-color: var(--amber); }
.image-picker-item.selected { border-color: var(--amber); box-shadow: var(--shadow-amber); }

.image-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.image-picker-item:hover img { transform: scale(1.04); }

.image-picker-item .select-overlay {
  position: absolute;
  inset: 0;
  background: rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 20px;
}

.image-picker-item.selected .select-overlay { opacity: 1; }

/* ─── SEO Fields ────────────────────────────────────────────────────────────── */
.seo-meter {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 4px;
  overflow: hidden;
}

.seo-meter-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease, background 0.3s;
}

.char-count {
  font-size: 11px;
  text-align: right;
  margin-top: 3px;
}

/* ─── Stats Cards ───────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-value.amber { color: var(--amber); }
.stat-value.green { color: var(--green); }
.stat-value.blue  { color: var(--blue); }

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ─── Modals ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1000px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
}

.modal-close:hover { background: var(--border-light); color: var(--text-primary); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── Loading States ────────────────────────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-pulse {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.pulse-dot:nth-child(2) { animation-delay: 0.2s; }
.pulse-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ─── Empty States ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ─── Demo Banner ───────────────────────────────────────────────────────────── */
.demo-banner {
  background: linear-gradient(135deg, rgba(245,158,11,0.15) 0%, rgba(245,158,11,0.05) 100%);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--amber-light);
  margin-bottom: 20px;
}

.demo-banner strong { font-weight: 700; }

/* ─── Dropdown ──────────────────────────────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: fade-in 0.1s ease;
  overflow: hidden;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: var(--border); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-dim); }

.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ─── Language Switcher ─────────────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.lang-btn {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  transition: all 0.15s;
}

.lang-btn.active {
  background: var(--amber);
  color: var(--bg-base);
}

/* ─── Step Indicator ────────────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-overlay);
  border: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.step.active .step-number { background: var(--amber); border-color: var(--amber); color: var(--bg-base); }
.step.done .step-number   { background: var(--green); border-color: var(--green); color: #fff; }
.step.active .step-label  { color: var(--text-primary); }
.step.done .step-label    { color: var(--text-muted); }
.step-label { color: var(--text-muted); }

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
  max-width: 40px;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .generator-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .page-header { padding: 20px 20px 0; }
  .page-body { padding: 0 20px 24px; }

  .auth-layout { flex-direction: column; }
  .auth-visual { display: none; }
  .auth-form-panel { width: 100%; padding: 32px 24px; }

  .grid-2 { grid-template-columns: 1fr; }
  .image-picker-grid { grid-template-columns: repeat(2, 1fr); }

  .mobile-menu-btn { display: flex; }
}

/* ─── Transitions ───────────────────────────────────────────────────────────── */
.v-enter-active, .v-leave-active { transition: opacity 0.2s ease, transform 0.2s ease; }
.v-enter-from, .v-leave-to { opacity: 0; transform: translateY(8px); }

.fade-enter-active, .fade-leave-active { transition: opacity 0.2s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ─── Token Progress ────────────────────────────────────────────────────────── */
.token-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.token-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber) 0%, var(--amber-dark) 100%);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ─── Tooltip ───────────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-overlay);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 300;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ─── Misc Utilities ────────────────────────────────────────────────────────── */
.text-amber    { color: var(--amber); }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.text-sm       { font-size: 12px; }
.text-xs       { font-size: 11px; }
.font-display  { font-family: var(--font-display); }
.font-mono     { font-family: 'Courier New', monospace; }
.font-bold     { font-weight: 700; }
.truncate      { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider       { height: 1px; background: var(--border); margin: 20px 0; }
.hidden        { display: none; }
.pointer       { cursor: pointer; }

/* ─── Page Load Animation ───────────────────────────────────────────────────── */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: slide-up 0.3s ease forwards; }
.animate-in-delay-1 { animation: slide-up 0.3s ease 0.05s both; }
.animate-in-delay-2 { animation: slide-up 0.3s ease 0.1s both; }
.animate-in-delay-3 { animation: slide-up 0.3s ease 0.15s both; }
.animate-in-delay-4 { animation: slide-up 0.3s ease 0.2s both; }
