/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0a0a0a;
  --bg-2: #0d0d0d;
  --bg-3: #111111;
  --bg-card: #141414;
  --bg-card-hover: #181818;
  --border: #1e1e1e;
  --border-cyan: rgba(0, 229, 255, 0.2);
  --cyan: #00E5FF;
  --cyan-dim: rgba(0, 229, 255, 0.08);
  --cyan-glow: rgba(0, 229, 255, 0.15);
  --cyan-glow-strong: rgba(0, 229, 255, 0.3);
  --white: #ffffff;
  --white-dim: rgba(255, 255, 255, 0.7);
  --white-muted: rgba(255, 255, 255, 0.4);
  --white-faint: rgba(255, 255, 255, 0.12);
  --red: #ff3b3b;
  --red-dim: rgba(255, 59, 59, 0.12);
  --green: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.1);
  --yellow: #ffd60a;
  --yellow-dim: rgba(255, 214, 10, 0.1);
  --purple: #b855ff;
  --purple-dim: rgba(184, 85, 255, 0.1);
  --orange: #ff6b2b;
  --orange-dim: rgba(255, 107, 43, 0.1);
  --pink: #ff2d78;
  --pink-dim: rgba(255, 45, 120, 0.1);
  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-cyan: 0 0 20px rgba(0, 229, 255, 0.08), 0 0 40px rgba(0, 229, 255, 0.04);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  --transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.4); }

/* ===== UTILITY CLASSES ===== */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.text-cyan { color: var(--cyan); }
.text-muted { color: var(--white-muted); }
.text-dim { color: var(--white-dim); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-purple { color: var(--purple); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-500 { font-weight: 500; }
.fs-sm { font-size: 12px; }
.fs-xs { font-size: 11px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== GRID BACKGROUND PATTERN ===== */
.grid-bg {
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== NOISE TEXTURE ===== */
.noise::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ===== LOGIN VIEW ===== */
#view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#view-login .login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 229, 255,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(0, 229, 255,0.04) 0%, transparent 60%),
    var(--bg);
  background-size: 40px 40px, 40px 40px, auto;
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 229, 255,0.06) 0%, transparent 70%),
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), 0 0 60px rgba(0, 229, 255,0.06);
}

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

.login-logo .wordmark {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--white);
  display: block;
}

.login-logo .wordmark span {
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(0, 229, 255,0.5);
}

.login-logo .tagline {
  font-size: 11px;
  color: var(--white-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 6px;
  font-family: var(--font-sans);
}

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

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--white-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-family: var(--font-sans);
}

.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 11px 14px;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255,0.1), 0 0 12px rgba(0, 229, 255,0.12);
}

.form-input::placeholder { color: var(--white-faint); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 229, 255,0.25);
}

.btn-primary:hover {
  background: #33eeff;
  box-shadow: 0 0 30px rgba(0, 229, 255,0.4);
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--white-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--white-faint);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}

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

.btn-icon {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white-muted);
}

.btn-icon:hover {
  background: var(--white-faint);
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,59,59,0.25);
}

.btn-danger:hover {
  background: rgba(255,59,59,0.2);
  box-shadow: 0 0 12px rgba(255,59,59,0.2);
}

.btn-full { width: 100%; }

.btn-cyan {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 16px rgba(0, 229, 255,0.2);
}

.btn-cyan:hover {
  background: #33eeff;
  box-shadow: 0 0 24px rgba(0, 229, 255,0.35);
}

.btn-cyan-outline {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
}

.btn-cyan-outline:hover {
  background: rgba(0, 229, 255,0.15);
  box-shadow: 0 0 12px rgba(0, 229, 255,0.2);
}

.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(255,59,59,0.25);
  border-radius: var(--radius);
  color: var(--red);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ===== APP LAYOUT ===== */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
#sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-wordmark {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--white);
}

.sidebar-wordmark span { color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255,0.5); }

.sidebar-tagline {
  font-size: 10px;
  color: var(--white-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  margin-top: 3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--white-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  padding: 8px 10px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--white-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--white-faint);
  color: var(--white);
}

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

.nav-item.active .nav-icon { color: var(--cyan); }

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .nav-icon { opacity: 1; }

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

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

.user-chip:hover { background: var(--white-faint); }

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
  font-family: var(--font-sans);
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 12px; font-weight: 600; color: var(--white); }
.user-role { font-size: 10px; color: var(--white-muted); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-sans); }

/* ===== MODE INDICATOR ===== */
.mode-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 0 10px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  border: 1px solid transparent;
  transition: var(--transition);
}
.mode-indicator.persistent {
  color: var(--green);
  border-color: rgba(0,255,136,0.15);
  background: rgba(0,255,136,0.05);
}
.mode-indicator.local {
  color: var(--yellow);
  border-color: rgba(255,214,10,0.15);
  background: rgba(255,214,10,0.05);
}
.mode-indicator.detecting {
  color: var(--white-muted);
  border-color: transparent;
}
.mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mode-dot.green { background: var(--green); box-shadow: 0 0 6px rgba(0,255,136,0.6); }
.mode-dot.yellow { background: var(--yellow); box-shadow: 0 0 6px rgba(255,214,10,0.6); }
.mode-dot.gray { background: #555; }

/* ===== MAIN CONTENT ===== */
#main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOP BAR ===== */
#topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

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

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.breadcrumb-sep {
  color: var(--white-faint);
  font-size: 16px;
}

.breadcrumb-link {
  color: var(--white-muted);
  cursor: pointer;
  transition: color 0.15s;
}

.breadcrumb-link:hover { color: var(--cyan); }

.breadcrumb-current { color: var(--white); font-weight: 600; }

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

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255,0.08);
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-sans);
  width: 200px;
}

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

.search-icon { color: var(--white-muted); width: 14px; height: 14px; flex-shrink: 0; }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover::before { opacity: 0.6; }

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

.stat-card.cyan { border-color: rgba(0, 229, 255,0.2); box-shadow: 0 0 20px rgba(0, 229, 255,0.05); }
.stat-card.green { border-color: rgba(0,255,136,0.15); }
.stat-card.purple { border-color: rgba(184,85,255,0.15); }
.stat-card.yellow { border-color: rgba(255,214,10,0.15); }
.stat-card.red { border-color: rgba(255,59,59,0.15); }
.stat-card.orange { border-color: rgba(255,107,43,0.15); }
.stat-card.pink { border-color: rgba(255,45,120,0.15); }

.stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--white-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  margin-bottom: 10px;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-value.cyan { color: var(--cyan); text-shadow: 0 0 20px rgba(0, 229, 255,0.3); }
.stat-value.green { color: var(--green); text-shadow: 0 0 16px rgba(0,255,136,0.3); }
.stat-value.purple { color: var(--purple); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.red { color: var(--red); }
.stat-value.orange { color: var(--orange); }
.stat-value.pink { color: var(--pink); }

.stat-sub {
  font-size: 11px;
  color: var(--white-muted);
  margin-top: 6px;
  font-family: var(--font-mono);
}

.stat-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  opacity: 0.1;
  font-size: 24px;
  pointer-events: none;
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 229, 255,0.6);
}

/* ===== TABLES ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--white-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--white); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: rgba(255,255,255,0.025); }

tbody td {
  padding: 12px 14px;
  font-size: 14px;
  color: var(--white-dim);
  vertical-align: middle;
}

tbody td .mono {
  font-size: 13px;
  color: var(--white);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.badge-active {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
}

.badge-active::before { content: '\25CF'; font-size: 7px; }

.badge-complete {
  background: rgba(0, 229, 255,0.08);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255,0.2);
}

.badge-draft {
  background: var(--white-faint);
  color: var(--white-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

.badge-paused {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(255,214,10,0.2);
}

.badge-booked {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
}

.badge-pending {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1px solid rgba(255,214,10,0.2);
}

.badge-cancelled {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255,59,59,0.2);
}

/* ===== PLATFORM ICONS ===== */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
}

.platform-tiktok { background: rgba(0,0,0,0.6); color: #fff; border: 1px solid #333; }
.platform-instagram { background: rgba(194,31,156,0.12); color: #e1306c; border: 1px solid rgba(225,48,108,0.25); }
.platform-youtube { background: rgba(255,0,0,0.1); color: #ff4444; border: 1px solid rgba(255,68,68,0.2); }
.platform-x { background: rgba(255,255,255,0.06); color: #e7e9ea; border: 1px solid rgba(255,255,255,0.15); }

/* ===== CAMPAIGN CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.campaign-card:hover {
  border-color: var(--border-cyan);
  box-shadow: var(--shadow-cyan);
  transform: translateY(-2px);
}

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

.campaign-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

.campaign-card-client {
  font-size: 12px;
  color: var(--white-muted);
  margin-top: 3px;
  font-family: var(--font-sans);
}

.campaign-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.card-stat { text-align: center; }
.card-stat-value {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  color: var(--white);
}

.card-stat-label {
  font-size: 10px;
  color: var(--white-muted);
  margin-top: 2px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}

/* ===== CAMPAIGNS LIST TABLE ===== */
.campaigns-list-table {
  width: 100%;
}
.campaigns-list-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--white-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.campaigns-list-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.campaigns-list-table tbody tr:hover {
  background: rgba(0, 200, 255, 0.03);
}
.campaigns-list-table tbody tr:last-child {
  border-bottom: none;
}

/* ===== POST CARDS ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.post-card:hover {
  border-color: var(--border-cyan);
  box-shadow: 0 0 24px rgba(0, 229, 255,0.12), 0 4px 20px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.post-thumbnail {
  height: 100px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-thumbnail-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.3;
}

.post-platform-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-sans);
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

.post-card-body {
  padding: 10px 12px;
}

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

.post-creator-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-sans);
}

.post-creator-name::before {
  content: '@';
  color: var(--cyan);
  opacity: 0.8;
}

.post-menu-btn {
  background: none;
  border: none;
  color: var(--white-muted);
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.post-menu-btn:hover { background: var(--white-faint); color: var(--white); }

.post-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

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

.post-stat-value {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--white);
  display: block;
}

.post-stat-icon {
  font-size: 10px;
  color: var(--white-muted);
  margin-bottom: 1px;
}

.post-eng-rate {
  background: var(--cyan-dim);
  border: 1px solid var(--border-cyan);
  border-radius: 5px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.post-eng-label {
  font-size: 10px;
  color: var(--white-muted);
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-eng-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0, 229, 255,0.4);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--white-muted);
  font-family: var(--font-sans);
}

/* ===== POST LIST TABLE ===== */
.posts-list-table td { padding: 10px 14px; }

/* ===== DROPDOWN MENU ===== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 150px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  overflow: hidden;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  background: none;
  border: none;
  color: var(--white-dim);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.dropdown-item:hover { background: var(--white-faint); color: var(--white); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-dim); }

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

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
  min-width: 200px;
}

.filter-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255,0.08);
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.filter-select:focus { border-color: var(--cyan); }
.filter-select option { background: var(--bg-card); color: var(--white); }

.view-toggle {
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-btn {
  padding: 8px 10px;
  background: none;
  border: none;
  color: var(--white-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.view-btn.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.view-btn:hover:not(.active) { color: var(--white); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 40px rgba(0, 229, 255,0.06);
  transform: translateY(10px);
  transition: transform 0.2s;
}

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

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

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--white-muted);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover { background: var(--white-faint); color: var(--white); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
}

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

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

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.toast-success {
  background: var(--bg-card);
  border: 1px solid rgba(0,255,136,0.3);
  color: var(--green);
}

.toast-error {
  background: var(--bg-card);
  border: 1px solid rgba(255,59,59,0.3);
  color: var(--red);
}

.toast-info {
  background: var(--bg-card);
  border: 1px solid rgba(0, 229, 255,0.3);
  color: var(--cyan);
}

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

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

/* ===== LOADING STATES ===== */
.skeleton {
  background: linear-gradient(90deg, #181818 25%, #222 50%, #181818 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

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

.skeleton-card {
  height: 140px;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  height: 44px;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 16px;
  color: var(--white-muted);
  font-size: 13px;
}

/* ===== EMPTY STATES ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--white-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white-dim);
  margin-bottom: 8px;
}

.empty-state-sub {
  font-size: 13px;
  color: var(--white-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ===== CAMPAIGN DETAIL ===== */
.campaign-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

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

.campaign-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.campaign-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.campaign-meta-item {
  font-size: 12px;
  color: var(--white-muted);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 5px;
}

.campaign-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.campaign-stat-pill {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-align: center;
  transition: var(--transition);
}

.campaign-stat-pill:hover {
  border-color: var(--border-cyan);
}

.campaign-stat-pill-value {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan);
  display: block;
}

.campaign-stat-pill-label {
  font-size: 10px;
  color: var(--white-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-sans);
  margin-top: 4px;
}

/* ===== CREATOR PROFILE ===== */
.creator-profile-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.creator-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 2px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  flex-shrink: 0;
  font-family: var(--font-mono);
  box-shadow: 0 0 20px rgba(0, 229, 255,0.12);
}

.creator-profile-info { flex: 1; }

.creator-profile-username {
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  font-family: var(--font-sans);
}

.creator-profile-name {
  font-size: 14px;
  color: var(--white-muted);
  margin-top: 4px;
}

/* ===== TOP PERFORMERS ===== */
.top-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.top-list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.top-list-item:last-child { border-bottom: none; }
.top-list-item:hover { background: rgba(255,255,255,0.025); }

.top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--white-muted);
  font-family: var(--font-sans);
  flex-shrink: 0;
}

.top-rank.gold { background: rgba(255,214,10,0.1); border-color: rgba(255,214,10,0.3); color: var(--yellow); }
.top-rank.silver { background: rgba(180,180,180,0.1); border-color: rgba(180,180,180,0.2); color: #b4b4b4; }
.top-rank.bronze { background: rgba(205,127,50,0.1); border-color: rgba(205,127,50,0.2); color: #cd7f32; }

.top-info { flex: 1; overflow: hidden; }
.top-name { font-size: 13px; font-weight: 700; color: var(--white); }
.top-sub { font-size: 11px; color: var(--white-muted); font-family: var(--font-sans); margin-top: 1px; }
.top-value { font-family: var(--font-sans); font-size: 13px; font-weight: 700; color: var(--cyan); text-align: right; }
.top-value-sub { font-size: 10px; color: var(--white-muted); font-family: var(--font-sans); text-align: right; }

/* ===== ACTIVITY FEED ===== */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0, 229, 255,0.5);
  flex-shrink: 0;
  margin-top: 3px;
}

.activity-text {
  font-size: 12px;
  color: var(--white-dim);
  line-height: 1.5;
  flex: 1;
}

.activity-time {
  font-size: 10px;
  color: var(--white-muted);
  font-family: var(--font-sans);
  white-space: nowrap;
}

/* ===== FORM ROW ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 10px 14px;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-sans);
}

.form-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255,0.1);
}

.form-hint {
  font-size: 11px;
  color: var(--white-muted);
  margin-top: 5px;
  font-family: var(--font-sans);
  line-height: 1.5;
}

/* ===== BOOKINGS TABLE ===== */
.bookings-table-wrap {
  overflow-x: auto;
}

.bookings-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.bookings-table thead th {
  padding: 10px 16px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--white-muted);
  background: var(--bg-3);
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.bookings-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.bookings-table tbody tr:last-child { border-bottom: none; }
.bookings-table tbody tr:hover { background: var(--bg-card-hover); }

.bookings-table tbody td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.booking-progress-bar {
  width: 80px;
  height: 4px;
  background: var(--white-faint);
  border-radius: 2px;
}

.booking-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}

.booking-action-btn {
  background: none;
  border: none;
  color: var(--white-muted);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.booking-action-btn:hover { color: var(--cyan); background: var(--cyan-dim); }
.booking-action-btn.danger:hover { color: var(--red) !important; background: var(--red-dim); }

.booking-status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.booking-status-badge.confirmed { background: var(--green-dim); color: var(--green); }
.booking-status-badge.pending { background: var(--yellow-dim); color: var(--yellow); }
.booking-status-badge.booked { background: var(--cyan-dim); color: var(--cyan); }

/* ===== BUDGET MODULE ===== */
.budget-module {
  background: var(--bg-card);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
}
.budget-metrics { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 12px; }
.budget-metric { display: flex; flex-direction: column; gap: 2px; }
.budget-metric-label { font-size: 10px; text-transform: uppercase; color: var(--white-muted); letter-spacing: 0.5px; font-family: var(--font-sans); font-weight: 700; }
.budget-metric-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--font-sans);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-metric-value.warning { color: var(--yellow); }
.budget-metric-value.over { color: var(--red); }
.budget-metric-sub {
  font-size: 10px;
  color: var(--white-muted);
  font-family: var(--font-sans);
  margin-top: 3px;
}
.budget-edit-btn { background: none; border: 1px solid var(--border); color: var(--white-dim); font-size: 11px; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-family: var(--font-sans); font-weight: 600; transition: var(--transition); margin-left: 6px; white-space: nowrap; }
.budget-edit-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.budget-edit-input { background: var(--bg-3); border: 1px solid var(--border-cyan); color: var(--white); padding: 4px 10px; border-radius: 4px; font-size: 14px; width: 120px; }
.budget-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.budget-progress-track {
  flex: 1;
  height: 6px;
  background: var(--white-faint);
  border-radius: 3px;
  overflow: hidden;
}
.budget-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--cyan);
  transition: width 0.3s ease;
}
.budget-progress-fill.warning { background: var(--yellow); }
.budget-progress-fill.over { background: var(--red); }
.budget-progress-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--font-sans);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}
.budget-inline-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}
.budget-inline-input {
  background: var(--bg-3);
  border: 1px solid var(--cyan);
  border-radius: 4px;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 3px 8px;
  outline: none;
  width: 120px;
  box-shadow: 0 0 0 2px rgba(0,229,255,0.1);
}

/* ===== BOOKINGS (legacy card styles kept for any existing uses) ===== */
.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.booking-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: var(--transition);
}

.booking-card:hover { border-color: var(--border-cyan); }
.booking-creator-name { font-size: 13px; font-weight: 700; color: var(--white); font-family: var(--font-sans); }
.booking-creator-name::before { content: '@'; color: var(--cyan); opacity: 0.8; }
.booking-fee { font-size: 12px; color: var(--white-muted); margin-top: 4px; font-family: var(--font-sans); }

/* ===== CREATOR TABLE DELETE BUTTON ===== */
.creator-del-cell {
  width: 40px;
  text-align: center;
}

.creator-del-btn {
  background: none;
  border: none;
  color: transparent;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--transition);
}

tr:hover .creator-del-btn {
  color: var(--white-muted);
}

.creator-del-btn:hover {
  color: var(--red) !important;
  background: var(--red-dim);
}

/* ===== USERS / SETTINGS ===== */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}

.settings-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settings-section-body { padding: 20px; }

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

/* --- Tablet: collapse sidebar to icon-only --- */
@media (max-width: 900px) {
  #sidebar { width: 60px; min-width: 60px; }
  .sidebar-wordmark, .sidebar-tagline, .nav-item span, .user-info, .nav-section-label, .mode-indicator span:not(.mode-dot) { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  #main { margin-left: 60px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .campaign-stats-bar { grid-template-columns: repeat(4, 1fr); }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .budget-metrics { flex-wrap: wrap; }
  .budget-metric { flex: 1 1 calc(50% - 20px); min-width: 120px; }
  .two-col-grid { grid-template-columns: 1fr; }
  .search-box input { width: 120px; }
}

/* --- Mobile: sidebar off-screen, hamburger visible --- */
@media (max-width: 640px) {
  /* Sidebar: slide off-screen by default */
  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    width: 220px;
    min-width: 220px;
    z-index: 1000;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  #sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Restore full sidebar labels when open */
  .sidebar-wordmark, .sidebar-tagline, .nav-item span, .user-info, .nav-section-label, .mode-indicator span:not(.mode-dot) { display: initial; }
  .nav-item { justify-content: flex-start; padding: 9px 10px; }

  /* Main content: full width, no sidebar margin */
  #main { margin-left: 0 !important; }

  /* Show hamburger */
  #hamburger-btn { display: flex; }

  /* Topbar: add left padding for hamburger */
  #topbar { padding-left: 56px; }

  /* Page content padding */
  .page-content { padding: 14px; }

  /* Prevent horizontal overflow globally */
  body, #main, .page-content { max-width: 100vw; overflow-x: hidden; }

  /* Stats grid: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }

  /* Campaign stats bar */
  .campaign-stats-bar { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .campaign-stat-pill { padding: 10px 12px; }
  .campaign-stat-pill-value { font-size: 16px; }

  /* Campaign cards grid */
  .cards-grid { grid-template-columns: 1fr !important; }

  /* Campaign list table: horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .campaigns-list-table { min-width: 700px; }

  /* Posts grid */
  .posts-grid { grid-template-columns: 1fr !important; }

  /* Bookings table: horizontal scroll */
  .bookings-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .bookings-table-wrap { overflow-x: auto; }
  .bookings-table { min-width: 700px; }

  /* Budget metrics */
  .budget-metrics { flex-wrap: wrap; gap: 10px; }
  .budget-metric { min-width: calc(50% - 6px); flex-direction: column; }

  /* Modals: full-screen on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal { width: 100% !important; max-width: 100% !important; max-height: 100vh; border-radius: 0 !important; }
  .modal-box { width: 100% !important; max-width: 100% !important; border-radius: 0 !important; }

  /* Two-col grid: stack */
  .two-col-grid { grid-template-columns: 1fr; }

  /* Campaign header */
  .campaign-header { padding: 16px; }
  .campaign-header-top { flex-direction: column; gap: 12px; }
  .campaign-name { font-size: 18px; }
  .campaign-meta-row { gap: 8px; }

  /* Creator profile header: stack vertically */
  .creator-profile-header { flex-direction: column; align-items: flex-start; padding: 16px; gap: 12px; }

  /* Search box: smaller on mobile */
  .search-box { display: none; }

  /* Topbar right actions: compact */
  .topbar-right { gap: 4px; }
  .topbar-right .btn { padding: 6px 8px; font-size: 11px; }

  /* Handle row in modals: stack */
  .handle-row { grid-template-columns: 1fr; gap: 6px; }
  .handle-row select, .handle-row input { width: 100%; }

  /* Form rows */
  .form-row { grid-template-columns: 1fr !important; }

  /* Filter bar: wrap */
  .filters-bar { flex-wrap: wrap; gap: 8px; }
  .filter-select { font-size: 12px; min-width: 0; flex: 1 1 calc(50% - 4px); }
  .view-toggle { margin-left: 0; }

  /* Post card: full width */
  .post-card { width: 100%; }
  .post-thumbnail { height: 200px; }

  /* Auto-detect panel */
  .auto-detect-header { padding: 12px 14px; }
  .auto-detect-body { padding: 0 14px 12px; }

  /* Settings sections */
  .settings-section-body { padding: 14px; }

  /* Platform checkboxes: wrap tighter */
  .platform-checks { gap: 6px; }
  .platform-check-label { padding: 5px 8px; font-size: 11px; }

  /* Tab bar: scrollable */
  .detail-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; }
  .detail-tab { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; font-size: 12px; }

  /* Top lists: stack */
  .top-list-item { padding: 10px 12px; }

  /* Confirm dialog */
  .confirm-modal { max-width: calc(100vw - 32px); }

  /* Login card */
  .login-card { padding: 32px 24px; margin: 0 16px; }

  /* Section headers: wrap actions */
  .section-header { flex-wrap: wrap; gap: 8px; }
  .section-header > div { flex-wrap: wrap; gap: 6px; }

  /* Page title: smaller */
  .page-title { font-size: 14px; }

  /* Card sections: tighter padding */
  .campaign-card { padding: 14px; }
  .campaign-card-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
}

/* ===== HAMBURGER BUTTON (mobile) ===== */
#hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1001;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#hamburger-btn:hover { background: var(--white-faint); color: var(--white); }

/* Force hamburger visible on mobile (must come AFTER base display:none) */
@media (max-width: 640px) {
  #hamburger-btn { display: flex !important; }
}

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

#sidebar-overlay.active { display: block; }

/* ===== PLATFORM COLORS ===== */
.tiktok-icon { color: #fff; }
.instagram-icon { color: #e1306c; }
.youtube-icon { color: #ff4444; }
.x-icon { color: #e7e9ea; }

/* ===== GLOW LINE ===== */
.cyan-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.3;
  margin: 16px 0;
}

/* ===== SECTION GRID ===== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1100px) {
  .two-col-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

/* ===== CONFIRM DIALOG ===== */
.confirm-modal {
  max-width: 380px;
}

.confirm-modal .modal-body p {
  font-size: 14px;
  color: var(--white-dim);
  line-height: 1.6;
}

/* ===== DETAIL TABS ===== */
.detail-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  width: fit-content;
  margin-bottom: 20px;
}

.detail-tab {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-muted);
  cursor: pointer;
  border-radius: 5px;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  border: none;
  background: none;
}

.detail-tab.active {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
}

.detail-tab:hover:not(.active) { color: var(--white); background: var(--white-faint); }

/* ===== V2: PROGRESS BAR ===== */
.progress-bar-wrap {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 22px;
  position: relative;
  overflow: hidden;
  margin: 8px 0;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease;
  min-width: 2px;
}
.progress-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  letter-spacing: 0.03em;
}

/* ===== V2: MULTI-PLATFORM CHECKBOXES ===== */
.platform-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.platform-check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--white-muted);
  transition: var(--transition);
  user-select: none;
}
.platform-check-label:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--white);
}
.platform-check-label input { display: none; }
.platform-check-label.checked {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  color: var(--cyan);
}

/* ===== V2: HANDLE ROW ===== */
.handle-row {
  display: grid;
  grid-template-columns: 1fr 110px 130px 32px;
  gap: 8px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.handle-row:last-child { border-bottom: none; }
.handle-row .rate-cards-section {
  grid-column: 1 / -1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.handle-row .rate-cards-section .rate-card-row .form-input {
  background: var(--bg-3);
}
.handle-row select, .handle-row input {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--white);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition);
}
.handle-row select:focus, .handle-row input:focus {
  border-color: var(--cyan);
}
.handle-row input[readonly] {
  background: var(--bg-2);
  color: var(--cyan);
  border-color: var(--border-cyan);
  cursor: default;
  font-family: var(--font-sans);
}
.handle-remove-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--white-muted);
  cursor: pointer;
  font-size: 14px;
}
.handle-remove-btn:hover { background: var(--red-dim); color: var(--red); border-color: rgba(255,59,59,0.3); }

/* ===== V2: AUTO-DETECTION PANEL ===== */
.auto-detect-panel {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
}
.auto-detect-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}
.auto-detect-header:hover { background: rgba(255,255,255,0.02); }
.auto-detect-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auto-detect-body {
  padding: 0 18px 16px;
  border-top: 1px solid var(--border);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.green { background: var(--green); box-shadow: 0 0 6px rgba(0,255,136,0.5); }
.status-dot.gray { background: #555; }

/* ===== V2: AUDIO LINK ===== */
.audio-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--cyan);
  font-size: 11px;
  font-family: var(--font-sans);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--cyan-dim);
  border: 1px solid var(--border-cyan);
  transition: var(--transition);
}
.audio-link:hover { background: rgba(0, 229, 255,0.15); }

/* ===== V2: CREATOR HANDLE BADGES ===== */
.handle-badge-more {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-sans);
  color: var(--white-muted);
  background: var(--white-faint);
  border: 1px solid var(--border);
  margin-left: 4px;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: var(--transition);
}
.toggle-slider:before {
  position: absolute;
  content: '';
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--white-muted);
  border-radius: 50%;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--cyan);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

/* ===== POST SPARKLINE ===== */
.post-sparkline {
  margin: 4px 0 2px;
  line-height: 0;
}
.post-sparkline svg {
  display: block;
  width: 100%;
  height: 20px;
}

/* ===== STATS HUB ===== */
.stats-hub-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.hub-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.hub-activity-item:last-child {
  border-bottom: none;
}

/* ===== SETTINGS SECTION (if not already styled) ===== */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}
.settings-section-header {
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--white-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  background: var(--bg-3);
}
.settings-section-body {
  padding: 20px;
}

/* ============================================================
   Pagination (F-06)
   ============================================================ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 8px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.pagination-info {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--white-muted);
  letter-spacing: 0.02em;
}
.pagination-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--white-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pagination-btn:hover:not(:disabled):not(.active) {
  background: var(--surface-hover);
  color: var(--foreground);
  border-color: var(--cyan);
}
.pagination-btn.active {
  background: var(--cyan);
  color: var(--background);
  border-color: var(--cyan);
}
.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pagination-ellipsis {
  color: var(--white-muted);
  font-size: 12px;
  padding: 0 4px;
}

/* ===== TAG PILLS ===== */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid var(--cyan);
  border-radius: 12px;
  font-size: 11px;
  color: var(--cyan);
  font-family: var(--font-sans);
}
.tag-pill button {
  background: none;
  border: none;
  color: var(--cyan);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.tag-pill button:hover { opacity: 1; }
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 6px;
}

/* ===== HANDLE ROW: USERNAME-FIRST MODE ===== */
.handle-row .handle-inputs-username {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  width: 100%;
}
.handle-row .handle-inputs-url {
  width: 100%;
}
.handle-row .handle-mode-toggle {
  font-size: 11px;
  color: var(--cyan);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: var(--font-sans);
  opacity: 0.8;
  margin-top: 2px;
  display: inline-block;
}
.handle-row .handle-mode-toggle:hover { opacity: 1; text-decoration: underline; }
.handle-row .handle-inputs-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
/* New handle-row grid for username-first mode */
.handle-row.username-mode {
  grid-template-columns: 1fr 32px;
}

/* ===== CREATOR LIST UPGRADES ===== */

/* Sortable table headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.sortable-th:hover {
  color: var(--cyan);
}
.sortable-th .sort-arrow {
  font-size: 10px;
  margin-left: 3px;
  opacity: 0.5;
}
.sortable-th.active .sort-arrow {
  opacity: 1;
  color: var(--cyan);
}

/* Creator list action buttons — always visible */
.creator-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.creator-action-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--white-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.creator-action-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 200, 255, 0.08);
}
.creator-action-btn.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 50, 50, 0.08);
}

/* Tag pills in table */
.tag-pill-sm {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-family: var(--font-sans);
  color: var(--cyan);
  border: 1px solid rgba(0, 200, 255, 0.25);
  background: rgba(0, 200, 255, 0.06);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  margin: 1px 2px;
}

/* Creator avatar in table */
.creator-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-cyan);
  flex-shrink: 0;
}
.creator-initials-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cyan-dim);
  border: 1px solid var(--border-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  font-family: var(--font-sans);
  flex-shrink: 0;
}
