/* ============================================================
   Study Networks — Global Styles
   ============================================================ */
:root {
  --sidebar-w:    260px;
  --topbar-h:     64px;
  --navy:         #1B3A8A;
  --navy-dark:    #122870;
  --navy-soft:    #EEF2FF;
  --gold:         #F5A623;
  --gold-soft:    #FEF3DC;
  --green:        #22c55e;
  --orange:       #f97316;
  --cyan:         #06b6d4;
  --red:          #ef4444;
  --bg:           #F5F7FF;
  --card-bg:      #ffffff;
  --sidebar-bg:   #ffffff;          /* white sidebar */
  --sidebar-border: #E5E7EB;
  --sidebar-text: #4B5563;
  --sidebar-hover: #F0F4FF;
  --text:         #111827;
  --text-muted:   #6B7280;
  --border:       #E5E7EB;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(0,0,0,.05), 0 2px 8px rgba(27,58,138,.06);
  --shadow-md:    0 4px 20px rgba(27,58,138,.10);

  /* keep --primary pointing to navy for Bootstrap overrides */
  --primary:      #1B3A8A;
  --primary-dark: #122870;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s cubic-bezier(.4,0,.2,1), width .3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: 72px; }

/* Brand / Logo */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  min-height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}
.brand-icon {
  width: 34px; height: 34px;
  background: var(--navy-soft);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--navy); font-size: 1rem;
  flex-shrink: 0;
}

/* Logo image — shown in original colors on white sidebar */
.brand-logo {
  height: 26px;
  /* NO filter — original logo colors on white background */
  transition: opacity .2s, width .3s;
  flex-shrink: 0;
}
.sidebar.collapsed .brand-logo { opacity: 0; width: 0; pointer-events: none; }

/* Search */
.sidebar-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  transition: opacity .2s;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-search { opacity: 0; pointer-events: none; height: 0; padding: 0; overflow: hidden; }
.sidebar-search-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  transition: border-color .15s;
}
.sidebar-search-inner:focus-within { border-color: var(--navy); }
.sidebar-search-icon { color: var(--text-muted); font-size: .78rem; flex-shrink: 0; }
.sidebar-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: .82rem;
  color: var(--text);
  min-width: 0;
}
.sidebar-search-input::placeholder { color: #9CA3AF; }
.sidebar-search-clear {
  border: none;
  background: transparent;
  padding: 0;
  color: var(--text-muted);
  font-size: .72rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-search-clear:hover { color: var(--text); }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  display: flex;
  flex-direction: column;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Section labels */
.nav-section-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: #9CA3AF;
  padding: 10px 10px 3px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-section-label { opacity: 0; height: 0; padding: 0; }

/* Bottom-pinned group (Subscription + Report Issue) */
.nav-bottom-group {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.sidebar.collapsed .nav-bottom-group { border-top: none; }

/* Pro upgrade header variant */
.nav-group-hd--pro {
  background: linear-gradient(90deg, #FEF3C7 0%, #FFFBEB 100%);
  border-radius: 8px;
}
.nav-group-hd--pro:hover { background: #FDE68A; }
.nav-group.open > .nav-group-hd--pro { background: #FDE68A; color: #92400E; }

/* Legacy label (kept for compat) */
.nav-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #9CA3AF;
  padding: 8px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-label { opacity: 0; height: 0; padding: 0; }

/* Hide nav items during search */
.nav-item.nav-hidden,
.nav-group.nav-hidden,
.nav-section-label.nav-hidden { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: .855rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 2px;
}
.nav-item i { font-size: .95rem; flex-shrink: 0; min-width: 20px; text-align: center; }
.nav-item span:first-of-type { flex: 1; transition: opacity .2s; }
.sidebar.collapsed .nav-item span:first-of-type { opacity: 0; width: 0; }
.sidebar.collapsed .nav-item .badge { display: none; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--navy); }
.nav-item.active {
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 600;
  border-left: 3px solid var(--navy);
  padding-left: 7px;
}
.nav-item.active i { color: var(--navy); }

/* ── Collapsible nav groups ─────────────────────── */
.nav-group { margin-bottom: 2px; }

.nav-group-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .855rem;
  font-weight: 500;
  color: var(--sidebar-text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: background .15s, color .15s;
  user-select: none;
}
.nav-group-hd i:first-child { font-size: .95rem; flex-shrink: 0; min-width: 20px; text-align: center; }
.nav-group-hd span:first-of-type { flex: 1; }
.nav-group-hd:hover { background: var(--sidebar-hover); color: var(--navy); }
.nav-group.open > .nav-group-hd {
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 600;
  border-left: 3px solid var(--navy);
  padding-left: 7px;
  border-radius: 0 8px 8px 0;
}

.nav-chevron {
  font-size: .72rem !important;
  min-width: auto !important;
  transition: transform .22s ease;
  opacity: .55;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-group.open > .nav-group-hd .nav-chevron { transform: rotate(180deg); opacity: 1; }

/* Body (children) */
.nav-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .26s ease;
}
.nav-group.open > .nav-group-body { max-height: 600px; }

/* Sub-items */
.nav-item.nav-sub {
  padding: 7px 10px 7px 36px;
  font-size: .815rem;
  margin-bottom: 1px;
}
.nav-item.nav-sub i { font-size: .82rem; min-width: 17px; }

/* Org icon in header */
.nav-org-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

/* Badge styles */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 20px;
  font-size: .62rem;
  font-weight: 800;
  flex-shrink: 0;
}
.nav-badge.warn    { background: #FEF3C7; color: #92400E; }
.nav-badge.danger  { background: #FEE2E2; color: #991B1B; }
.nav-badge.primary { background: #DBEAFE; color: #1E40AF; }

/* Hide text in collapsed sidebar */
.sidebar.collapsed .nav-group-hd span,
.sidebar.collapsed .nav-group-hd .nav-chevron,
.sidebar.collapsed .nav-group-hd .nav-badge,
.sidebar.collapsed .nav-group-hd .nav-org-icon ~ span { opacity: 0; width: 0; }
.sidebar.collapsed .nav-group-body { max-height: 0 !important; }
.sidebar.collapsed .nav-group.open > .nav-group-hd { background: var(--navy-soft); }

/* User strip */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-user img { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.user-info { flex: 1; min-width: 0; transition: opacity .2s; }
.sidebar.collapsed .user-info, .sidebar.collapsed .sidebar-user a { opacity: 0; width: 0; }
.user-name { font-size: .8rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role { font-size: .7rem; color: var(--text-muted); }
.sidebar-user a { color: var(--text-muted); font-size: 1rem; }
.sidebar-user a:hover { color: var(--navy); }

/* ── Main Wrapper ─────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.main-wrapper.expanded { margin-left: 72px; }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 0 var(--border);
}
.sidebar-toggle-btn {
  background: none; border: none;
  color: var(--text-muted); padding: 4px 8px;
  border-radius: 8px; cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-toggle-btn:hover { background: var(--bg); color: var(--navy); }
.topbar-title h5 { font-size: .95rem; font-weight: 700; color: var(--text); }
.topbar-search .form-control { font-size: .82rem; border-radius: 8px 0 0 8px; }
.topbar-search .btn { border-radius: 0 8px 8px 0; }
.btn-icon {
  background: none; border: none;
  color: var(--text-muted); padding: 4px 8px;
  border-radius: 8px; position: relative; cursor: pointer;
}
.btn-icon:hover { background: var(--bg); color: var(--navy); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 4px; right: 4px; border: 2px solid #fff; }
.avatar-sm img { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }

/* ── Page Content ─────────────────────────────────────────── */
.page-content { flex: 1; padding: 28px; }

/* ── Welcome Banner ───────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #2347b0 60%, #1a55c4 100%);
  border-radius: var(--radius);
  padding: 22px 28px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  position: relative; overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(245,166,35,.15);
}
.welcome-banner::after {
  content: '';
  position: absolute; left: 40%; bottom: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.welcome-banner h4 { color: #fff; font-weight: 700; }
.welcome-banner p  { color: rgba(255,255,255,.75); }
.welcome-actions { display: flex; gap: 8px; }
.welcome-actions .btn-primary { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.welcome-actions .btn-primary:hover { background: rgba(255,255,255,.25); }
.welcome-actions .btn-outline-secondary { border-color: rgba(255,255,255,.35); color: #fff; }
.welcome-actions .btn-outline-secondary:hover { background: rgba(255,255,255,.12); }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-blue   .stat-icon { background: var(--navy-soft);  color: var(--navy); }
.stat-green  .stat-icon { background: rgba(34,197,94,.1); color: #16a34a; }
.stat-purple .stat-icon { background: var(--gold-soft);   color: #9a6000; }
.stat-orange .stat-icon { background: rgba(249,115,22,.1);color: var(--orange); }

.stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.stat-change { font-size: .74rem; font-weight: 600; }
.stat-change.up   { color: #16a34a; }
.stat-change.down { color: var(--red); }

/* ── Cards ────────────────────────────────────────────────── */
.portal-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.portal-card .card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 20px; }
.portal-card .card-body { padding: 16px 20px; }

/* ── Table ────────────────────────────────────────────────── */
.table th { font-size: .71rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); font-weight: 700; }
.table td { font-size: .85rem; }
.badge-student    { background: var(--navy-soft);  color: var(--navy);   font-weight: 600; }
.badge-teacher    { background: rgba(34,197,94,.1); color: #16a34a;      font-weight: 600; }
.badge-consultant { background: var(--gold-soft);   color: #9a6000;      font-weight: 600; }
.badge-academy    { background: rgba(6,182,212,.1); color: #0891b2;      font-weight: 600; }
.badge-institute  { background: var(--navy-soft);   color: var(--navy);  font-weight: 600; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active   { background: #22c55e; }
.status-dot.pending  { background: var(--orange); }
.status-dot.inactive { background: #9CA3AF; }

/* ── Donut Legend ─────────────────────────────────────────── */
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-muted); }
.legend-item strong { margin-left: auto; color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Institute Rank ───────────────────────────────────────── */
.institute-rank-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.institute-rank-item:last-child { border: none; padding-bottom: 0; }
.rank-badge {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--navy), #2a52b5);
  color: #fff; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.progress-bar-mini { width: 80px; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.progress-bar-mini div { height: 100%; background: linear-gradient(90deg, var(--navy), var(--gold)); border-radius: 99px; }

/* ── Quick Actions ────────────────────────────────────────── */
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 10px;
  background: var(--bg); color: var(--text-muted);
  font-size: .75rem; font-weight: 600;
  text-decoration: none; text-align: center;
  transition: background .15s, color .15s, transform .15s;
  border: 1px solid var(--border);
}
.quick-action-btn i { font-size: 1.25rem; color: var(--navy); }
.quick-action-btn:hover { background: var(--navy); color: #fff; transform: translateY(-2px); }
.quick-action-btn:hover i { color: #fff; }

/* ── Page Header ──────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.page-header-title h4 { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.page-header-title p  { font-size: .82rem; color: var(--text-muted); margin: 0; }

/* ── Filter Bar ───────────────────────────────────────────── */
.filter-bar {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 18px;
  margin-bottom: 18px; display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}

/* ── Data Table ───────────────────────────────────────────── */
.data-table { border-radius: var(--radius); overflow: hidden; }
.data-table .table { margin: 0; }
.data-table .table thead th { background: var(--bg); }

/* ── Action Buttons ───────────────────────────────────────── */
.btn-action {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-size: .8rem; cursor: pointer; transition: all .15s;
}
.btn-action:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-action.danger:hover { background: #ef4444; border-color: #ef4444; }

/* ── Form / Edit page ─────────────────────────────────────── */
.form-section-title {
  font-size: .69rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--navy);
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 2px solid var(--navy-soft);
}
.form-label { font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.form-control, .form-select {
  font-size: .85rem; border-radius: 8px;
  border: 1.5px solid var(--border); padding: 9px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,138,.1);
}
.required-star { color: var(--red); }

/* ── Avatar Upload ────────────────────────────────────────── */
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-preview { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--border); }
.avatar-upload-btn { font-size: .8rem; color: var(--navy); cursor: pointer; display: flex; align-items: center; gap: 4px; }

/* ── Logo upload box (institute-edit) ─────────────────────── */
.logo-upload-box {
  width: 120px; height: 120px; border: 2px dashed var(--border);
  border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; transition: border-color .15s, background .15s;
  color: var(--text-muted); font-size: .75rem; text-align: center;
}
.logo-upload-box:hover { border-color: var(--navy); background: var(--navy-soft); }

/* ── Tab nav (institute-edit) ─────────────────────────────── */
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }

/* ── Mobile Overlay ───────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }

/* ── Profile Card ─────────────────────────────────────────── */
.profile-card-header {
  background: linear-gradient(135deg, var(--navy), #2347b0);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 32px 24px 48px; position: relative;
}
.profile-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  border: 4px solid #fff; object-fit: cover;
  position: absolute; bottom: -45px; left: 24px;
}
.profile-card-body { padding: 56px 24px 24px; }

/* ── Bootstrap overrides ──────────────────────────────────── */
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-dark); border-color: var(--navy-dark); box-shadow: none; }
.btn-outline-primary { color: var(--navy); border-color: var(--navy); }
.btn-outline-primary:hover { background: var(--navy); border-color: var(--navy); }
.page-link { color: var(--navy); }
.page-item.active .page-link { background: var(--navy); border-color: var(--navy); }
.text-primary { color: var(--navy) !important; }
.bg-primary { background: var(--navy) !important; }
.breadcrumb-item a { color: var(--navy); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; color: var(--border); margin-bottom: 16px; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container { z-index: 9999; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ── Area Discovery ───────────────────────────────────────── */
.discover-hero {
  background: linear-gradient(135deg,#1B3A8A 0%,#1A6BFF 60%,#3B82F6 100%);
  border-radius: 16px;
  padding: 32px 32px 0;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.discover-hero::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='28'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events:none;
}
.discover-hero-title { font-size:1.55rem; font-weight:800; color:#fff; margin-bottom:4px; }
.discover-hero-sub   { color:rgba(255,255,255,.75); font-size:.9rem; margin-bottom:20px; }
.discover-tabs {
  display:flex; gap:4px;
  background:rgba(255,255,255,.12);
  border-radius:12px 12px 0 0;
  padding:8px 8px 0;
  position:relative; z-index:1;
}
.discover-tab {
  flex:1; text-align:center; padding:10px 12px;
  border-radius:8px 8px 0 0;
  color:rgba(255,255,255,.75); font-size:.82rem; font-weight:600;
  text-decoration:none; border:none; background:transparent;
  transition:all .18s; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.discover-tab:hover { background:rgba(255,255,255,.12); color:#fff; }
.discover-tab.active { background:#fff; color:#1A6BFF; box-shadow:0 -2px 8px rgba(0,0,0,.08); }
.discover-tab.active i { color:#1A6BFF; }
.discover-search-panel {
  background:#fff;
  border-radius: 0 0 16px 16px;
  padding: 20px 24px 24px;
  box-shadow: 0 4px 20px rgba(27,58,138,.1);
  margin-bottom: 24px;
}
.discover-search-panel .form-label {
  font-size:.72rem; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:#64748B; margin-bottom:6px;
}
.discover-search-panel .form-select,
.discover-search-panel .form-control {
  border-radius:10px; border-color:#E2E8F0;
  font-size:.875rem; padding:9px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: border-color .15s, box-shadow .15s;
}
.discover-search-panel .form-select:focus,
.discover-search-panel .form-control:focus {
  border-color:#1A6BFF; box-shadow: 0 0 0 3px rgba(26,107,255,.1);
}
.discover-search-btn {
  background: linear-gradient(135deg,#1A6BFF,#3B82F6);
  border:none; border-radius:10px;
  color:#fff; font-weight:700; font-size:.875rem;
  padding:9px 20px; width:100%;
  transition: transform .15s, box-shadow .15s;
}
.discover-search-btn:hover {
  transform:translateY(-1px); box-shadow:0 4px 14px rgba(26,107,255,.35); color:#fff;
}
.discover-result-bar { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.discover-result-count { font-size:.82rem; color:#64748B; font-weight:500; }
.discover-result-count strong { color:#1E293B; }
.filter-chip {
  display:inline-flex; align-items:center; gap:6px;
  background:#EFF6FF; color:#1A6BFF;
  border:1px solid #BFDBFE; border-radius:20px;
  padding:4px 12px; font-size:.78rem; font-weight:500;
}
.filter-chip-close { color:#93C5FD; transition:color .12s; text-decoration:none; font-size:.8rem; }
.filter-chip-close:hover { color:#1A6BFF; }
.discover-card {
  border-radius:14px; border:1px solid #E8EFF8;
  background:#fff; padding:18px; height:100%;
  display:flex; flex-direction:column; gap:12px;
  transition: transform .18s, box-shadow .18s;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  overflow:hidden;
}
.discover-card:hover {
  transform:translateY(-3px);
  box-shadow: 0 8px 24px rgba(27,58,138,.12);
  border-color:#BFDBFE;
}
.discover-avatar { width:52px; height:52px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.discover-avatar-fallback {
  width:52px; height:52px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:1.2rem; font-weight:700; color:#fff;
}
.discover-name { font-size:.95rem; font-weight:700; color:#1E293B; word-break:break-word; }
.discover-sub  { font-size:.78rem; color:#64748B; word-break:break-word; }

/* Discover page pagination */
.discover-pagination { display:flex; justify-content:center; margin-top:24px; }
.discover-pagination .pagination { gap:4px; flex-wrap:wrap; }
.discover-pagination .page-link {
  border-radius:8px !important; border:1px solid #E2E8F0;
  color:#1A6BFF; font-size:.82rem; font-weight:500;
  padding:6px 14px; line-height:1.5;
  transition: background .15s, border-color .15s, color .15s;
}
.discover-pagination .page-link:hover { background:#EFF6FF; border-color:#BFDBFE; color:#1A6BFF; }
.discover-pagination .page-item.active .page-link { background:#1A6BFF; border-color:#1A6BFF; color:#fff; }
.discover-pagination .page-item.disabled .page-link { color:#CBD5E1; border-color:#F1F5F9; background:#F8FAFC; }
.area-chip {
  display:inline-flex; align-items:center; gap:4px;
  background:#F0FDF4; color:#15803D; border:1px solid #BBF7D0;
  border-radius:20px; padding:2px 9px; font-size:.7rem; font-weight:500;
}
.subject-chip {
  background:#F8FAFF; color:#374151; border:1px solid #E2E8F0;
  border-radius:6px; padding:2px 8px; font-size:.7rem;
}
.verified-badge {
  background:#DCFCE7; color:#15803D; border-radius:20px;
  padding:2px 8px; font-size:.65rem; font-weight:600;
  display:inline-flex; align-items:center; gap:3px;
}
.discover-empty {
  text-align:center; padding:60px 20px;
  background:#FAFBFF; border-radius:14px;
  border:2px dashed #E2E8F0;
}
.discover-empty-icon {
  width:72px; height:72px; border-radius:50%;
  background:linear-gradient(135deg,#EFF6FF,#DBEAFE);
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 16px; font-size:1.8rem; color:#1A6BFF;
}

/* ── Subscription Plans Page ──────────────────────────────────── */
.plans-hero {
  background: linear-gradient(135deg, #0C1220 0%, #1A2744 100%);
  padding: 48px 0 36px; color: #fff;
}
.plan-card {
  border: 2px solid var(--border); border-radius: 16px;
  background: #fff; padding: 32px 28px; height: 100%;
  transition: box-shadow .2s, border-color .2s, transform .2s;
  position: relative;
}
.plan-card:hover { box-shadow: 0 12px 36px rgba(26,107,255,.12); border-color: var(--blue); transform: translateY(-3px); }
.plan-card.plan-featured { border-color: #7C3AED; box-shadow: 0 8px 32px rgba(124,58,237,.15); }
.plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 100px; padding: 4px 12px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; margin-bottom: 12px;
}
.plan-price { font-family:'Sora',sans-serif; font-size: 2.2rem; font-weight: 800; color: #0C1220; line-height: 1; margin: 16px 0 4px; }
.plan-price sup { font-size: 1rem; font-weight: 600; vertical-align: super; }
.plan-price small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.plan-annual { font-size: .78rem; color: var(--muted); margin-bottom: 20px; }
.plan-annual strong { color: #059669; }
.plan-divider { height: 1px; background: var(--border); margin: 20px 0; }
.plan-feature { display: flex; align-items: center; gap: 8px; font-size: .83rem; margin-bottom: 8px; color: #374151; }
.plan-feature .bi-check-circle-fill { color: #059669; font-size: .9rem; flex-shrink: 0; }
.plan-feature .bi-x-circle-fill { color: #D1D5DB; font-size: .9rem; flex-shrink: 0; }
.plan-cta { margin-top: 24px; }
.type-tab { display: inline-flex; gap: 4px; background: #F1F5F9; border-radius: 10px; padding: 4px; }
.type-tab-btn {
  border: none; background: transparent; padding: 7px 20px; border-radius: 8px;
  font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s;
}
.type-tab-btn.active { background: #fff; color: #0C1220; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.popular-ribbon {
  position: absolute; top: -1px; right: 24px; background: #7C3AED; color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; padding: 4px 12px; border-radius: 0 0 8px 8px;
}

/* ── My Plan Page ──────────────────────────────────────────────── */
.myplan-stat { background:#F8FAFF; border-radius:12px; padding:16px 20px; }
.myplan-stat-label { font-size:.72rem; color:#94A3B8; font-weight:600; text-transform:uppercase; letter-spacing:.05em; margin-bottom:4px; }
.myplan-stat-value { font-size:1.1rem; font-weight:700; color:#1E293B; }

/* ── Plan current state ──────────────────────────────────────── */
.plan-current { border-color:#22C55E !important; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.plan-current-ribbon {
  position: absolute; top: -1px; right: 24px;
  background: #22C55E; color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 0 0 8px 8px;
}

/* ── Plans FAQ section ───────────────────────────────────────── */
.plans-faq-section {
  background: linear-gradient(135deg, #0C1220 0%, #1A2744 100%);
  border-radius: 16px; padding: 48px 40px 36px;
}
.plans-faq-header { text-align:center; margin-bottom:36px; }
.plans-faq-icon {
  width:56px; height:56px; border-radius:50%;
  background:rgba(255,255,255,.1);
  display:flex; align-items:center; justify-content:center;
  font-size:1.5rem; color:#F59E0B;
  margin:0 auto 16px;
}
.plans-faq-title { font-family:'Sora',sans-serif; font-weight:800; font-size:1.6rem; color:#fff; margin-bottom:8px; }
.plans-faq-sub { color:rgba(255,255,255,.55); font-size:.9rem; margin:0; }
.plans-faq-card {
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.1);
  border-radius:12px; padding:20px; height:100%;
  transition: background .18s, border-color .18s;
}
.plans-faq-card:hover { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.2); }
.plans-faq-card-icon {
  width:36px; height:36px; border-radius:8px;
  background:rgba(245,158,11,.15); color:#F59E0B;
  display:flex; align-items:center; justify-content:center;
  font-size:1rem; margin-bottom:12px;
}
.plans-faq-card-q { font-size:.88rem; font-weight:700; color:#fff; margin-bottom:6px; }
.plans-faq-card-a { font-size:.78rem; color:rgba(255,255,255,.6); line-height:1.6; }
.plans-faq-cta { text-align:center; margin-top:32px; padding-top:24px; border-top:1px solid rgba(255,255,255,.1); }

/* ── Payment history table ───────────────────────────────────── */
.payment-table thead th {
  background: #F8FAFF; font-size:.72rem; font-weight:700;
  letter-spacing:.06em; text-transform:uppercase; color:#64748B;
  border-bottom:1px solid #E2E8F0; padding:12px 16px;
}
.payment-table tbody td { padding:14px 16px; vertical-align:middle; border-bottom:1px solid #F1F5F9; }
.payment-table tbody tr:last-child td { border-bottom:none; }
.payment-table tbody tr:hover { background:#F8FAFF; }
.payment-method-chip {
  display:inline-flex; align-items:center; gap:5px;
  background:#F1F5F9; color:#475569;
  border-radius:20px; padding:3px 10px; font-size:.75rem; font-weight:500;
}
.payment-amount { font-size:.95rem; font-weight:700; color:#1E293B; }
.payment-date-main { font-size:.84rem; color:#1E293B; font-weight:500; }
.payment-date-sub { font-size:.72rem; color:#94A3B8; margin-top:2px; }

/* ── How It Works Page ───────────────────────────────────────── */
.hiw-hero {
  background: linear-gradient(135deg, #0C1220 0%, #1A2744 100%);
  border-radius: 16px; padding: 48px 40px 0; margin-bottom: 40px; text-align: center;
}
.hiw-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,.15); color: #F59E0B;
  border-radius: 20px; padding: 4px 14px; font-size: .75rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px;
}
.hiw-hero-title { font-family:'Sora',sans-serif; font-weight:800; font-size:clamp(1.5rem,3vw,2.2rem); color:#fff; margin-bottom:10px; }
.hiw-hero-sub { color:rgba(255,255,255,.6); font-size:.95rem; max-width:520px; margin:0 auto 28px; }
.hiw-role-tabs { display:flex; gap:6px; justify-content:center; flex-wrap:wrap; padding-bottom:0; }
.hiw-role-tab {
  border:none; border-radius:10px 10px 0 0; padding:10px 24px;
  font-size:.85rem; font-weight:600; cursor:pointer; transition:all .15s;
  background:rgba(255,255,255,.08); color:rgba(255,255,255,.6);
}
.hiw-role-tab.active { background:#fff; color:#0C1220; }
.hiw-role-tab:hover:not(.active) { background:rgba(255,255,255,.14); color:#fff; }

.hiw-section { background:#fff; border-radius:0 16px 16px 16px; padding:36px; margin-bottom:28px; border:1px solid #E8EFF8; }
.hiw-section-label {
  font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase;
  margin-bottom:28px; display:flex; align-items:center; gap:8px;
}

/* Step layout */
.hiw-steps { display:flex; flex-direction:column; gap:0; }
.hiw-step { display:grid; grid-template-columns:96px 1fr; gap:24px; padding-bottom:0; }
.hiw-step-reverse { direction:rtl; }
.hiw-step-reverse > * { direction:ltr; }
.hiw-step-visual { display:flex; flex-direction:column; align-items:center; gap:8px; }
.hiw-step-num { font-family:'Sora',sans-serif; font-size:1.1rem; font-weight:800; width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.hiw-step-icon { width:72px; height:72px; border-radius:16px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.hiw-step-line { width:2px; flex:1; min-height:40px; background:linear-gradient(#E2E8F0,#F1F5F9); margin:4px 0; }
.hiw-step-content { padding:12px 0 40px; }
.hiw-step-title { font-size:1.05rem; font-weight:700; color:#1E293B; margin-bottom:8px; }
.hiw-step-desc { font-size:.87rem; color:#475569; line-height:1.7; margin-bottom:12px; }
.hiw-step-tips { display:flex; flex-direction:column; gap:6px; }
.hiw-tip { font-size:.8rem; color:#475569; display:flex; align-items:flex-start; gap:8px; }
.hiw-tip i { flex-shrink:0; margin-top:2px; font-size:.78rem; }

.hiw-cta-bar {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px;
  background:#F8FAFF; border:1px solid #E2E8F0; border-radius:12px; padding:20px 24px; margin-top:8px;
}

/* Quick reference cards */
.hiw-quick-card {
  display:flex; flex-direction:column; gap:8px;
  background:#fff; border:1px solid #E8EFF8; border-radius:12px; padding:20px;
  text-decoration:none; color:inherit; transition:box-shadow .18s, transform .18s;
}
.hiw-quick-card:hover { box-shadow:0 8px 24px rgba(27,58,138,.12); transform:translateY(-3px); color:inherit; }
.hiw-quick-icon { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:1.2rem; }
.hiw-quick-title { font-weight:700; font-size:.9rem; color:#1E293B; }
.hiw-quick-desc { font-size:.78rem; color:#64748B; flex:1; }
.hiw-quick-arrow { font-size:.85rem; }

@media (max-width:640px) {
  .hiw-hero { padding:32px 20px 0; }
  .hiw-section { padding:24px 16px; }
  .hiw-step { grid-template-columns:60px 1fr; gap:12px; }
  .hiw-step-icon { width:52px; height:52px; }
  .hiw-step-reverse { direction:ltr; }
  .hiw-cta-bar { flex-direction:column; align-items:flex-start; }
}
