@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =====================================================================
   Mentify Platform — Design System
   Light-first, clean flat design (Freelancing / BloodLink style)
   Font: Inter
   Primary: #0f766e (green)
   ===================================================================== */

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

:root {
  /* Brand Colors */
  --green:        #0f766e;
  --green-dark:   #0b4f4a;
  --green-light:  rgba(15,118,110,0.08);
  --blue:         #1c85e8;
  --blue-dark:    #1570cc;
  --blue-light:   #e3f0fd;
  --text:         #1f1f1f;
  --text-muted:   #6e6e6e;
  --text-light:   #999999;
  --border:       #e0e0e0;
  --surface:      #fafafa;
  --bg-surface:   #f9fafb;
  --white:        #ffffff;
  --danger:       #d93025;
  --warning:      #e67e22;
  --info:         #2980b9;
  --radius:       4px;
  --shadow:       0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 2px 8px rgba(0,0,0,.10);
  --nav-h:        64px;

  /* Aliases for template vars */
  --color-primary:        var(--green);
  --color-primary-dark:   var(--green-dark);
  --color-primary-light:  var(--green);
  --color-accent:         var(--green);
  --color-accent-dark:    var(--green-dark);
  --color-warning:        var(--warning);
  --color-danger:         var(--danger);
  --color-success:        var(--green);

  --bg-page:     var(--surface);
  --bg-card:     var(--white);
  --bg-card-hover: #f5f5f5;
  --bg-input:    var(--white);
  --bg-navbar:   var(--white);
  --bg-sidebar:  var(--white);

  --border-color: var(--border);
  --border-focus: var(--green);

  --text-primary:   var(--text);
  --text-secondary: var(--text-muted);
  --text-on-primary: #fff;

  --shadow-card: var(--shadow-md);
  --shadow-lg:   0 4px 16px rgba(0,0,0,.12);
  --glow-primary: none;

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;

  --radius-sm:   var(--radius);
  --radius-md:   6px;
  --radius-lg:   8px;
  --radius-pill: 999px;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'Courier New', monospace;

  --transition-fast:   0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow:   0.3s ease;

  --navbar-h: var(--nav-h);
}

/* Dark theme */
body.dark-theme,
html.dark-theme body {
  --text:       #e4e4e4;
  --text-muted: #a1a1a1;
  --text-light: #777777;
  --border:     #333333;
  --surface:    #121212;
  --white:      #1e1e1e;
  --bg-surface: #1e1e1e;
  --shadow:     0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.6);
}

/* ─── Base ───────────────────────────────────────────────────── */
html {
  font-size: 15px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 220;
  background: rgba(15, 118, 110, 0.96);
  color: white;
  padding: 12px 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.12);
}
.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner a { color: #fff; text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5 { font-size: .9rem; }

p { color: var(--text-muted); margin-bottom: var(--space-md); }
small { font-size: .8rem; color: var(--text-light); }

.text-primary   { color: var(--text) !important; }
.text-secondary { color: var(--text-muted) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-accent    { color: var(--green) !important; }
.text-brand     { color: var(--green) !important; }
.text-success   { color: var(--green) !important; }
.text-warning   { color: var(--warning) !important; }
.text-danger    { color: var(--danger) !important; }
.text-green     { color: var(--green) !important; }
.text-sm        { font-size: .82rem; }
.fw-600         { font-weight: 600; }
.text-right     { text-align: right; }

.text-gradient {
  color: var(--green);
}

/* ─── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrap { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 48px; min-height: 100vh; }
.main-content { min-height: calc(100vh - var(--nav-h)); padding: 32px 0 48px; }

.page-header {
  padding: 12px 0 20px;
  margin-bottom: 24px;
}

/* ─── Global Section Divider Spacing ──────────────────────────────────────────
   Ensure elements that immediately follow a bordered section header always
   have a minimum breathing gap. Applies across all Mentify Prep pages on both
   mobile and desktop so no form, search bar, or container ever touches a
   border-bottom divider line.
   ─────────────────────────────────────────────────────────────────────────── */
[class*="-header"] + [class*="-toolbar"],
[class*="-header"] + [class*="-section"],
[class*="-header"] + [class*="-body"],
[class*="-header"] + [class*="-grid"],
[class*="-header"] + [class*="-content"] {
  padding-top: max(var(--section-gap, 24px), 24px);
}
/* Fallback: any direct next-sibling of a bordered page-header gets clearance */
.page-header + *,
[class$="-header"][style*="border-bottom"] + * {
  margin-top: max(var(--section-gap, 0px), 0px);
}
.auth-page {
  padding: 56px 0 48px;
  display: flex;
  justify-content: center;
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo h1 {
  margin-top: 16px;
  margin-bottom: 8px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-check-input {
  width: 16px;
  height: 16px;
  margin-right: 8px;
}
.password-input-group {
  position: relative;
}
.password-input-group input {
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  padding: 4px;
}
.divider {
  margin: 24px 0;
}
.dashboard-body {
  padding: 32px 36px 56px;
}
.empty-state,
.card,
.card-container {
  box-shadow: var(--shadow);
}
.empty-state {
  padding: 32px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.alert {
  margin-bottom: 18px;
}
.footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
}
.footer-links a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

/* Dashboard layout */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - var(--nav-h));
  padding-left: 240px;
  width: 100%;
  box-sizing: border-box;
  transition: padding-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-body {
  flex: 1;
  padding: 36px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.navbar-brand span  { color: var(--green); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex: 1;
}
.navbar-nav .nav-link {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.navbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.5rem;
  padding: 0;
  border-radius: var(--radius);
  transition: background .2s;
  touch-action: manipulation;
}
.mobile-menu-btn:active { background: var(--surface); }
.mobile-drawer { display: none; }
.mobile-drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150; opacity: 0;
  transition: opacity .25s ease;
}
.mobile-drawer-overlay.active { display: block; opacity: 1; }
.mobile-drawer-panel {
  position: fixed; top: 0; left: 0;
  width: 85%; max-width: 320px; min-height: 100dvh;
  background: var(--white); z-index: 160;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease; overflow: visible;
}
.mobile-drawer-panel.active { transform: translateX(0); }
.mobile-drawer-close {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1.5rem;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.mobile-drawer-content { padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.mobile-drawer-link {
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted); text-decoration: none;
  font-weight: 500; font-size: .95rem;
  transition: background .2s, color .2s;
  display: flex; align-items: center; gap: 10px;
  touch-action: manipulation;
}
.mobile-drawer-link:hover  { background: #f3f3f3; color: var(--text); }
.mobile-drawer-link.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.mobile-drawer-link svg { flex-shrink: 0; }
.mobile-drawer-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mobile-drawer-button  { padding: 10px 14px; margin: 4px 0; width: 100%; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 14px 0 16px;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  width: 240px;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
}
body.dark-theme .sidebar {
  background: #121212;
  border-right-color: #242424;
}

/* Sidebar Top Container */
.sidebar-top-container {
  display: flex;
  flex-direction: column;
}
.sidebar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  min-height: 36px;
}
.sidebar-header-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-collapse-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  background: var(--hover);
  color: var(--text);
  border-color: var(--border);
}

/* Sidebar Bottom User Profile (docked cleanly like Gemini) */
.sidebar-footer-profile {
  padding: 12px 14px 4px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-footer-profile .sidebar-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-profile {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: 0 16px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sidebar-profile > .sidebar-profile-row {
  min-width: 0;
}
.sidebar-profile > .badge {
  margin-top: 8px;
}
.sidebar-nav {
  flex: 0 0 auto;
  width: 100%;
}

/* Retractable Sidebar collapsed states */
body.sidebar-collapsed .dashboard-layout,
html.sidebar-collapsed .dashboard-layout {
  padding-left: 64px !important;
}
body.sidebar-collapsed .sidebar,
html.sidebar-collapsed .sidebar {
  width: 64px !important;
  padding: 14px 0 16px !important;
}
body.sidebar-collapsed .sidebar-header-row,
html.sidebar-collapsed .sidebar-header-row {
  padding: 0 0 12px 0;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-header-label,
html.sidebar-collapsed .sidebar-header-label,
body.sidebar-collapsed .sidebar-profile-info,
html.sidebar-collapsed .sidebar-profile-info,
body.sidebar-collapsed .sidebar-footer-profile .badge,
html.sidebar-collapsed .sidebar-footer-profile .badge,
body.sidebar-collapsed .nav-label,
html.sidebar-collapsed .nav-label {
  display: none !important;
}
body.sidebar-collapsed .sidebar-collapse-btn,
html.sidebar-collapsed .sidebar-collapse-btn {
  display: inline-flex !important;
  margin: 0 auto;
}
body.sidebar-collapsed .sidebar-footer-profile,
html.sidebar-collapsed .sidebar-footer-profile {
  padding: 10px 0 4px;
  align-items: center;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-profile,
html.sidebar-collapsed .sidebar-profile {
  padding-right: 0;
  padding-left: 0;
  align-items: center;
}
body.sidebar-collapsed .sidebar-footer-profile .sidebar-profile-row {
  justify-content: center;
}
body.sidebar-collapsed .sidebar-profile > .sidebar-profile-row,
html.sidebar-collapsed .sidebar-profile > .sidebar-profile-row {
  justify-content: center;
}
html.main-sidebar-collapsed #main-sidebar .sidebar-nav li a,
html.main-sidebar-collapsed #main-sidebar .sidebar-nav .nav-item a {
  justify-content: center;
  padding: 11px 0;
  font-size: 0;
  margin: 3px 8px;
  border-radius: 8px;
}
html.main-sidebar-collapsed #main-sidebar .sidebar-nav li a svg,
html.main-sidebar-collapsed #main-sidebar .sidebar-nav .nav-item a svg {
  margin-right: 0 !important;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-nav li a,
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-nav .nav-item a {
  justify-content: center;
  padding: 11px 0;
  font-size: 0;
  margin: 3px 8px;
  border-radius: 8px;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-nav li a svg,
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-nav .nav-item a svg {
  margin-right: 0 !important;
}
html.main-sidebar-collapsed .main-app-dashboard-layout {
  padding-left: 64px !important;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar {
  width: 64px !important;
  padding: 14px 0 16px !important;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-header-row {
  padding: 0 0 12px;
  justify-content: center;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-header-label,
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-profile-info,
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-profile > .badge,
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .nav-label {
  display: none !important;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-collapse-btn {
  display: inline-flex !important;
  margin: 0 auto;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-profile {
  padding: 0 0 12px;
  align-items: center;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-profile > .sidebar-profile-row {
  justify-content: center;
}
.main-app-sidebar-page .sidebar .sidebar-profile.sidebar-footer-profile {
  padding: 12px 14px 4px;
  margin: auto 0 0;
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
html.main-sidebar-collapsed .main-app-sidebar-page .sidebar .sidebar-profile.sidebar-footer-profile {
  padding: 10px 0 4px;
  align-items: center;
  justify-content: center;
}
.main-app-sidebar-page .footer,
.prep-app .footer {
  width: calc(100% - 240px);
  margin-left: 240px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
html.main-sidebar-collapsed .main-app-sidebar-page .footer,
html.sidebar-collapsed .prep-app .footer {
  width: calc(100% - 64px);
  margin-left: 64px;
}
.sidebar-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-profile-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; flex-shrink: 0;
  overflow: hidden;
}
.sidebar-profile-avatar.has-image img,
.nav-avatar.has-image img,
.profile-photo-preview.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-profile-info {
  min-width: 0;
  flex: 1;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.sidebar-profile-role {
  font-size: 0.72rem;
  margin-top: 4px;
}
.sidebar-profile-name {
  font-weight: 700; font-size: 0.95rem; color: var(--text);
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-profile-email {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 1px;
  display: block;
  width: 100%;
  max-width: 136px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  border-radius: 0;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar-nav li a:hover { background: #f3f3f3; color: var(--text); text-decoration: none; }
.sidebar-nav li a.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.sidebar-nav li a svg { flex-shrink: 0; width: 16px; height: 16px; color: currentColor; }
.sidebar-nav .nav-item a { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: var(--text-muted); font-size: .9rem; font-weight: 500; transition: background .12s, color .12s; }
.sidebar-nav .nav-item a:hover  { background: #f3f3f3; color: var(--text); text-decoration: none; }
.sidebar-nav .nav-item a.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.sidebar-nav .nav-item a .icon  { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; align-items: center; }

.sidebar-section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-light);
  padding: 16px 20px 6px;
}

/* Nav avatar */
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  overflow: hidden;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-glass {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.card-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

/* Stat cards */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
}
.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.stat-card .stat-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.stat-card .stat-icon {
  position: absolute;
  bottom: 16px; right: 16px;
  opacity: 0.08;
  color: var(--green);
}
.stat-sub { font-size: .78rem; color: var(--text-light); margin-top: 2px; }

/* Course card */
.course-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.course-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
}
.course-card .card-cover {
  height: 150px;
  background: linear-gradient(135deg, rgba(15,118,110,0.08), #d4f0d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}
.course-card .card-cover.has-image {
  background: #111;
}
.course-card .card-cover img,
.course-detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-detail-banner {
  width: 100%;
  aspect-ratio: 16 / 6;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.course-card .card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-card .card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.course-catalog-container {
  padding-bottom: 48px;
}
.course-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 40px;
  align-items: flex-start;
  margin-top: 16px;
}
.course-detail-layout > * {
  min-width: 0;
}
.course-detail-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 16px);
}
.course-cohort-card {
  border-left: 3px solid var(--green);
}
.course-cohort-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.course-cohort-header > *,
.course-cohort-price {
  min-width: 0;
}
.course-cohort-price {
  text-align: right;
}
.course-cohort-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.course-cohort-meta > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.course-cohort-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  line-height: 1.6;
}
.badge-primary  { background: var(--green-light); color: var(--green); }
.badge-accent   { background: var(--green-light); color: var(--green); }
.badge-success  { background: rgba(15,118,110,0.08); color: var(--green); }
.badge-warning  { background: #fff7e6; color: #b06000; }
.badge-danger   { background: #fee; color: var(--danger); }
.badge-muted    { background: #f3f3f3; color: var(--text-muted); }
.badge-info     { background: var(--blue-light); color: var(--blue); }

.track-tech       { background: var(--green-light); color: var(--green); }
.track-cbc        { background: #fff7e6; color: #b06000; }
.track-specialist { background: #fee; color: var(--danger); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: none;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s, border-color .15s;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
}
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-accent {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
}
.btn-accent:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-blue {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
}
.btn-blue:hover { background: var(--blue-dark); }

.btn-outline {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface); border-color: #ccc; }

.btn-outline-primary {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-outline-primary:hover { background: var(--green-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface); color: var(--text); }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm    { padding: 6px 14px; font-size: .82rem; }
.btn-lg    { font-size: .95rem; padding: 11px 24px; }
.btn-block { width: 100%; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control,
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(15,118,110,0.12);
}
.form-control::placeholder,
.form-input::placeholder { color: var(--text-light); }
.form-textarea  { resize: vertical; min-height: 100px; }
.form-select    { cursor: pointer; }

.form-text, .form-hint { font-size: .78rem; color: var(--text-light); margin-top: 4px; }
.form-error   { font-size: .78rem; color: var(--danger); margin-top: 4px; }
.errorlist    { list-style: none; margin: 4px 0; }
.errorlist li { font-size: .8rem; color: var(--danger); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.form-check-label { font-size: .9rem; color: var(--text-muted); cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
  border-left: 3px solid;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success { background: rgba(15,118,110,0.06); border-color: var(--green); color: #1a5c00; }
.alert-error,
.alert-danger  { background: #fff2f2; border-color: var(--danger); color: #990000; }
.alert-warning { background: #fffbf0; border-color: var(--warning); color: #7a4500; }
.alert-info    { background: var(--blue-light); border-color: var(--blue); color: #0c4080; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrapper, .table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.table-wrapper table,
.table-wrap table { margin: 0; }
.table, table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.table thead th, th {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  white-space: nowrap;
}
.table tbody tr, tr { border-bottom: 1px solid var(--border); }
.table tbody tr:hover td, tr:hover td { background: #fafafa; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody td, td {
  padding: 10px 14px;
  color: var(--text-muted);
  vertical-align: middle;
}

/* ─── Progress ───────────────────────────────────────────────── */
.progress {
  height: 6px;
  background: #e8e8e8;
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--green);
  transition: width .5s ease;
}

/* ─── Stats Grid ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.grid-stat  { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

/* ─── Grids ──────────────────────────────────────────────────── */
.grid      { display: grid; gap: 16px; }
.grid-2    { grid-template-columns: repeat(2, 1fr); }
.grid-3    { grid-template-columns: repeat(3, 1fr); }
.grid-4    { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

section + section { margin-top: 32px; }
.card h3,
.card h4 { margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }
.card,
.course-card,
.session-item { overflow-wrap: anywhere; }
.flex > .btn,
.card-footer .btn { flex-shrink: 0; }

/* ─── Video ──────────────────────────────────────────────────── */
.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ─── Lesson Items ───────────────────────────────────────────── */
.lesson-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .12s, background .12s;
  text-decoration: none;
  color: var(--text);
}
.lesson-item:hover {
  border-color: var(--green);
  background: var(--green-light);
  text-decoration: none;
}
.lesson-item .lesson-number {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: var(--green-light);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.lesson-item.completed .lesson-number {
  background: rgba(15,118,110,0.08);
  color: var(--green);
}
.lesson-item .lesson-info { flex: 1; min-width: 0; }
.lesson-item .lesson-title { font-weight: 600; font-size: .95rem; color: var(--text); }
.lesson-item .lesson-meta  { font-size: .78rem; color: var(--text-light); margin-top: 2px; }

.resource-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
}
.resource-link:hover { border-color: var(--green); color: var(--green); background: var(--green-light); text-decoration: none; }
.resource-list,
.assignment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resource-type {
  font-size: .7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.assignment-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.lesson-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 36px;
  align-items: flex-start;
}
.lesson-video-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.lesson-video-panel .video-container {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.lesson-video-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
}
.lesson-video-meta strong {
  color: var(--text);
}
.lesson-copy {
  font-size: .95rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 0;
}
.lesson-empty-video {
  margin-bottom: 24px;
}

/* Cohort and tutor cards */
.cohort-detail-shell {
  max-width: 760px;
  margin: 16px auto 0;
}
.cohort-detail-card {
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.cohort-detail-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--green);
}
.cohort-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 24px;
}
.price-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  min-width: 180px;
  text-align: right;
}
.price-panel__value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.price-panel__label {
  margin-top: 4px;
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.tutor-profile-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.tutor-profile-card__avatar,
.tutor-inline-summary > span {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.tutor-profile-card__avatar img,
.tutor-inline-summary img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tutor-profile-card__body {
  min-width: 0;
}
.tutor-profile-card__name {
  font-weight: 700;
  color: var(--text);
}
.tutor-profile-card__meta {
  color: var(--text-muted);
  font-size: .84rem;
}
.tutor-profile-card__specialty {
  display: inline-flex;
  margin: 8px 0;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--green-light);
  color: var(--green);
  font-size: .78rem;
  font-weight: 700;
}
.tutor-profile-card p {
  margin: 2px 0 0;
  font-size: .88rem;
}
.tutor-inline-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.tutor-inline-summary img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tutor-inline-summary > span {
  width: 40px;
  height: 40px;
  font-size: .82rem;
}
.tutor-inline-summary strong,
.tutor-inline-summary small {
  display: block;
}
.tutor-inline-summary small {
  color: var(--text-muted);
}
.cohort-copy {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.cohort-enroll-actions {
  text-align: center;
  margin-top: 24px;
}
.profile-settings-shell {
  max-width: 760px;
}
.profile-settings-card {
  max-width: none;
  padding: 40px;
}

/* ─── Sessions ───────────────────────────────────────────────── */
.session-item {
  display: flex; gap: 16px;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .15s;
  align-items: center;
}
.session-item.upcoming { border-left: 3px solid var(--green); }
.session-item.makeup   { border-left: 3px solid var(--warning); }
.session-item .session-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 52px; padding: 8px;
  background: var(--green-light);
  border-radius: var(--radius);
}
.session-item .session-date .day   { font-size: 1.3rem; font-weight: 700; color: var(--green); line-height: 1; }
.session-item .session-date .month { font-size: .65rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: .4px; }

/* ─── Notifications ──────────────────────────────────────────── */
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .88rem;
}
.notif-content { min-width: 0; }
.notif-link { color: var(--text); text-decoration: none; font-weight: 500; }
.notif-link:hover { color: var(--green); text-decoration: underline; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex-shrink: 0; margin-top: 6px; }
.notif-time { font-size: .76rem; color: var(--text-light); margin-top: 2px; }

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.page-header h1 { font-size: 1.4rem; }
.page-header h1,
.page-header h2,
.page-header h3 { margin-bottom: 8px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-muted);
  margin-bottom: 6px;
  list-style: none;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb-sep { opacity: .4; }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: var(--green-light);
  border-radius: 50%;
  margin: 0 auto 16px;
  color: var(--green);
}
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p  { max-width: 360px; margin: 0 auto; font-size: .95rem; }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(15,118,110,.2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast / Flash Messages ─────────────────────────────────── */
.messages-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in .3s ease;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--white);
}
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: rgba(15,118,110,0.06); border-color: var(--green); color: #1a5c00; }
.toast-error   { background: #fff2f2; border-color: var(--danger); color: #990000; }
.toast-info    { background: var(--blue-light); border-color: var(--blue); color: #0c4080; }
.toast-warning { background: #fffbf0; border-color: var(--warning); color: #7a4500; }

/* ─── Hero Section ───────────────────────────────────────────── */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 80px 0 60px;
}
.hero h1 { font-size: 2.4rem; font-weight: 700; color: var(--text); max-width: 600px; }
.hero h1 span { color: var(--green); }
.hero p { font-size: 1.05rem; max-width: 520px; margin-top: 14px; color: var(--text-muted); }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; }

/* ─── Auth Pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: var(--surface);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo img {
  height: 52px; width: 52px;
  object-fit: contain;
  border-radius: var(--radius);
  margin: 0 auto 10px;
}
.auth-logo h1 { font-size: 1.4rem; color: var(--text); }
.auth-logo p  { font-size: .88rem; color: var(--text-muted); margin: 0; }

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.btn-google:hover { background: var(--surface); border-color: #ccc; text-decoration: none; }

/* Divider with text */
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: .8rem;
  color: var(--text-light);
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Filters Bar ────────────────────────────────────────────── */
.filters-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 20px; padding: 14px 18px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
}
.filters-bar .form-select,
.filters-bar .form-input,
.filters-bar .form-control {
  width: auto; min-width: 160px; padding: 7px 10px;
}

/* Section title */
.section-title { font-size: 1rem; font-weight: 600; margin-bottom: 14px; color: var(--text); }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); font-size: .85rem; color: var(--text-muted);
  transition: background .12s; text-decoration: none;
}
.pagination a:hover { background: var(--surface); text-decoration: none; }
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }

/* ─── Avatar ─────────────────────────────────────────────────── */
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.avatar-placeholder {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700;
}
.profile-photo-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.profile-photo-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 700;
  overflow: hidden;
}

/* ─── Skills Tags ────────────────────────────────────────────── */
.skills-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.skill-tag {
  padding: 3px 12px; border-radius: 20px;
  background: #f3f3f3; color: var(--text-muted);
  font-size: .8rem; font-weight: 500;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
  color: var(--text-muted);
}

/* ─── Utility ────────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-sm  { gap: 8px; }
.gap-md  { gap: 16px; }
.gap-lg  { gap: 24px; }
.gap-2   { gap: 12px; }
.flex-1  { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.stack-mobile { display: flex; flex-direction: column; }
.stack-mobile > * + * { margin-top: 12px; }

.mt-0  { margin-top: 0; }
.mt-sm { margin-top: 8px; }
.mt-md, .mt-2 { margin-top: 16px; }
.mt-lg, .mt-3 { margin-top: 24px; }
.mt-xl, .mt-4 { margin-top: 32px; }
.mb-sm { margin-bottom: 8px; }
.mb-md, .mb-2 { margin-bottom: 16px; }
.mb-lg, .mb-3 { margin-bottom: 24px; }
.mb-xl, .mb-4 { margin-bottom: 32px; }
.mb-2xl { margin-bottom: 64px; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded  { border-radius: var(--radius-md); }
.rounded-pill { border-radius: var(--radius-pill); }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* Social Share SVG Buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-btn:hover {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-light);
  transform: translateY(-2px);
}
body.dark-theme .share-btn {
  background: #242424;
  border-color: #383838;
  color: #a1a1a1;
}
body.dark-theme .share-btn:hover {
  color: #2dd4bf;
  border-color: var(--green);
  background: rgba(15, 118, 110, 0.2);
}

/* Theme toggle */
.theme-toggle {
  background: transparent; border: none; color: var(--text);
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius);
  transition: background .2s; display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--surface); }

/* Dark theme fixes */
body.dark-theme .sidebar-nav li a:hover { background: #2a2a2a; }
body.dark-theme .sidebar-nav li a.active { background: #053d38; color: var(--green); }
body.dark-theme .sidebar-nav .nav-item a:hover { background: #2a2a2a; }
body.dark-theme .sidebar-nav .nav-item a.active { background: #053d38; color: var(--green); }
body.dark-theme .badge-success { background: #053d38; }
body.dark-theme .badge-muted   { background: #2c2c2c; }
body.dark-theme .alert-success { background: #053d38; border-color: var(--green); color: #2dd4bf; }
body.dark-theme .alert-error   { background: #3d1515; border-color: var(--danger); color: #e57373; }
body.dark-theme .alert-warning { background: #3d2b0e; border-color: var(--warning); color: #ffb74d; }
body.dark-theme .alert-info    { background: #102640; border-color: var(--blue); color: #64b5f6; }
body.dark-theme .toast-success { background: #053d38; border-color: var(--green); color: #2dd4bf; }
body.dark-theme .toast-error   { background: #3d1515; border-color: var(--danger); color: #e57373; }
body.dark-theme tr:hover td    { background: #262626; }
body.dark-theme .card-container,
body.dark-theme .auth-card     { background: #1e1e1e; }
body.dark-theme .course-card .card-cover { background: #053d38; }
body.dark-theme .stat-card::before { background: var(--green); }
body.dark-theme .btn-outline   { background: #1e1e1e; color: #e4e4e4; border-color: #333; }
body.dark-theme .btn-google    { background: #1e1e1e; border-color: #333; color: #e4e4e4; }
body.dark-theme .empty-state .empty-icon { background: #053d38; }
body.dark-theme .mobile-drawer-panel     { background: #1e1e1e; }
body.dark-theme .mobile-drawer-link:hover { background: #2a2a2a; }
body.dark-theme .mobile-drawer-link.active { background: #053d38; color: var(--green); }
body.dark-theme .mobile-drawer-divider   { background: #333; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-layout {
    padding-left: 0 !important;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow-x: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    background: var(--surface);
  }
  body.sidebar-collapsed .dashboard-layout,
  html.sidebar-collapsed .dashboard-layout,
  html.main-sidebar-collapsed .main-app-dashboard-layout {
    padding-left: 0 !important;
  }
  body.sidebar-collapsed .sidebar,
  html.sidebar-collapsed .sidebar {
    width: 100% !important;
    padding: 8px 0 !important;
  }
  html.main-sidebar-collapsed #main-sidebar {
    width: 100% !important;
    padding: 8px 0 !important;
  }
  .main-app-sidebar-page .footer,
  .prep-app .footer,
  html.main-sidebar-collapsed .main-app-sidebar-page .footer,
  html.sidebar-collapsed .prep-app .footer {
    width: 100%;
    margin-left: 0;
  }
  .sidebar-profile { display: none; }
  .sidebar-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 6px 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-nav li a,
  .sidebar-nav .nav-item a {
    white-space: nowrap;
    border-radius: 20px;
    min-height: 44px;
    font-size: 0.84rem;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .sidebar-nav li a.active,
  .sidebar-nav .nav-item a.active {
    background: var(--green);
    color: #ffffff;
    border-color: var(--green);
  }
  body.dark-theme .sidebar-nav li a,
  body.dark-theme .sidebar-nav .nav-item a {
    background: #1e1e1e;
    border-color: #333;
    color: #e4e4e4;
  }
  body.dark-theme .sidebar-nav li a.active,
  body.dark-theme .sidebar-nav .nav-item a.active {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
  }
  .sidebar-section-label { display: none; }
  .dashboard-body { padding: 24px 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .lesson-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .navbar {
    padding: 0 14px;
    gap: 8px;
  }
  .navbar-nav .nav-link {
    padding: 6px 8px;
    font-size: 0.82rem;
  }
}

@media (max-width: 860px) {
  :root { --nav-h: 56px; }
  .container { padding: 0 16px; }
  .main-content { padding: 16px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar { padding: 0 16px; gap: 8px; }
  .navbar-nav { display: none; }
  .mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-drawer { display: block; }
  .mobile-drawer-panel { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
  .mobile-drawer-content { padding-bottom: 24px; }
  .sidebar { display: none !important; }
  .dashboard-layout { padding-left: 0 !important; }
  .dashboard-body { padding: 16px 12px; }
  .card { padding: 16px 14px; }
  .course-clean-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    gap: 7px;
  }
  .course-clean-row > div:last-child {
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.78rem;
  }
  .session-item { align-items: flex-start; flex-wrap: wrap; }
  .page-header[style*="display: flex"] {
    align-items: flex-start !important;
    flex-direction: column;
    gap: 12px !important;
    margin-bottom: 16px !important;
  }
  .page-header { padding-top: 8px; padding-bottom: 14px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .hero-actions .btn { width: 100%; }
  .auth-card { padding: 24px 18px; }
  .profile-photo-panel { align-items: flex-start; flex-direction: column; }
  .profile-settings-card,
  .cohort-detail-card { padding: 24px 20px; }
  .cohort-detail-heading,
  .lesson-video-meta,
  .tutor-profile-card { flex-direction: column; }
  .price-panel { width: 100%; text-align: left; }
  .course-detail-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .course-detail-sidebar {
    position: static;
  }
  .course-cohort-header {
    flex-direction: column;
    align-items: stretch;
  }
  .course-cohort-price {
    text-align: left;
  }
  .course-cohort-price > div:first-child {
    justify-content: flex-start !important;
    flex-wrap: wrap;
  }
  .course-cohort-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .course-cohort-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .course-cohort-actions .btn {
    width: 100%;
  }
  .form-row { grid-template-columns: 1fr; }
  .messages-container { bottom: 16px; right: 16px; left: 16px; max-width: 100%; }
  .home-page > section:not(.hero) {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  .home-page .hero > .container > div:first-child {
    padding-top: 32px !important;
    padding-bottom: 18px !important;
  }
  .home-page .hero h1 {
    margin-bottom: 16px !important;
  }
  .home-page .hero p {
    margin-bottom: 24px !important;
    font-size: 1rem !important;
  }
  .home-page > section > .container > div[style*="text-align: center"] {
    margin-bottom: 24px !important;
  }
  .home-page .card[style*="padding: 40px"] {
    padding: 20px !important;
  }
  .home-page .cta-title {
    margin-bottom: 12px !important;
  }
  .home-page .cta-title + p {
    margin-bottom: 24px !important;
  }
  .home-page .btn {
    min-height: 44px;
  }
}

@media (max-width: 479px) {
  html { font-size: 14px; }
  .container { padding: 0 12px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.1rem; }
  .btn { padding: 9px 14px; font-size: .84rem; }
  .btn-sm { padding: 7px 10px; font-size: .75rem; }
  .dashboard-body { padding: 12px 10px; }
  .stats-grid, .grid-stat { grid-template-columns: 1fr; }
  .grid-auto { grid-template-columns: minmax(0, 1fr); }
  .stat-card { padding: 12px; }
  .stat-card .stat-value { font-size: 1.35rem; }
  .stat-strip-item { padding-right: 8px; }
  .filters-bar { flex-direction: column; gap: 8px; padding: 10px; align-items: stretch; }
  .filters-bar .form-select,
  .filters-bar .form-input,
  .filters-bar .form-control,
  .filters-bar .btn { width: 100%; min-width: unset; }
  table { font-size: .75rem; }
  th, td { padding: 8px 10px; }
  .alert { padding: 8px 12px; font-size: .8rem; }
  .card { padding: 12px; border-radius: 8px; }
  .course-card .card-cover { height: 120px; }
  .course-detail-banner { aspect-ratio: 16 / 9; }
  .course-detail-page {
    margin-top: 16px !important;
  }
  .course-detail-page h1 {
    overflow-wrap: anywhere;
  }
  .course-card .card-body { padding: 14px; }
  .course-card .card-footer { padding: 12px 14px; align-items: stretch; }
  .course-card .card-footer .btn { width: 100%; }
  .navbar { padding-right: 8px; padding-left: 8px; gap: 4px; }
  .navbar-brand { gap: 5px; font-size: 1rem; }
  .navbar-end { gap: 4px; }
  .navbar-end > a[href*="/prep/billing/"] {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 4px 9px !important;
    font-size: 0.78rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: fit-content !important;
    width: auto !important;
    height: auto !important;
    border-radius: var(--radius-pill) !important;
  }
  .navbar-end > a[href*="/prep/billing/"] span {
    display: inline !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 380px) {
  .navbar-end { gap: 3px; }
  .navbar-brand { font-size: 0.92rem; }
  .navbar-end > a[href*="/prep/billing/"] {
    padding: 3px 7px !important;
    font-size: 0.74rem !important;
    gap: 3px !important;
    min-width: fit-content !important;
    width: auto !important;
    height: auto !important;
    border-radius: var(--radius-pill) !important;
  }
}

@media (min-width: 861px) {
  .navbar-nav { display: flex !important; }
  .form-row { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   Profile Pages  (BloodLink-style, Mentify teal theme)
   ===================================================================== */

/* ── Page layout ─────────────────────────────────────────── */
.profile-page {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px 60px;
}
.profile-col { display: flex; flex-direction: column; gap: 20px; }

.profile-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.profile-page-header .page-title  { font-size: 1.4rem; font-weight: 700; }
.profile-page-header .page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: 2px; }

/* ── Hero card ───────────────────────────────────────────── */
.profile-hero-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-cover {
  height: 88px;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
}
.profile-cover.cover-learner  { background: linear-gradient(135deg, #0b4f4a, #0f766e); }
.profile-cover.cover-tutor    { background: linear-gradient(135deg, #1570cc, #1c85e8); }
.profile-cover.cover-guardian { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.profile-cover.cover-admin    { background: linear-gradient(135deg, #991b1b, #d93025); }

.profile-hero-body {
  padding: 0 24px 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

/* ── Avatar ──────────────────────────────────────────────── */
.profile-avatar-wrap { margin-top: -40px; flex-shrink: 0; }

.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-md);
  display: block;
}
.profile-avatar.clickable { cursor: zoom-in; }

.profile-avatar-placeholder {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
  background: var(--green-light); color: var(--green);
}
.profile-avatar-placeholder.avatar-learner  { background: var(--green-light); color: var(--green); }
.profile-avatar-placeholder.avatar-tutor    { background: var(--blue-light);  color: var(--blue);  }
.profile-avatar-placeholder.avatar-guardian { background: rgba(168,85,247,.1); color: #7c3aed; }
.profile-avatar-placeholder.avatar-admin    { background: rgba(217,48,37,.08); color: var(--danger); }

/* ── Name block ──────────────────────────────────────────── */
.profile-name-block { flex: 1; padding-top: 44px; }
.profile-full-name  { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.profile-email      { font-size: .82rem; color: var(--text-muted); margin: 3px 0 8px; }
.profile-headline   { font-size: .88rem; color: var(--text-muted); margin-top: 6px; }

.profile-badges-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.profile-role-badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: .73rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.role-learner  { background: var(--green-light); color: var(--green); }
.role-tutor    { background: var(--blue-light);  color: var(--blue);  }
.role-guardian { background: rgba(168,85,247,.1); color: #7c3aed; }
.role-admin    { background: rgba(217,48,37,.08); color: var(--danger); }

.profile-specialty-tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 999px;
  font-size: .73rem; font-weight: 500;
  background: rgba(28,133,232,.08); color: var(--blue);
  border: 1px solid rgba(28,133,232,.18);
}
.profile-location-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .73rem; color: var(--text-muted);
}

/* ── Stats row ───────────────────────────────────────────── */
.profile-stats-row {
  display: flex;
  justify-content: flex-start;
  gap: 0;
  border-top: 1px solid var(--border);
}
.profile-stat {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.profile-stat:last-child { border-right: none; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: var(--green); }
.stat-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ── Info card ───────────────────────────────────────────── */
.profile-info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.profile-section-title {
  font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.profile-info-item {
  display: flex; flex-direction: column; gap: 4px;
}
.info-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 500; }
.info-value { font-size: .92rem; font-weight: 600; color: var(--text); }

.profile-bio-text {
  font-size: .9rem; line-height: 1.75; color: var(--text-muted);
  white-space: pre-line;
}

/* ── Empty nudge ─────────────────────────────────────────── */
.profile-empty-nudge {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
}
.profile-empty-nudge p { font-size: .9rem; }

/* ── Actions footer ──────────────────────────────────────── */
.profile-actions-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; gap: 12px;
}

/* ── Edit page cards ─────────────────────────────────────── */
.profile-edit-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.avatar-upload-row {
  display: flex; align-items: center; gap: 24px;
}
.avatar-preview-wrap { flex-shrink: 0; }
.avatar-upload-info { display: flex; flex-direction: column; gap: 8px; }
.avatar-upload-btn {
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}

/* Hide the raw file input visually (label acts as trigger) */
#id_avatar_image { display: none; }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-edit-actions {
  display: flex; gap: 12px; align-items: center;
}

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox-overlay {
  display: none; position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.85);
  align-items: center; justify-content: center;
}
.lightbox-overlay.active { display: flex; }
.lightbox-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 6px; object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.2rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .profile-page { padding: 0 12px 40px; margin: 20px auto; }
  .profile-hero-body { flex-direction: column; align-items: flex-start; gap: 8px; }
  .profile-name-block { padding-top: 0; }
  .profile-stats-row { flex-wrap: wrap; }
  .profile-stat { min-width: 50%; flex: unset; }
  .form-row-2 { grid-template-columns: 1fr; }
  .avatar-upload-row { flex-direction: column; align-items: flex-start; }
  .profile-page-header { flex-direction: column; }
}

/* =====================================================================
   Custom File Input Buttons & Control Styling
   ===================================================================== */
input[type="file"],
.form-control[type="file"] {
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .88rem;
  color: var(--text-muted);
  width: 100%;
  line-height: 1.5;
}
input[type="file"]::file-selector-button,
input[type="file"]::-webkit-file-upload-button {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(15, 118, 110, 0.25);
  padding: 6px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  margin-right: 12px;
  transition: all 0.2s ease;
}
input[type="file"]::file-selector-button:hover,
input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--green);
  color: #ffffff;
  border-color: var(--green);
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

body.dark-theme input[type="file"]::file-selector-button,
body.dark-theme input[type="file"]::-webkit-file-upload-button {
  background: rgba(15, 118, 110, 0.2);
  color: #2dd4bf;
  border-color: rgba(45, 212, 191, 0.3);
}
body.dark-theme input[type="file"]::file-selector-button:hover,
body.dark-theme input[type="file"]::-webkit-file-upload-button:hover {
  background: var(--green);
  color: #ffffff;
}

/* =====================================================================
   Legal & Static Policy Pages (Privacy, Terms, Cookies, Contact)
   ===================================================================== */
.policy-page-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px 84px;
  font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.policy-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 34px 38px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.policy-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--green), #2dd4bf);
}
.policy-header-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green);
  background: var(--green-light);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.policy-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0;
  line-height: 1.15;
}
.policy-header p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
  max-width: 720px;
}
.policy-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 20px;
}

.policy-nav-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow);
}
.policy-nav-link {
  padding: 9px 15px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}
.policy-nav-link:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.policy-nav-link.active {
  background: var(--green-light);
  color: var(--green);
  font-weight: 600;
}

.policy-content-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 38px 40px;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text);
}
.policy-section {
  margin-bottom: 34px;
}
.policy-section:last-child {
  margin-bottom: 0;
}
.policy-section h2 {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.policy-section h2 .sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
}
.policy-section p {
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.78;
}
.policy-section ul {
  margin: 12px 0 18px 24px;
  color: var(--text-muted);
}
.policy-section ul li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* Contact Page Layout */
.contact-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 84px;
  font-family: var(--font-sans, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
}
@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}
.contact-info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow);
  height: fit-content;
}
.contact-info-item {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
}
.contact-info-item:last-child {
  margin-bottom: 0;
}
.contact-info-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-info-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.contact-info-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .policy-page-container,
  .contact-container {
    padding: 28px 14px 64px;
  }
  .policy-nav-tabs {
    gap: 6px;
    padding: 6px;
  }
  .policy-nav-link {
    flex: 1 1 calc(50% - 6px);
    text-align: center;
    padding: 10px 8px;
    font-size: 0.82rem;
  }
  .policy-header {
    padding: 26px 22px;
    margin-bottom: 22px;
  }
  .policy-header p {
    font-size: 0.94rem;
  }
  .policy-meta-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .policy-content-card {
    padding: 26px 22px;
  }
  .policy-section {
    margin-bottom: 28px;
  }
  .policy-section h2 {
    align-items: flex-start;
    font-size: 1.04rem;
    line-height: 1.35;
  }
  .policy-section ul {
    margin-left: 18px;
  }
  .contact-info-card {
    padding: 22px;
  }
}

/* ─── Blog Article Content Typography ───────────────────────────── */
.blog-article-content {
  color: var(--text);
  line-height: 1.8;
  font-size: 1.05rem;
}

.blog-article-content h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.3;
}

.blog-article-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  line-height: 1.35;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.blog-article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.4;
}

.blog-article-content h4,
.blog-article-content h5,
.blog-article-content h6 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.blog-article-content p {
  margin-top: 0;
  margin-bottom: 1.25rem;
  line-height: 1.8;
  color: var(--text);
}

/* Bullet points & Numbered Lists */
.blog-article-content ul {
  list-style-type: disc !important;
  padding-left: 2rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 1.25rem !important;
}

.blog-article-content ol {
  list-style-type: decimal !important;
  padding-left: 2rem !important;
  margin-top: 0.5rem !important;
  margin-bottom: 1.25rem !important;
}

.blog-article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.blog-article-content li > ul,
.blog-article-content li > ol {
  margin-top: 0.4rem !important;
  margin-bottom: 0.4rem !important;
}

/* Horizontal Divider (---) */
.blog-article-content hr {
  border: none !important;
  border-top: 2px solid var(--border) !important;
  margin: 2.5rem 0 !important;
  height: 0 !important;
}

/* Inline Code (backticks `code`) */
.blog-article-content code {
  background: var(--bg-surface, rgba(15, 118, 110, 0.08));
  color: var(--green, #0f766e);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  padding: 0.2em 0.45em;
  border-radius: 4px;
  border: 1px solid rgba(15, 118, 110, 0.15);
}

/* Code Blocks (```python ... ```) */
.blog-article-content pre {
  background: #0d2340 !important;
  color: #f3f4f6 !important;
  padding: 1.25rem !important;
  border-radius: var(--radius-md, 8px) !important;
  overflow-x: auto !important;
  margin-top: 1.25rem !important;
  margin-bottom: 1.75rem !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-article-content pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  border: none !important;
  font-size: inherit !important;
}

/* Blockquotes (> Quote) */
.blog-article-content blockquote {
  border-left: 4px solid var(--green, #0f766e) !important;
  background: rgba(15, 118, 110, 0.04);
  padding: 1rem 1.25rem !important;
  margin: 1.5rem 0 !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

.blog-article-content blockquote p {
  margin-bottom: 0 !important;
}

/* Images & Tables */
.blog-article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md);
}

.blog-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.blog-article-content th,
.blog-article-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.blog-article-content th {
  background: var(--bg-surface, #f9fafb);
  font-weight: 700;
}
