/* ============================================================
   WebHub - Design System & Main Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --hot: #f43f5e;
  --warm: #f97316;
  --cold: #64748b;

  --bg-base: #0a0a14;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.08);
  --bg-glass: rgba(255,255,255,0.06);
  --bg-sidebar: rgba(10,10,20,0.95);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --border: rgba(255,255,255,0.08);
  --border-active: rgba(99,102,241,0.5);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(99,102,241,0.2);

  --sidebar-w: 260px;
  --header-h: 64px;

  --transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background animated gradient */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 20% 30%, rgba(99,102,241,0.12) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 70%, rgba(14,165,233,0.08) 0%, transparent 50%);
  animation: bg-breathe 8s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes bg-breathe {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.1) rotate(3deg); }
}

/* ─── Auth Screen ───────────────────────────────────────── */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 12px;
  box-shadow: 0 0 30px rgba(99,102,241,0.4);
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 4px;
}

.auth-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  font-family: inherit;
}

.auth-tab.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}

/* ─── Form Elements ─────────────────────────────────────── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* OTP Input */
.otp-container { display: flex; gap: 10px; }
.otp-input {
  flex: 1;
  width: 100%;
  padding: 14px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 4px;
  font-family: monospace;
  outline: none;
  transition: var(--transition);
}
.otp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 6px 24px rgba(99,102,241,0.5);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* OTP hint box */
.otp-hint {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── App Layout ─────────────────────────────────────────── */
#app-screen {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
  border-color: var(--border-active);
}

.nav-item .nav-icon { font-size: 18px; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ─── Main Content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-header {
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10,10,20,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  width: 300px;
  transition: var(--transition);
}

.header-search:focus-within {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
}

.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  flex: 1;
}

.header-search input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* Lead Badge */
.lead-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lead-badge.hot { background: rgba(244,63,94,0.15); color: var(--hot); border: 1px solid rgba(244,63,94,0.3); }
.lead-badge.warm { background: rgba(249,115,22,0.15); color: var(--warm); border: 1px solid rgba(249,115,22,0.3); }
.lead-badge.cold { background: rgba(100,116,139,0.15); color: var(--cold); border: 1px solid rgba(100,116,139,0.3); }

.lead-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-lead 2s infinite;
}

@keyframes pulse-lead {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ─── Page Content ──────────────────────────────────────── */
.page {
  padding: 28px;
  flex: 1;
  display: none;
}

.page.active { display: block; }

/* ─── Page Header ───────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title { font-size: 24px; font-weight: 700; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.12); background: var(--bg-card-hover); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-color, var(--primary));
  opacity: 0.08;
  transform: translate(30%, -30%);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  font-size: 24px;
  margin-bottom: 12px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color, var(--primary-light)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.stat-trend { font-size: 12px; color: var(--success); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-trend.down { color: var(--danger); }

/* ─── Score Ring ────────────────────────────────────────── */
.score-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.score-ring {
  position: relative;
  width: 120px;
  height: 120px;
}

.score-ring svg { transform: rotate(-90deg); }
.score-ring .ring-bg { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 8; }
.score-ring .ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
}

.score-ring .ring-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
}

/* ─── Document Library ──────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  transition: var(--transition);
}

.filter-select:focus { border-color: var(--primary); }

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.doc-card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.doc-cover {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.doc-cover-icon {
  font-size: 48px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.doc-cover-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.doc-preview-only {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(245,158,11,0.2);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--warning);
}

.doc-body { padding: 16px; }
.doc-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.doc-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
  font-weight: 500;
}

.doc-level {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.doc-level.Beginner { background: rgba(16,185,129,0.15); color: var(--success); }
.doc-level.Intermediate { background: rgba(245,158,11,0.15); color: var(--warning); }
.doc-level.Advanced { background: rgba(244,63,94,0.15); color: var(--hot); }

.doc-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-desc {
  font-size: 13px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Document Viewer ───────────────────────────────────── */
.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.viewer-overlay.open { display: flex; animation: fadeIn 0.2s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.viewer-modal {
  background: #0f1020;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #0f1020;
  z-index: 10;
}

.viewer-cover {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  position: relative;
}

.viewer-body { padding: 24px; }

.doc-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.doc-info-item {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.doc-info-item label { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }
.doc-info-item value { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; }

/* View Timer */
.view-timer {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.timer-bar-wrap { flex: 1; background: rgba(255,255,255,0.08); border-radius: 999px; height: 6px; overflow: hidden; }
.timer-bar { height: 100%; background: var(--primary); border-radius: 999px; width: 0%; transition: width 1s linear; }

/* Download limit */
.download-limit {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--warning);
  margin-top: 12px;
}

/* ─── Analytics ─────────────────────────────────────────── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 24px;
}

.score-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.score-item:last-child { border-bottom: none; }
.score-item-icon { font-size: 20px; width: 36px; text-align: center; }
.score-item-info { flex: 1; }
.score-item-label { font-size: 13px; color: var(--text-secondary); }
.score-item-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 999px; height: 6px; margin-top: 6px; overflow: hidden; }
.score-item-bar { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.score-item-value { font-size: 20px; font-weight: 700; min-width: 40px; text-align: right; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.timeline-item:hover { border-color: rgba(255,255,255,0.12); }

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 8px var(--primary);
}

.timeline-dot.download { background: var(--success); box-shadow: 0 0 8px var(--success); }
.timeline-dot.view { background: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.timeline-dot.search { background: var(--warning); box-shadow: 0 0 8px var(--warning); }

.timeline-content { flex: 1; }
.timeline-title { font-size: 13px; font-weight: 500; }
.timeline-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 999px;
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 500;
}

.tag-weight {
  background: var(--primary);
  color: white;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
}

/* ─── Admin Panel ───────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Charts ────────────────────────────────────────────── */
.chart-container { position: relative; height: 200px; }

/* ─── Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }

/* ─── Toast Notification ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15,15,30,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s cubic-bezier(0.34,1.56,0.64,1);
  min-width: 280px;
  max-width: 360px;
  font-size: 14px;
}

.toast.success { border-color: rgba(16,185,129,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.info { border-color: rgba(99,102,241,0.3); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Separator ─────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ─── Section Header ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 16px; font-weight: 600; }

/* ─── Alert Banner ──────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert.hot-alert {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.25);
  color: #fda2b1;
}

.alert.info-alert {
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.25);
  color: var(--primary-light);
}

/* ─── Skeleton Loader ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── CRM Status Indicator ──────────────────────────────── */
.crm-status { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); animation: pulse-lead 2s infinite; }

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .analytics-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }
