/* ═══════════════════════════════════════════════════════
   WCSH ACCREDITATION TOOL — ORANGE THEME
   ES 7191:2025 | Developed by Dr. Jemal Bedru
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&display=swap');

:root {
  /* ── Core Orange Palette ── */
  --orange:       #F97316;
  --orange-dark:  #EA580C;
  --orange-deep:  #C2410C;
  --orange-light: #FB923C;
  --orange-pale:  #FFF7ED;
  --orange-50:    #FFF7ED;
  --orange-100:   #FFEDD5;
  --orange-200:   #FED7AA;
  --orange-500:   #F97316;
  --orange-600:   #EA580C;
  --orange-700:   #C2410C;

  /* ── Neutrals ── */
  --white:        #FFFFFF;
  --gray-50:      #F9FAFB;
  --gray-100:     #F3F4F6;
  --gray-200:     #E5E7EB;
  --gray-300:     #D1D5DB;
  --gray-400:     #9CA3AF;
  --gray-500:     #6B7280;
  --gray-600:     #4B5563;
  --gray-700:     #374151;
  --gray-800:     #1F2937;
  --gray-900:     #111827;

  /* ── Status Colors ── */
  --green:        #16A34A;
  --green-bg:     #F0FDF4;
  --green-border: #BBF7D0;
  --green-text:   #15803D;

  --amber:        #D97706;
  --amber-bg:     #FFFBEB;
  --amber-border: #FDE68A;
  --amber-text:   #B45309;

  --red:          #DC2626;
  --red-bg:       #FEF2F2;
  --red-border:   #FECACA;
  --red-text:     #B91C1C;

  --blue:         #2563EB;
  --blue-bg:      #EFF6FF;
  --blue-border:  #BFDBFE;
  --blue-text:    #1D4ED8;

  --purple:       #7C3AED;
  --purple-bg:    #F5F3FF;
  --purple-border:#DDD6FE;
  --purple-text:  #6D28D9;

  /* ── Typography ── */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;

  /* ── Shadows ── */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow:     0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  --shadow-orange: 0 4px 14px rgba(249,115,22,0.25);
  --shadow-orange-lg: 0 8px 25px rgba(249,115,22,0.35);

  /* ── Border Radius ── */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* ── Transitions ── */
  --trans: all 0.2s ease;
  --trans-slow: all 0.35s ease;
}

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust:100%; }
body {
  background: var(--gray-50);
  color: var(--gray-800);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}
img, svg { display:block; max-width:100%; }
button, select, input, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.topbar-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-orange);
  flex-shrink: 0;
}
.topbar-logo img { width:100%; height:100%; object-fit:cover; border-radius:10px; }
.topbar-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.2;
}
.topbar-name span { color: var(--orange); }
.topbar-nav { display:flex; align-items:center; gap:6px; }
.topbar-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  padding: 7px 14px;
  border-radius: var(--radius);
  transition: var(--trans);
  border: 1px solid transparent;
  text-decoration: none;
  display: flex; align-items: center; gap: 6px;
}
.topbar-link:hover { background: var(--gray-100); color: var(--gray-800); }
.topbar-link.active { background: var(--orange-pale); color: var(--orange-dark); border-color: var(--orange-200); font-weight:600; }
.topbar-back {
  display:flex; align-items:center; gap:6px;
  font-size:13px; color:var(--gray-600);
  padding:7px 14px; border-radius:var(--radius);
  border:1px solid var(--gray-200);
  background:var(--white);
  transition:var(--trans);
}
.topbar-back:hover { border-color:var(--orange-200); color:var(--orange); background:var(--orange-pale); }
.topbar-back svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; }

/* ── MAIN CONTAINER ── */
.main { max-width:1280px; margin:0 auto; padding:32px 32px 80px; }
.main-wide { max-width:1440px; margin:0 auto; padding:32px 32px 80px; }

/* ── PAGE HEADER ── */
.page-header { margin-bottom:32px; }
.page-eyebrow {
  display:inline-flex; align-items:center; gap:8px;
  font-size:11px; font-weight:700; letter-spacing:2px;
  text-transform:uppercase; color:var(--orange);
  margin-bottom:10px;
  background:var(--orange-pale);
  padding:5px 12px; border-radius:var(--radius-full);
  border:1px solid var(--orange-200);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.page-title .accent { color: var(--orange); }
.page-subtitle { font-size:15px; color:var(--gray-500); margin-top:8px; max-width:600px; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-body { padding: 24px; }
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.card-title { font-size:15px; font-weight:700; color:var(--gray-800); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: var(--trans);
  text-decoration: none;
  line-height: 1;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: var(--white);
  box-shadow: var(--shadow-orange);
}
.btn-primary:hover { transform:translateY(-1px); box-shadow:var(--shadow-orange-lg); }
.btn-primary:active { transform:translateY(0); }
.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background:var(--gray-50); border-color:var(--gray-400); }
.btn-ghost { background:transparent; color:var(--gray-600); }
.btn-ghost:hover { background:var(--gray-100); color:var(--gray-800); }
.btn-sm { padding:7px 14px; font-size:12px; border-radius:var(--radius-sm); }
.btn-lg { padding:14px 28px; font-size:15px; border-radius:var(--radius-md); }
.btn svg { width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; flex-shrink:0; }

/* ── FORM ELEMENTS ── */
.form-label {
  font-size:11px; font-weight:700; letter-spacing:1px;
  text-transform:uppercase; color:var(--gray-500);
  margin-bottom:6px; display:block;
}
.form-input, .form-select, .form-textarea {
  width:100%;
  background:var(--white);
  border:1.5px solid var(--gray-200);
  border-radius:var(--radius);
  padding:10px 14px;
  font-family:var(--font-body);
  font-size:14px;
  color:var(--gray-800);
  outline:none;
  transition:var(--trans);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(249,115,22,0.12);
}
.form-select { appearance:none; cursor:pointer; }
.form-select option { background:var(--white); }
.form-textarea { resize:vertical; min-height:80px; }

/* ── BADGES ── */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 10px; border-radius:var(--radius-full);
  font-size:11px; font-weight:700; letter-spacing:0.5px;
}
.badge-critical { background:var(--red-bg); color:var(--red-text); border:1px solid var(--red-border); }
.badge-core     { background:var(--amber-bg); color:var(--amber-text); border:1px solid var(--amber-border); }
.badge-dev      { background:var(--blue-bg); color:var(--blue-text); border:1px solid var(--blue-border); }
.badge-orange   { background:var(--orange-pale); color:var(--orange-dark); border:1px solid var(--orange-200); }

/* ── SCORE CHIPS ── */
.score-0   { background:#FEF2F2; color:#B91C1C; border:1px solid #FECACA; }
.score-50  { background:#FFFBEB; color:#B45309; border:1px solid #FDE68A; }
.score-100 { background:#F0FDF4; color:#15803D; border:1px solid #BBF7D0; }
.score-na  { background:#F3F4F6; color:#6B7280; border:1px solid #E5E7EB; }

/* ── STATS GRID ── */
.stats-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px,1fr));
  gap:16px;
  margin-bottom:28px;
}
.stat-card {
  background:var(--white);
  border:1.5px solid var(--gray-200);
  border-radius:var(--radius-md);
  padding:20px;
  text-align:center;
  box-shadow:var(--shadow-sm);
  transition:var(--trans);
}
.stat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-1px); }
.stat-num {
  font-family:var(--font-display);
  font-size:36px; font-weight:700;
  line-height:1; margin-bottom:6px;
  color:var(--orange);
}
.stat-label { font-size:12px; color:var(--gray-500); font-weight:600; }

/* ── PROGRESS BAR ── */
.progress-wrap { margin-bottom:6px; }
.progress-label-row {
  display:flex; justify-content:space-between; align-items:center;
  margin-bottom:6px;
}
.progress-label { font-size:12px; color:var(--gray-500); font-weight:500; }
.progress-val { font-size:13px; font-weight:700; color:var(--gray-700); }
.progress-bg {
  height:8px; background:var(--gray-200);
  border-radius:var(--radius-full); overflow:hidden;
}
.progress-fill {
  height:100%; border-radius:var(--radius-full);
  background:linear-gradient(90deg, var(--orange), var(--orange-light));
  transition:width 0.6s ease;
}
.progress-fill.green { background:linear-gradient(90deg, #16A34A, #22C55E); }
.progress-fill.amber { background:linear-gradient(90deg, #D97706, #F59E0B); }
.progress-fill.red   { background:linear-gradient(90deg, #DC2626, #EF4444); }

/* ── FILTER CHIPS ── */
.filter-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; align-items:center; }
.filter-chip {
  padding:7px 16px;
  border-radius:var(--radius-full);
  border:1.5px solid var(--gray-200);
  background:var(--white);
  font-size:12px; font-weight:600;
  color:var(--gray-600);
  cursor:pointer;
  transition:var(--trans);
}
.filter-chip:hover { border-color:var(--orange-200); color:var(--orange); background:var(--orange-pale); }
.filter-chip.active { border-color:var(--orange); color:var(--orange-dark); background:var(--orange-pale); }
.filter-chip.active.critical { border-color:var(--red); color:var(--red-text); background:var(--red-bg); }
.filter-chip.active.core { border-color:var(--amber); color:var(--amber-text); background:var(--amber-bg); }
.filter-chip.active.dev { border-color:var(--blue); color:var(--blue-text); background:var(--blue-bg); }
.filter-chip.active.green { border-color:var(--green); color:var(--green-text); background:var(--green-bg); }

/* ── FOOTER CREDIT ── */
.dev-credit {
  text-align:center;
  padding:20px;
  font-size:12px;
  color:var(--gray-400);
  border-top:1px solid var(--gray-100);
  margin-top:40px;
}
.dev-credit strong { color:var(--orange); }

/* ── TOAST ── */
.toast {
  position:fixed; bottom:24px; right:24px;
  padding:12px 20px; border-radius:var(--radius-md);
  font-size:13px; font-weight:600;
  box-shadow:var(--shadow-xl);
  z-index:999;
  display:none; align-items:center; gap:8px;
  animation:slideUp 0.3s ease;
}
.toast.show { display:flex; }
.toast.success { background:var(--green-bg); border:1px solid var(--green-border); color:var(--green-text); }
.toast.error { background:var(--red-bg); border:1px solid var(--red-border); color:var(--red-text); }
.toast.info { background:var(--orange-pale); border:1px solid var(--orange-200); color:var(--orange-dark); }

/* ── LOADING ── */
.spinner {
  width:24px; height:24px;
  border:3px solid var(--orange-200);
  border-top-color:var(--orange);
  border-radius:50%;
  animation:spin 0.7s linear infinite;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align:center; padding:60px 20px;
  color:var(--gray-400);
}
.empty-state-icon { font-size:48px; margin-bottom:16px; opacity:0.5; }
.empty-state-title { font-size:18px; font-weight:700; color:var(--gray-600); margin-bottom:8px; }
.empty-state-sub { font-size:14px; line-height:1.6; max-width:380px; margin:0 auto 20px; }

/* ── MOBILE NAV TOGGLE ── */
.mobile-menu-btn {
  display:none;
  width:36px; height:36px;
  border:1.5px solid var(--gray-200);
  border-radius:var(--radius-sm);
  background:var(--white);
  cursor:pointer;
  align-items:center; justify-content:center;
  flex-direction:column; gap:5px;
}
.mobile-menu-btn span {
  display:block; width:18px; height:2px;
  background:var(--gray-600); border-radius:2px;
  transition:var(--trans);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
@keyframes spin {
  to { transform:rotate(360deg); }
}
@keyframes pulse {
  0%,100%{ opacity:1; } 50%{ opacity:0.5; }
}
.animate-fade-up { animation:fadeUp 0.5s ease forwards; }
.animate-fade-up-delay-1 { animation:fadeUp 0.5s ease 0.1s forwards; opacity:0; }
.animate-fade-up-delay-2 { animation:fadeUp 0.5s ease 0.2s forwards; opacity:0; }
.animate-fade-up-delay-3 { animation:fadeUp 0.5s ease 0.3s forwards; opacity:0; }

/* ── RESPONSIVE ── */
@media (max-width:768px) {
  .topbar { padding:0 16px; }
  .topbar-name { display:none; }
  .topbar-nav { display:none; }
  .topbar-nav.open { display:flex; flex-direction:column; position:fixed; top:64px; left:0; right:0; background:var(--white); border-bottom:1px solid var(--gray-200); padding:16px; z-index:199; box-shadow:var(--shadow-lg); }
  .mobile-menu-btn { display:flex; }
  .main, .main-wide { padding:20px 16px 60px; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:12px; }
  .page-title { font-size:28px; }
}
@media (max-width:480px) {
  .stats-grid { grid-template-columns:1fr; }
  .filter-row { gap:6px; }
  .filter-chip { padding:5px 12px; font-size:11px; }
}
@media print {
  .topbar, .topbar-nav, .mobile-menu-btn, .toast, .btn { display:none!important; }
  body { background:#fff; color:#000; }
}