/* ============================================================
   SATHTERN — Design System
   Blue & white, "verified seal" signature motif
   ============================================================ */

:root {
  /* Color */
  --navy: #0A2540;
  --blue: #155EEF;
  --blue-dark: #0B3FAE;
  --sky: #38BDF8;
  --white: #FFFFFF;
  --bg: #F5F8FC;
  --bg-alt: #EAF1FB;
  --border: #DCE6F5;
  --slate: #475467;
  --slate-light: #8A94A6;
  --success: #18A957;
  --success-bg: #E7F8EF;
  --danger: #E5484D;
  --danger-bg: #FDECEC;
  --gold: #C8941B; /* seal ribbon accent */

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 37, 64, 0.10);
  --shadow-lg: 0 24px 60px rgba(10, 37, 64, 0.16);
  --max-width: 1180px;
}

:root[data-theme="dark"] {
  --navy: #EAF1FB;
  --blue: #6EA8FF;
  --blue-dark: #8AB8FF;
  --sky: #38BDF8;
  --white: #111827;
  --bg: #07111F;
  --bg-alt: #132238;
  --border: #243652;
  --slate: #C8D3E1;
  --slate-light: #8FA1B8;
  --success: #5BE08F;
  --success-bg: #102D20;
  --danger: #FF777C;
  --danger-bg: #35171C;
  --gold: #F2C45D;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--navy);
}

p { margin: 0 0 1em; color: var(--slate); }
a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: 0 8px 20px rgba(21, 94, 239, 0.32); }
.btn-outline {
  background: var(--white);
  color: var(--blue);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--blue); background: var(--bg-alt); }
.btn-ghost {
  background: transparent;
  color: var(--navy);
}
.btn-ghost:hover { background: var(--bg-alt); }

.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover {
  background: var(--bg-alt);
  border-color: var(--blue);
  color: var(--blue-dark);
}
.theme-toggle:active {
  transform: translateY(1px);
}
.theme-toggle svg {
  width: 20px;
  height: 20px;
}
.theme-toggle-auth {
  margin: 0 0 18px auto;
}
.theme-toggle-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
}

:root[data-theme="dark"] .btn-primary {
  color: #FFFFFF;
}
:root[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.9);
}
:root[data-theme="dark"] .verify-teaser {
  background: linear-gradient(135deg, #07111F, #102A58);
}
:root[data-theme="dark"] .verify-teaser h2,
:root[data-theme="dark"] .verify-teaser p,
:root[data-theme="dark"] .site-footer h4,
:root[data-theme="dark"] .site-footer .brand {
  color: #FFFFFF;
}
:root[data-theme="dark"] .site-footer {
  background: #050B14;
  color: #C9D6E8;
}
:root[data-theme="dark"] .footer-grid a,
:root[data-theme="dark"] .footer-brand p {
  color: #B7C5D8;
}
:root[data-theme="dark"] .auth-aside {
  background: linear-gradient(160deg, #050B14, #102A58 60%, #155EEF);
}
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- Top navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--navy);
}
.brand-mark {
  width: 34px; height: 34px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  color: var(--navy);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-links a:hover { color: var(--blue); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 860px) {
  .nav-links { 
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 72px 0 64px;
  background: radial-gradient(ellipse at top right, var(--bg-alt) 0%, var(--bg) 60%);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.1;
  max-width: 14ch;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--blue), var(--sky));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.08rem;
  max-width: 46ch;
  margin-bottom: 28px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
}
.hero-stat .label { font-size: 0.82rem; color: var(--slate-light); }

/* ---------- Certificate sample (signature element) ---------- */
.cert-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}
.cert-sample {
  width: min(100%, 640px);
  height: auto;
  display: block;
  border-radius: var(--radius-md);
  box-shadow: 0 28px 70px rgba(10, 37, 64, 0.16);
  transform: rotate(-3deg);
  animation: float-cert 7s ease-in-out infinite;
}
.cert-card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px;
  position: relative;
  transform: rotate(-4deg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(-4deg) translateY(-10px); }
}
@keyframes float-cert {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-10px); }
}
.cert-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.cert-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cert-brand { font-family: var(--font-display); font-weight: 700; color: var(--blue-dark); font-size: 0.95rem; }
.cert-id { font-family: var(--font-mono); font-size: 0.68rem; color: var(--slate-light); }
.cert-title { font-family: var(--font-display); font-size: 1.3rem; margin: 22px 0 4px; }
.cert-name { font-size: 1.05rem; font-weight: 600; color: var(--blue-dark); margin-bottom: 2px; }
.cert-meta { font-size: 0.82rem; color: var(--slate-light); margin-bottom: 18px; }
.cert-foot { display: flex; align-items: center; justify-content: space-between; }
.cert-sign { font-family: var(--font-display); font-style: italic; font-size: 0.95rem; color: var(--navy); border-top: 1px solid var(--border); padding-top: 6px; }

.seal {
  width: 64px; height: 64px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(200, 148, 27, 0.35));
}
.seal-float {
  position: absolute;
  bottom: -18px; right: -18px;
  width: 84px; height: 84px;
  animation: seal-pulse 3.4s ease-in-out infinite;
}
@keyframes seal-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.06) rotate(3deg); }
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--white); }
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.section-head p { font-size: 1.02rem; }

/* Program / domain cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 920px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #c7dcf6; }
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--blue);
}
.card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.card p { font-size: 0.92rem; margin-bottom: 14px; }
.card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blue-dark);
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.card-applied {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Testimonials */
.testimonial-grid {
  align-items: stretch;
}
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.testimonial-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
}
.testimonial-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.testimonial-card h3 {
  font-size: 0.98rem;
  margin: 0 0 2px;
}
.testimonial-card .testimonial-head p {
  color: var(--slate-light);
  font-size: 0.82rem;
  margin: 0;
}
.testimonial-card > p {
  margin: 0;
  font-size: 0.92rem;
}
.testimonial-stars {
  color: #F59E0B;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  white-space: nowrap;
}

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: step; }
@media (max-width: 920px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step-num {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--bg-alt);
  -webkit-text-stroke: 1.5px var(--blue);
  margin-bottom: 10px;
  display: block;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { font-size: 0.9rem; }

/* Verify teaser */
.verify-teaser {
  background: linear-gradient(135deg, var(--navy), var(--blue-dark));
  border-radius: var(--radius-lg);
  padding: 56px;
  color: var(--white);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}
@media (max-width: 860px) { .verify-teaser { grid-template-columns: 1fr; padding: 36px 26px; } }
.verify-teaser h2 { color: var(--white); }
.verify-teaser p { color: #C9DCFB; }
.verify-form { display: flex; gap: 10px; }
.verify-form input {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #C9D6E8;
  padding: 56px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: var(--white); font-size: 0.92rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 10px; font-size: 0.88rem; }
.footer-grid a { color: #C9D6E8; }
.footer-grid a:hover { color: var(--sky); }
.footer-brand p { color: #9DB1CF; font-size: 0.88rem; max-width: 32ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 0.82rem;
  color: #87A0C2;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Company/legal pages ---------- */
.simple-page {
  min-height: 100vh;
  background: var(--bg);
}
.simple-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.simple-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}
.simple-content {
  padding: 56px 0 72px;
}
.simple-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 34px;
  max-width: 860px;
}
.simple-card h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}
.simple-card h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}
.simple-card p,
.simple-card li {
  color: var(--slate);
  line-height: 1.7;
}
.simple-card ul {
  margin: 10px 0 0 20px;
}
.simple-card .updated {
  color: var(--slate-light);
  font-size: 0.88rem;
  margin-bottom: 22px;
}
@media (max-width: 600px) {
  .simple-header .container {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .simple-card {
    padding: 24px;
  }
}

/* ---------- Auth pages ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 860px) { .auth-shell { grid-template-columns: 1fr; } }
.auth-aside {
  background: linear-gradient(160deg, var(--navy), var(--blue-dark) 60%, var(--blue));
  color: var(--white);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
@media (max-width: 860px) { .auth-aside { display: none; } }
.auth-aside .brand { color: var(--white); }
.auth-quote { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.35; max-width: 26ch; }
.auth-quote span { color: var(--sky); }
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-form-wrap > .brand { display: none; margin-bottom: 28px; }
@media (max-width: 860px) { .auth-form-wrap > .brand { display: flex; } }
.auth-form-wrap h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-form-wrap .sub { margin-bottom: 28px; font-size: 0.95rem; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--navy);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--sky);
  border-color: var(--blue);
}
.field-hint { font-size: 0.78rem; color: var(--slate-light); margin-top: 4px; }

.form-alert {
  display: none;
  font-size: 0.88rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.form-alert.show { display: block; }
.form-alert.error { background: var(--danger-bg); color: var(--danger); }
.form-alert.success { background: var(--success-bg); color: var(--success); }

.auth-switch { margin-top: 22px; font-size: 0.9rem; text-align: center; color: var(--slate); }

/* ---------- Dashboard ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.app-sidebar .brand { padding: 0 8px 26px; }
.side-nav { list-style: none; margin: 0; padding: 0; flex: 1; }
.side-nav li { margin-bottom: 4px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--slate);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.side-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side-link:hover { background: var(--bg-alt); color: var(--blue-dark); }
.side-link.active { background: var(--bg-alt); color: var(--blue-dark); font-weight: 700; }
.side-foot { border-top: 1px solid var(--border); padding-top: 16px; }

.app-main { flex: 1; min-width: 0; background: var(--bg); }
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.app-topbar h1 { font-size: 1.2rem; margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--blue-dark);
  overflow: hidden;
  border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.app-content { padding: 32px; max-width: 1080px; }
.app-view { display: none; }
.app-view.active { display: block; }

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
    min-height: 100vh;
  }
  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 14px 10px;
  }
  .app-sidebar .brand {
    padding: 0 4px 12px;
  }
  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    flex: none;
    -webkit-overflow-scrolling: touch;
  }
  .side-nav li {
    margin-bottom: 0;
    flex: 0 0 auto;
  }
  .side-link {
    min-height: 42px;
    white-space: nowrap;
    padding: 9px 11px;
    font-size: 0.86rem;
  }
  .side-link svg {
    width: 17px;
    height: 17px;
  }
  .side-foot {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-top: none;
    padding-top: 8px;
  }
  .side-foot .side-link {
    flex: 0 0 auto;
    width: auto;
  }
  .app-topbar {
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }
  .app-topbar h1 {
    font-size: 1rem;
    line-height: 1.3;
  }
  .user-chip {
    flex-shrink: 0;
  }
  .app-content {
    width: 100%;
    max-width: none;
    padding: 16px;
  }
  .panel {
    padding: 18px;
    border-radius: var(--radius-sm);
  }
  .panel-head {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }
  .field[style*="display:flex"] {
    flex-direction: column;
  }
  .search-bar {
    max-width: none;
  }
  table.data-table {
    min-width: 640px;
  }
  #certificatesTableWrap,
  #adminApplicationsTableWrap,
  #studentsTableWrap,
  #reviewsTableWrap,
  #hardCopyOrdersTableWrap,
  #hardCopyOrdersWrap,
  #applicationsTableWrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .photo-uploader {
    align-items: flex-start;
    flex-direction: column;
  }
}

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 28px; }
@media (max-width: 760px) { .stat-row { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.stat-card .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.stat-card .label { font-size: 0.85rem; color: var(--slate-light); }

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  margin-bottom: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 1.1rem; margin: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}
.status-pill.applied { background: var(--bg-alt); color: var(--blue-dark); }
.status-pill.issued { background: var(--success-bg); color: var(--success); }
.status-pill.pending { background: #FFF6E5; color: #B07A05; }
.status-pill.in-review { background: #FFF6E5; color: #B07A05; }
.status-pill.completed { background: var(--success-bg); color: var(--success); }
.status-pill.approved { background: var(--success-bg); color: var(--success); }
.status-pill.payment_received { background: var(--bg-alt); color: var(--blue-dark); }
.status-pill.processing { background: #FFF6E5; color: #B07A05; }
.status-pill.shipped { background: #E8F3FF; color: #0B5CAD; }
.status-pill.delivered { background: var(--success-bg); color: var(--success); }
.status-pill.cancelled { background: var(--danger-bg); color: var(--danger); }
.status-pill.rejected { background: var(--danger-bg); color: var(--danger); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-light);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.data-table td { padding: 13px 12px; border-bottom: 1px solid var(--border); color: var(--navy); }
table.data-table tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate-light);
}
.empty-state.compact {
  padding: 18px 16px;
  text-align: left;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.6; }

.cert-result {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  background: var(--white);
  margin-top: 24px;
}
.cert-result.show { display: block; }
.cert-result.not-found { border-color: var(--danger); }
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-bg);
  color: var(--success);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 600px) { .verify-grid { grid-template-columns: 1fr; } }
.verify-field .label { font-size: 0.78rem; color: var(--slate-light); text-transform: uppercase; letter-spacing: 0.03em; }
.verify-field .value { font-size: 1rem; font-weight: 600; color: var(--navy); }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.spinner.dark { border-color: rgba(10,37,64,0.15); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 999;
}

/* Profile photo uploader */
.photo-uploader { display: flex; align-items: center; gap: 18px; }
.photo-uploader .avatar { width: 72px; height: 72px; font-size: 1.4rem; }

.review-form {
  max-width: 620px;
}
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.star-btn {
  border: none;
  background: none;
  color: #D5DFEF;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  padding: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.star-btn.active {
  color: #F59E0B;
}
.star-btn:hover {
  transform: translateY(-1px);
}
.review-list {
  margin-top: 26px;
  display: grid;
  gap: 12px;
}
.review-list h3 {
  font-size: 0.98rem;
  margin: 0;
}
.review-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--white);
}
.review-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.review-preview p {
  margin: 0;
  font-size: 0.9rem;
}
.review-cell {
  max-width: 300px;
  line-height: 1.5;
}

.hard-copy-form {
  display: grid;
  gap: 18px;
}
.doc-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.doc-product {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}
.doc-product:has(input:checked) {
  border-color: var(--blue);
  background: var(--bg-alt);
}
.doc-product input {
  width: 18px;
  height: 18px;
}
.doc-product strong,
.doc-product small {
  display: block;
}
.doc-product small {
  color: var(--slate-light);
  font-size: 0.78rem;
  margin-top: 2px;
}
.doc-product b {
  color: var(--blue-dark);
}
.cart-summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.cart-summary > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.cart-summary strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--blue-dark);
}
.cart-summary p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--slate-light);
}
.address-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.address-grid .field.full {
  grid-column: 1 / -1;
}
.address-cell {
  max-width: 260px;
  line-height: 1.5;
}
.hard-copy-terms {
  display: grid;
  gap: 12px;
}
.hard-copy-terms details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.hard-copy-terms summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  padding: 14px 16px;
}
.terms-content {
  border-top: 1px solid var(--border);
  padding: 16px;
}
.terms-content h3 {
  font-size: 0.95rem;
  margin: 18px 0 6px;
}
.terms-content h3:first-child {
  margin-top: 0;
}
.terms-content p,
.terms-content li {
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.65;
}
.terms-content ul {
  margin: 8px 0 0 20px;
}
.table-input {
  width: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-body);
  color: var(--navy);
}
@media (max-width: 700px) {
  .doc-product-grid,
  .address-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Admin extras: search, status controls, modal, icon picker ---------- */
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
  margin-bottom: 16px; max-width: 320px;
}
.search-bar svg { flex-shrink: 0; color: var(--slate-light); }
.search-bar input { border: none; outline: none; font-size: 0.9rem; width: 100%; font-family: var(--font-body); color: var(--navy); background: transparent; }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #FBD9D9; }

.table-actions { display: flex; gap: 14px; align-items: center; }
.link-btn { font-size: 0.82rem; font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; color: var(--blue); }
.link-btn.danger { color: var(--danger); }

select.status-select {
  font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 10px 5px 12px; background: var(--bg-alt); color: var(--blue-dark);
  font-family: var(--font-body); cursor: pointer;
}
select.status-select[data-status="completed"] { background: var(--success-bg); color: var(--success); }
select.status-select[data-status="rejected"] { background: var(--danger-bg); color: var(--danger); }
select.status-select[data-status="in-review"] { background: #FFF6E5; color: #B07A05; }

.role-toggle {
  font-size: 0.78rem; font-weight: 700; padding: 6px 13px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; color: var(--blue-dark);
}
.role-toggle.is-admin { background: var(--navy); color: var(--white); border-color: var(--navy); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 37, 64, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 300;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--white); border-radius: var(--radius-md);
  padding: 26px; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 1.05rem; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--slate-light); font-size: 1.4rem; line-height: 1; padding: 0; }
.modal-close:hover { color: var(--navy); }

.icon-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-option {
  width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--slate); background: var(--white);
}
.icon-option.selected { border-color: var(--blue); background: var(--bg-alt); color: var(--blue); }

.tab-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab-row button {
  font-size: 0.85rem; font-weight: 600; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); color: var(--slate); cursor: pointer;
}
.tab-row button.active { background: var(--blue); color: var(--white); border-color: var(--blue); }

.program-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.program-row:last-child { border-bottom: none; }
.program-row .card-icon { margin-bottom: 0; flex-shrink: 0; }
.program-row .info { flex: 1; min-width: 0; }
.program-row .info h4 { font-size: 0.95rem; margin: 0 0 2px; }
.program-row .info p { font-size: 0.82rem; margin: 0; color: var(--slate-light); }

/* Utility */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ---------- Mobile comfort pass ---------- */
@media (max-width: 680px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  .nav {
    padding: 12px 18px;
    gap: 10px;
  }
  .brand {
    min-width: 0;
    font-size: 1.06rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
  .nav-actions {
    gap: 8px;
    margin-left: auto;
  }
  .nav-actions .btn {
    padding: 8px 11px;
    font-size: 0.8rem;
  }
  .theme-toggle {
    width: 36px;
    height: 36px;
  }
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }

  .hero {
    padding: 48px 0 46px;
  }
  .hero-sub {
    font-size: 0.98rem;
  }
  .hero-cta {
    gap: 10px;
  }
  .hero-cta .btn {
    width: 100%;
  }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .cert-stage {
    min-height: 220px;
  }
  .cert-sample {
    width: 100%;
    transform: none;
    animation: none;
  }

  .section {
    padding: 54px 0;
  }
  .section-head {
    margin-bottom: 30px;
  }
  .verify-form {
    flex-direction: column;
  }
  .verify-form .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .footer-bottom {
    flex-direction: column;
  }

  .auth-main {
    padding: 30px 18px;
  }
  .auth-form-wrap {
    max-width: none;
  }

  .simple-content {
    padding: 34px 0 50px;
  }
  .simple-card {
    padding: 22px;
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 80;
    background: var(--white);
  }
  .app-sidebar .brand {
    font-size: 1rem;
  }
  .side-nav,
  .side-foot {
    scrollbar-width: none;
  }
  .side-nav::-webkit-scrollbar,
  .side-foot::-webkit-scrollbar {
    display: none;
  }
  .side-link {
    gap: 8px;
    min-height: 38px;
    padding: 8px 10px;
  }
  .app-topbar {
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .app-topbar h1 {
    flex: 1 1 100%;
    order: 1;
  }
  .user-chip {
    order: 2;
    max-width: calc(100% - 48px);
  }
  .user-chip span {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .theme-toggle-app {
    order: 3;
    margin-left: auto;
  }
  .app-content {
    padding: 14px;
  }
  .panel {
    padding: 16px;
    margin-bottom: 16px;
  }
  .panel-head h2 {
    font-size: 1rem;
  }

  .doc-product {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
    padding: 14px;
  }
  .doc-product b {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }
  .cart-summary > div {
    align-items: flex-start;
    flex-direction: column;
  }
  .address-grid {
    gap: 0;
  }
  .hard-copy-terms summary {
    padding: 12px 14px;
  }
  .terms-content {
    padding: 14px;
  }
  .terms-content ul {
    margin-left: 18px;
  }
  .table-input {
    width: 140px;
  }
  table.data-table {
    font-size: 0.84rem;
    min-width: 560px;
  }
  table.data-table th,
  table.data-table td {
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .nav-actions .btn-ghost {
    display: none;
  }
  .app-topbar h1 {
    font-size: 0.95rem;
  }
  .user-chip span {
    max-width: 140px;
  }
  .btn {
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }
  .panel .btn-sm,
  .side-foot .side-link,
  .nav-actions .btn,
  .theme-toggle {
    width: auto;
  }
  .review-preview-head {
    flex-direction: column;
  }
  .star-btn {
    font-size: 1.75rem;
  }
}
