/* ============================================================
   NPO Enterprise + GHE — Main Stylesheet
   ============================================================ */

:root {
  --black:    #0a0a0a;
  --white:    #f7f5f0;
  --cream:    #ede9e0;
  --gold:     #f7f5f0;
  --gold-lt:  #e8cc7a;
  --slate:    #2a3140;
  --slate-lt: #3d4a5c;
  --muted:    #7a8394;
  --green:    #1e7b4a;
  --radius:   4px;
  --shadow:   0 2px 16px rgba(0,0,0,.12);
  --blue:         #0078d4;
  --blue-dark:    #005a9e;
  --blue-light:   #deecf9;
  --blue-mid:     #c7e0f4;
  --teal:         #008272;
  --teal-light:   #d2f0eb;
  --amber:        #d29200;
  --amber-light:  #fff4ce;
  --red:          #a4262c;
  --surface:      #ffffff;
  --surface-2:    #f3f2f1;
  --surface-3:    #edebe9;
  --border:       #e1dfdd;
  --border-strong:#c8c6c4;
  --text-primary: #201f1e;
  --text-secondary:#605e5c;
  --text-muted:   #a19f9d;
  --shadow-sm: 0 1.6px 3.6px rgba(0,0,0,0.13), 0 0.3px 0.9px rgba(0,0,0,0.1);
  --shadow-md: 0 4.8px 14.4px rgba(0,0,0,0.13), 0 0.6px 1.8px rgba(0,0,0,0.11);
  --shadow-lg: 0 25.6px 57.6px rgba(0,0,0,0.12), 0 4.8px 14.4px rgba(0,0,0,0.1);
  --radius-lg: 8px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background: var(--white);
  color: var(--black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, .brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

a { color: var(--slate); text-decoration: none; }
a:hover { color: var(--gold); }

/* ── TOPBAR + NAV (GHE style) ── */
.topbar { background: var(--blue-dark); height: 4px; width: 100%; }
.nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 56px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-icon {
  width: 32px; height: 32px; border-radius: 4px;
  background: var(--blue); display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .9rem;
  color: #fff; flex-shrink: 0;
}
.nav-name { font-size: .95rem; font-weight: 600; color: var(--text-primary); letter-spacing: -.01em; }
.nav-name span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 0; }
.nav-link {
  padding: 0 14px; height: 56px; display: flex; align-items: center;
  font-size: .85rem; color: var(--text-secondary); font-weight: 400;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s; text-decoration: none;
}
.nav-link:hover { color: var(--blue); border-bottom-color: var(--blue); }
.nav-link.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.nav-btn {
  margin-left: 16px; padding: 6px 16px;
  background: var(--blue); color: #fff;
  border-radius: 4px; font-size: .85rem; font-weight: 600;
  transition: background .15s; text-decoration: none;
}
.nav-btn:hover { background: var(--blue-dark); }
.burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--text-primary); margin: 4px 0; }

/* ── OLD NAVBAR (courses.php etc) ── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 68px; background: var(--slate);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.navbar-brand {
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.3rem;
  color: var(--white) !important; display: flex; align-items: center;
  gap: .5rem; letter-spacing: -.01em;
}
.brand-icon { color: var(--gold); font-size: 1.4rem; }
.navbar-links { display: flex; align-items: center; gap: 1.5rem; }
.navbar-links a { color: rgba(247,245,240,.75); font-size: .9rem; font-weight: 500; transition: color .2s; }
.navbar-links a:hover { color: var(--gold); }

/* ── BUTTONS ── */
.btn-primary, .btn-outline, .btn-admin, .btn-danger, .btn-success {
  display: inline-block; padding: .5rem 1.25rem; border-radius: var(--radius);
  font-family: 'Syne', sans-serif; font-weight: 600; font-size: .85rem;
  letter-spacing: .03em; cursor: pointer; border: 2px solid transparent;
  transition: all .18s; text-align: center;
}
.btn-primary  { background: var(--gold); color: var(--black); }
.btn-primary:hover { background: var(--gold-lt); color: var(--black); }
.btn-outline  { border-color: rgba(247,245,240,.4); color: var(--white); background: transparent; }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-admin    { background: var(--gold); color: var(--black); font-size: .8rem; padding: .4rem 1rem; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover { background: #165f38; color: #fff; }
button.btn-primary, button.btn-danger, button.btn-success {
  font-family: 'Syne', sans-serif; font-weight: 600;
}
.btn-block { width: 100%; padding: .75rem; font-size: 1rem; margin-top: .5rem; }

/* ── LAYOUT ── */
.main-content { flex: 1; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.page-hero {
  background: var(--slate); color: var(--white);
  padding: 4rem 1.5rem 3.5rem; text-align: center;
}
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .75rem; }
.page-hero p  { color: rgba(247,245,240,.7); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }
.section { padding: 3.5rem 1.5rem; }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.course-card {
  background: #fff; border: 1px solid #e2ddd5; border-radius: 6px;
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.course-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.14); }
.course-card-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-mid) 100%);
  display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.course-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.course-card-body h3 { font-size: 1rem; margin-bottom: .4rem; color: var(--text-primary); }
.course-card-body p  { color: var(--muted); font-size: .88rem; flex: 1; margin-bottom: 1rem; }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 3px;
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.badge-free   { background: #d4edda; color: #155724; }
.badge-paid   { background: #fff3cd; color: #856404; }
.badge-locked { background: #f8d7da; color: #721c24; }

/* ── AUTH FORMS ── */
.auth-wrap {
  min-height: calc(100vh - 68px); display: flex;
  align-items: top; justify-content: center;
  padding: 2rem 1rem;
}
.auth-box {
  background: #fff; border: 1px solid #ddd8ce; border-radius: 8px;
  padding: 2.5rem 2rem; width: 100%; max-width: 420px; box-shadow: var(--shadow);
}
.auth-box h1 { font-size: 1.8rem; margin-bottom: .25rem; }
.auth-box .auth-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.75rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--slate); margin-bottom: .35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid #d4cfc5;
  border-radius: var(--radius); font-family: 'DM Sans', sans-serif;
  font-size: .95rem; background: var(--white); color: var(--black);
  transition: border-color .18s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200,168,75,.15);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--red); }
.alert-success { background: #dff6dd; color: #155724; border-left: 4px solid var(--green); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }
.auth-footer { margin-top: 1.25rem; text-align: center; font-size: .88rem; color: var(--muted); }
.auth-footer a { color: var(--gold); font-weight: 600; }

/* ── DASHBOARD ── */
.dash-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  align-items: start;
}
.dash-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  position: sticky;
  top: 72px;
}
.dash-sidebar h3 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.dash-sidebar a {
  display: block; padding: 8px 10px; font-size: .88rem;
  color: var(--text-secondary); border-radius: 4px;
  margin-bottom: 2px; transition: background .15s, color .15s;
  text-decoration: none;
}
.dash-sidebar a:hover { background: var(--surface-2); color: var(--blue); }
.dash-sidebar a.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.dash-main { padding: 1rem 0; background: transparent; }
.dash-main h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); margin-bottom: 1.5rem; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
thead { background: var(--slate); color: var(--white); }
thead th { padding: .75rem 1rem; font-family: 'Syne', sans-serif; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; text-align: left; }
tbody tr { border-bottom: 1px solid #eae6df; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #faf8f4; }
tbody td { padding: .7rem 1rem; font-size: .9rem; }

/* ── COURSE CONTENT ── */
.lesson-content { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.5rem; line-height: 1.75; }
.lesson-content h2 { margin: 1.5rem 0 .5rem; }
.lesson-content p  { margin-bottom: 1rem; }
.paywall-gate {
  text-align: center; padding: 4rem 2rem;
  background: var(--cream); border: 2px dashed #c8c0b0;
  border-radius: 8px; margin: 2rem auto; max-width: 560px;
}
.paywall-gate h2 { font-size: 1.6rem; margin-bottom: .75rem; }
.paywall-gate p  { color: var(--muted); margin-bottom: 1.5rem; }

/* ── FOOTER ── */
.site-footer { background: #1b1a19; color: rgba(255,255,255,0.65); padding: 48px 32px 32px; }
.footer-inner { max-width: 1200px; margin: 0 auto; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 48px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand { max-width: 280px; }
.footer-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-icon { width: 28px; height: 28px; border-radius: 4px; background: var(--blue); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; color: #fff; }
.footer-org-name { font-weight: 600; font-size: .95rem; color: #fff; }
.footer-desc { font-size: .82rem; line-height: 1.7; }
.footer-links-col h4 { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,0.4); margin-bottom: 14px; }
.footer-links-col a { display: block; font-size: .85rem; color: rgba(255,255,255,0.6); padding: 4px 0; transition: color .15s; }
.footer-links-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .78rem; color: rgba(255,255,255,0.35); }

/* ── ADMIN ── */
.admin-panel { min-height: calc(100vh - 68px); background: var(--cream); padding: 2rem; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--gold); }
.admin-header h1 { font-size: 1.6rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-box { background: #fff; border: 1px solid #ddd8ce; border-radius: 6px; padding: 1.25rem; text-align: center; }
.stat-box .stat-num { font-family: 'Syne', sans-serif; font-size: 2.2rem; font-weight: 800; color: var(--slate); }
.stat-box .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: .2rem; }

/* ── MOBILE OVERLAY ── */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(15,23,36,0.97); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.mobile-overlay.active { opacity: 1; pointer-events: all; }
.mobile-overlay a {
  color: rgba(200,211,220,0.8); text-decoration: none;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  padding: 10px 24px; border-radius: 8px;
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s, transform .4s, color .2s, background .2s;
}
.mobile-overlay a:hover { color: #E8B54A; }
.mobile-overlay.active a { opacity: 1; transform: translateY(0); }
.mobile-overlay.active a:nth-child(1) { transition-delay: .04s; }
.mobile-overlay.active a:nth-child(2) { transition-delay: .08s; }
.mobile-overlay.active a:nth-child(3) { transition-delay: .12s; }
.mobile-overlay.active a:nth-child(4) { transition-delay: .16s; }
.mobile-overlay.active a:nth-child(5) { transition-delay: .20s; }
.mobile-overlay.active a:nth-child(6) { transition-delay: .24s; }
.mobile-overlay-login {
  margin-top: 16px; color: #0f1724 !important;
  background: linear-gradient(135deg, #E8B54A, #D4AC0D);
  border-radius: 40px !important; font-size: 1rem !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .dash-sidebar { position: static; }
  .nav-links { display: none; }
  .burger { display: block; }
  .navbar { padding: 0 1rem; }
  .navbar-links { gap: .75rem; font-size: .8rem; }
  .footer-top { flex-direction: column; }
}
