/* ===================================================================
   AW Auto — Command Center
   Design system: dark automotive premium
   =================================================================== */

/* ── Design Tokens ────────────────────────────────────── */
:root {
  --bg:          #0b0f14;
  --bg-sidebar:  #111820;
  --bg-card:     #151c25;
  --bg-card-hover: #1a2332;
  --cyan:        #00b8d9;
  --cyan-dim:    rgba(0, 184, 217, 0.12);
  --cyan-glow:   rgba(0, 184, 217, 0.25);
  --gold:        #d4a843;
  --gold-dim:    rgba(212, 168, 67, 0.12);
  --green:       #22c55e;
  --green-dim:   rgba(34, 197, 94, 0.12);
  --red:         #ef4444;
  --red-dim:     rgba(239, 68, 68, 0.12);
  --text:        #e8eaed;
  --text-muted:  #7a8599;
  --border:      rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow:      0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.4);
  --radius:      10px;
  --radius-btn:  8px;
  --radius-badge: 20px;
  --font-heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w:   240px;
  --topbar-h:    64px;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--cyan);
  color: #0b0f14;
  font-weight: 700;
}
.btn-primary:hover { background: #00cfef; box-shadow: 0 0 20px var(--cyan-glow); }

.btn-success {
  background: var(--green);
  color: #0b0f14;
  font-weight: 700;
}
.btn-success:hover { background: #34d56e; box-shadow: 0 0 20px rgba(34,197,94,0.3); }

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger-outline:hover { background: var(--red-dim); }

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.04); }


/* ===================================================================
   LOGIN PAGE
   =================================================================== */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0b0f14 0%, #111820 50%, #0d1219 100%);
  position: relative;
  overflow: hidden;
}

/* Subtle radial glow behind card */
.login-body::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,184,217,0.06) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 48px 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  text-align: center;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.login-brand { margin-bottom: 8px; }

.login-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1;
}

.login-tagline {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
}

.login-divider {
  width: 48px;
  height: 2px;
  background: var(--cyan);
  margin: 24px auto;
  border-radius: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.login-field { position: relative; }

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.login-input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-btn);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input::placeholder { color: var(--text-muted); }

.login-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.login-input:focus ~ .login-input-icon,
.login-input:focus + .login-input-icon {
  color: var(--cyan);
}

/* fix icon color on focus — icon is before input */
.login-input-wrap:focus-within .login-input-icon {
  color: var(--cyan);
}

.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 4px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

.login-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Shake animation for error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-6px); }
  30%, 70% { transform: translateX(6px); }
}

.login-card.shake {
  animation: shake 0.5s ease;
}


/* ===================================================================
   DASHBOARD LAYOUT
   =================================================================== */

.dashboard-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Sidebar ──────────────────────────────────────────── */

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

.sidebar-header {
  padding: 28px 20px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.sidebar-brand { display: flex; flex-direction: column; }

.sidebar-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1;
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 3px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--radius-btn);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--cyan);
  background: var(--cyan-dim);
  border-left-color: var(--cyan);
}

.nav-item svg { flex-shrink: 0; }

.nav-label { white-space: nowrap; overflow: hidden; }

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

.nav-logout { color: var(--text-muted); }
.nav-logout:hover { color: var(--red); background: var(--red-dim); }

/* ── Sidebar overlay (mobile) ─────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Main wrapper ─────────────────────────────────────── */

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

/* ── Top bar ──────────────────────────────────────────── */

.topbar {
  height: var(--topbar-h);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-menu {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.topbar-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.topbar-greeting {
  font-size: 14px;
  color: var(--text-muted);
}

.topbar-greeting strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Main content ─────────────────────────────────────── */

.main-content {
  flex: 1;
  padding: 28px 32px 48px;
  animation: fadeIn 0.3s ease;
}


/* ===================================================================
   OVERVIEW — STAT CARDS
   =================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

/* Bottom accent border */
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.stat-card.stat-cyan::after  { background: var(--cyan); }
.stat-card.stat-gold::after  { background: var(--gold); }
.stat-card.stat-green::after { background: var(--green); }
.stat-card.stat-red::after   { background: var(--red); }

/* Background icon */
.stat-card-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.stat-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-number.color-cyan { color: var(--cyan); }
.stat-number.color-gold { color: var(--gold); }
.stat-number.color-green { color: var(--green); }
.stat-number.color-red { color: var(--red); }

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Overview activity section ────────────────────────── */

.section-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.activity-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px 0;
}


/* ===================================================================
   BLOG QUEUE
   =================================================================== */

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-size: 14px;
}

.queue-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 20px 24px;
  border-left: 4px solid var(--cyan);
  transition: all 0.35s ease;
  overflow: hidden;
  max-height: 400px;
  animation: slideIn 0.3s ease;
}

.queue-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  border-left-color: var(--cyan);
}

.queue-item.removing {
  opacity: 0;
  transform: translateX(60px);
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: -12px;
}

.queue-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.queue-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.queue-item-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-badge);
  background: var(--cyan-dim);
  color: var(--cyan);
}

.queue-item-date {
  font-size: 12px;
  color: var(--text-muted);
}

.queue-item-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.queue-item-full {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
  display: none;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.queue-item-full.expanded { display: block; }

.queue-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-expand-btn {
  background: none;
  border: none;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--font-body);
}
.queue-expand-btn:hover { text-decoration: underline; }


/* ===================================================================
   PLATFORM-SPECIFIC QUEUE CARDS — REDESIGNED
   =================================================================== */

/* ===== INSTAGRAM — Phone Preview Cards ===== */

.ig-phone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 400px));
  gap: 24px;
  justify-content: center;
}

.ig-phone-card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  border: none;
  border-left: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
  max-width: 420px;
  padding: 0;
  max-height: none;
}

.ig-phone-card:hover {
  background: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2), 0 0 0 1px rgba(0,0,0,0.06);
}

.ig-phone-card.removing {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

/* Image carousel */
.ig-preview-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #f0f0f0;
  overflow: hidden;
}

.ig-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}

.ig-preview-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
}

.ig-carousel-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

.ig-carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}

.ig-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  transition: background 0.2s;
}

.ig-dot.active {
  background: #fff;
}

.ig-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: background 0.15s;
  z-index: 2;
}

.ig-carousel-btn:hover {
  background: #fff;
}

.ig-carousel-prev { left: 10px; }
.ig-carousel-next { right: 10px; }

/* Profile row */
.ig-preview-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 4px;
}

.ig-preview-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ig-preview-profile-text {
  display: flex;
  flex-direction: column;
}

.ig-preview-username {
  font-size: 13px;
  font-weight: 600;
  color: #262626;
}

.ig-preview-sponsored {
  font-size: 11px;
  color: #8e8e8e;
}

/* Caption */
.ig-preview-caption-wrap {
  padding: 4px 16px 4px;
}

.ig-preview-caption-short,
.ig-preview-caption-full {
  font-size: 13px;
  color: #262626;
  line-height: 1.5;
  white-space: pre-line;
}

.ig-preview-caption-short strong,
.ig-preview-caption-full strong {
  font-weight: 600;
  color: #262626;
}

.ig-more-btn {
  background: none;
  border: none;
  color: #8e8e8e;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}

.ig-more-btn:hover {
  color: #555;
}

/* Hashtags */
.ig-preview-hashtags {
  padding: 4px 16px 8px;
  font-size: 12px;
  color: #00376b;
  line-height: 1.6;
}

.ig-preview-hashtag {
  color: #00376b;
  margin-right: 2px;
}

/* Action buttons */
.ig-preview-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #efefef;
  margin-top: 4px;
}

.ig-post-btn {
  flex: 1;
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
}

.ig-post-btn:hover {
  box-shadow: 0 2px 12px rgba(225, 48, 108, 0.35);
  transform: translateY(-1px);
}

.ig-reject-btn {
  background: transparent;
  color: #8e8e8e;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid #dbdbdb;
  border-radius: 8px;
}

.ig-reject-btn:hover {
  border-color: #aaa;
  color: #555;
}


/* ===== FACEBOOK — Post Preview Cards ===== */

.fb-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 520px));
  gap: 24px;
  justify-content: center;
}

.fb-preview-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  border-left: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  max-width: 560px;
  padding: 0;
  max-height: none;
}

.fb-preview-card:hover {
  background: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.06);
}

.fb-preview-card.removing {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

/* Header */
.fb-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 0;
}

.fb-preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fb-preview-header-text {
  flex: 1;
}

.fb-preview-page-name {
  font-size: 14px;
  font-weight: 600;
  color: #050505;
}

.fb-preview-time {
  font-size: 12px;
  color: #65676b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fb-preview-time svg { color: #65676b; }

.fb-preview-dots {
  font-size: 22px;
  color: #65676b;
  padding: 0 4px;
  cursor: default;
  letter-spacing: 1px;
  line-height: 1;
  margin-left: auto;
}

/* Post text */
.fb-preview-text {
  padding: 10px 16px 12px;
  font-size: 14px;
  color: #050505;
  line-height: 1.55;
  white-space: pre-line;
}

/* Image */
.fb-preview-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.fb-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fb-preview-more-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-top-left-radius: 8px;
}

/* Engagement bar */
.fb-preview-engagement {
  padding: 0 16px;
}

.fb-preview-reactions {
  display: flex;
  gap: 2px;
  padding: 8px 0 6px;
}

.fb-reaction-icon {
  font-size: 16px;
}

.fb-preview-engagement-divider {
  height: 1px;
  background: #e4e6eb;
  margin: 0;
}

.fb-preview-eng-row {
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
}

.fb-eng-action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #65676b;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: default;
}

/* Action buttons */
.fb-preview-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid #e4e6eb;
}

.fb-post-btn {
  flex: 1;
  background: #1877f2;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
}

.fb-post-btn:hover {
  background: #166fe5;
  box-shadow: 0 2px 12px rgba(24, 119, 242, 0.3);
  transform: translateY(-1px);
}

.fb-reject-btn {
  background: transparent;
  color: #65676b;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid #dadde1;
  border-radius: 8px;
}

.fb-reject-btn:hover {
  border-color: #bec3c9;
  color: #444;
}


/* ===== YOUTUBE — Video Preview Cards ===== */

.yt-video-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.yt-preview-card {
  background: #0f0f0f;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  border-left: none;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
  padding: 0;
  max-height: none;
}

.yt-preview-card:hover {
  background: #0f0f0f;
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.yt-preview-card.removing {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

/* Video player */
.yt-preview-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
}

.yt-preview-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.yt-preview-player.yt-preview-pending {
  display: flex;
  align-items: center;
  justify-content: center;
}

.yt-preview-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: absolute;
  inset: 0;
}

.yt-pending-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.7);
  z-index: 1;
}

.yt-pending-badge {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* Info section */
.yt-preview-info {
  padding: 16px 20px 20px;
}

.yt-preview-title {
  font-size: 17px;
  font-weight: 600;
  color: #f1f1f1;
  line-height: 1.35;
  margin-bottom: 8px;
}

.yt-preview-channel {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.yt-preview-channel-name {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
}

.yt-preview-meta {
  font-size: 12px;
  color: #717171;
}

.yt-preview-meta::before {
  content: "\00B7";
  margin-right: 8px;
}

.yt-preview-desc {
  font-size: 13px;
  color: #aaa;
  line-height: 1.5;
  margin-bottom: 10px;
}

.yt-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.yt-preview-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  color: #ccc;
  letter-spacing: 0.01em;
}

/* Script toggle */
.yt-script-section {
  margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
}

.yt-script-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: none;
  color: #aaa;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
}

.yt-script-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: #ddd;
}

.yt-script-body {
  padding: 14px;
  font-size: 13px;
  color: #aaa;
  line-height: 1.65;
  white-space: pre-line;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.3);
  max-height: 300px;
  overflow-y: auto;
}

.yt-script-body::-webkit-scrollbar { width: 5px; }
.yt-script-body::-webkit-scrollbar-track { background: transparent; }
.yt-script-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* Action buttons */
.yt-preview-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.yt-post-btn {
  flex: 1;
  background: #cc0000;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
}

.yt-post-btn:hover {
  background: #e60000;
  box-shadow: 0 2px 12px rgba(255, 0, 0, 0.3);
  transform: translateY(-1px);
}

.yt-reject-btn {
  background: transparent;
  color: #717171;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
}

.yt-reject-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: #aaa;
}


/* ===================================================================
   SOCIAL ACCOUNTS
   =================================================================== */

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

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

.social-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.social-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

/* Gradient border glow on hover */
.social-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, transparent 60%, var(--social-accent, var(--cyan)) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
  pointer-events: none;
}

.social-card:hover::before { opacity: 0.15; }

.social-card-inner { position: relative; z-index: 1; }

.social-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.social-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.social-icon svg { width: 24px; height: 24px; }

.social-icon.instagram  { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.social-icon.facebook   { background: #1877f2; color: #fff; }
.social-icon.youtube    { background: #ff0000; color: #fff; }
.social-icon.threads    { background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.social-icon.google_business { background: #4285f4; color: #fff; }
.social-icon.tiktok     { background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.social-icon.x          { background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.social-icon.linkedin   { background: #0a66c2; color: #fff; }
.social-icon.default    { background: var(--cyan-dim); color: var(--cyan); }

/* Instagram accent */
.social-card.instagram  { --social-accent: #e6683c; }
.social-card.facebook   { --social-accent: #1877f2; }
.social-card.youtube    { --social-accent: #ff0000; }
.social-card.threads    { --social-accent: #999; }
.social-card.google_business { --social-accent: #4285f4; }
.social-card.tiktok     { --social-accent: #69c9d0; }
.social-card.x          { --social-accent: #999; }
.social-card.linkedin   { --social-accent: #0a66c2; }

.social-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.social-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-top: 2px;
}

.social-card-status.connected { color: var(--green); }
.social-card-status.disconnected { color: var(--text-muted); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
  background: var(--text-muted);
}

.social-card-username {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.social-card-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}


/* ===================================================================
   INVENTORY TABLE
   =================================================================== */

.inventory-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.inventory-search {
  flex: 1;
  max-width: 400px;
  padding: 10px 16px 10px 40px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.inventory-search:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-dim);
}

.inventory-search::placeholder { color: var(--text-muted); }

.inventory-search-wrap {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.inventory-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.inventory-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.inventory-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.inventory-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.inventory-table td {
  padding: 12px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.inventory-table tr:last-child td { border-bottom: none; }

.inventory-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.inventory-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.inventory-price {
  color: var(--gold);
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 15px;
}

.inventory-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-badge);
}

.inventory-status.available { background: var(--green-dim); color: var(--green); }
.inventory-status.sold      { background: var(--red-dim); color: var(--red); }
.inventory-status.pending   { background: var(--gold-dim); color: var(--gold); }

.inventory-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-size: 14px;
}


/* ===================================================================
   CHAT
   =================================================================== */

.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 56px);
  max-height: 700px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.chat-placeholder {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 60px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.chat-placeholder svg { opacity: 0.3; }

.chat-msg {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: fadeIn 0.2s ease;
}

.chat-msg-user {
  align-self: flex-end;
  background: var(--cyan);
  color: #0b0f14;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.chat-msg-ai {
  align-self: flex-start;
  background: var(--bg-card-hover);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg-sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 3px;
  opacity: 0.6;
}

/* Typing indicator */
.chat-typing {
  align-self: flex-start;
  padding: 12px 18px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

.chat-input-bar {
  display: flex;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  border-radius: 0;
  padding: 16px 28px;
  border-left: 1px solid var(--border);
}


/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.35s ease forwards;
  white-space: nowrap;
}

.toast.toast-success { background: var(--green); color: #0b0f14; }
.toast.toast-error   { background: var(--red); color: #fff; }
.toast.toast-info    { background: var(--cyan); color: #0b0f14; }

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(16px); }
}


/* ===================================================================
   ANIMATIONS
   =================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Staggered card animations */
.queue-item:nth-child(1) { animation-delay: 0s; }
.queue-item:nth-child(2) { animation-delay: 0.05s; }
.queue-item:nth-child(3) { animation-delay: 0.1s; }
.queue-item:nth-child(4) { animation-delay: 0.15s; }
.queue-item:nth-child(5) { animation-delay: 0.2s; }

.social-card { animation: slideIn 0.3s ease both; }
.social-card:nth-child(1) { animation-delay: 0s; }
.social-card:nth-child(2) { animation-delay: 0.05s; }
.social-card:nth-child(3) { animation-delay: 0.1s; }
.social-card:nth-child(4) { animation-delay: 0.15s; }
.social-card:nth-child(5) { animation-delay: 0.2s; }


/* ===================================================================
   LOADING SKELETON
   =================================================================== */

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-btn);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* Tablet: sidebar collapses to icons */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-close {
    display: block;
  }

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

  .topbar-menu {
    display: block;
  }

  .main-content {
    padding: 20px 16px 40px;
  }

  .topbar {
    padding: 0 16px;
  }

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

  .social-grid {
    grid-template-columns: 1fr;
  }

  .inventory-table { font-size: 12px; }
  .inventory-table th,
  .inventory-table td { padding: 10px 10px; }

  .chat-msg { max-width: 85%; }
}

/* Mobile */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-number { font-size: 32px; }

  .stat-card { padding: 18px 14px 16px; }

  .queue-item-actions {
    flex-direction: column;
  }

  .queue-item-actions .btn { width: 100%; }

  .inventory-header { flex-direction: column; align-items: stretch; }
  .inventory-search-wrap { max-width: none; }
  .inventory-count { margin-left: 0; margin-top: 4px; }

  .topbar-greeting { display: none; }

  .chat-wrapper { max-height: none; height: calc(100vh - var(--topbar-h) - 40px); }
}

/* ── Scrollbar (global) ────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }
