/* ==========================================================================
   MARTIN EDUVERSE - AUTOMATION HUB, CRM & CAMPAIGN COMMAND CENTER
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=Outfit:wght@400;500;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg-dark: #060913;
  --bg-surface: #0c1222;
  --bg-card: rgba(16, 25, 46, 0.75);
  --bg-card-hover: rgba(22, 35, 64, 0.9);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 169, 0.35);

  --accent-emerald: #00f2a9;
  --accent-emerald-dark: #00b37d;
  --accent-emerald-glow: rgba(0, 242, 169, 0.25);
  
  --accent-cyan: #38bdf8;
  --accent-gold: #fbbf24;
  --accent-purple: #a855f7;
  --accent-indigo: #6366f1;
  --accent-rose: #f43f5e;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #00f2a9;

  /* Typography */
  --font-heading: 'Outfit', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Elevation */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(0, 242, 169, 0.2);
  --shadow-gold: 0 0 30px rgba(251, 191, 36, 0.2);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 242, 169, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(56, 189, 248, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 20%, var(--accent-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gold-gradient {
  background: linear-gradient(135deg, #ffd700 0%, #fbbf24 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-emerald { color: var(--accent-emerald); }
.text-cyan { color: var(--accent-cyan); }
.text-gold { color: var(--accent-gold); }
.text-purple { color: var(--accent-purple); }
.text-muted { color: var(--text-muted); }

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
.navbar-custom {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(6, 9, 19, 0.9);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.logo-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-emerald), #0284c7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #000;
  font-size: 1.2rem;
  box-shadow: 0 0 15px var(--accent-emerald-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-emerald);
}

/* Status Pill in Navbar */
.system-status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 242, 169, 0.08);
  border: 1px solid var(--border-glow);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--accent-emerald);
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-normal);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark));
  color: #05140f;
  box-shadow: 0 4px 15px var(--accent-emerald-glow);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 169, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  box-shadow: var(--shadow-gold);
  font-weight: 700;
}

/* Top Dashboard Stats Grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-fast);
}

.stat-box:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
}

.stat-box-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-box-val {
  font-size: 2.3rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
}

.stat-box-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* CRM Table Section */
.crm-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 3.5rem;
  box-shadow: var(--shadow-lg);
}

.crm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.crm-search-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 300px;
}

.form-control {
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: rgba(6, 9, 19, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

.crm-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leads-table th {
  background: rgba(12, 18, 34, 0.9);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.leads-table td {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  vertical-align: middle;
}

.lead-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges & Tags */
.course-badge {
  display: inline-block;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.source-tag {
  display: inline-block;
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* Status Dropdown in Table */
.status-select {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
}

.badge-new { background: rgba(0, 242, 169, 0.15); color: #00f2a9; border-color: rgba(0, 242, 169, 0.4); }
.badge-contacted { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.badge-scheduled { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.badge-enrolled { background: rgba(168, 85, 247, 0.2); color: #c084fc; border-color: rgba(168, 85, 247, 0.5); }
.badge-lost { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

/* Table Action Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-wa-action {
  background: rgba(37, 211, 102, 0.15);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.3);
}

.btn-wa-action:hover {
  background: #25d366;
  color: #fff;
}

.btn-call-action {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-delete-action {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
}

/* Upload Pipeline Checklist Card */
.pipeline-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  transition: var(--transition-fast);
}

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

.step-number-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-emerald), #0284c7);
  color: #000;
  font-weight: 900;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pipeline-content {
  flex: 1;
}

.pipeline-title {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 0.4rem;
}

.pipeline-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Modal Windows */
.custom-lead-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.custom-lead-modal.active {
  display: flex;
}

.custom-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(8px);
}

.custom-modal-content {
  position: relative;
  background: #0d1424;
  border: 1px solid var(--border-glow);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 90%;
  padding: 2.2rem;
  z-index: 10;
}

/* Section Header */
.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 2.5rem auto;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-emerald);
  background: rgba(0, 242, 169, 0.08);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.8rem;
  border: 1px solid var(--border-glow);
}

.section-title {
  font-size: 2.3rem;
  margin-bottom: 0.8rem;
}

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

@media (max-width: 600px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}

/* ==========================================================================
   INSTAGRAM AUTOMATION & VIRAL COMMENT STUDIO STYLES
   ========================================================================== */
.insta-control-deck {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}

@media (max-width: 992px) {
  .insta-control-deck {
    grid-template-columns: 1fr;
  }
}

.insta-account-card {
  background: rgba(7, 12, 24, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.insta-account-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f58529, #dd2a7b, #8134af, #515bd4);
}

.insta-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(0, 242, 169, 0.12);
  color: var(--accent-emerald);
  border: 1px solid rgba(0, 242, 169, 0.3);
}

.insta-badge-pill.warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-gold);
  border-color: rgba(251, 191, 36, 0.3);
}

.viral-comment-card {
  background: rgba(10, 16, 31, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.25rem;
  transition: var(--transition-normal);
  position: relative;
}

.viral-comment-card:hover {
  border-color: rgba(0, 242, 169, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 242, 169, 0.08);
}

.comment-hook-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-box-code {
  background: #020409;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre-wrap;
}

.tag-tier-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.tag-tier-1 { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.tag-tier-2 { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.tag-tier-3 { background: rgba(0, 242, 169, 0.15); color: #00f2a9; border: 1px solid rgba(0, 242, 169, 0.3); }
.tag-tier-4 { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }

.log-console {
  background: #03060f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 0.8rem;
}

.log-entry {
  display: flex;
  gap: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.log-time { color: var(--text-muted); }
.log-event { font-weight: 700; color: var(--accent-cyan); }
.log-status-SUCCESS { color: var(--accent-emerald); }
.log-status-SCHEDULED { color: var(--accent-gold); }
.log-status-FAILED { color: var(--accent-rose); }

