/* ========================================
   AI Fragrance Global — Admin Dashboard CSS
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Sans:wght@400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-base: #0a0a0f;
  --bg-surface: #12121a;
  --bg-elevated: #1a1a28;
  --bg-glass: rgba(26, 26, 40, 0.6);
  --accent-primary: #00d4aa;
  --accent-secondary: #0080ff;
  --accent-warm: #ff6b35;
  --accent-gold: #d4af37;
  --accent-red: #ef4444;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b7d;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(0, 212, 170, 0.1);
}

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

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.06), transparent),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(0, 128, 255, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 24px 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 0 24px 24px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}
.sidebar-logo .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 12px var(--accent-primary);
}
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.sidebar-nav a.active {
  background: var(--bg-elevated);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}
.sidebar-nav .icon {
  width: 20px; height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px 32px;
  min-width: 0;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.topbar h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
}
.topbar-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.topbar-meta .live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.kpi-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.kpi-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}
.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}
.kpi-change {
  font-size: 0.75rem;
  margin-top: 4px;
}
.kpi-change.up { color: var(--accent-primary); }
.kpi-change.down { color: var(--accent-red); }

/* Chart Cards */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.chart-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
}
.chart-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.chart-container {
  width: 100%;
  height: 280px;
  position: relative;
}

/* Full Width Chart */
.chart-card.full { grid-column: 1 / -1; }
.chart-card.full .chart-container { height: 360px; }

/* Data Table */
.data-table-card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-elevated);
  color: var(--accent-primary);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  border-bottom: 2px solid var(--accent-primary);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
tr:hover td { background: var(--bg-elevated); }

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}
.status-new { background: rgba(0,212,170,0.15); color: var(--accent-primary); }
.status-contacted { background: rgba(0,128,255,0.15); color: var(--accent-secondary); }
.status-closed { background: rgba(212,175,55,0.15); color: var(--accent-gold); }
.status-hot { background: rgba(255,107,53,0.15); color: var(--accent-warm); }

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}
.tab {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* AI Section */
.ai-card {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(0, 128, 255, 0.05));
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}
.ai-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { width: 60px; }
  .sidebar-logo { padding: 0 16px 16px; font-size: 0; }
  .sidebar-logo .dot { margin: 0; }
  .sidebar-nav a { padding: 12px; justify-content: center; }
  .sidebar-nav a span:not(.icon) { display: none; }
  .main-content { margin-left: 60px; padding: 16px; }
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
