/* ───────────────────────────────────────────────────────────────
   Expand Education — shared design system
   ───────────────────────────────────────────────────────────────
   Mirrors the Expand Health AI platform design tokens
   (~/Projects/expandhealthai/demo/expand-health/v2/public/css/main.css)
   so the Academy admin + storefront feel like an Expand product.

   What this file gives you:
     - colour + spacing tokens
     - global resets + body font
     - app-container + sidebar shell components (admin layout)
     - card / metric / pill / button base styles
     - nav-item + nav-section-title sidebar styles

   Page-specific styles still live in each lms-*.html file; this is the
   foundation those pages should layer on top of.
   ─────────────────────────────────────────────────────────────── */

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

:root {
  /* Brand — same primaries as the EHAI app */
  --primary: #1E4D3F;
  --primary-dark: #163D32;
  --primary-light: #2E7A64;
  --accent-green: #4ADE80;

  /* Surfaces */
  --bg-light: #F5F4F0;
  --bg-white: #FFFFFF;
  --bg-cream: #FBF9F4;

  /* Text */
  --text-dark: #0F1F1A;
  --text-medium: #4B5563;
  --text-muted: #6C7280;
  --text-light: #9CA3AF;

  /* Borders */
  --border: #E8E5DF;
  --border-light: #F0EDE8;

  /* Status */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #4A9FD4;

  /* Sidebar — same dark teal as EHAI */
  --sidebar-bg: #1B3A30;
  --sidebar-hover: #22483C;
  --sidebar-active: #2E7A64;
  --sidebar-text: #C8E0D8;
  --sidebar-text-dim: rgba(200, 224, 216, 0.5);
  --sidebar-border: rgba(255, 255, 255, 0.08);

  /* Layout */
  --sidebar-width: 244px;
  --topbar-height: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* Type */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Legacy aliases used in older Academy pages — kept so we don't have
     to rewrite every page in one go. */
  --bg: var(--bg-light);
  --surface: var(--bg-white);
  --surface2: var(--border-light);
  --gold: var(--primary-light);
  --gold-light: var(--accent-green);
  --text: var(--text-dark);
  --green: var(--success);
  --amber: var(--warning);
  --red: var(--error);
  --blue: var(--info);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

/* ───────────────────────────────────────────────────────────────
   Admin app shell — sidebar + main
   Apply via:
   <div class="app-container">
     <aside class="sidebar"> ... </aside>
     <main class="main"> ... </main>
   </div>
   ─────────────────────────────────────────────────────────────── */

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-green);
}

.sidebar-logo-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.sidebar-logo-brand {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.4px;
}

.sidebar-logo-sub {
  font-size: 15px;
  font-weight: 400;
  color: var(--sidebar-text);
  letter-spacing: 0.4px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-text-dim);
  padding: 16px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.nav-item svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: 0.75;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--sidebar-active);
  color: #FFFFFF;
}
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 12px;
  color: var(--sidebar-text-dim);
}

.sidebar-footer .user-email {
  color: var(--sidebar-text);
  font-weight: 500;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-logout {
  background: none;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text-dim);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.btn-sidebar-logout:hover { color: #FFFFFF; border-color: rgba(255,255,255,0.25); }

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
}

.main-inner {
  max-width: 1180px;
  padding: 32px 36px 60px;
}

@media (max-width: 900px) {
  .sidebar { position: static; height: auto; width: 100%; }
  .main { margin-left: 0; }
  .main-inner { padding: 24px 18px 60px; }
}

/* ───────────────────────────────────────────────────────────────
   Common page chrome
   ─────────────────────────────────────────────────────────────── */

.page-header {
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-dark);
}
.page-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}
.page-gen-time {
  color: var(--text-light);
  font-size: 12px;
}

/* ───────────────────────────────────────────────────────────────
   Cards
   ─────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
}
.card-sub {
  color: var(--text-muted);
  font-size: 13px;
}

/* ───────────────────────────────────────────────────────────────
   Metric grid (pulse blocks on the overview)
   ─────────────────────────────────────────────────────────────── */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.metric {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.metric.ok    { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.06); }
.metric.warn  { border-color: rgba(245,158,11,0.35); background: rgba(245,158,11,0.06); }
.metric.alert { border-color: rgba(239,68,68,0.35);  background: rgba(239,68,68,0.06); }

.metric-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}
.metric-value {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--text-dark);
}
.metric-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ───────────────────────────────────────────────────────────────
   Pills + status badges
   ─────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill-upcoming { background: rgba(74,159,212,0.12); color: var(--info); }
.pill-active   { background: rgba(74,222,128,0.18); color: #166534; }
.pill-completed { background: rgba(168,85,247,0.15); color: #6B21A8; }
.pill-success  { background: rgba(16,185,129,0.15); color: var(--success); }
.pill-warn     { background: rgba(245,158,11,0.15); color: var(--warning); }
.pill-error    { background: rgba(239,68,68,0.15); color: var(--error); }

/* ───────────────────────────────────────────────────────────────
   Buttons
   ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-medium);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #FFFFFF;
}
.btn-accent {
  background: var(--accent-green);
  color: var(--primary-dark);
  border-color: var(--accent-green);
}
.btn-accent:hover {
  background: var(--primary-light);
  color: #FFFFFF;
  border-color: var(--primary-light);
}
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ───────────────────────────────────────────────────────────────
   Crumbs / breadcrumbs
   ─────────────────────────────────────────────────────────────── */

.crumbs {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary-light); }
