/* ================================================================
   CheMentor — Unified Design System v3.0
   Professional, consistent across ALL pages
   ================================================================ */

/* ── Google Fonts ── */
@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&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── Design Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --brand:      #6366f1;
  --brand-dark: #4f46e5;
  --brand-soft: #818cf8;
  --brand-pale: #eef2ff;
  --accent:     #8b5cf6;
  --accent-soft:#ede9fe;

  /* Status */
  --success:    #10b981;
  --success-bg: #d1fae5;
  --warning:    #f59e0b;
  --warning-bg: #fef3c7;
  --danger:     #ef4444;
  --danger-bg:  #fee2e2;
  --info:       #3b82f6;
  --info-bg:    #dbeafe;

  /* Gradients */
  --g-brand:   linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --g-sidebar: linear-gradient(180deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  --g-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --g-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --g-danger:  linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --g-info:    linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --g-hero:    linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --g-coins:   linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  /* Surfaces (Light Mode) */
  --bg:         #f0f2ff;
  --surface:    #ffffff;
  --surface2:   #f8f9ff;
  --surface3:   #f1f3fe;
  --border:     #e5e7f0;
  --border-soft:#eff0f7;

  /* Text */
  --t1: #0f172a;
  --t2: #475569;
  --t3: #94a3b8;
  --t-inv: #ffffff;

  /* Layout */
  --sidebar-w: 275px;
  --topbar-h:  0px;
  --max-w:     1400px;

  /* Radii */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill:100px;

  /* Shadows */
  --shadow-xs: 0 1px 3px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.09);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.13);
  --shadow-xl: 0 16px 64px rgba(0,0,0,.18);
  --shadow-brand: 0 4px 20px rgba(99,102,241,.25);

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --trans: .22s var(--ease);
  --trans-slow: .4s var(--ease);
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg:         #0d0f1a;
  --surface:    #161827;
  --surface2:   #1e2035;
  --surface3:   #252844;
  --border:     #2a2d45;
  --border-soft:#222438;
  --t1:  #f1f5f9;
  --t2:  #cbd5e1;
  --t3:  #64748b;
  --brand-pale: rgba(99,102,241,.15);
  --accent-soft:rgba(139,92,246,.15);
  --success-bg: rgba(16,185,129,.15);
  --warning-bg: rgba(245,158,11,.15);
  --danger-bg:  rgba(239,68,68,.15);
  --info-bg:    rgba(59,130,246,.15);
  --shadow-sm:  0 2px 10px rgba(0,0,0,.25);
  --shadow-md:  0 4px 20px rgba(0,0,0,.35);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.45);
}

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--trans), color var(--trans);
  scrollbar-width: thin;
  scrollbar-color: var(--t3) transparent;
}
body::-webkit-scrollbar { width: 6px; }
body::-webkit-scrollbar-thumb { background: var(--t3); border-radius: 3px; }

button, input, textarea, select { font-family: inherit; }
*:focus-visible { outline: 3px solid rgba(99,102,241,.5); outline-offset: 2px; border-radius: 4px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Layout Overlay ── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 800; opacity: 0; pointer-events: none;
  transition: opacity var(--trans); backdrop-filter: blur(3px);
}
.overlay.visible { opacity: 1; pointer-events: all; }

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--g-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  transition: transform var(--trans-slow);
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* Brand Header */
.sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand .brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.sidebar-brand .logo-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--g-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff;
  box-shadow: 0 4px 12px rgba(99,102,241,.4);
  flex-shrink: 0;
}
.sidebar-brand h2 { color: #fff; font-size: 1.2rem; font-weight: 800; letter-spacing: -.3px; }
.sidebar-brand p  { color: rgba(255,255,255,.45); font-size: .7rem; letter-spacing: .5px; text-transform: uppercase; }

/* User Card */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: 12px;
}
.sidebar-user .s-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--g-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 1.1rem;
  flex-shrink: 0; overflow: hidden;
  border: 2px solid rgba(255,255,255,.2);
}
.sidebar-user .s-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.sidebar-user .s-name  { color: #fff; font-weight: 600; font-size: .88rem; }
.sidebar-user .s-role  { color: rgba(255,255,255,.4); font-size: .72rem; margin-top: 1px; }

/* Nav Sections */
.nav-section { padding: 14px 14px 4px; }
.nav-label {
  font-size: .63rem; font-weight: 700;
  letter-spacing: 1.2px; color: rgba(255,255,255,.28);
  text-transform: uppercase; padding: 0 8px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 10px; margin-bottom: 2px;
  color: rgba(255,255,255,.58); font-size: .875rem; font-weight: 500;
  transition: all var(--trans); position: relative; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,.4), rgba(99,102,241,.12));
  color: #fff;
  border-left: 3px solid var(--brand-soft);
  padding-left: 9px;
}
.nav-item i { width: 18px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  border-radius: 20px; padding: 1px 7px;
  font-size: .68rem; font-weight: 700;
}
.nav-item.ext::after { content: '↗'; font-size: .65rem; margin-left: auto; opacity: .4; }

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sidebar-coins {
  display: flex; align-items: center; gap: 8px;
  background: rgba(245,158,11,.15);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fcd34d; font-weight: 700; font-size: .85rem;
  margin-bottom: 10px;
}
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.55); font-size: .875rem;
  transition: all var(--trans); width: 100%;
  background: transparent; border: none; cursor: pointer;
  text-decoration: none; font-family: inherit;
}
.logout-btn:hover { background: rgba(239,68,68,.18); color: #f87171; }

/* Mobile Toggle */
.mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: 20px; right: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--g-brand);
  color: #fff; border: none; cursor: pointer;
  font-size: 1.1rem; z-index: 850;
  box-shadow: 0 4px 16px rgba(99,102,241,.4);
  align-items: center; justify-content: center;
  transition: transform var(--trans);
}
.mobile-menu-btn:hover { transform: scale(1.08); }

/* ================================================================
   MAIN CONTENT LAYOUT
   ================================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  padding: 28px 30px;
  min-height: 100vh;
  transition: margin var(--trans-slow);
}

/* ── Topbar ── */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--surface);
  padding: 18px 24px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
  border: 1px solid var(--border-soft);
}
.topbar-left h1 {
  font-size: 1.55rem; font-weight: 800;
  color: var(--t1); letter-spacing: -.3px;
}
.topbar-left p { color: var(--t2); font-size: .875rem; margin-top: 3px; }
.topbar-right  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Coins badge in topbar */
.coins-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--g-coins);
  color: #fff; padding: 8px 16px;
  border-radius: var(--r-pill);
  font-weight: 700; font-size: .85rem;
  box-shadow: 0 4px 12px rgba(245,158,11,.3);
}

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  border: 1px solid var(--border-soft);
}
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--t1);
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--bg);
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--brand); }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
  transition: all var(--trans);
  border: 1px solid var(--border-soft);
  cursor: default;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.si-purple { background: var(--g-brand);   color: #fff; }
.si-green  { background: var(--g-success); color: #fff; }
.si-orange { background: var(--g-warning); color: #fff; }
.si-blue   { background: var(--g-info);    color: #fff; }
.si-red    { background: var(--g-danger);  color: #fff; }
.si-yellow { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); color: #fff; }
.stat-info .num   { font-size: 1.8rem; font-weight: 800; color: var(--t1); line-height: 1; }
.stat-info .label { color: var(--t2); font-size: .82rem; margin-top: 4px; }
.stat-info .sub   { color: var(--t3); font-size: .75rem; margin-top: 2px; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: none; cursor: pointer;
  font-size: .875rem; font-weight: 600;
  transition: all var(--trans);
  text-decoration: none; white-space: nowrap;
  font-family: inherit;
}
.btn-primary  { background: var(--g-brand);   color: #fff; box-shadow: 0 3px 10px rgba(99,102,241,.3); }
.btn-success  { background: var(--g-success);  color: #fff; box-shadow: 0 3px 10px rgba(16,185,129,.3); }
.btn-danger   { background: var(--g-danger);   color: #fff; box-shadow: 0 3px 10px rgba(239,68,68,.3); }
.btn-warning  { background: var(--g-warning);  color: #fff; box-shadow: 0 3px 10px rgba(245,158,11,.3); }
.btn-info     { background: var(--g-info);     color: #fff; box-shadow: 0 3px 10px rgba(59,130,246,.3); }
.btn-outline  { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-ghost    { background: var(--surface2); color: var(--t1); }
.btn-sm       { padding: 6px 12px; font-size: .8rem; border-radius: var(--r-sm); }
.btn-lg       { padding: 13px 26px; font-size: .95rem; border-radius: var(--r-lg); }
.btn:hover    { transform: translateY(-1px); opacity: .92; }
.btn:active   { transform: translateY(0); }

/* ================================================================
   FORMS
   ================================================================ */
.form-group   { margin-bottom: 18px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-weight: 600; color: var(--t1); font-size: .875rem;
}
.form-control {
  width: 100%; padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  font-size: .9rem; font-family: inherit;
  color: var(--t1); background: var(--surface);
  transition: all var(--trans); outline: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.form-control::placeholder { color: var(--t3); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* Toggle Switch */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  margin-bottom: 10px;
}
.toggle-row label { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--t1); font-size: .875rem; cursor: pointer; }
.toggle-row label i { color: var(--brand); width: 16px; text-align: center; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 26px;
  transition: background var(--trans);
}
.slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  left: 4px; bottom: 4px;
  background: #fff; border-radius: 50%;
  transition: transform var(--trans);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input:checked + .slider { background: var(--brand); }
input:checked + .slider::before { transform: translateX(20px); }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--g-brand);
  color: #fff; padding: 12px 16px; text-align: left;
  font-weight: 600; font-size: .8rem; letter-spacing: .4px;
  white-space: nowrap;
}
thead th:first-child { border-radius: 10px 0 0 0; }
thead th:last-child  { border-radius: 0 10px 0 0; }
tbody tr { border-bottom: 1px solid var(--border-soft); transition: background var(--trans); }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 11px 16px; color: var(--t1); vertical-align: middle; }
tbody tr:last-child td:first-child { border-radius: 0 0 0 10px; }
tbody tr:last-child td:last-child  { border-radius: 0 0 10px 0; }

/* ================================================================
   ALERTS & TOASTS
   ================================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: .875rem; font-weight: 500;
}
.alert-success { background: var(--success-bg); color: #065f46; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-bg);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: var(--info-bg);    color: #1e40af; border-left: 4px solid var(--info); }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  white-space: nowrap;
}
.badge-icse     { background: var(--info-bg);    color: #1d4ed8; }
.badge-isc      { background: var(--accent-soft); color: #6d28d9; }
.badge-p1112    { background: var(--success-bg); color: #065f46; }
.badge-active   { background: var(--success-bg); color: #065f46; }
.badge-inactive { background: var(--danger-bg);  color: #991b1b; }
.badge-pending  { background: var(--warning-bg); color: #92400e; }
.badge-answered { background: var(--success-bg); color: #065f46; }
.badge-resolved { background: var(--info-bg);    color: #1e40af; }
.badge-female   { background: #fce7f3; color: #9d174d; }
.badge-male     { background: var(--info-bg);    color: #1d4ed8; }
.badge-primary  { background: var(--brand-pale); color: var(--brand-dark); }

/* ================================================================
   MODALS
   ================================================================ */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans);
}
.modal-bg.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 90%; max-width: 580px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(.95) translateY(10px);
  transition: transform var(--trans);
  border: 1px solid var(--border-soft);
}
.modal-bg.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: var(--surface2); border: none; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; color: var(--t2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: all var(--trans);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body   { padding: 22px 24px; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 13px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--t1);
  cursor: pointer; font-size: .83rem; font-weight: 600;
  transition: all var(--trans); font-family: inherit;
}
.page-btn:hover, .page-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ================================================================
   PROFILE / UPLOADS
   ================================================================ */
.profile-pic-wrap { text-align: center; margin-bottom: 24px; }
.profile-pic {
  width: 120px; height: 120px;
  border-radius: 50%; margin: 0 auto 14px;
  background: var(--g-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 700; color: #fff;
  overflow: hidden; box-shadow: 0 6px 24px rgba(99,102,241,.3);
}
.profile-pic img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.upload-label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; background: var(--surface2);
  border-radius: var(--r-md); cursor: pointer;
  font-size: .83rem; font-weight: 600; color: var(--t1);
  transition: all var(--trans);
  border: 2px dashed var(--border);
}
.upload-label:hover { border-color: var(--brand); color: var(--brand); }
.upload-label input { display: none; }

/* ================================================================
   EMPTY STATES
   ================================================================ */
.empty-state {
  text-align: center; padding: 56px 20px; color: var(--t3);
}
.empty-state .es-icon {
  width: 80px; height: 80px;
  border-radius: 50%; background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; margin: 0 auto 20px;
  color: var(--t3);
}
.empty-state h3 { color: var(--t1); font-size: 1.2rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { font-size: .9rem; max-width: 380px; margin: 0 auto 22px; }

/* ================================================================
   PAGE-SPECIFIC: DOUBTS
   ================================================================ */
.doubt-card {
  padding: 18px; border-radius: var(--r-md);
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  margin-bottom: 12px;
  transition: all var(--trans);
}
.doubt-card:hover { box-shadow: var(--shadow-sm); }
.doubt-subject { font-weight: 700; font-size: 1rem; color: var(--t1); }
.doubt-text    { color: var(--t2); font-size: .875rem; line-height: 1.6; margin-top: 6px; }
.doubt-answer  {
  margin-top: 14px; padding: 14px 16px;
  background: var(--success-bg);
  border-radius: var(--r-md);
  border-left: 4px solid var(--success);
  color: #065f46; font-size: .875rem; line-height: 1.7;
}

/* ================================================================
   PAGE-SPECIFIC: PRODUCTS
   ================================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans);
  border: 2px solid var(--border-soft);
}
.product-card:hover {
  border-color: var(--brand);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.product-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--g-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: #fff; margin-bottom: 16px;
}
.product-name { font-weight: 700; font-size: 1.05rem; color: var(--t1); margin-bottom: 10px; }
.product-meta { font-size: .83rem; color: var(--t2); margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.product-meta div { display: flex; align-items: center; gap: 7px; }
.product-meta i { color: var(--brand); width: 14px; }
.product-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ================================================================
   PAGE-SPECIFIC: RECOMMENDATIONS
   ================================================================ */
.recs-grid { display: grid; gap: 18px; }
.rec-card {
  background: var(--surface);
  padding: 22px 24px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--brand);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--brand);
  transition: all var(--trans);
}
.rec-card:hover { transform: translateX(4px); box-shadow: var(--shadow-md); }
.rec-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.rec-title  { font-weight: 700; font-size: 1.05rem; color: var(--t1); flex: 1; }
.rec-date   { font-size: .8rem; color: var(--t3); display: flex; align-items: center; gap: 5px; }
.rec-content { font-size: .875rem; color: var(--t2); line-height: 1.7; margin-bottom: 14px; }
.rec-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; gap: 10px; }
.rec-category {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--g-brand); color: #fff;
  padding: 5px 14px; border-radius: var(--r-pill);
  font-size: .78rem; font-weight: 600;
}
.rec-mentor { font-size: .82rem; color: var(--t2); display: flex; align-items: center; gap: 6px; }
.rec-mentor i { color: var(--brand); }

/* ================================================================
   PAGE-SPECIFIC: SETTINGS
   ================================================================ */
.settings-container { display: grid; gap: 22px; }
.settings-card {
  background: var(--surface);
  padding: 26px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
}
.settings-title {
  font-size: 1.05rem; font-weight: 700; color: var(--t1);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--bg);
}
.settings-title i { color: var(--brand); }
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
  font-size: .875rem;
}
.info-row:last-child { border-bottom: none; }
.info-row strong { color: var(--t1); font-weight: 600; }
.info-row span, .info-row code {
  color: var(--t2);
}
.info-row code {
  background: var(--surface2); padding: 3px 10px;
  border-radius: var(--r-sm); font-family: 'JetBrains Mono', monospace;
  font-size: .82rem; color: var(--brand);
}

/* ================================================================
   SEARCH BAR
   ================================================================ */
.search-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--surface); padding: 14px 18px;
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  margin-bottom: 20px; border: 1px solid var(--border-soft);
}
.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap i {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--t3);
}
.search-input {
  width: 100%; padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-size: .875rem;
  background: var(--surface2); color: var(--t1);
  transition: all var(--trans); outline: none; font-family: inherit;
}
.search-input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.search-input::placeholder { color: var(--t3); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-up  { animation: fadeUp  .4s var(--ease) both; }
.fade-in  { animation: fadeIn  .3s var(--ease) both; }

/* Stagger delays */
.fade-up:nth-child(1)  { animation-delay: .05s; }
.fade-up:nth-child(2)  { animation-delay: .10s; }
.fade-up:nth-child(3)  { animation-delay: .15s; }
.fade-up:nth-child(4)  { animation-delay: .20s; }
.fade-up:nth-child(5)  { animation-delay: .25s; }
.fade-up:nth-child(6)  { animation-delay: .30s; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 250px; }
  .main-content { padding: 20px 22px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.open { transform: translateX(0); }
  .main-content {
    margin-left: 0;
    padding: 18px 16px;
  }
  .mobile-menu-btn { display: flex; }
  .topbar { padding: 14px 16px; }
  .topbar-left h1 { font-size: 1.25rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn { padding: 8px 14px; font-size: .82rem; }
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  min-height: 100vh;
  background: var(--g-hero);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-box {
  display: flex;
  width: 100%; max-width: 920px;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  min-height: 560px;
}
.login-left {
  flex: 1;
  background: linear-gradient(160deg, #4338ca 0%, #312e81 100%);
  padding: 50px 44px;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; position: relative; overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.login-left .brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 36px; }
.login-left .brand-icon {
  width: 52px; height: 52px;
  border-radius: 14px; background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.login-left .brand-name { font-size: 1.6rem; font-weight: 800; }
.login-left .brand-sub  { font-size: .75rem; opacity: .5; text-transform: uppercase; letter-spacing: .8px; }
.login-left h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 10px; line-height: 1.2; }
.login-left > p { opacity: .7; font-size: .9rem; line-height: 1.6; margin-bottom: 30px; }
.login-features { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.login-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: .875rem; opacity: .85;
}
.login-features li::before {
  content: ''; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a5f3fc'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z'/%3E%3C/svg%3E");
  background-size: 12px; background-repeat: no-repeat; background-position: center;
}
.login-right {
  flex: 1; background: var(--surface);
  padding: 50px 44px;
  display: flex; flex-direction: column; justify-content: center;
}
.login-right h2 { font-size: 1.75rem; font-weight: 800; color: var(--t1); margin-bottom: 8px; }
.login-right .sub { color: var(--t2); font-size: .9rem; margin-bottom: 28px; }
.login-err {
  background: var(--danger-bg); color: #991b1b;
  border-left: 4px solid var(--danger);
  padding: 10px 14px; border-radius: var(--r-md);
  font-size: .875rem; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-weight: 600; font-size: .875rem; color: var(--t1); margin-bottom: 7px; }
.login-input-wrap { position: relative; }
.login-input-wrap i {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--t3); font-size: .95rem;
}
.login-input-wrap input {
  width: 100%; padding: 12px 14px 12px 40px;
  border: 2px solid var(--border); border-radius: var(--r-md);
  font-size: .9rem; font-family: inherit; color: var(--t1);
  background: var(--surface2); outline: none;
  transition: all var(--trans);
}
.login-input-wrap input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px rgba(99,102,241,.1); }
.login-btn {
  width: 100%; padding: 13px;
  background: var(--g-brand); color: #fff; border: none;
  border-radius: var(--r-md); font-size: .95rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: all var(--trans); box-shadow: var(--shadow-brand);
  font-family: inherit; margin-top: 6px;
}
.login-btn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.login-help { text-align: center; margin-top: 20px; color: var(--t3); font-size: .83rem; }
.login-help a { color: var(--brand); font-weight: 600; }

@media (max-width: 680px) {
  .login-box { flex-direction: column; min-height: auto; }
  .login-left { padding: 30px 28px; }
  .login-right { padding: 30px 28px; }
  .login-left h1 { font-size: 1.4rem; }
}

/* ================================================================
   ADDITIONS v2.0 — New pages & features
   ================================================================ */

/* ── Animations ── */
@keyframes fadeIn   { from{opacity:0}            to{opacity:1} }
@keyframes slideUp  { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes pulse    { 0%,100%{transform:scale(1)}  50%{transform:scale(1.06)} }
@keyframes spin     { to{transform:rotate(360deg)} }
.fade-in  { animation:fadeIn  .3s var(--ease) both; }
.fade-up  { animation:slideUp .45s var(--ease) both; }

/* ── Coin badge variant ── */
.coins-badge-gold {
  background:linear-gradient(135deg,#f59e0b,#fbbf24);
  color:#fff; padding:8px 16px; border-radius:var(--r-pill);
  font-weight:700; font-size:.85rem;
  box-shadow:0 4px 14px rgba(245,158,11,.35);
  display:inline-flex; align-items:center; gap:7px;
}

/* ── Progress ring ── */
.progress-ring-wrap { position:relative; display:inline-flex; align-items:center; justify-content:center; }
.progress-ring-label {
  position:absolute; text-align:center;
  font-weight:800; font-size:1rem; color:var(--t1);
}

/* ── Resource cards extra ── */
.resource-tag {
  display:inline-flex; align-items:center; gap:3px;
  font-size:.7rem; background:var(--surface3); color:var(--t3);
  padding:2px 8px; border-radius:20px; border:1px solid var(--border-soft);
}

/* ── Leaderboard extras ── */
.lb-rank-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:50%;
  font-size:.78rem; font-weight:800;
}

/* ── Timetable extras ── */
.tt-duration-chip {
  font-size:.68rem; background:var(--surface3); color:var(--t3);
  padding:2px 6px; border-radius:8px; display:inline-flex; align-items:center; gap:3px;
}

/* ── Referral extras ── */
.referral-code-display {
  font-family:'JetBrains Mono',monospace;
  font-size:1.4rem; font-weight:800; letter-spacing:3px;
  color:var(--brand); background:var(--brand-pale);
  padding:10px 20px; border-radius:var(--r-md);
  border:2px dashed var(--brand); display:inline-block;
}

/* ── Analytics specific ── */
.analytics-kpi {
  background:var(--g-brand); color:#fff;
  border-radius:var(--r-lg); padding:20px 24px;
  display:flex; align-items:center; gap:14px;
}
.analytics-kpi .ak-num  { font-size:2rem; font-weight:800; line-height:1; }
.analytics-kpi .ak-label{ font-size:.82rem; opacity:.75; margin-top:4px; }

/* ── Admin nav extras ── */
.admin-nav-new { position:relative; }
.admin-nav-new::after {
  content:'NEW'; position:absolute; top:-4px; right:-6px;
  background:var(--danger); color:#fff; font-size:.55rem;
  font-weight:800; padding:1px 5px; border-radius:6px;
  letter-spacing:.3px;
}

/* ── Bulk action selection ── */
.client-check-row.selected { background:var(--brand-pale); }
tr:has(.client-check:checked) { background:var(--brand-pale) !important; }

/* ── Notification dot on nav ── */
.notif-nav-dot {
  width:8px; height:8px; border-radius:50%;
  background:var(--danger); position:absolute;
  top:6px; right:6px; animation:pulse 2s infinite;
}

/* ── Form select enhanced ── */
select.form-control option { padding:6px; }

/* ── Dashboard new tiles ── */
.feature-tile {
  background:var(--surface); border-radius:var(--r-lg);
  padding:20px; border:2px solid var(--border-soft);
  text-align:center; transition:all var(--trans);
  cursor:pointer; text-decoration:none; color:var(--t1);
  display:flex; flex-direction:column; align-items:center; gap:8px;
}
.feature-tile:hover { border-color:var(--brand); transform:translateY(-4px); box-shadow:var(--shadow-md); }
.feature-tile .ft-icon { font-size:2rem; width:60px; height:60px; border-radius:18px; display:flex; align-items:center; justify-content:center; }
.feature-tile .ft-label { font-weight:700; font-size:.875rem; }
.feature-tile .ft-sub   { font-size:.75rem; color:var(--t3); }

/* ── Scrollbar for tables ── */
.table-wrap::-webkit-scrollbar { height:4px; }
.table-wrap::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* ── Tags/chips ── */
.tag-chip {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 10px; border-radius:20px;
  background:var(--surface2); border:1px solid var(--border-soft);
  font-size:.72rem; color:var(--t2); font-weight:500;
}

/* ── Admin Dashboard cards ── */
.modern-card { background:var(--surface); border-radius:18px; padding:22px; box-shadow:var(--shadow-sm); border:1px solid var(--border-soft); }
.section-title { font-weight:700; font-size:.95rem; color:var(--t1); margin-bottom:14px; display:flex; align-items:center; gap:8px; }
.section-title i { color:var(--brand); }

/* ── Doubt priority border ── */
.doubt-card[style*="danger"]  .doubt-subject::before { content:'🔴 '; }
.doubt-card[style*="warning"] .doubt-subject::before { content:'🟡 '; }

/* ── View client tabs ── */
.tab-nav { display:flex; gap:4px; border-bottom:2px solid var(--border); margin-bottom:18px; overflow-x:auto; }
.tab-btn {
  padding:10px 18px; background:none; border:none; cursor:pointer;
  font-weight:600; font-size:.875rem; color:var(--t2);
  border-bottom:2px solid transparent; margin-bottom:-2px;
  transition:all var(--trans); white-space:nowrap; font-family:inherit;
}
.tab-btn.active { color:var(--brand); border-bottom-color:var(--brand); }
.tab-btn:hover  { color:var(--brand); background:var(--brand-pale); border-radius:8px 8px 0 0; }
.tab-panel      { display:none; }
.tab-panel.active { display:block; }

/* ── Search bar admin ── */
.search-bar { margin-bottom:16px; }
.search-input-wrap { position:relative; max-width:360px; }
.search-input-wrap i { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:var(--t3); font-size:.9rem; }
.search-input-wrap input { padding-left:36px; }

/* ── Responsive improvements ── */
@media (max-width: 768px) {
  .main-content { margin-left:0; padding:16px; }
  .sidebar      { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); }
  .mobile-menu-btn { display:flex; }
  .stats-grid   { grid-template-columns:repeat(2,1fr); }
  .products-grid{ grid-template-columns:1fr; }
  .topbar       { flex-direction:column; align-items:flex-start; }
  .topbar-right { width:100%; justify-content:flex-start; }
  .section-grid { grid-template-columns:1fr; }
  .podium-wrap  { flex-direction:column; align-items:center; }
  .ref-hero     { padding:24px 18px; }
  .tt-grid      { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
  .how-steps    { flex-direction:column; }
  .coins-hero   { flex-direction:column; text-align:center; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns:1fr; }
  .chapter-grid { grid-template-columns:1fr; }
  .resources-grid { grid-template-columns:1fr; }
}
