/* ═══════════════════════════════════════════════
   DIGITAL MARKETING AUTOMATION — DARK PRO THEME
   ═══════════════════════════════════════════════ */

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

:root {
  --bg-base:      #f6f7fb;
  --bg-surface:   #ffffff;
  --bg-elevated:  #f8f9fc;
  --bg-hover:     #f2f4fa;
  --border:       rgba(17, 24, 39, 0.12);
  --border-soft:  rgba(17, 24, 39, 0.08);

  --accent:       #f36884;
  --accent-dim:   rgba(243, 104, 132, 0.14);
  --accent-glow:  rgba(243, 104, 132, 0.22);
  --accent-2:     #f59f61;
  --accent-2-dim: rgba(245, 159, 97, 0.14);
  --accent-3:     #ef4444;

  --text-primary:   #111827;
  --text-secondary: #4b5563;
  --text-muted:     #94a3b8;
  --text-accent:    #db4f73;

  --success: #10b981;
  --warning: #f59e0b;
  --error:   #ef4444;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --sidebar-w: 240px;
  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --shadow-sm:  0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md:  0 14px 34px rgba(15, 23, 42, 0.08);
  --shadow-lg:  0 20px 52px rgba(15, 23, 42, 0.12);
  --shadow-accent: 0 0 24px var(--accent-glow);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 85% -10%, rgba(245, 159, 97, 0.15), transparent 35%),
    radial-gradient(circle at -5% 30%, rgba(243, 104, 132, 0.14), transparent 30%),
    var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

body.app-locked .sidebar,
body.app-locked .main-content {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body.app-locked .loading-overlay {
  z-index: 2500;
}

/* ── LOGIN ───────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(243, 104, 132, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(245, 159, 97, 0.16), transparent 30%),
    rgba(246, 247, 251, 0.88);
  backdrop-filter: blur(12px);
}

.login-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--text-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 10px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 12px;
}

.login-error {
  margin-top: 12px;
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
}

body.app-locked .sidebar,
body.app-locked .main-content {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

body.app-locked .loading-overlay {
  z-index: 2500;
}

/* ── LOGIN ───────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(243, 104, 132, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(245, 159, 97, 0.16), transparent 30%),
    rgba(246, 247, 251, 0.88);
  backdrop-filter: blur(12px);
}

.login-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 30px;
}

.login-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--text-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 10px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 12px;
}

.login-error {
  margin-top: 12px;
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
}

/* ── AMBIENT BACKGROUND ─────────────────────── */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.2;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #f36884, transparent 70%);
  top: -200px; left: -100px;
  animation: orbFloat 18s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f59f61, transparent 70%);
  bottom: -150px; right: -150px;
  animation: orbFloat 22s ease-in-out infinite reverse;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #fb7185, transparent 70%);
  top: 40%; left: 40%;
  animation: orbFloat 15s ease-in-out infinite 3s;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(30px,-40px) scale(1.05); }
  66%       { transform: translate(-20px,20px) scale(0.95); }
}

/* ── SIDEBAR ────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  z-index: 100;
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 24px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 24px;
}
.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #f78da6 58%, var(--accent-2));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px var(--accent-glow);
}
.logo-text {
  display: flex;
  flex-direction: column;
}
.logo-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #111827, var(--text-accent));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.nav-section { flex: 1; }
.nav-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  text-align: left;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--text-accent);
  border: 1px solid rgba(243, 104, 132, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}
.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item span:nth-child(2) { flex: 1; }
.nav-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.nav-item.active .nav-badge {
  background: var(--accent);
  color: white;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.health-indicator {
  display: flex;
  gap: 6px;
}
.health-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}
.health-dot.ok  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.health-dot.err { background: var(--error); }
.health-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ── MAIN CONTENT ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 44px 52px;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-content.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── PAGE HEADER ────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 36px;
  gap: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #111827 10%, #334155 52%, var(--text-accent) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 8px;
  max-width: 680px;
}

/* ── STEP TRACKER ───────────────────────────── */
.step-tracker {
  display: flex;
  align-items: center;
  gap: 0;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s;
  cursor: default;
}
.step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
}
.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.step-line {
  width: 32px;
  height: 2px;
  background: var(--border);
}

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  border-color: rgba(243, 104, 132, 0.24);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}
.card-wide { max-width: 800px; }

.card-head {
  margin-bottom: 26px;
}
.card-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 4px;
}
.card-head p {
  color: var(--text-secondary);
  font-size: 13px;
}

.step-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c73d65;
  background: #fee7ee;
  padding: 3px 10px;
  border-radius: 4px;
}

/* ── STEP PANELS ────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }

/* ── INPUTS ─────────────────────────────────── */
.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 6px;
}
.input-field {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(243, 104, 132, 0.14);
}
.input-field::placeholder { color: var(--text-muted); }
.input-field-sm {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.input-field-sm:focus { border-color: var(--accent); }
textarea.input-field {
  resize: vertical;
  min-height: 80px;
}

/* ── BUTTONS ────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--accent), #f8839f 60%, var(--accent-2));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(243, 104, 132, 0.28);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(243, 104, 132, 0.32);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary.btn-sm { padding: 9px 16px; font-size: 13px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover {
  background: #fff5f7;
  color: var(--text-primary);
  border-color: var(--accent);
}
.btn-secondary.btn-sm { padding: 9px 16px; font-size: 13px; }

.btn-publish {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #f59f61, #ffb777);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 26px rgba(245, 159, 97, 0.34);
}
.btn-publish:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(245, 159, 97, 0.42);
}
.publish-icon { font-size: 18px; }

.btn-arrow { opacity: 0.7; }
.mt-16 { margin-top: 16px; }

/* ── CHIPS ──────────────────────────────────── */
.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text-accent);
  background: #fff5f7;
}

/* ── RESULT BLOCKS ──────────────────────────── */
.result-block {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 52px;
}
.result-block.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

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

.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

/* ── IMAGE PREVIEW ──────────────────────────── */
.image-preview {
  background: #fbfcff;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.image-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-md);
  object-fit: cover;
}
.image-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ── PUBLISH PREVIEW ────────────────────────── */
.publish-preview {
  background: #fcfdff;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}
.publish-preview .preview-topic {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.publish-preview .preview-caption {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.publish-preview .preview-hashtags {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 4px;
}

/* ── SCHEDULE ───────────────────────────────── */
.schedule-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}
.toggle-label input { display: none; }
.toggle-switch {
  width: 40px; height: 22px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 100px;
  position: relative;
  transition: all 0.2s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.2s;
}
.toggle-label input:checked + .toggle-switch {
  background: #ffd8e3;
  border-color: var(--accent);
}
.toggle-label input:checked + .toggle-switch::after {
  background: var(--accent);
  left: 20px;
}
.hidden { display: none !important; }

/* ── SEO GRID ───────────────────────────────── */
.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-top: 28px;
}
.seo-card-wide { grid-column: span 2; }

.seo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.seo-card:hover {
  border-color: rgba(243, 104, 132, 0.24);
  transform: translateY(-2px);
}

.seo-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.seo-card-icon {
  font-size: 22px;
  line-height: 1;
  margin-top: 2px;
}
.seo-card-header h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}
.seo-card-header p {
  font-size: 12px;
  color: var(--text-secondary);
}
.seo-card-header > :nth-child(2) { flex: 1; }

.seo-status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  white-space: nowrap;
}
.seo-status.running { background: rgba(108,99,255,0.15); color: var(--accent); }
.seo-status.done    { background: rgba(16,185,129,0.12); color: var(--success); }
.seo-status.error   { background: rgba(255,107,107,0.12); color: var(--error); }

.btn-seo {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.btn-seo:hover {
  background: #fff5f7;
  border-color: var(--accent);
  color: var(--text-accent);
}
.btn-seo:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.seo-result {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.autopost-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.autopost-actions .btn-seo {
  width: auto;
  min-width: 180px;
}

.autopost-preview {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
}

.autopost-placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.platform-checks {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.plat-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}
.plat-check:has(input:checked) {
  border-color: var(--accent);
  color: var(--text-accent);
  background: #fff5f7;
}
.plat-check input { display: none; }
.plat-icon { font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-icon {
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── KEYWORDS TABLE ─────────────────────────── */
.kw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.kw-table-scroll {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}
.kw-table th {
  text-align: left;
  padding: 6px 10px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.kw-table td {
  padding: 6px 10px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-secondary);
}
.kw-table tr:hover td { background: var(--bg-hover); }
.intent-badge {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}
.intent-informational { background: var(--accent-dim); color: var(--accent); }
.intent-commercial    { background: rgba(255,179,71,0.15); color: var(--warning); }
.intent-transactional { background: var(--accent-2-dim); color: var(--accent-2); }

/* ── SPINNER ────────────────────────────────── */
.spinner-ring {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-ring.large {
  width: 48px; height: 48px;
  border-width: 3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── LOADING OVERLAY ────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}
.loading-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ── TOAST ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
  border: 1px solid;
}
.toast.success {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.28);
  color: var(--success);
}
.toast.error {
  background: rgba(255,107,107,0.12);
  border-color: rgba(255,107,107,0.3);
  color: var(--error);
}
.toast.info {
  background: #fff5f7;
  border-color: rgba(243, 104, 132, 0.28);
  color: var(--text-accent);
}
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── KPI CARDS ──────────────────────────────── */
.kpi-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.kpi-card {
  flex: 1;
  min-width: 100px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}
.kpi-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-accent);
}
.kpi-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.kpi-change { font-size: 11px; margin-top: 2px; }
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--error); }

/* ── SUCCESS / ERROR RESULTS ────────────────── */
.result-success {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--success);
  font-size: 14px;
}
.result-error {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--error);
  font-size: 14px;
}
.result-info {
  background: #fff5f7;
  border: 1px solid rgba(243, 104, 132, 0.24);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-accent);
  font-size: 13px;
}

/* ── INSIGHT LIST ───────────────────────────── */
.insight-list {
  list-style: none;
  padding: 0;
}
.insight-list li {
  padding: 6px 0 6px 16px;
  position: relative;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-soft);
}
.insight-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ── MONO TEXT ──────────────────────────────── */
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ── SCROLLBAR ──────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1100px) {
  .seo-grid {
    grid-template-columns: 1fr 1fr;
  }
  .seo-card-wide { grid-column: span 2; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .logo-text, .nav-label, .nav-item span:not(.nav-icon):not(.nav-badge),
  .sidebar-footer .health-label { display: none; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { padding: 22px 18px; }
  .page-title { font-size: 30px; }
  .seo-grid { grid-template-columns: 1fr; }
  .seo-card-wide { grid-column: span 1; }
  .autopost-actions .btn-seo {
    width: 100%;
  }
}
