/* ============================================================
   cross-post - Main Application Stylesheet (Late-style redesign)
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --accent: #67C587;
  --accent-hover: #52b572;
  --accent-light: rgba(103, 197, 135, 0.12);
  --bg: #FAFAFA;
  --bg-white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #8a8a9a;
  --text-secondary: #6b7280;
  --sidebar-bg: #FFFFFF;
  --sidebar-text: #1a1a2e;
  --sidebar-border: #EBEBEB;
  --border: #E8E8E8;
  --input-bg: #F5F5F5;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;
  --success: #67C587;
  --info: #3b82f6;
  --dot-schedule: #5B9BD5;
  --dot-now: #67C587;
  --dot-queue: #9B59B6;
  --dot-draft: #D4A843;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --sidebar-width: 280px;
  --header-height: 60px;
  --transition: 0.2s ease;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg: #121218;
  --bg-white: #1a1a24;
  --text: #e4e4e7;
  --text-muted: #71717a;
  --text-secondary: #a1a1aa;
  --sidebar-bg: #16161e;
  --sidebar-text: #e4e4e7;
  --sidebar-border: #27272a;
  --border: #27272a;
  --input-bg: #222230;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

[data-theme="dark"] img {
  opacity: 0.92;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-accent {
  color: #1a1a2e;
}

[data-theme="dark"] .btn-secondary {
  background: var(--input-bg);
  border-color: var(--border);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .main-header {
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .post-card:hover {
  border-color: #3f3f46;
}

[data-theme="dark"] .filter-pill {
  background: var(--input-bg);
  border-color: var(--border);
}

[data-theme="dark"] .queue-slot {
  background: var(--input-bg);
  border-color: var(--border);
}

[data-theme="dark"] .platform-card {
  background: var(--input-bg);
  border-color: var(--border);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn-primary,
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 500;
}

.btn-primary:hover,
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--input-bg);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

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

.btn-danger:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

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

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

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-block {
  width: 100%;
}

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

/* ============================================================
   FORMS
   ============================================================ */

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

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

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

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

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

.form-row {
  display: flex;
  gap: 16px;
}

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

/* Late-style form elements (used in create post modal) */
.form-label-late {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
}

.form-textarea-late {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  transition: box-shadow var(--transition);
}

.form-textarea-late:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-light);
}

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

.textarea-wrapper {
  position: relative;
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input-late,
.form-select-late {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 14px;
  transition: border-color var(--transition);
}

.form-input-late:focus,
.form-select-late:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   LANDING PAGE - Navigation
   ============================================================ */

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.landing-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.landing-nav-logo svg {
  width: 32px;
  height: 32px;
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.landing-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.landing-nav-links a:hover {
  color: var(--text);
}

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-nav .mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
}

/* ============================================================
   LANDING PAGE - Hero
   ============================================================ */

.landing-hero {
  padding: 140px 24px 80px;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}

.landing-hero h1 .accent {
  color: var(--accent);
}

.landing-hero .subtitle {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.landing-hero .hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ============================================================
   LANDING PAGE - Features
   ============================================================ */

.landing-section {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.landing-section-title {
  text-align: center;
  margin-bottom: 48px;
}

.landing-section-title h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.landing-section-title p {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border);
  transition: box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================================
   LANDING PAGE - Platforms
   ============================================================ */

.platform-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.platform-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.platform-logo-item .platform-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.platform-icon.tiktok { background: #000000; }
.platform-icon.instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.platform-icon.youtube { background: #FF0000; }
.platform-icon.twitter { background: #000000; }
.platform-icon.threads { background: #000000; }
.platform-icon.bluesky { background: #0085FF; }
.platform-icon.pinterest { background: #E60023; }

.platform-logo-item span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ============================================================
   LANDING PAGE - Pricing
   ============================================================ */

.pricing-section {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

/* (Pricing styles moved to Plans / Subscription section below) */

/* ============================================================
   LANDING PAGE - FAQ
   ============================================================ */

.faq-section {
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  padding: 20px 0;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text);
  background: none;
  border: none;
}

.faq-question::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq-item.active .faq-question::after {
  content: '\2212';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 0 20px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

/* ============================================================
   LANDING PAGE - Footer
   ============================================================ */

.landing-footer {
  background: #0f0f23;
  color: #e5e7eb;
  padding: 60px 24px 32px;
}

.landing-footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.landing-footer-brand h3 {
  font-size: 18px;
  color: #fff;
  margin-bottom: 8px;
}

.landing-footer-brand p {
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.6;
}

.landing-footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.landing-footer-col a {
  display: block;
  font-size: 14px;
  color: #9ca3af;
  padding: 4px 0;
  transition: color var(--transition);
}

.landing-footer-col a:hover {
  color: #fff;
}

.landing-footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}

.auth-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text);
}

.auth-card-logo svg {
  width: 32px;
  height: 32px;
}

.auth-card h1 {
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.auth-toggle {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-toggle a {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 6px;
  transition: all var(--transition);
}

.auth-toggle a.active {
  background: var(--bg-white);
  color: var(--text);
  box-shadow: var(--shadow);
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.google-btn:hover {
  background: var(--bg);
  border-color: #d1d5db;
}

.google-btn svg {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  font-weight: 500;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.auth-success {
  background: var(--accent-light);
  color: var(--accent-hover);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

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

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

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
  padding: 24px;
}

.sidebar-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 12px;
  margin-top: 24px;
}

.sidebar-label:first-child,
.sidebar-nav .sidebar-label:first-child {
  margin-top: 0;
}

.sidebar-nav {
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-link svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition);
}

.sidebar-link:hover {
  background: var(--input-bg);
  color: var(--text);
}

.sidebar-link:focus-visible {
  background: var(--input-bg);
  color: var(--text);
}

.sidebar-link:hover svg {
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-link.active svg {
  color: var(--accent);
}

/* Active section card */
.sidebar-active {
  margin-top: 24px;
}

.sidebar-active-card {
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.sidebar-active-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.sidebar-active-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Usage section */
/* --- Sidebar User Menu (bottom) --- */
.sidebar-user {
  margin-top: auto;
  position: relative;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

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

.sidebar-user-info:hover {
  background: var(--input-bg);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-user-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.sidebar-user.open .sidebar-user-chevron {
  transform: rotate(180deg);
}

.sidebar-user-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 200;
}

.sidebar-user.open .sidebar-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sidebar-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
}

.sidebar-user-dropdown-item:hover {
  background: var(--input-bg);
}

.sidebar-user-dropdown-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-user-dropdown-logout {
  color: #e55;
}

.sidebar-user-dropdown-logout svg {
  color: #e55;
}

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

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

/* --- Header --- */
.main-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--sidebar-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background: var(--input-bg);
  color: var(--text);
}

.theme-toggle:focus-visible,
.hamburger-btn:focus-visible,
.header-user:focus-visible,
.user-dropdown a:focus-visible,
.sidebar-link:focus-visible,
.filter-pill:focus-visible,
.filter-dropdown-item:focus-visible,
.period-pill:focus-visible,
.analytics-tab:focus-visible,
.warmup-trigger-btn:focus-visible,
.modal-close:focus-visible,
.warmup-close:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  position: relative;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.header-user:hover {
  background: var(--input-bg);
}

.header-user:focus-visible {
  background: var(--input-bg);
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-username {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

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

/* User dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 200;
  display: none;
  padding: 4px;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  border-radius: 6px;
  transition: background var(--transition);
}

.user-dropdown a:hover {
  background: var(--input-bg);
}

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

/* --- Main Body --- */
.main-body {
  padding: 32px;
  flex-grow: 1;
}

/* ============================================================
   PAGE SYSTEM
   ============================================================ */

.page {
  display: none;
}

.page.active {
  display: block;
}

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

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

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

.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   FILTER BAR (pill-style)
   ============================================================ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--bg-white);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: #ccc;
  background: var(--input-bg);
}

.filter-pill:focus-visible {
  border-color: var(--accent);
  background: var(--accent-light);
}

.filter-pill.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.filter-pill svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.sort-pill {
  margin-left: auto;
}

/* Filter dropdown */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 100;
  padding: 4px;
  display: none;
}

.filter-dropdown.show {
  display: block;
}

.filter-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  transition: background var(--transition);
  cursor: pointer;
  background: none;
  border: none;
}

.filter-dropdown-item:hover {
  background: var(--input-bg);
}

.filter-dropdown-item:focus-visible {
  background: var(--input-bg);
}

.filter-dropdown-item.selected {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   POST CARDS
   ============================================================ */

/* Posts Dropzone */
.posts-dropzone {
  margin-bottom: 20px;
  cursor: pointer;
}

.posts-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 24px;
  background: var(--bg-white);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, background 0.2s;
}

.posts-dropzone:hover .posts-dropzone-inner,
.posts-dropzone.dragover .posts-dropzone-inner {
  border-color: var(--accent);
  background: rgba(103, 197, 135, 0.04);
}

.posts-dropzone.dragover .posts-dropzone-inner {
  border-style: solid;
}

.posts-dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.posts-dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Posts Grid */
.posts-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1100px) {
  .posts-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .posts-list { grid-template-columns: 1fr; }
}

.post-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: box-shadow var(--transition), border-color var(--transition);
  min-height: 180px;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d0d0d0;
}

/* Top row: date left, time right */
.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.post-card-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.post-card-time {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Media type badge */
.post-card-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: var(--input-bg);
  color: var(--text-secondary);
  margin-bottom: 10px;
  width: fit-content;
}

.post-card-media-badge svg {
  width: 12px;
  height: 12px;
  display: inline;
}

/* Caption area */
.post-card-body {
  flex-grow: 1;
  min-width: 0;
}

.post-card-caption {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* Footer row: platform avatars left, status right */
.post-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
}

.post-card-platforms {
  display: flex;
  align-items: center;
  gap: 0;
}

.post-card-platform-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--bg-white);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--input-bg);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  position: relative;
  flex-shrink: 0;
}

.post-card-platform-avatar + .post-card-platform-avatar {
  margin-left: -8px;
}

.post-card-platform-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.post-card-platform-avatar.instagram { background: #E1306C; }
.post-card-platform-avatar.youtube { background: #FF0000; }
.post-card-platform-avatar.tiktok { background: #000; }
.post-card-platform-avatar.twitter { background: #000; }
.post-card-platform-avatar.threads { background: #000; }
.post-card-platform-avatar.bluesky { background: #0085FF; }
.post-card-platform-avatar.pinterest { background: #E60023; }

/* Small platform icon overlay on avatar */
.post-card-platform-icon {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-white);
  font-size: 7px;
  font-weight: 800;
  color: #fff;
}

.post-card-platform-icon.instagram { background: #E1306C; }
.post-card-platform-icon.youtube { background: #FF0000; }
.post-card-platform-icon.tiktok { background: #000; }
.post-card-platform-icon.twitter { background: #000; }
.post-card-platform-icon.threads { background: #000; }
.post-card-platform-icon.bluesky { background: #0085FF; }
.post-card-platform-icon.pinterest { background: #E60023; }

/* Post card thumbnail */
.post-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  width: 50%;
  margin: 0 auto;
  overflow: hidden;
  background: var(--input-bg);
}

.post-card-thumb img,
.post-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  opacity: 0;
  transition: opacity 0.2s;
}

.post-card:hover .post-card-thumb-overlay {
  opacity: 1;
}

.post-card-thumb-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.post-card[data-clickable] {
  cursor: pointer;
}

.post-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Post card context menu */
.post-card-menu-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.post-card-menu-btn:hover {
  background: var(--input-bg);
  color: var(--text);
}

/* Post status */
.post-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.post-status.published { background: rgba(103, 197, 135, 0.12); color: #4a9b64; }
.post-status.failed { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.post-status.scheduled { background: rgba(91, 155, 213, 0.12); color: var(--dot-schedule); }
.post-status.partial { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.post-status.draft { background: rgba(212, 168, 67, 0.12); color: var(--dot-draft); }
.post-status.publishing { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.post-destinations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.post-destination {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.post-destination-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

/* ============================================================
   CONNECTIONS PAGE — Row Layout
   ============================================================ */

.conn-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.conn-row:last-child {
  border-bottom: none;
}

.conn-row-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.conn-row-icon img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.conn-row-btn {
  flex-shrink: 0;
  padding: 8px 20px;
  border-radius: 6px;
  border: none;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition);
  white-space: nowrap;
  min-width: 160px;
  text-align: center;
}

.conn-row-btn:hover {
  opacity: 0.85;
}

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

.conn-row-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--transition);
}

.conn-chip:hover {
  border-color: var(--text-muted);
}

.conn-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.conn-chip-avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.conn-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.conn-chip-remove {
  background: none;
  border: none;
  color: #e53e3e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.conn-chip-remove:hover {
  opacity: 1;
}

[data-theme="dark"] .conn-row-btn {
  background: var(--bg-white);
  color: var(--text);
  border: 1px solid var(--border);
}

[data-theme="dark"] .conn-chip {
  background: var(--input-bg);
}

@media (max-width: 700px) {
  .conn-row {
    flex-wrap: wrap;
    gap: 10px;
  }
  .conn-row-accounts {
    width: 100%;
    padding-left: 52px;
  }
}

/* ============================================================
   CREATE POST MODAL
   ============================================================ */

.create-post-modal {
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-accent-line {
  width: 3px;
  height: 36px;
  background: var(--dot-schedule);
  border-radius: 2px;
  flex-shrink: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  transition: background var(--transition);
}

.modal-close:hover {
  background: var(--input-bg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.create-post-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-section {
  margin-bottom: 20px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #D0D0D0;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--input-bg);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone-icon {
  margin-bottom: 8px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
}

.upload-zone-text {
  font-size: 14px;
  color: var(--text);
}

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

/* Media preview grid (inside modal) */
.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.media-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--input-bg);
}

.media-preview-item img,
.media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: background var(--transition);
}

.media-preview-remove:hover {
  background: var(--danger);
}

/* Platforms list */
.platforms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.platforms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--input-bg);
  border-radius: var(--radius);
}

.platforms-empty svg {
  color: var(--border);
}

.platform-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-white);
}

.platform-check:hover {
  border-color: var(--accent);
}

.platform-check.checked {
  border-color: var(--accent);
  background: var(--accent-light);
}

.platform-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.platform-check-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.platform-check-icon,
img.platform-check-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
  object-fit: cover;
}

.platform-check-icon.instagram { background: linear-gradient(135deg, #f09433, #dc2743); }
.platform-check-icon.youtube { background: #FF0000; }
.platform-check-icon.tiktok { background: #000000; }
.platform-check-icon.twitter { background: #000000; }
.platform-check-icon.threads { background: #000000; }
.platform-check-icon.bluesky { background: #0085FF; }
.platform-check-icon.pinterest { background: #E60023; }

/* Publishing modes */
.publish-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.publish-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-white);
}

.publish-mode:hover {
  border-color: #ccc;
}

.publish-mode.active[data-mode="schedule"] {
  background: rgba(91, 155, 213, 0.08);
  border-color: var(--dot-schedule);
  color: var(--dot-schedule);
}

.publish-mode.active[data-mode="now"] {
  background: rgba(103, 197, 135, 0.08);
  border-color: var(--dot-now);
  color: #4a9b64;
}

.publish-mode.active[data-mode="queue"] {
  background: rgba(155, 89, 182, 0.08);
  border-color: var(--dot-queue);
  color: var(--dot-queue);
}

.publish-mode.active[data-mode="draft"] {
  background: rgba(212, 168, 67, 0.08);
  border-color: var(--dot-draft);
  color: var(--dot-draft);
}

/* Publishing dots */
.publish-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-schedule { background: var(--dot-schedule); }
.dot-now { background: var(--dot-now); }
.dot-queue { background: var(--dot-queue); }
.dot-draft { background: var(--dot-draft); }

/* Schedule fields */
.schedule-fields {
  display: none;
}

.schedule-fields.show {
  display: block;
}

/* Modal footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #F9F9F9;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

/* ============================================================
   GENERIC MODAL
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

/* ============================================================
   ANALYTICS / STATS
   ============================================================ */

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

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 14px;
  color: var(--text-muted);
}

.stat-card-trend {
  font-size: 13px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-trend.up { color: var(--success); }
.stat-card-trend.down { color: var(--danger); }

.analytics-section {
  margin-top: 24px;
}

.analytics-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.platform-breakdown-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.platform-breakdown-label {
  width: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.platform-breakdown-track {
  flex-grow: 1;
  height: 8px;
  background: var(--input-bg);
  border-radius: 4px;
  overflow: hidden;
}

.platform-breakdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.platform-breakdown-fill.instagram { background: #E1306C; }
.platform-breakdown-fill.youtube { background: #FF0000; }
.platform-breakdown-fill.tiktok { background: #000000; }
.platform-breakdown-fill.twitter { background: #000000; }
.platform-breakdown-fill.threads { background: #1a1a1a; }
.platform-breakdown-fill.bluesky { background: #0085FF; }
.platform-breakdown-fill.pinterest { background: #E60023; }

.platform-breakdown-count {
  width: 40px;
  text-align: right;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* ============================================================
   QUEUE SLOTS
   ============================================================ */

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

.queue-day {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.queue-day-header {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.queue-day-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.queue-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--input-bg);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--text);
}

.queue-slot-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border: none;
}

.queue-slot-remove:hover {
  background: var(--danger);
  color: #fff;
}

.queue-no-slots {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

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

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: toastIn 0.3s ease;
}

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

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

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

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-body {
  flex-grow: 1;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 13px;
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.toast-close:hover {
  color: var(--text);
}

/* ============================================================
   TABLES
   ============================================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

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

.data-table tbody tr:hover {
  background: var(--input-bg);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  cursor: pointer;
  transition: all var(--transition);
}

.pagination button:hover {
  background: var(--input-bg);
}

.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0 8px;
}

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-green { background: rgba(103, 197, 135, 0.12); color: #4a9b64; }
.badge-red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-blue { background: rgba(59, 130, 246, 0.1); color: var(--info); }
.badge-orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-gray { background: var(--input-bg); color: var(--text-muted); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

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

/* Loading spinner */
.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-spinner.sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

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

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state p,
.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 20px;
}

/* Card generic */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-header {
  margin-bottom: 20px;
}

.card-header h2 {
  font-size: 18px;
}

.card-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

/* Danger zone */
.danger-zone {
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 24px;
}

.danger-zone h3 {
  color: var(--danger);
  font-size: 16px;
  margin-bottom: 8px;
}

.danger-zone p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ============================================================
   SUBSCRIPTION PAGE (inside app.html)
   ============================================================ */

/* --- Plans / Subscription Page --- */

/* Billing toggle */
.plans-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.plans-toggle {
  display: inline-flex;
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.plans-toggle-btn {
  position: relative;
  z-index: 1;
  padding: 10px 28px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.plans-toggle-btn.active {
  color: #fff;
}

.plans-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  width: calc(50% - 4px);
  background: var(--text);
  border-radius: 999px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

[data-theme="dark"] .plans-toggle-slider {
  background: var(--accent);
}

.plans-toggle.yearly .plans-toggle-slider {
  transform: translateX(100%);
}

.plans-toggle-save {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--success);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -90px;
  white-space: nowrap;
}

/* Plans grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1060px;
}

/* Plan card */
.plan-card {
  background: var(--bg-white);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.plan-card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* Current plan highlight */
.plan-card--current {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.plan-card--current:hover {
  box-shadow: 0 0 0 1px var(--success), 0 8px 30px rgba(103, 197, 135, 0.1);
}

.plan-card__current-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  white-space: nowrap;
}

/* Popular badge */
.plan-card__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 8px;
  position: relative;
  top: -2px;
}

.plan-card__badge--popular {
  background: rgba(103, 197, 135, 0.12);
  color: #3a9b5b;
}

[data-theme="dark"] .plan-card__badge--popular {
  background: rgba(103, 197, 135, 0.15);
  color: var(--success);
}

.plan-card__badge--deal {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

[data-theme="dark"] .plan-card__badge--deal {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* Card header */
.plan-card__name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.plan-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Divider */
.plan-card__divider {
  height: 1px;
  background: var(--border);
  margin-bottom: 24px;
}

/* Price */
.plan-card__price {
  margin-bottom: 24px;
}

.plan-card__price-amount {
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -2px;
  line-height: 1;
}

.plan-card__price-period {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}

.plan-card__price-yearly-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Features */
.plan-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  flex: 1;
}

.plan-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.plan-card__features li .check-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--success);
}

.plan-card__features li .feat-highlight {
  font-weight: 700;
  color: var(--success);
}

/* Plan button */
.plan-card__btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg-white);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-card__btn:hover {
  border-color: var(--text);
  background: var(--bg);
}

.plan-card__btn--primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.plan-card__btn--primary:hover {
  opacity: 0.88;
  background: var(--text);
}

[data-theme="dark"] .plan-card__btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="dark"] .plan-card__btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.plan-card__btn--current {
  background: var(--bg);
  color: var(--text-muted);
  border-color: var(--border);
  cursor: default;
}

.plan-card__btn--current:hover {
  background: var(--bg);
  border-color: var(--border);
}

/* Responsive */
@media (max-width: 960px) {
  .plans-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .plans-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

  .plan-card__price-amount {
    font-size: 40px;
  }
}

/* ============================================================
   PROFILE PAGE (inside app.html)
   ============================================================ */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.profile-card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Profile avatar section */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--input-bg);
  border: 3px solid var(--border);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  transition: transform 0.15s ease;
}

.profile-avatar:hover .profile-avatar-edit {
  transform: scale(1.1);
}

.profile-avatar-info {
  flex: 1;
  min-width: 0;
}

.profile-avatar-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.profile-avatar-email {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-avatar-tier {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  text-transform: capitalize;
}

/* Profile form fields */
.profile-form-group {
  margin-bottom: 20px;
  max-width: 400px;
}

.profile-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.profile-form-group input,
.profile-form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 14px;
  transition: border-color 0.2s;
}

.profile-form-group input:focus,
.profile-form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Profile connected accounts */
.profile-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--input-bg);
  border-radius: var(--radius);
}

.profile-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.profile-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-account-avatar.instagram { background: #E1306C; }
.profile-account-avatar.youtube { background: #FF0000; }
.profile-account-avatar.tiktok { background: #000; }
.profile-account-avatar.twitter { background: #000; }
.profile-account-avatar.threads { background: #000; }
.profile-account-avatar.bluesky { background: #0085FF; }
.profile-account-avatar.pinterest { background: #E60023; }

.profile-account-info {
  flex: 1;
  min-width: 0;
}

.profile-account-name {
  font-size: 14px;
  font-weight: 500;
}

.profile-account-platform {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.profile-connect-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-white);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.profile-connect-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Profile alerts */
.profile-alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.profile-alert.success { background: rgba(103,197,135,0.12); color: #2d7a47; }
.profile-alert.error { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Platform badge (small inline) */
.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.platform-badge.tiktok { background: #000; }
.platform-badge.instagram { background: #E1306C; }
.platform-badge.youtube { background: #FF0000; }
.platform-badge.twitter { background: #000; }
.platform-badge.threads { background: #000; }
.platform-badge.bluesky { background: #0085FF; }
.platform-badge.pinterest { background: #E60023; }

/* ============================================================
   ANALYTICS ENHANCEMENTS
   ============================================================ */

/* Period selector */
.analytics-period-selector {
  display: flex;
  gap: 4px;
  background: var(--input-bg);
  border-radius: var(--radius-full);
  padding: 3px;
}

.period-pill {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.period-pill:hover {
  color: var(--text);
}

.period-pill:focus-visible {
  color: var(--text);
  background: var(--bg-white);
}

.period-pill.active {
  background: var(--bg-white);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Connected accounts strip */
.analytics-accounts-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 0 4px;
  min-height: 44px;
}

.analytics-account {
  position: relative;
  margin-right: -8px;
  cursor: default;
}

.analytics-account:last-child {
  margin-right: 0;
}

.analytics-account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-white);
  object-fit: cover;
  display: block;
  background: var(--input-bg);
}

.analytics-account-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg-white);
}

.analytics-account-badge.instagram { background: #E1306C; }
.analytics-account-badge.youtube { background: #FF0000; }
.analytics-account-badge.tiktok { background: #000000; }
.analytics-account-badge.twitter { background: #000000; }
.analytics-account-badge.threads { background: #000000; }
.analytics-account-badge.bluesky { background: #0085FF; }
.analytics-account-badge.pinterest { background: #E60023; }

.analytics-account-badge svg {
  width: 8px;
  height: 8px;
  color: #fff;
  fill: #fff;
}

/* Tooltip */
.analytics-account .analytics-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.analytics-account .analytics-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}

.analytics-account:hover .analytics-tooltip {
  opacity: 1;
}

/* Analytics tabs */
.analytics-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.analytics-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.analytics-tab:hover {
  color: var(--text);
}

.analytics-tab:focus-visible {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.analytics-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab content */
.analytics-tab-content {
  display: none;
}

.analytics-tab-content.active {
  display: block;
}

/* Posts over time chart */
.analytics-chart-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.analytics-chart-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.analytics-chart {
  width: 100%;
  min-height: 200px;
  position: relative;
}

.analytics-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.analytics-chart .chart-bar {
  fill: var(--accent);
  opacity: 0.7;
  transition: opacity 0.15s ease;
  cursor: pointer;
}

.analytics-chart .chart-bar:hover {
  opacity: 1;
}

.analytics-chart .chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.analytics-chart .chart-axis-line {
  stroke: var(--border);
  stroke-width: 1;
}

.analytics-chart .chart-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
}

.analytics-chart .chart-empty {
  text-anchor: middle;
  fill: var(--text-muted);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.chart-tooltip {
  position: absolute;
  background: var(--text);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transform: translateX(-50%);
}

/* Calendar */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.calendar-title {
  font-size: 18px;
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-white);
}

.calendar-day-header {
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  background: var(--input-bg);
  border-bottom: 1px solid var(--border);
}

.calendar-cell {
  min-height: 100px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-white);
  position: relative;
}

.calendar-cell:nth-child(7n) {
  border-right: none;
}

.calendar-cell.outside {
  background: var(--input-bg);
  opacity: 0.5;
}

.calendar-cell.today {
  background: rgba(103, 197, 135, 0.04);
}

.calendar-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.calendar-cell.today .calendar-date {
  color: var(--accent);
  font-weight: 700;
}

.calendar-post-tile {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text);
  margin-bottom: 2px;
  cursor: default;
  border-left: 3px solid var(--border);
  background: var(--input-bg);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.calendar-post-tile.published { border-left-color: var(--success); }
.calendar-post-tile.scheduled { border-left-color: var(--dot-schedule); }
.calendar-post-tile.failed { border-left-color: var(--danger); }
.calendar-post-tile.draft { border-left-color: var(--dot-draft); }
.calendar-post-tile.publishing { border-left-color: var(--info); }

.calendar-post-time {
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.calendar-post-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-post-platforms {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.calendar-post-platforms img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
}

.calendar-more {
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 6px;
  font-weight: 500;
}

.calendar-more:hover {
  text-decoration: underline;
}

/* Failed posts */
.failed-posts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.failed-posts-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.failed-posts-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

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

.failed-post-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow var(--transition);
}

.failed-post-card:hover {
  box-shadow: var(--shadow);
}

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

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

.failed-post-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: var(--input-bg);
  color: var(--text-muted);
}

.failed-post-caption {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.failed-post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.failed-post-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: 6px;
  line-height: 1.4;
}

/* ============================================================
   WARM UP TIPS POPUP
   ============================================================ */

/* Trigger button in header */
.warmup-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #1a1a2e;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  margin-left: 12px;
}

.warmup-trigger-btn svg {
  flex-shrink: 0;
  color: var(--accent);
}

.warmup-trigger-btn:hover {
  background: #2d2d4e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.3);
}

.warmup-trigger-btn:focus-visible {
  background: #2d2d4e;
}

/* Overlay */
.warmup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  backdrop-filter: blur(4px);
}

.warmup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Modal */
.warmup-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s ease;
}

.warmup-overlay.show .warmup-modal {
  transform: translateY(0) scale(1);
}

/* Header */
.warmup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #eee;
}

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

.warmup-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #1a1a2e;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warmup-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
}

.warmup-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.15s;
}

.warmup-close:hover {
  background: #f0f0f0;
  color: #333;
}

[data-theme="dark"] .theme-toggle:focus-visible,
[data-theme="dark"] .hamburger-btn:focus-visible,
[data-theme="dark"] .header-user:focus-visible,
[data-theme="dark"] .user-dropdown a:focus-visible,
[data-theme="dark"] .sidebar-link:focus-visible,
[data-theme="dark"] .filter-pill:focus-visible,
[data-theme="dark"] .filter-dropdown-item:focus-visible,
[data-theme="dark"] .period-pill:focus-visible,
[data-theme="dark"] .analytics-tab:focus-visible,
[data-theme="dark"] .warmup-trigger-btn:focus-visible,
[data-theme="dark"] .modal-close:focus-visible,
[data-theme="dark"] .warmup-close:focus-visible,
[data-theme="dark"] .btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(103, 197, 135, 0.28);
}

/* Body */
.warmup-body {
  padding: 24px 28px;
}

.warmup-intro {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 24px;
}

.warmup-intro strong {
  color: #1a1a2e;
}

/* Steps */
.warmup-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 24px;
}

.warmup-step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #f3f3f3;
}

.warmup-step:last-child {
  border-bottom: none;
}

.warmup-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a1a2e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.warmup-step-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 4px;
}

.warmup-step-content p {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.warmup-step-content strong {
  color: #1a1a2e;
  font-weight: 600;
}

/* India notice */
.warmup-india-notice {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f8f4ff, #f0e8ff);
  border: 1px solid #e0d4f5;
  border-radius: 12px;
  border-left: 4px solid #7c3aed;
}

.warmup-india-flag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warmup-india-flag svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
}

.warmup-india-notice h4 {
  font-size: 14px;
  font-weight: 600;
  color: #5b21b6;
  margin-bottom: 4px;
}

.warmup-india-notice p {
  font-size: 13px;
  color: #555;
  line-height: 1.6;
}

.warmup-india-notice strong {
  color: #5b21b6;
  font-weight: 600;
}

/* Footer */
.warmup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

.warmup-dismiss-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
}

.warmup-dismiss-check input[type="checkbox"] {
  accent-color: #1a1a2e;
  width: 15px;
  height: 15px;
}

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

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

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

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .landing-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .landing-hero {
    padding: 100px 16px 48px;
  }

  .landing-hero h1 {
    font-size: 34px;
  }

  .landing-hero .subtitle {
    font-size: 16px;
  }

  .landing-nav-links {
    display: none;
  }

  .landing-nav .mobile-toggle {
    display: block;
  }

  .landing-nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
    box-shadow: var(--shadow-md);
  }

  .landing-footer-grid {
    grid-template-columns: 1fr;
  }

  .landing-footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .main-body {
    padding: 20px 16px;
  }

  .main-header {
    padding: 0 16px;
  }

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

  .auth-card {
    padding: 28px 20px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
  }

  .page-title {
    font-size: 22px;
  }

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

  .connected-accounts-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    gap: 8px;
  }

  .calendar-cell {
    min-height: 70px;
    padding: 4px;
  }

  .calendar-post-tile {
    font-size: 10px;
  }

  .calendar-post-caption {
    display: none;
  }

  .failed-posts-grid {
    grid-template-columns: 1fr;
  }

  .analytics-period-selector {
    margin-top: 8px;
  }

  .sort-pill {
    margin-left: 0;
  }

  .warmup-trigger-btn {
    padding: 4px 10px;
    font-size: 11px;
    margin-left: 8px;
  }

  .warmup-modal {
    max-width: 100%;
    margin: 8px;
  }

  .warmup-header, .warmup-body, .warmup-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .warmup-india-notice {
    flex-direction: column;
    gap: 10px;
  }

  .create-post-modal {
    margin: 8px;
    max-height: calc(100vh - 16px);
  }
}

@media (max-width: 480px) {
  .landing-hero h1 {
    font-size: 28px;
  }

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

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .platform-grid {
    gap: 10px;
  }

  .platform-card {
    width: 80px;
    height: 80px;
  }

  .header-username {
    display: none;
  }
}

/* ============================================================
   Bulk Upload Page
   ============================================================ */

.bulk-accounts-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.bulk-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border: 1.5px solid #e5e5ea;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bulk-account-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(103, 197, 135, 0.12);
}

.bulk-account-card.selected {
  border-color: var(--accent);
  background: rgba(103, 197, 135, 0.06);
  box-shadow: 0 2px 8px rgba(103, 197, 135, 0.15);
}

.bulk-account-card .account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.bulk-account-card .account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bulk-account-card .account-avatar.instagram { background: #E1306C; }
.bulk-account-card .account-avatar.youtube { background: #FF0000; }
.bulk-account-card .account-avatar.tiktok { background: #010101; }
.bulk-account-card .account-avatar.twitter { background: #000000; }
.bulk-account-card .account-avatar.threads { background: #000000; }
.bulk-account-card .account-avatar.bluesky { background: #0085FF; }
.bulk-account-card .account-avatar.pinterest { background: #E60023; }

.bulk-account-card .bulk-account-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-account-card .bulk-account-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}

.bulk-account-card .bulk-account-platform {
  font-size: 11px;
  color: #8a8a9a;
  text-transform: capitalize;
  font-weight: 500;
}

.bulk-account-card .bulk-check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d4d4d8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.bulk-account-card.selected .bulk-check {
  border-color: var(--accent);
  background: var(--accent);
}

.bulk-account-card.selected .bulk-check svg {
  display: block;
}

.bulk-account-card .bulk-check svg {
  display: none;
  stroke: #fff;
}

.bulk-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.bulk-main {
  flex: 1;
  min-width: 0;
}

.bulk-sidebar {
  width: 360px;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

/* Upload zone */
.bulk-upload-zone {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed #d4d4d8;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 40px 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bulk-upload-zone:hover,
.bulk-upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(103, 197, 135, 0.04);
  box-shadow: 0 4px 16px rgba(103, 197, 135, 0.1);
}

.bulk-upload-zone .upload-zone-icon {
  color: #b0b0b8;
}

.bulk-upload-zone .upload-zone-text {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
}

.bulk-upload-zone .upload-zone-hint {
  font-size: 13px;
  color: #8a8a9a;
  font-weight: 400;
}

/* Videos list */
.bulk-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  margin-bottom: 14px;
}

.bulk-videos-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.01em;
}

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

/* Video cards */
.bulk-video-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1.5px solid #e5e5ea;
  border-radius: 14px;
  align-items: flex-start;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s;
}

.bulk-video-card:hover {
  border-color: #d0d0d6;
}

.bulk-video-thumb {
  width: 110px;
  height: 78px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-video-thumb img,
.bulk-video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bulk-video-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bulk-video-file {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-video-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-video-size {
  font-size: 12px;
  color: #8a8a9a;
  white-space: nowrap;
  font-weight: 500;
}

.bulk-video-status {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 6px;
}

.bulk-video-status.pending {
  color: #8a8a9a;
  background: #f0f0f3;
}

.bulk-video-status.uploading {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.bulk-video-status.uploaded {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
}

.bulk-video-status.failed {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.bulk-video-caption {
  width: 100%;
}

.bulk-video-caption textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  background: #fafafa;
  color: #1a1a2e;
  transition: border-color 0.15s;
}

.bulk-video-caption textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.bulk-video-schedule {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bulk-video-schedule input {
  padding: 8px 10px;
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  background: #fafafa;
  color: #1a1a2e;
  font-weight: 500;
  transition: border-color 0.15s;
}

.bulk-video-schedule input:focus {
  outline: none;
  border-color: var(--accent);
}

.bulk-video-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.bulk-video-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #b0b0b8;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s;
}

.bulk-video-delete:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.06);
}

.bulk-video-retry {
  background: none;
  border: none;
  cursor: pointer;
  color: #2563eb;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s;
}

.bulk-video-retry:hover {
  background: rgba(37, 99, 235, 0.06);
}

/* Settings sidebar cards */
.bulk-settings-card {
  background: #fff;
  border: 1.5px solid #e5e5ea;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.bulk-settings-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.bulk-settings-card .form-label-late {
  font-weight: 600;
  color: #1a1a2e;
}

.bulk-settings-card .form-input-late,
.bulk-settings-card .form-select-late {
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  background: #fafafa;
  color: #1a1a2e;
  font-weight: 500;
}

.bulk-settings-card .form-input-late:focus,
.bulk-settings-card .form-select-late:focus {
  border-color: var(--accent);
  outline: none;
}

.bulk-settings-card .form-textarea-late {
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  background: #fafafa;
}

.bulk-settings-card .form-textarea-late:focus {
  border-color: var(--accent);
  outline: none;
}

.bulk-settings-card .btn-accent {
  background: #1a1a2e;
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: -0.01em;
  transition: background 0.15s;
}

.bulk-settings-card .btn-accent:hover {
  background: #2d2d44;
}

.bulk-settings-card .btn-accent:disabled {
  background: #d4d4d8;
  color: #8a8a9a;
  cursor: not-allowed;
}

.bulk-settings-card .btn-ghost {
  border: 1.5px solid #e5e5ea;
  border-radius: 10px;
  font-weight: 600;
  color: #1a1a2e;
  background: #fafafa;
  font-size: 13px;
  padding: 8px 14px;
  transition: all 0.15s;
}

.bulk-settings-card .btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(103, 197, 135, 0.04);
}

/* Schedule preview */
.bulk-schedule-preview {
  margin-top: 16px;
  background: #f5f5f7;
  border-radius: 12px;
  padding: 16px;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.7;
}

.bulk-schedule-preview .preview-day {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.bulk-schedule-preview .preview-day-date {
  font-weight: 600;
  color: #1a1a2e;
}

.bulk-schedule-preview .preview-duration {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e5ea;
  font-weight: 700;
  color: #1a1a2e;
  font-size: 13px;
}

.bulk-schedule-hint {
  font-size: 12px;
  color: #8a8a9a;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
  line-height: 1.5;
}

/* Progress overlay */
.bulk-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bulk-progress-modal {
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.bulk-progress-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.bulk-progress-bar-track {
  width: 100%;
  height: 8px;
  background: #f0f0f3;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}

.bulk-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bulk-progress-text {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 20px;
  font-weight: 500;
}

.bulk-progress-results {
  text-align: left;
  font-size: 13px;
  max-height: 300px;
  overflow-y: auto;
}

.bulk-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f3;
}

.bulk-result-item:last-child {
  border-bottom: none;
}

.bulk-result-item .result-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.bulk-result-item.success .result-icon { color: #16a34a; }
.bulk-result-item.failure .result-icon { color: #dc2626; }

.bulk-result-item .result-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1a1a2e;
  font-weight: 500;
}

.bulk-result-item.failure .result-text {
  color: #dc2626;
}

/* Responsive */
@media (max-width: 1024px) {
  .bulk-layout {
    flex-direction: column;
  }

  .bulk-sidebar {
    width: 100%;
    position: static;
  }
}

@media (max-width: 768px) {
  .bulk-video-card {
    flex-direction: column;
  }

  .bulk-video-thumb {
    width: 100%;
    height: 160px;
  }

  .bulk-video-schedule {
    flex-direction: column;
    align-items: stretch;
  }

  .bulk-accounts-strip {
    gap: 8px;
  }

  .bulk-account-card {
    padding: 10px 14px;
  }
}

/* ============================================================
   Post Detail Modal
   ============================================================ */

.post-detail-media {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
}

.post-detail-media-item {
  max-height: 300px;
  border-radius: var(--radius-lg);
  object-fit: contain;
  background: var(--input-bg);
  flex-shrink: 0;
  max-width: 100%;
}

.post-detail-caption {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--input-bg);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-detail-info {
  margin-bottom: 16px;
}

.post-detail-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.post-detail-info-row span:first-child {
  color: var(--text-muted);
  font-weight: 500;
}

.post-detail-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.post-detail-dest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.post-detail-dest-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.post-detail-dest-info {
  flex: 1;
  min-width: 0;
}

.post-detail-dest-name {
  font-size: 13px;
  font-weight: 600;
}

.post-detail-dest-platform {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.post-detail-dest-error {
  font-size: 12px;
  color: var(--danger);
  padding: 4px 0 4px 42px;
}

.post-detail-dest-link {
  font-size: 12px;
  padding: 2px 0 8px 42px;
  display: block;
}

/* ============================================================
   Sidebar Connected Accounts
   ============================================================ */

.sidebar-accounts-section {
  padding: 0 16px 16px;
}

.sidebar-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-accounts-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 0;
}

.sidebar-accounts-toggle {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 0 0;
  text-align: left;
}

.sidebar-accounts-toggle:hover {
  text-decoration: underline;
}

.sidebar-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.sidebar-account-item:hover {
  background: var(--input-bg);
}

.sidebar-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--text-muted);
}

.sidebar-account-name {
  flex: 1;
  font-size: 13px;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-account-badge.instagram { background: #E1306C; }
.sidebar-account-badge.youtube { background: #FF0000; }
.sidebar-account-badge.tiktok { background: #000; }
.sidebar-account-badge.twitter { background: #000; }
.sidebar-account-badge.threads { background: #000; }
.sidebar-account-badge.bluesky { background: #0085FF; }
.sidebar-account-badge.pinterest { background: #E60023; }

[data-theme="dark"] .sidebar-account-badge.tiktok,
[data-theme="dark"] .sidebar-account-badge.twitter,
[data-theme="dark"] .sidebar-account-badge.threads { background: #fff; }

.sidebar-account-platform-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  object-fit: cover;
}

/* ============================================================
   Onboarding Wizard (full-screen overlay)
   ============================================================ */

.ob-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #eef0f2;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

[data-theme="dark"] .ob-overlay { background: #18181b; }

/* --- Header bar --- */
.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

[data-theme="dark"] .ob-header { background: #1e1e26; border-color: #27272a; }

.ob-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.ob-steps-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.ob-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: #d1d5db;
  color: #fff;
  transition: all 0.3s;
  flex-shrink: 0;
}

.ob-step-num.active {
  background: #22c55e;
  color: #fff;
}

.ob-step-num.done {
  background: #22c55e;
  color: #fff;
}

.ob-step-line {
  width: 60px;
  height: 3px;
  background: #d1d5db;
  transition: background 0.3s;
}

.ob-step-line.done {
  background: #22c55e;
}

.ob-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.ob-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Body --- */
.ob-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 24px 24px;
  overflow-y: auto;
}

/* --- Footer --- */
.ob-footer {
  display: flex;
  align-items: center;
  padding: 16px 32px;
  flex-shrink: 0;
}

.ob-footer-spacer { flex: 1; }

.ob-btn-back {
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 10px 20px;
}

.ob-btn-back:hover { opacity: 0.7; }

.ob-btn-next {
  background: #22c55e;
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.ob-btn-next:hover { background: #16a34a; }
.ob-btn-next:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Step 1: Profile type --- */
.ob-tag {
  font-size: 14px;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 8px;
}

.ob-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 32px;
}

.ob-subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-bottom: 32px;
}

.ob-type-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 580px;
}

.ob-type-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

[data-theme="dark"] .ob-type-card { background: #1e1e26; border-color: #27272a; }

.ob-type-card:hover {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px #22c55e;
}

.ob-type-card.selected {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.ob-type-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ob-type-card.selected .ob-type-radio {
  border-color: #22c55e;
  background: #22c55e;
}

.ob-type-card.selected .ob-type-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.ob-type-info { flex: 1; }

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

.ob-type-desc {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 2px;
}

/* --- Step 2: Connect accounts --- */
.ob-platforms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 720px;
}

.ob-platform-card {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.2s;
}

[data-theme="dark"] .ob-platform-card { background: #1e1e26; border-color: #27272a; }

.ob-platform-card.connected {
  border-color: #22c55e;
}

.ob-platform-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ob-platform-top img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.ob-platform-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ob-platform-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  background: #1e293b;
  color: #fff;
}

[data-theme="dark"] .ob-platform-btn { background: #374151; }

.ob-platform-btn:hover { opacity: 0.85; }

.ob-platform-btn.added {
  background: #dcfce7;
  color: #16a34a;
  cursor: default;
}

[data-theme="dark"] .ob-platform-btn.added { background: #14532d; color: #86efac; }

/* --- Step 3: Choose plan --- */
.ob-plans-wrap {
  width: 100%;
  max-width: 800px;
}

.ob-plans-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  position: relative;
}

.ob-plans-toggle-btn {
  padding: 10px 28px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #e5e7eb;
  color: #6b7280;
  transition: all 0.2s;
}

.ob-plans-toggle-btn:first-child { border-radius: 8px 0 0 8px; }
.ob-plans-toggle-btn:last-child { border-radius: 0 8px 8px 0; }

.ob-plans-toggle-btn.active {
  background: #22c55e;
  color: #fff;
}

.ob-plans-save-badge {
  position: absolute;
  top: -14px;
  right: calc(50% - 120px);
  background: #f97316;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.ob-plans-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.ob-plan-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
}

[data-theme="dark"] .ob-plan-card { background: #1e1e26; border-color: #27272a; }

.ob-plan-card.popular {
  border-color: #22c55e;
}

.ob-plan-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ob-plan-name {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.ob-plan-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: #dcfce7;
  color: #16a34a;
}

.ob-plan-desc {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 20px;
}

.ob-plan-price {
  margin-bottom: 20px;
}

.ob-plan-price-amount {
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.ob-plan-price-period {
  font-size: 16px;
  font-weight: 400;
  color: #9ca3af;
}

.ob-plan-price-amount sup {
  font-size: 22px;
  font-weight: 700;
  vertical-align: baseline;
  position: relative;
  top: -0.4em;
}

.ob-plan-billed {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
  margin-bottom: 8px;
}

.ob-plan-annual-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #e8735a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.ob-plan-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

[data-theme="dark"] .ob-plan-divider { border-color: #27272a; }

.ob-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ob-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.ob-plan-features li .ob-check {
  color: #22c55e;
  flex-shrink: 0;
  margin-top: 1px;
}

.ob-plan-features li strong {
  color: #22c55e;
  font-weight: 700;
}

.ob-plan-cta {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  background: #22c55e;
  color: #fff;
  transition: background 0.2s;
}

.ob-plan-cta:hover { background: #16a34a; }

.ob-plan-trial-note {
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ob-plan-trial-note svg { flex-shrink: 0; }

.ob-free-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: #9ca3af;
}

.ob-free-link a {
  color: #6b7280;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.ob-free-link a:hover { color: var(--text); }

/* --- Responsive --- */
@media (max-width: 700px) {
  .ob-platforms-grid { grid-template-columns: repeat(2, 1fr); }
  .ob-plans-grid { grid-template-columns: 1fr; }
  .ob-header { padding: 12px 16px; }
  .ob-step-line { width: 30px; }
  .ob-body { padding: 32px 16px 16px; }
  .ob-footer { padding: 12px 16px; }
}

@media (max-width: 480px) {
  .ob-platforms-grid { grid-template-columns: 1fr; }
  .ob-title { font-size: 22px; }
}

/* ============================================================
   Queue Slot Drag & Drop Enhancements
   ============================================================ */

.queue-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-day-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.queue-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.queue-slot-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: -2px;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.queue-slot:hover .queue-slot-drag {
  opacity: 1;
}

.queue-slot.dragging {
  opacity: 0.4;
}

.queue-slot.drag-over {
  box-shadow: 0 -2px 0 var(--accent);
}

.queue-slot-time {
  font-weight: 500;
}
