/* ============================================================
   OUTREACH by Viral Makers — Light Professional Theme
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  /* VM Brand */
  --vm-pink: #ff187c;
  --vm-cyan: #71fcff;
  --vm-dark: #1c091c;

  --bg: #f5f6fa;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-sidebar-hover: #fdf2f7;
  --bg-sidebar-active: rgba(255, 24, 124, 0.07);
  --bg-topbar: #ffffff;
  --bg-input: #f5f6fa;
  --bg-input-focus: #ffffff;

  --text: #1e1e2d;
  --text-secondary: #5e5e76;
  --text-muted: #9b9bb0;
  --text-sidebar: #5e5e76;
  --text-sidebar-hover: #1e1e2d;
  --text-sidebar-active: var(--vm-pink);
  --text-on-primary: #ffffff;

  --primary: var(--vm-pink);
  --primary-hover: #e5156f;
  --primary-light: rgba(255, 24, 124, 0.05);
  --primary-border: rgba(255, 24, 124, 0.15);

  --accent: var(--vm-cyan);
  --accent-light: rgba(113, 252, 255, 0.08);
  --accent-border: rgba(113, 252, 255, 0.25);

  --border: #eaeaf2;
  --border-light: #f2f2f8;
  --border-sidebar: #eaeaf2;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Brand colors (sub-brands) */
  --brand-viuty: #14b8a6;
  --brand-primalis: #9f5255;
  --brand-mylo: #eab308;

  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

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

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

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

a {
  color: var(--vm-pink);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--primary-hover); }

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

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

::selection {
  background: rgba(255, 24, 124, 0.15);
  color: var(--text);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.6rem; letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-success { color: var(--success); }

.mono { font-family: var(--font-mono); }

/* ---------- Layout: Sidebar + Main ---------- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

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

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

.sidebar-logo h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--vm-pink);
  letter-spacing: -0.03em;
  margin: 0;
}

.sidebar-logo .logo-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* -- Nav links -- */
.sidebar-nav {
  padding: 16px 0;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  color: var(--text-sidebar);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar-nav a:hover {
  color: var(--text-sidebar-hover);
  background: var(--bg-sidebar-hover);
}

.sidebar-nav a.active {
  color: var(--vm-pink);
  background: var(--bg-sidebar-active);
  border-left-color: var(--vm-pink);
  font-weight: 600;
}

.sidebar-nav a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

/* -- Brand filter -- */
.sidebar-brands {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

.sidebar-brands h4 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.brand-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-sidebar);
  transition: color 0.15s ease;
}

.brand-filter-item:hover { color: var(--text); }
.brand-filter-item.active { color: var(--text); font-weight: 600; }

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.brand-dot.viuty,
.brand-dot.viuty_it,
.brand-dot.viuty_de { background: var(--brand-viuty); }
.brand-dot.primalis { background: var(--brand-primalis); }
.brand-dot.mylo { background: var(--brand-mylo); }

/* -- User info -- */
.sidebar-user {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user .user-name {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
}

.sidebar-user .logout-link {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sidebar-user .logout-link:hover { color: var(--danger); }

.sidebar-bottom-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-toggle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 7px;
  border-radius: 4px;
  text-decoration: none;
}
.lang-toggle:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-separator {
  height: 1px;
  background: var(--border);
  margin: 6px 18px;
}

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

/* -- Top bar -- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-topbar);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.top-bar h1 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 700;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* -- Content body -- */
.content-body {
  padding: 28px 32px;
  flex: 1;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--text-on-primary);
  box-shadow: 0 4px 16px rgba(255, 24, 124, 0.35);
}

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

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.14);
}

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

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 11px 24px;
  font-size: 0.95rem;
}

.btn-icon { padding: 6px 8px; }

.btn[disabled], .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

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

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

.card-header h3 { margin: 0; }

.card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* ---------- Stats Grid ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-card .stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card .stat-change { font-size: 0.75rem; margin-top: 4px; }
.stat-card .stat-change.up { color: var(--success); }
.stat-card .stat-change.down { color: var(--danger); }

/* ---------- Pipeline Status Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-discovered {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.badge-shortlisted {
  background: rgba(168, 85, 247, 0.08);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-messaged {
  background: var(--info-bg);
  color: #2563eb;
  border: 1px solid var(--info-border);
}

.badge-responded {
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-negotiating {
  background: var(--warning-bg);
  color: #d97706;
  border: 1px solid var(--warning-border);
}

.badge-invited {
  background: rgba(168, 85, 247, 0.08);
  color: #7c3aed;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.badge-accepted {
  background: rgba(20, 184, 166, 0.08);
  color: #0d9488;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.badge-sample_approved {
  background: var(--warning-bg);
  color: #d97706;
  border: 1px solid var(--warning-border);
}

.badge-onboarded {
  background: var(--success-bg);
  color: #059669;
  border: 1px solid var(--success-border);
}

.badge-active {
  background: var(--success-bg);
  color: #059669;
  border: 1px solid var(--success-border);
}

.badge-rejected {
  background: var(--danger-bg);
  color: #dc2626;
  border: 1px solid var(--danger-border);
}

.badge-blacklisted {
  background: #f1f1f5;
  color: #64748b;
  border: 1px solid #e2e2ea;
}

.badge-pending {
  background: var(--warning-bg);
  color: #d97706;
  border: 1px solid var(--warning-border);
}

/* Campaign status badges */
.badge-status-active { background: var(--success-bg); color: #059669; border: 1px solid var(--success-border); }
.badge-status-paused { background: var(--warning-bg); color: #d97706; border: 1px solid var(--warning-border); }
.badge-status-completed { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }

.badge-phase {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.62rem;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

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

thead th {
  background: #f8fafc;
  padding: 11px 16px;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
  vertical-align: middle;
}

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

tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

table .checkbox-col { width: 36px; text-align: center; }
table .actions-col { text-align: right; white-space: nowrap; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.88rem;
  transition: all 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--vm-pink);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(255, 24, 124, 0.08);
}

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

textarea.form-control {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

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

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.form-inline .form-group { margin-bottom: 0; }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--vm-pink);
  cursor: pointer;
}

/* Radio buttons */
.radio-group { display: flex; flex-direction: column; gap: 10px; }

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-option:hover { border-color: #cbd5e1; }

.radio-option.selected {
  border-color: var(--vm-pink);
  background: var(--primary-light);
}

.radio-option input[type="radio"] { accent-color: var(--vm-pink); margin-top: 2px; }
.radio-option .radio-label { font-weight: 500; color: var(--text); }
.radio-option .radio-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Filter / Search Bar ---------- */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-bar .form-group { margin-bottom: 0; min-width: 140px; }
.filter-bar .form-group.search-group { flex: 1; min-width: 200px; }

.search-input { position: relative; }
.search-input input { padding-left: 36px; }

.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ---------- View Toggle ---------- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.view-toggle button {
  padding: 6px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.view-toggle button:not(:last-child) { border-right: 1px solid var(--border); }

.view-toggle button.active,
.view-toggle button:hover {
  background: var(--primary-light);
  color: var(--vm-pink);
}

/* ---------- Creator Cards (Grid View) ---------- */
.creators-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.creator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
}

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

.creator-card .creator-checkbox { position: absolute; top: 14px; right: 14px; }

.creator-card .creator-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  overflow: hidden;
  border: 2px solid var(--border-light);
}

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

.creator-card .creator-name { font-weight: 600; color: var(--text); font-size: 0.95rem; }

.creator-card .creator-username { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }

.creator-card .creator-stats { display: flex; gap: 16px; margin-bottom: 12px; }

.creator-card .creator-stat { text-align: center; }

.creator-card .creator-stat .stat-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.creator-card .creator-stat .stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.creator-card .creator-actions { display: flex; gap: 6px; margin-top: 12px; }

/* ---------- Pipeline Funnel ---------- */
.pipeline-funnel { display: flex; flex-direction: column; gap: 8px; }

.pipeline-row { display: flex; align-items: center; gap: 14px; }

.pipeline-row .pipeline-label {
  width: 120px;
  font-size: 0.8rem;
  text-transform: capitalize;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
  font-weight: 500;
}

.pipeline-row .pipeline-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-light);
}

.pipeline-row .pipeline-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.pipeline-bar.discovered { background: #94a3b8; }
.pipeline-bar.shortlisted { background: #a855f7; }
.pipeline-bar.messaged { background: #3b82f6; }
.pipeline-bar.responded { background: #6366f1; }
.pipeline-bar.negotiating { background: #f59e0b; }
.pipeline-bar.invited { background: #8b5cf6; }
.pipeline-bar.accepted { background: #14b8a6; }
.pipeline-bar.sample_approved { background: #f59e0b; }
.pipeline-bar.onboarded { background: #10b981; }
.pipeline-bar.active { background: #22c55e; }
.pipeline-bar.rejected { background: #ef4444; }
.pipeline-bar.blacklisted { background: #94a3b8; }

.pipeline-row .pipeline-count {
  width: 40px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  flex-shrink: 0;
}

/* ---------- Activity Log ---------- */
.activity-list { list-style: none; padding: 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

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

.activity-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 2px;
  font-weight: 600;
}

.activity-icon.search { background: var(--info-bg); color: #2563eb; }
.activity-icon.message { background: rgba(168, 85, 247, 0.08); color: #7c3aed; }
.activity-icon.status { background: rgba(20, 184, 166, 0.08); color: #0d9488; }
.activity-icon.campaign { background: var(--warning-bg); color: #d97706; }
.activity-icon.import { background: var(--success-bg); color: #059669; }
.activity-icon.collab { background: var(--success-bg); color: #059669; }

.activity-text { flex: 1; color: var(--text-secondary); }
.activity-text strong { color: var(--text); }

.activity-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

/* ---------- Brand Stats Cards ---------- */
.brand-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.brand-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.brand-stat-card.viuty::before,
.brand-stat-card.viuty_it::before,
.brand-stat-card.viuty_de::before { background: var(--brand-viuty); }
.brand-stat-card.primalis::before { background: var(--brand-primalis); }
.brand-stat-card.mylo::before { background: var(--brand-mylo); }

.brand-stat-card .brand-name { font-weight: 600; font-size: 0.9rem; margin-bottom: 12px; color: var(--text); }

.brand-stat-card .brand-counts { display: flex; gap: 18px; }

.brand-stat-card .brand-count { text-align: center; }

.brand-stat-card .brand-count .count-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.brand-stat-card .brand-count .count-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Template Editor ---------- */
.template-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.template-editor .editor-panel { display: flex; flex-direction: column; }

.template-editor textarea.form-control {
  min-height: 240px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
}

.template-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-height: 240px;
}

.template-preview h4 {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.template-preview .preview-content {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.placeholders-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.placeholder-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #0e9aa0;
  font-weight: 500;
}

/* ---------- Campaign Cards ---------- */
.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.campaign-card .campaign-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.campaign-card .campaign-name { font-weight: 600; font-size: 1rem; color: var(--text); }
.campaign-card .campaign-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }

.campaign-card .campaign-stats {
  display: flex;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.campaign-card .campaign-stat { text-align: center; }

.campaign-card .campaign-stat .c-stat-num {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.campaign-card .campaign-stat .c-stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 30, 45, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

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

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}
.modal-close:hover { color: var(--text); background: var(--bg); }

.modal-body { margin-bottom: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Flash Messages ---------- */
.flash-messages { padding: 0 32px; margin-top: 16px; }

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 12px;
  animation: flashIn 0.3s ease;
  font-weight: 500;
}

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

.flash-success { background: var(--success-bg); border: 1px solid var(--success-border); color: #059669; }
.flash-error { background: var(--danger-bg); border: 1px solid var(--danger-border); color: #dc2626; }
.flash-info { background: var(--info-bg); border: 1px solid var(--info-border); color: #2563eb; }

.flash-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0 4px;
}
.flash-dismiss:hover { opacity: 1; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.pagination a:hover { background: var(--bg); color: var(--text); }
.pagination .active { background: var(--vm-pink); color: white; font-weight: 600; }
.pagination .disabled { opacity: 0.3; pointer-events: none; }
.pagination .ellipsis { color: var(--text-muted); }

/* ---------- Loading Spinner ---------- */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--vm-pink);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-muted);
  gap: 12px;
  font-size: 0.9rem;
}

/* ---------- Bulk Action Bar ---------- */
.bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(calc(-50% + 120px));
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: bulkBarIn 0.2s ease;
}

.bulk-bar.hidden { display: none; }

@keyframes bulkBarIn {
  from { opacity: 0; transform: translateX(calc(-50% + 120px)) translateY(10px); }
  to { opacity: 1; transform: translateX(calc(-50% + 120px)) translateY(0); }
}

.bulk-bar .bulk-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--vm-pink);
  font-weight: 600;
  white-space: nowrap;
}

.bulk-bar .bulk-actions { display: flex; gap: 8px; }

.bulk-bar .bulk-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
}
.bulk-bar .bulk-cancel:hover { color: var(--text); }

/* ---------- Note Banner ---------- */
.note-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #2563eb;
  margin-bottom: 22px;
  font-weight: 500;
}

.note-banner.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #d97706;
}

/* ---------- Creator Detail Page ---------- */
.creator-header {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.creator-header .avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border);
}

.creator-header .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.creator-header .creator-info h2 { margin-bottom: 2px; }
.creator-header .creator-info .username { color: var(--text-muted); font-size: 0.9rem; }

.detail-stats {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.detail-stat { text-align: center; }

.detail-stat .d-stat-num {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.detail-stat .d-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 26px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--bg-card);
}

.timeline-item.highlight::before { background: var(--vm-pink); }
.timeline-item .timeline-date { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; }
.timeline-item .timeline-text { font-size: 0.85rem; color: var(--text-secondary); }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state h3 { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; max-width: 400px; margin: 0 auto 16px; }

/* ---------- Section Heading ---------- */
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0; }

/* ---------- Login Page ---------- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 400px;
  max-width: 90%;
  box-shadow: var(--shadow-md);
}

.login-card .login-logo { text-align: center; margin-bottom: 32px; }

.login-card .login-logo h1 {
  font-size: 1.5rem;
  color: var(--vm-pink);
  margin-bottom: 4px;
  font-weight: 700;
}

.login-card .login-logo p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.login-card .login-error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---------- Spacing Utilities ---------- */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .template-editor { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    transition: left 0.3s ease;
    z-index: 200;
  }

  .sidebar.open { left: 0; }
  .main-content { margin-left: 0; }
  .top-bar { padding: 14px 16px; }
  .content-body { padding: 16px; }
  .mobile-menu-btn { display: flex; }

  .bulk-bar { left: 16px; right: 16px; transform: none; width: auto; }

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

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-group { min-width: 100%; }
  .creators-grid { grid-template-columns: 1fr; }
  .campaigns-grid { grid-template-columns: 1fr; }
  .brand-stats-grid { grid-template-columns: 1fr; }
  .pipeline-row .pipeline-label { width: 80px; font-size: 0.7rem; }
  .flash-messages { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .detail-stats { flex-wrap: wrap; gap: 16px; }
  .creator-header { flex-direction: column; text-align: center; }
}

/* Mobile menu button (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(30, 30, 45, 0.2);
  backdrop-filter: blur(2px);
  z-index: 150;
}

.sidebar-backdrop.active { display: block; }

/* ---------- Scrollbar styling ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dddde5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c0c0cc; }

/* ---------- Flow Steps Visual ---------- */
.flow-steps-visual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.flow-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  width: 100%;
}
.flow-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--vm-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--primary-border);
}
.flow-step-content { flex: 1; }
.flow-step-type {
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: capitalize;
  color: var(--text);
}
.flow-step-detail {
  font-size: 0.78rem;
  margin-top: 2px;
}
.flow-step-arrow {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 8px;
}

/* ---------- Settings-specific ---------- */
.shop-card {
  transition: all 0.15s ease;
}
.shop-card:hover {
  border-color: #d1d5e0 !important;
  box-shadow: var(--shadow-sm);
}
