/* ==========================================================================
   OMNIMARKET PROFESSIONAL LIGHT SAAS DESIGN SYSTEM
   Standardized Architecture for Universal Marketing OS
   ========================================================================== */

:root {
  /* Surface Layers (Professional Light SaaS) */
  --bg-canvas: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-topbar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #f1f5f9;
  --bg-input: #ffffff;
  --bg-overlay: rgba(15, 23, 42, 0.45);

  /* Primary Brand (Modern Enterprise Blue / Indigo) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.12);
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --accent-indigo: #4f46e5;

  /* Semantic Accents */
  --accent-green: #10b981;
  --accent-green-bg: #ecfdf5;
  --accent-green-border: #a7f3d0;
  --accent-green-text: #059669;

  --accent-amber: #f59e0b;
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;
  --accent-amber-text: #d97706;

  --accent-red: #ef4444;
  --accent-red-bg: #fef2f2;
  --accent-red-border: #fecaca;
  --accent-red-text: #dc2626;

  --accent-blue: #0284c7;
  --accent-blue-bg: #f0f9ff;
  --accent-blue-border: #bae6fd;
  --accent-blue-text: #0369a1;

  --accent-purple: #7c3aed;
  --accent-purple-bg: #f5f3ff;
  --accent-purple-border: #ddd6fe;
  --accent-purple-text: #6d28d9;

  /* Typography Colors (High Contrast, Enterprise SaaS) */
  --text-main: #0f172a;       /* Slate 900 */
  --text-secondary: #475569;  /* Slate 600 */
  --text-muted: #64748b;      /* Slate 500 */
  --text-dim: #94a3b8;        /* Slate 400 */

  /* Borders & Dividers */
  --border-subtle: #f1f5f9;
  --border-color: #e2e8f0;    /* Slate 200 */
  --border-hover: #cbd5e1;    /* Slate 300 */
  --border-focus: #2563eb;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Shadows (Subtle, Natural SaaS Shadows) */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);

  /* Fonts & Transitions */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.15s ease-in-out;
  --transition-fast: 0.12s ease-in-out;
}

/* Light / Store Theme Overrides */
body.brand-shopify {
  --primary: #e11d48;
  --primary-hover: #be123c;
  --primary-light: #fff1f2;
  --primary-glow: rgba(225, 29, 72, 0.12);
  --primary-gradient: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
}

body.brand-woo {
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(5, 150, 105, 0.12);
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

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

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: hidden;
  display: block;
  position: relative;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* App Container */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* ==========================================================================
   SIDEBAR (LINEAR / STRIPE STYLE)
   ========================================================================== */

.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 30;
  user-select: none;
}

.sidebar-header {
  height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-badge {
  width: 28px;
  height: 28px;
  background: var(--primary-gradient);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
  flex-shrink: 0;
}

.brand-badge svg {
  width: 16px;
  height: 16px;
}

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

.brand-text h2 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.2;
}

.brand-text span {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 14px 10px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  position: relative;
}

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

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-item .icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-item:hover .icon,
.nav-item.active .icon {
  color: var(--primary);
}

.nav-item .badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

.health-status-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-ring 2s infinite ease-out;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & TOP NAVBAR
   ========================================================================== */

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

.top-navbar {
  height: 58px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 20;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

/* Store Switcher Pill */
.store-switcher-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: var(--transition);
}

.store-switcher-box:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.store-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
  flex-shrink: 0;
}

.store-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.store-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.store-type-badge {
  font-size: 0.62rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.store-currency {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.store-select-dropdown {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.store-select-dropdown option {
  background: #ffffff;
  color: var(--text-main);
}

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

.live-sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green-border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--accent-green-text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Emergency Controls */
.emergency-kill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-red-bg);
  color: var(--accent-red-text);
  border: 1px solid var(--accent-red-border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.emergency-kill-btn:hover {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

/* Content Viewport */
.content-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view-section {
  display: none;
  animation: fadeIn 0.15s ease-out;
}

.view-section.active {
  display: block;
}

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

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.view-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.view-title p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ==========================================================================
   DASHBOARD KPI METRIC CARDS (STRIPE / LINEAR STYLE)
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.kpi-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* Elegant top hairline accents */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

.kpi-card.kpi-spend::before { background: linear-gradient(90deg, #38bdf8, transparent); }
.kpi-card.kpi-revenue::before { background: linear-gradient(90deg, #10b981, transparent); }
.kpi-card.kpi-roas::before { background: linear-gradient(90deg, #a855f7, transparent); }
.kpi-card.kpi-orders::before { background: linear-gradient(90deg, #f59e0b, transparent); }

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.kpi-icon svg {
  width: 15px;
  height: 15px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
  line-height: 1.1;
}

.kpi-trend {
  font-size: 0.74rem;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.trend-up {
  color: var(--accent-green);
}

.trend-sub {
  color: var(--text-muted);
  font-weight: 400;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

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

.panel-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   DATA TABLES (ENTERPRISE / HIGH-DENSITY)
   ========================================================================== */

.custom-table {
  width: 100%;
  border-collapse: collapse;
}

.custom-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-canvas);
}

.custom-table td {
  padding: 12px 14px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

#campaignQueueTable th:last-child,
#campaignQueueTable td:last-child {
  text-align: right;
}

#campaignQueueTable td:last-child > div {
  justify-content: flex-end;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-active {
  background: var(--accent-green-bg);
  color: var(--accent-green-text);
  border: 1px solid var(--accent-green-border);
}

.badge-scheduled {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-warning {
  background: var(--accent-amber-bg);
  color: var(--accent-amber-text);
  border: 1px solid var(--accent-amber-border);
}

.badge-failed {
  background: var(--accent-red-bg);
  color: var(--accent-red-text);
  border: 1px solid var(--accent-red-border);
}

/* ==========================================================================
   DYNAMIC BANNER STUDIO (CLEAN WORKSPACE)
   ========================================================================== */

.studio-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
}

.studio-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  box-shadow: var(--shadow-card);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-control,
.form-input,
.form-select,
.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
  box-sizing: border-box;
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Segmented Aspect Ratio Control (Linear Style) */
.ratio-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.ratio-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.ratio-btn:hover {
  color: var(--text-main);
}

.ratio-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

/* Canvas Stage */
.canvas-preview-wrapper {
  background: #f1f5f9;
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 0);
  background-size: 20px 20px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  min-height: 540px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.05);
}

.canvas-toolbar-floating {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  z-index: 10;
}

.canvas-ratio-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.canvas-zoom-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

.canvas-zoom-btn:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

#bannerCanvas {
  max-width: 90%;
  max-height: 480px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: #000;
}

/* ==========================================================================
   AI COPY & POLICY LINTER (SEGMENTED TABS & REALISTIC MOCKUPS)
   ========================================================================== */

.platform-tab-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.platform-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.platform-tab-btn:hover {
  color: var(--text-main);
}

.platform-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.ai-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.char-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-top: 4px;
}

.char-count {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-green);
}

.char-count.warning { color: var(--accent-amber); }
.char-count.exceeded { color: var(--accent-red); }

/* Linter Compliance Card */
.linter-score-box {
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.linter-checks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.linter-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.linter-check-item.passed {
  color: #34d399;
}

.linter-check-item.failed {
  color: #f87171;
}

/* Device Mockups Frame */
.device-mockup-frame {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Instagram Post */
.mockup-instagram {
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.ig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.ig-user-info {
  display: flex;
  align-items: center;
  gap: 9px;
}

.ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(45deg, #f09433, #dc2743, #bc1888);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.ig-username {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-badge {
  color: #0284c7;
  font-size: 0.8rem;
}

.ig-sponsored {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ig-media-box {
  width: 100%;
  background: var(--bg-canvas);
}

.ig-media-img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.ig-cta-strip {
  background: var(--bg-canvas);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.ig-cta-strip:hover {
  background: var(--primary-light);
}

.ig-cta-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

.ig-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
}

.ig-action-left {
  display: flex;
  gap: 14px;
  font-size: 1.15rem;
  color: var(--text-main);
}

.ig-likes-count {
  padding: 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.ig-caption-box {
  padding: 0 14px 14px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.ig-caption-box a {
  color: var(--primary);
  text-decoration: none;
}

/* Facebook Post */
.mockup-facebook {
  background: #ffffff;
  border: 1px solid var(--border-color);
}

.fb-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.fb-name-meta h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.fb-name-meta span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.fb-text-body {
  padding: 10px 14px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-main);
}

.fb-link-preview {
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-color);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fb-link-info span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.fb-link-info h5 {
  font-size: 0.88rem;
  color: var(--text-main);
}

.fb-link-btn {
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

/* WhatsApp Bubble */
.mockup-whatsapp {
  background: #efeae2;
  border: 1px solid var(--border-color);
}

.wa-chat-header {
  background: #008069;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  color: #008069;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.wa-header-info h4 {
  font-size: 0.84rem;
  font-weight: 700;
  color: #ffffff;
}

.wa-header-info span {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.85);
}

.wa-chat-body {
  padding: 14px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 0);
  background-size: 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.wa-msg-bubble {
  background: #d9fdd3;
  border-radius: 8px 0px 8px 8px;
  padding: 10px 12px;
  max-width: 88%;
  color: #111b21;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.wa-msg-media {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 6px;
}

.wa-msg-text {
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: #111b21;
}

.wa-msg-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 6px;
}

.wa-action-btn {
  background: #ffffff;
  color: #008069;
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.wa-msg-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.65rem;
  color: #667781;
  margin-top: 4px;
}

/* Google SERP */
.mockup-google {
  background: #ffffff;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
}

.google-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #202124;
  margin-bottom: 4px;
}

.google-ad-badge {
  background: #ffffff;
  color: #202124;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #202124;
}

.google-headline-link {
  font-size: 1.15rem;
  font-weight: 500;
  color: #1a0dab;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
}

.google-headline-link:hover {
  text-decoration: underline;
}

.google-ratings-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: #e37400;
  margin-bottom: 6px;
}

.google-desc-text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #4d5156;
  margin-bottom: 12px;
}

.google-sitelinks-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}

.google-sitelink-item a {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1a0dab;
  text-decoration: none;
  display: block;
}

.google-sitelink-item span {
  font-size: 0.74rem;
  color: #4d5156;
}

/* YouTube Shorts */
.mockup-youtube {
  background: #0f0f0f;
  min-height: 400px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.yt-shorts-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.yt-shorts-overlay {
  position: relative;
  z-index: 2;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.yt-sidebar-actions {
  position: absolute;
  right: 12px;
  bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 3;
}

.yt-action-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.yt-action-icon span {
  font-size: 0.68rem;
  font-weight: 600;
}

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

.yt-sub-btn {
  background: #ff0000;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  border: none;
}

/* ==========================================================================
   CONNECTED CHANNELS HUB (STRIPE METRICS STYLE)
   ========================================================================== */

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

.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.channel-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.channel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.channel-meta::before {
  background: linear-gradient(90deg, #1877f2, #e1306c);
}

.channel-google::before {
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
}

.channel-whatsapp::before {
  background: linear-gradient(90deg, #25d366, #128c7e);
}

.channel-youtube::before {
  background: linear-gradient(90deg, #ff0000, #cc0000);
}

.channel-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.channel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.channel-brand-meta h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.channel-brand-meta span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.channel-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 12px 0;
}

.channel-stat-item {
  display: flex;
  flex-direction: column;
}

.channel-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.channel-stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.channel-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ==========================================================================
   UNIVERSAL STANDARDIZED MODAL SYSTEM (PHASE 11 UI HARDENING)
   ========================================================================== */

/* 1. Backdrop / Overlay Layer (z-index: 1000) */
.modal-backdrop,
.modal-overlay,
.modal-wrapper,
.modal {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-overlay, rgba(15, 23, 42, 0.45));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  z-index: 1000;
  overflow: hidden;
  pointer-events: auto;
  animation: modalFadeIn 0.18s ease-out;
}

.modal-backdrop.open,
.modal-backdrop.active,
.modal-overlay.open,
.modal-overlay.active,
.modal-wrapper.open,
.modal-wrapper.active,
.modal.open,
.modal.active {
  display: block !important;
}

/* Prevent nested backdrop from doubling blur/opacity */
.modal > .modal-backdrop {
  display: none !important;
}

/* 2. Modal Container / Dialog Card (z-index: 1010) */
.modal-card,
.modal-content,
.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1010;
  background: #ffffff;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow-modal, 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04));
  width: 95%;
  max-width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 !important;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal Size Modifiers */
.modal-card.modal-lg,
.modal-content.modal-lg,
.modal-dialog.modal-lg,
.modal-card[data-size="large"],
#publishAuditModal .modal-card,
#modalPaidCampaignWizard .modal-card,
#createCampaignModal .modal-content,
#utmBuilderModal .modal-card {
  max-width: min(900px, calc(100vw - 40px));
}

.modal-card.modal-sm,
.modal-content.modal-sm,
.modal-dialog.modal-sm,
#rescheduleContentModal .modal-card {
  max-width: min(480px, calc(100vw - 40px));
}

#marketingCostModal .modal-card,
#storeSettingsModal .modal-card {
  max-width: min(600px, calc(100vw - 40px));
}

/* Absolute constraint: Never allow width > calc(100vw - 32px) */
.modal-card,
.modal-content,
.modal-dialog {
  max-width: min(720px, calc(100vw - 32px));
}

.modal-card.modal-lg,
.modal-content.modal-lg,
.modal-dialog.modal-lg,
#publishAuditModal .modal-card,
#modalPaidCampaignWizard .modal-card,
#createCampaignModal .modal-content,
#utmBuilderModal .modal-card {
  max-width: min(900px, calc(100vw - 32px));
}

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

@keyframes modalScaleIn {
  from { transform: translate(-50%, -50%) scale(0.96); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 3. Modal Header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.modal-header .modal-title,
.modal-header h2,
.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close,
.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.modal-close:hover,
.modal-close-btn:hover {
  color: var(--text-main, #0f172a);
  background: var(--bg-elevated, #f1f5f9);
}

/* 4. Modal Body */
.modal-body {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  box-sizing: border-box;
}

/* 5. Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, #e2e8f0);
  background: var(--bg-canvas, #f8fafc);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 6. Form Grid Layout (CSS Grid 2-column) */
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-form-grid > * {
  min-width: 0;
}

.modal-form-grid .grid-col-full,
.modal-form-grid .full-width {
  grid-column: 1 / -1;
}

/* Input overflow prevention */
.modal-card input,
.modal-card select,
.modal-card textarea,
.modal-content input,
.modal-content select,
.modal-content textarea,
.modal-dialog input,
.modal-dialog select,
.modal-dialog textarea {
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* Dropdowns / Popovers inside modals (z-index: 1020) */
.modal-card .dropdown-menu,
.modal-content .dropdown-menu,
.modal-dialog .dropdown-menu,
.modal-card .popover,
.modal-content .popover,
.modal-dialog .popover {
  z-index: 1020;
}

/* 7. Responsive Breakpoints */
@media (max-width: 768px) {
  .modal-card,
  .modal-content,
  .modal-dialog {
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .modal-card,
  .modal-content,
  .modal-dialog {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    border-radius: 8px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-header {
    padding: 12px 14px;
  }

  .modal-header .modal-title h3,
  .modal-header h2 {
    font-size: 0.95rem;
  }

  .modal-footer {
    padding: 12px 14px;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button,
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .modal-form-grid {
    grid-template-columns: 1fr !important;
  }

  .modal-form-grid > * {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 390px) {
  .modal-card,
  .modal-content,
  .modal-dialog {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideIn 0.22s ease-out;
}

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   CONTENT CALENDAR (ENTERPRISE WEEKLY SCHEDULE & BOARD)
   ========================================================================== */

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.calendar-day-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 290px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.calendar-day-col:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.calendar-day-header {
  padding: 10px 12px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-day-header span:first-child {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.calendar-day-header span:last-child {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 4px;
}

.calendar-day-col:first-child .calendar-day-header {
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid rgba(99, 102, 241, 0.25);
}

.calendar-day-col:first-child .calendar-day-header span:first-child {
  color: #a5b4fc;
}

.calendar-day-col:first-child .calendar-day-header span:last-child {
  background: var(--primary);
  color: #fff;
}

.calendar-slot-item {
  margin: 8px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.calendar-slot-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.calendar-slot-item p {
  margin: 6px 0 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.calendar-empty-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 20px 10px;
  text-align: center;
}

/* ==========================================================================
   CODE & DATA CHIPS
   ========================================================================== */

code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--primary);
  display: inline-block;
  letter-spacing: -0.01em;
}

/* Channel Platform Tags */
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 4px;
  white-space: nowrap;
}

.pill-ig {
  background: rgba(225, 48, 108, 0.12);
  color: #f472b6;
  border: 1px solid rgba(225, 48, 108, 0.25);
}

.pill-fb {
  background: rgba(24, 119, 242, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(24, 119, 242, 0.25);
}

.pill-google {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pill-wa {
  background: rgba(37, 211, 102, 0.12);
  color: #4ade80;
  border: 1px solid rgba(37, 211, 102, 0.25);
}

.pill-yt {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   MODAL TABS (CONNECT STORE MODAL)
   ========================================================================== */

.modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.modal-tab-btn:hover {
  color: var(--text-main);
}

.modal-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

/* ==========================================================================
   MARKETING SLOT MODE SELECTOR (ORGANIC VS PAID)
   ========================================================================== */
.sched-mode-card {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.sched-mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}
.sched-mode-card.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.22);
}
.sched-mode-card.active.mode-organic {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}
.badge-free-organic {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-paid-boost {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ==========================================================================
   CUSTOM BANNER UPLOAD DROPZONE & STUDIO TABS
   ========================================================================== */
.banner-dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.4);
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.banner-dropzone:hover, .banner-dropzone.dragover {
  border-color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.09);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}
.banner-upload-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.studio-mode-tab-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}
.studio-mode-tab-btn:hover {
  color: var(--text-main);
}
.studio-mode-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

/* ==========================================================================
   CONTENT LIBRARY & BRAND ASSET HUB (Blueprint Section 10 & 21)
   ========================================================================== */
.lib-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.lib-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.lib-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
}

.lib-stat-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.lib-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.lib-stat-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.lib-brand-strip-container {
  margin-bottom: 18px;
}

.lib-brand-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.lib-brand-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.lib-brand-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.lib-brand-pill.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
}

.lib-brand-pill .pill-count {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

.lib-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.lib-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-width: 260px;
  flex: 1;
  color: var(--text-muted);
}

.lib-search-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.82rem;
  width: 100%;
  outline: none;
}

.lib-search-box input::placeholder {
  color: var(--text-muted);
}

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

.lib-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.lib-select:focus {
  border-color: var(--accent-indigo);
  color: #fff;
}

.lib-subtabs {
  display: flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.lib-subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.lib-subtab-btn:hover {
  color: var(--text-main);
}

.lib-subtab-btn.active {
  background: #ffffff;
  color: var(--primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.lib-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.lib-media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-fast);
  position: relative;
}

.lib-media-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.lib-thumb-box {
  position: relative;
  height: 220px;
  background: #090d16;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-subtle);
}

.lib-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.lib-media-card:hover .lib-thumb-img {
  transform: scale(1.04);
}

.lib-badge-format {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #38bdf8;
  font-family: var(--font-mono);
}

.lib-badge-platforms {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.lib-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lib-card-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.lib-card-brand {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-indigo);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lib-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

.lib-card-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.lib-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}

.btn-repost-action {
  flex: 1;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-repost-action:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
  transform: translateY(-1px);
}

.btn-lib-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-lib-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Reusable Captions Grid */
.lib-captions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 18px;
}

.lib-caption-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
}

.lib-caption-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.lib-caption-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.lib-caption-body {
  background: var(--bg-canvas);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: inherit;
  max-height: 140px;
  overflow-y: auto;
}

.lib-hashtags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hashtag-chip {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
}

.lib-caption-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Campaign Rollout Card (Blueprint Sec 21) */
.campaign-pack-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-card);
}

.campaign-pack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.campaign-days-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.campaign-day-pill {
  background: var(--bg-canvas);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  transition: var(--transition);
}

.campaign-day-pill:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.day-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.day-theme {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.day-brand {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ==========================================================================
   CAMPAIGN MANAGEMENT MODULE (PHASE 1)
   ========================================================================== */

.campaign-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.campaign-table th {
  padding: 10px 14px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-color);
}

.campaign-table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.campaign-table tr:hover td {
  background: var(--bg-card-hover);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.status-active {
  background: var(--accent-green-bg);
  color: var(--accent-green-text);
  border: 1px solid var(--accent-green-border);
}

.status-badge.status-draft {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.status-badge.status-paused {
  background: var(--accent-amber-bg);
  color: var(--accent-amber-text);
  border: 1px solid var(--accent-amber-border);
}

.status-badge.status-completed {
  background: var(--accent-blue-bg);
  color: var(--accent-blue-text);
  border: 1px solid var(--accent-blue-border);
}

.status-badge.status-archived {
  background: #f1f5f9;
  color: var(--text-dim);
  border: 1px solid #cbd5e1;
}

.objective-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  background: #f8fafc;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.wizard-steps {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 18px;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-x: auto;
  gap: 8px;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.wizard-step-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.wizard-step.active {
  color: var(--primary);
}

.wizard-step.active .wizard-step-circle {
  background: var(--primary);
  color: #ffffff;
}

.wizard-step.completed {
  color: var(--accent-green-text);
}

.wizard-step.completed .wizard-step-circle {
  background: var(--accent-green);
  color: #ffffff;
}

.product-select-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
}

.product-select-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.product-select-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ==========================================================================
   PHASE 2: CONTENT CREATION ENGINE & UNIVERSAL TEMPLATES SYSTEM
   ========================================================================== */

/* Step Header */
.creation-steps-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.creation-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.creation-step-card:hover {
  border-color: var(--border-hover);
}

.step-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.step-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.step-card-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.step-card-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
}

/* Step 1: Content Type Cards Grid */
.content-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.content-type-card {
  padding: 16px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.content-type-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.content-type-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow-sm);
}

.content-type-card .type-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.content-type-card .type-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.content-type-card .type-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Step 2: Context & Live Catalog Product Card */
.live-catalog-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.live-catalog-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.live-catalog-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-catalog-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.live-catalog-pricing {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-price-sale {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-green-text);
}

.live-price-mrp {
  font-size: 0.82rem;
  text-decoration: line-through;
  color: var(--text-dim);
}

.live-price-discount {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-green-bg);
  color: var(--accent-green-text);
  border: 1px solid var(--accent-green-border);
}

.price-drift-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber-text);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Step 3: Creative Options & Studio Connect */
.creative-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.creative-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.creative-action-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.creative-action-btn.active {
  border-color: var(--primary);
  border-style: solid;
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary);
}

.creative-preview-viewport {
  position: relative;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 105px;
  padding: 12px;
  transition: all 0.2s ease;
}

.creative-preview-viewport.has-media {
  background: #0f172a;
  border-style: solid;
  border-color: #1e293b;
  min-height: 280px;
  padding: 16px;
}

.creative-preview-viewport img,
.creative-preview-viewport svg {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
}

.aspect-ratio-selector {
  display: inline-flex;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 3px;
}

.aspect-ratio-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.aspect-ratio-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Step 4: Copy & Platform Tabs */
.platform-tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1.5px solid var(--border-color);
  margin-bottom: 16px;
}

.platform-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
  transition: var(--transition);
}

.platform-tab-btn:hover {
  color: var(--text-main);
}

.platform-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.ai-assistant-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  align-items: center;
}

.ai-strip-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.ai-strip-btn:hover {
  border-color: var(--accent-purple-border);
  color: var(--accent-purple-text);
  background: var(--accent-purple-bg);
}

/* Step 5: Realistic Platform Previews */
.preview-simulator-grid {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: 0 auto;
}

.social-sim-shell {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.social-sim-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.social-sim-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

.social-sim-media {
  width: 100%;
  aspect-ratio: 1/1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.social-sim-media img,
.social-sim-media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-sim-body {
  padding: 14px 16px;
}

.social-sim-caption {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}

.social-sim-hashtags {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.social-sim-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

.social-sim-cta-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Universal Template Library Grid */
.templates-category-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
}

.category-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.category-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

.template-catalog-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.template-catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.template-card-preview {
  height: 140px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: #ffffff;
  text-align: center;
}

.template-card-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.template-card-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.template-badges-strip {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
}

.template-ratio-pill {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-weight: 600;
}

.template-card-actions {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
}

/* Creative Batch Generator Output */
.batch-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.batch-item-box {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.batch-item-preview {
  width: 100%;
  background: #0f172a;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 140px;
}

.batch-item-preview img,
.batch-item-preview svg {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.batch-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.batch-item-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   PHASE 3: SCHEDULER, CALENDAR UPGRADE & PUBLISHING MONITOR STYLES
   ========================================================================== */

/* Calendar Top Toolbar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.calendar-toolbar-left,
.calendar-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-view-btn-group {
  display: flex;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.calendar-view-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-view-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.calendar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-nav-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.calendar-current-date-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  min-width: 170px;
}

.calendar-timezone-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  padding: 4px 10px;
  border-radius: 20px;
}

.badge-simulation-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

/* Pause Alert Banner */
.pause-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.pause-alert-banner.hidden {
  display: none;
}

.pause-alert-banner .pause-text {
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Month Grid Layout */
.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.calendar-month-cell {
  min-height: 110px;
  border: 1px solid #f1f5f9;
  border-radius: 6px;
  padding: 6px;
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.calendar-month-cell:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.calendar-month-cell.today {
  border: 1.5px solid var(--primary);
  background: #f8faff;
}

.calendar-month-cell.drag-over {
  background: #eff6ff;
  border: 2px dashed var(--primary);
}

.calendar-month-cell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.calendar-month-cell.today .calendar-month-cell-header {
  color: var(--primary);
}

/* Calendar Scheduled Item Card */
.calendar-slot-item {
  cursor: grab;
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
  margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
}

.calendar-slot-item:hover {
  border-color: #94a3b8;
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.calendar-slot-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.calendar-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 4px;
}

.calendar-slot-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.calendar-slot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #64748b;
}

.calendar-slot-channels {
  display: flex;
  gap: 3px;
  align-items: center;
}

.channel-tag-tiny {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  text-transform: uppercase;
}
.channel-tag-ig { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.channel-tag-fb { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.channel-tag-yt { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.channel-tag-wa { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Status Badges */
.badge-status-ready { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-status-scheduled { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-status-publishing { background: #fefce8; color: #a16207; border: 1px solid #fef08a; animation: pulse 1.5s infinite; }
.badge-status-published { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.badge-status-blocked { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-status-failed { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-status-paused { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.badge-status-cancelled { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; text-decoration: line-through; }

/* Sanity Guard Checklist in Modal */
.sanity-guard-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px;
}

.sanity-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid #f1f5f9;
}

.sanity-check-item.passed .sanity-check-icon {
  color: #10b981;
}

.sanity-check-item.failed .sanity-check-icon {
  color: #ef4444;
}

.sanity-check-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sanity-check-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.sanity-check-detail {
  font-size: 0.74rem;
  color: #64748b;
}

.sanity-check-warning {
  font-size: 0.72rem;
  color: #b45309;
  background: #fffbeb;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 2px;
  display: inline-block;
}

/* Publishing Activity Monitor Table */
.publishing-monitor-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

.monitor-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.monitor-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.monitor-filter-tab {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.monitor-filter-tab:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.monitor-filter-tab.active {
  background: #1e293b;
  color: #ffffff;
  border-color: #1e293b;
}

/* Modal Drawer Styling */
.modal-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  justify-content: flex-end;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

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

.modal-drawer-content {
  width: 580px;
  max-width: 95vw;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-drawer-overlay.active .modal-drawer-content {
  transform: translateX(0);
}

.modal-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-drawer-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.modal-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* ==========================================================================
   PHASE 4: LIVE SOCIAL CHANNEL CONNECTIONS & PRODUCTION PUBLISHING UI
   ========================================================================== */

.phase4-badge-simulation {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #b45309 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.phase4-badge-live {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #047857 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mode-toggle-pill {
  display: inline-flex;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 3px;
  gap: 3px;
}

.mode-toggle-option {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: all 0.15s ease;
}

.mode-toggle-option.active-sim {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}

.mode-toggle-option.active-live {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.3);
}

.channel-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
}

.channel-status-CONNECTED { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.channel-status-CONNECTING { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.channel-status-DISCONNECTED { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.channel-status-TOKEN_EXPIRED { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.channel-status-PERMISSION_ERROR { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.channel-status-CONFIGURATION_ERROR { background: #ffedd5; color: #c2410c; border: 1px solid #fed7aa; }
.channel-status-SUSPENDED { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }

.channel-capabilities-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.capability-chip {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
}

.publish-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.publish-history-table th, .publish-history-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.publish-history-table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
}

/* ==========================================================================
   PHASE 5: LIVE SOCIAL ANALYTICS & ATTRIBUTION STYLES
   ========================================================================== */

.btn-date-filter {
  background: transparent;
  border: none;
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-date-filter:hover {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.btn-date-filter.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid var(--border-color);
}

.analytics-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.analytics-tab-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.analytics-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
}

.analytics-tab-pane {
  display: block;
}

.platform-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-subtle);
  font-size: 0.78rem;
}

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

.metric-unsupported {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.73rem;
}

/* ==============================================================================
   PHASE 6: PAID ADS COMMAND CENTER & CAMPAIGN CONTROL STYLES (STRICT LIGHT SAAS)
   ============================================================================== */

.ads-nav-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-canvas);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}

.ads-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ads-tab-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.ads-tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--border-color);
}

.ads-tab-pane {
  display: none;
}

.ads-tab-pane.active {
  display: block;
}

/* KPI Cards */
.ads-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.ads-kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ads-kpi-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ads-kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.ads-kpi-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* System Classification Badges (Phase 6.10) */
.badge-classification {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-classification-WINNING {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-classification-ACTIVE {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.badge-classification-LEARNING {
  background: #fefce8;
  color: #ca8a04;
  border: 1px solid #fef08a;
}

.badge-classification-UNDERPERFORMING {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-classification-FATIGUED {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
}

.badge-classification-PAUSED {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Approval Modes Badges (Phase 6.9) */
.badge-approval {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-approval-RECOMMEND_ONLY {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-approval-REQUIRE_APPROVAL {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-approval-AUTO_EXECUTE {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Wizard Progress Indicators */
.wizard-steps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.wizard-step-bubble {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wizard-step-bubble.active {
  color: var(--primary);
  font-weight: 700;
}

.wizard-step-bubble.completed {
  color: var(--accent-green-text);
}

.step-number-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
}

.wizard-step-bubble.active .step-number-circle {
  background: var(--primary);
  color: #ffffff;
}

.wizard-step-bubble.completed .step-number-circle {
  background: #10b981;
  color: #ffffff;
}

.wizard-step-content {
  padding: 20px;
  display: none;
}

.wizard-step-content.active {
  display: block;
}

/* Simulation Badges */
.badge-simulation-mode {
  background: #fdf4ff;
  color: #a21caf;
  border: 1px solid #f0abfc;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================================== */
/* PHASE 7: OMNICHANNEL ORCHESTRATION & CUSTOMER JOURNEY (LIGHT SAAS)             */
/* ============================================================================== */

/* Funnel Step Box */
.journey-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.journey-step-row:hover {
  border-color: #c7d2fe;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.06);
}

.journey-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.journey-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 140px;
}

.journey-step-bar-wrap {
  flex: 1;
  background: #f1f5f9;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.journey-step-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
  border-radius: 5px;
  transition: width 0.4s ease;
}

.journey-step-metrics {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.journey-step-dropoff {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* Budget Comparison Meter Card */
.budget-meter-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.budget-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-meter-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-bar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0;
}

.budget-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.budget-bar-track {
  background: #f1f5f9;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.budget-bar-current {
  background: #3b82f6;
  height: 100%;
  border-radius: 4px;
}

.budget-bar-recommended {
  background: #10b981;
  height: 100%;
  border-radius: 4px;
}

/* Recommendation Card */
.rec-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.rec-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.rec-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.rec-priority-high {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.rec-priority-medium {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.rec-priority-low {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

/* ========================================================
   PHASE 8: CUSTOMER LIFECYCLE & RETENTION LIGHT SAAS UI
   ======================================================== */

.subtab-bar {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  overflow-x: auto;
  background: #ffffff;
  padding: 6px 8px;
  border-radius: 8px;
}

.subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.subtab-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.subtab-btn.active {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
  font-weight: 600;
}

/* Lifecycle State Badges */
.lifecycle-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lifecycle-badge.state-visitor {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.lifecycle-badge.state-prospect {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.lifecycle-badge.state-product-interested,
.lifecycle-badge.state-product_interested {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.lifecycle-badge.state-cart-abandoned,
.lifecycle-badge.state-cart_abandoned {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.lifecycle-badge.state-customer {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.lifecycle-badge.state-repeat-customer,
.lifecycle-badge.state-repeat_customer {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.lifecycle-badge.state-high-value,
.lifecycle-badge.state-high_value {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.lifecycle-badge.state-at-risk,
.lifecycle-badge.state-at_risk {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.lifecycle-badge.state-churned {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.lifecycle-badge.state-reactivated {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
}

/* RFM Score Pills */
.rfm-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.rfm-score-high {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.rfm-score-mid {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.rfm-score-low {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

/* Privacy Hashed ID Styling */
.hash-pill {
  font-family: var(--font-mono, monospace);
  font-size: 0.74rem;
  color: #475569;
  background: #f8fafc;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

/* Cohort Cell Matrix Heatmap Styling */
.cohort-cell {
  text-align: center;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 8px 6px;
}

.cohort-cell-high {
  background: #dcfce7;
  color: #166534;
}

.cohort-cell-med {
  background: #f0fdf4;
  color: #15803d;
}

.cohort-cell-low {
  background: #fefce8;
  color: #854d0e;
}

.cohort-cell-empty {
  background: #f8fafc;
  color: #94a3b8;
}

/* =========================================================================
   PHASE 9: PRODUCTION COMMUNICATIONS & CUSTOMER JOURNEYS (LIGHT SAAS)
   ========================================================================= */

.comm-subtabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.comm-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.comm-tab-btn:hover {
  color: #0f172a;
}

.comm-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.comm-tab-pane {
  display: none;
}

.comm-tab-pane.active {
  display: block;
}

.journey-pipeline {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 16px 8px;
  gap: 12px;
}

.journey-node {
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============================================================
   PHASE 10: ENTERPRISE INTELLIGENCE & OPTIMIZATION STYLES
   ============================================================ */
.ent-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease-in-out;
}

.ent-tab-btn:hover {
  color: #1e293b;
  border-bottom-color: #cbd5e1;
}

.ent-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 700;
}

.ent-tab-pane {
  display: none;
}

.ent-tab-pane.active {
  display: block;
}

.ent-alert-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.ent-alert-card.critical {
  border-left: 4px solid #ef4444;
}

.ent-alert-card.warning {
  border-left: 4px solid #f59e0b;
}

.ent-alert-card.info {
  border-left: 4px solid #3b82f6;
}

.ent-rec-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* User Profile Dropdown & Modal Styles */
.profile-dropdown-card {
  animation: fadeInDown 0.16s ease-out;
}

.dropdown-item-btn {
  transition: all 0.15s ease;
}

.dropdown-item-btn:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.04)) !important;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   LIGHT SAAS LOGIN & STORE SELECTION RESPONSIVE STYLES
   ========================================================================== */
.light-saas-login-page,
.light-saas-store-selection {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.login-saas-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.store-select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.store-select-card:hover {
  border-color: #2563eb;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

@media (max-width: 768px) {
  .login-saas-card {
    padding: 32px 24px !important;
    max-width: 90vw !important;
  }
}

@media (max-width: 390px) {
  .login-saas-card {
    padding: 24px 16px !important;
    max-width: calc(100vw - 20px) !important;
  }
}

/* ==========================================================================
   SAAS-2 STEP 8: FRONTEND ENTITLEMENT GATING STYLES
   ========================================================================== */
.feature-locked {
  position: relative;
  opacity: 0.72;
  transition: opacity 0.2s ease;
}

.feature-locked:hover {
  opacity: 0.95;
}

.entitlement-lock-badge {
  display: inline-block;
  font-size: 0.78rem;
  margin-left: 5px;
  vertical-align: middle;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

.gated-disabled {
  opacity: 0.48 !important;
  cursor: not-allowed !important;
  filter: grayscale(0.2);
}

.gated-disabled:hover {
  filter: grayscale(0.2);
}

.feature-locked-screen {
  animation: fadeIn 0.2s ease-in-out;
}

